3 ms·
I've always liked this visualisation too! I like to think of fmap as a converting a normal function into a function that operates "through" a functor. This is
by dbaupp 14y ago
I've always liked this visualisation too!
I like to think of fmap as a converting a normal function into a function that operates "through" a functor. This is clearer looking at the Haskell type signature, which can be written as:
fmap :: (a -> b) -> (f a -> f b)
- johnpmayer 14y agoIn general, thinking about the different valid rewrites of the type signatures of the various higher order functions in Haskell tends to reveal quite a bit!