Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deriving (Applicative, Monad) via GenericFreeMonad "Pure" (Free f) #214

Open
Icelandjack opened this issue Apr 14, 2022 · 0 comments
Open

Comments

@Icelandjack
Copy link

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 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant