ekmett / free

free monads
http://hackage.haskell.org/package/free
Other
159 stars 65 forks source link

Make liftF a method of MonadFree #208

Open treeowl opened 3 years ago

treeowl commented 3 years ago

This seems to work a bit better for things like FT.

treeowl commented 3 years ago

This isn't strictly backwards compatible because MonadFree f m now requires that either:

  1. f is a Functor, or
  2. f does not need to be a Functor to implement liftF.

These hold for all the implementations in the package. I don't know if they fail somewhere else.

treeowl commented 3 years ago

Hmm... That's a bit weird... the instance for Control.Monad.Free.Free actually didn't previously need a Functor f constraint, but it had one anyway.

treeowl commented 3 years ago

Another option is to use a different name for the method, to preserve performance characteristics.