First published at 04:29 UTC on April 7th, 2018.
Functional programming in the mathematical spirit.
Long and difficult, yet boring explanations given in excruciating detail.
Start by reading the slides, go through the worked examples and exercises. Watch the video when you cannot fully understan…
MORE
Functional programming in the mathematical spirit.
Long and difficult, yet boring explanations given in excruciating detail.
Start by reading the slides, go through the worked examples and exercises. Watch the video when you cannot fully understand something in the slides.
Chapter 4. Functors: their laws and structure
Abstracting the properties of a "data container"
Motivation for the functor laws
Examples of functors and non-functors
Examples of deriving a functor's fmap from its type and checking the laws
Contrafunctors; covariance and contravariance
How to decide whether a type constructor is a functor, a contrafunctor, or neither
Building up the structure for exponential-polynomial functor types: functor product, disjunction, implication, composition, recursion
How to prove the functor laws for each build-up step
Worked examples and exercises
Slides: https://github.com/winitzki/talks/blob/master/ftt-fp/04-functors.pdf
Code examples: https://github.com/winitzki/scala-examples
LESS