I am wondering where it belongs, I could add it to my idiomatic package which is for deriving Applicative for sums but this package may be a better fit. It allows us to derive Applicative and Monad for Free f and other instantiations of it:
data Free f a = Pure a | Free (f (Free f a))
deriving (Functor, Applicative, Monad)
via GenericFreeMonad "Pure" (Free f)
At least I wanted to make it known :) I am not proposing that Monad (Free f) should be derived, but that is possible
Li-yao implemented a way to derive
Free
functors, I will link the gist:I am wondering where it belongs, I could add it to my idiomatic package which is for deriving Applicative for sums but this package may be a better fit. It allows us to derive
Applicative
andMonad
forFree f
and other instantiations of it:At least I wanted to make it known :) I am not proposing that
Monad (Free f)
should be derived, but that is possible