effect-monad
effect-monad copied to clipboard
Add effect functor and applicatives
Effect
should reflect the Functor
-Applicative
-Monad
hierarchy. How about something like:
class EffectFunctor (m :: k -> * -> *) where
fmap :: (a -> b) -> m f a -> m f b
There is a fairly obvious Applicative
generalisation as well, which would have to introduce the type families Unit
, Plus
and Inv
.
I think that EffectFunctor
is not really needed since we can still just use Functor
. However, an applicative version makes sense theoretically (having a graded applicative) and could be a nice addition if you want to do a PR?