18 |
2 |
HC18-18. Haskell Chapter 18 Practical Tasks: Functor |
This lesson dives into Functors, a fundamental abstraction in Haskell. If you've ever used map, you've already worked with Functors! By the end, you'll understand Functors conceptually and know how to use them effectively.
? Key Topics
Generalizing map - Functors let you apply functions inside various structures.
The Functor type class - Defines fmap and <$>.
Defining Functor instances - How to make your custom types functorial.
Unexpected Functor instances - Examples include Either a, (,) a, and (->) r.
Lifting functions - Applying ordinary functions to values inside contexts. |