Learning about functors in Haskell, e.g. [Integer]
or [] Integer
, I understand that the functor needs to define fmap
(in the list example: fmap = map
).
If I get it right, a functor can implement the sequential application <*>
in order to become an applicative functor. This is why
[(1+), (2+)]
is a perfectly fine element of the list instance [] Integer
. And an expression like
(+) <$> [1..10] <*> [101..110]
makes sence.
The examples for instances of Functor
that I found were all applicative functors, too. I.e. there was a sensible definition of <*>
. The typical examples for functors Maybe, [], Either e, Tree, e ->, Pair, (,) e, ... are usually applicative, as well (i.e. there is a sensible definition of <*>
). From what I understand they are all monads, even!
I found ZipList
as an example of an applicative functor that is not a monad (for a reason).
Now is there a functor that is not an applicative functor and reasonably so?