Spaces:
Runtime error
Runtime error
Changelog of the functional-programming course
2025-04-08
functors.py
- restructure the notebook
- replace
fin the function signatures withgto indicate regular functions and distinguish from functors - move
Maybefuntor to sectionMore Functor instances
- add
Eitherfunctor - add
unziputility function for functors
2025-04-07
applicatives.py
- the
applymethod ofMaybeApplicative should returnNonewhenfgorfaisNone
- add
sequenceLas a classmethod forApplicativeand add examples forWrapper,Maybe,List - add description for utility functions of
Applicative
- refine the implementation of
IOApplicative - reimplement
get_charswithIO.sequenceL
- add an example to show that
ListMonoidalis equivalent toListApplicative
2025-04-06
applicatives.py
- remove
sequenceLfromApplicativebecause it should be a classmethod but can't be generically implemented
2025-04-02
functors.py
Migrate to
python3.13Replace all occurrences of
class Functor(Generic[A])with
class Functor[A]for conciseness
Use
fain function signatures instead ofawhenfais a Functor
applicatives.py
0.1.0version of notebook06_applicatives.py
2025-03-16
functors.py
Use uppercased letters for
Generictypes, e.g.A = TypeVar("A")Refactor the
Functorclass, changingfmapand utility methods toclassmethodFor example:
@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_lawmethod fromFunctorclass to a standard function
- Rename
ListWrappertoListfor simplicity - Remove the
Justclass
- Rewrite proofs
2025-03-13
functors.py
0.1.0version of notebook05_functors
Thank Akshay and Haleshot for reviewing
2025-03-11
functors.py
- Demo version of notebook
05_functors.py