dorchard / effect-monad

Provides 'graded monads' and 'parameterised monads' to Haskell, enabling fine-grained reasoning about effects.
BSD 2-Clause "Simplified" License
99 stars 11 forks source link

Add effect functor and applicatives #10

Open turion opened 6 years ago

turion commented 6 years ago

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.

dorchard commented 3 years ago

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?