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

Add a class for free monad transformer-type things. #209

Closed
treeowl opened this issue Jul 11, 2021 · 0 comments
Closed

Add a class for free monad transformer-type things. #209

treeowl opened this issue Jul 11, 2021 · 0 comments

Comments

@treeowl
Copy link

treeowl commented Jul 11, 2021

We can do something like the following:

class FreeMonad f n => FreeMonadTransed f m n | n -> f m where
  loft :: m a -> n a
  default loft :: (n ~ t m, MonadTrans t, Monad m) => m a -> n a
  loft = lift

instance (Functor f, Monad m) => FreeMonadTransed f m (Free f m)
instance Monad m => FreeMonadTrans f m (FT f m)
@treeowl treeowl closed this as completed Jul 16, 2021
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