File size: 2,606 Bytes
7339b50
 
3c962e6
 
 
 
 
 
 
 
 
6399834
 
 
 
3c962e6
 
 
6399834
3c4c5bc
 
 
 
3c962e6
 
 
 
3c4c5bc
3c962e6
 
 
9509a36
e485eac
 
9509a36
 
3c962e6
 
 
 
 
 
 
 
 
 
 
e485eac
48feff6
 
9509a36
 
3c962e6
 
48feff6
7139673
 
3c4c5bc
 
3c962e6
7139673
3c962e6
7139673
 
 
 
 
 
 
 
 
 
 
 
 
3c962e6
7139673
9509a36
db2b2a2
3c962e6
d417768
 
 
9509a36
 
3c962e6
 
d417768
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3c962e6
 
d417768
 
3c962e6
 
48c286d
 
 
9509a36
 
3c962e6
48c286d
3c962e6
 
48c286d
 
 
9509a36
 
3c962e6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Changelog of the functional-programming course

## 2025-04-16

**applicatives.py**

- replace `return NotImplementedError` with `raise NotImplementedError`

- add `Either` applicative
- Add `Alternative`

## 2025-04-11

**functors.py**

- add `Bifunctor` section

- replace `return NotImplementedError` with `raise NotImplementedError`

## 2025-04-08

**functors.py**

- restructure the notebook
- replace `f` in the function signatures with `g` to indicate regular functions and
  distinguish from functors
- move `Maybe` funtor to section `More Functor instances`

- add `Either` functor

- add `unzip` utility function for functors

## 2025-04-07

**applicatives.py**

- the `apply` method of `Maybe` _Applicative_ should return `None` when `fg` or `fa` is
  `None`

- add `sequenceL` as a classmethod for `Applicative` and add examples for `Wrapper`,
  `Maybe`, `List`
- add description for utility functions of `Applicative`

- refine the implementation of `IO` _Applicative_
- reimplement `get_chars` with `IO.sequenceL`

- add an example to show that `ListMonoidal` is equivalent to `List` _Applicative_

## 2025-04-06

**applicatives.py**

- remove `sequenceL` from `Applicative` because it should be a classmethod but can't be
  generically implemented

## 2025-04-02

**functors.py**

- Migrate to `python3.13`

    - Replace all occurrences of

        ```python
        class Functor(Generic[A])
        ```

        with

        ```python
        class Functor[A]
        ```

        for conciseness

- Use `fa` in function signatures instead of `a` when `fa` is a _Functor_

**applicatives.py**

- `0.1.0` version of notebook `06_applicatives.py`

## 2025-03-16

**functors.py**

- Use uppercased letters for `Generic` types, e.g. `A = TypeVar("A")`
- Refactor the `Functor` class, changing `fmap` and utility methods to `classmethod`

    For example:

    ```python
    @dataclass
    class Wrapper(Functor, Generic[A]):
        value: A

        @classmethod
        def fmap(cls, f: Callable[[A], B], a: "Wrapper[A]") -> "Wrapper[B]":
            return Wrapper(f(a.value))

    >>> Wrapper.fmap(lambda x: x + 1, wrapper)
    Wrapper(value=2)
    ```

- Move the `check_functor_law` method from `Functor` class to a standard function

- Rename `ListWrapper` to `List` for simplicity
- Remove the `Just` class

- Rewrite proofs

## 2025-03-13

**functors.py**

- `0.1.0` version of notebook `05_functors`

Thank [Akshay](https://github.com/akshayka) and [Haleshot](https://github.com/Haleshot)
for reviewing

## 2025-03-11

**functors.py**

- Demo version of notebook `05_functors.py`