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

Comonad f => MonadFree f (Tagged f) #202

Open
Icelandjack opened this issue Oct 27, 2020 · 1 comment
Open

Comonad f => MonadFree f (Tagged f) #202

Icelandjack opened this issue Oct 27, 2020 · 1 comment

Comments

@Icelandjack
Copy link

A could of 'trivial' instances, I just wrote them to write them so I have no use for them

instance Comonad f => MonadFree f (Tagged f) where
  wrap :: f (Tagged f a) -> Tagged f a
  wrap = extract

instance MonadFree Identity Identity where
  wrap :: Identity (Identity a) -> Identity a
  wrap = extract
@Icelandjack
Copy link
Author

Now I remember, as a consequence we can derive "MonadFree Identity Fresh" for our little friend down there:

type    Fresh :: Type -> Type
newtype Fresh a = Fresh (Integer -> (a, Integer))
 deriving
   (Functor, Applicative, Monad, MonadFix, MonadState Integer, MonadFree Identity)
 via State Integer

I was wondering if State Integer could make sense as a MonadFree instance which lead me to think about Identity ..

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