fmap with a function
What is this code doing?
To understand what
fmap does whenever it is called, it is necessary to know which instance of
fmap is being used. You can find this out by mousing over
fmap (first place the line
func = fmap not (\x -> x > 3) in a Haskell file in your project), to see:
$dFunctor :: Functor ((->) Integer) means that the instance of
Functor being used is
The instance of
((->) Integer) is:
- Or in pointfree style: fmap = (.)
and this is what is being used in the examples above.
Created: January 13, 2023