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

foldFree id ≟ retract #130

Open
Icelandjack opened this issue Mar 9, 2016 · 3 comments
Open

foldFree id ≟ retract #130

Icelandjack opened this issue Mar 9, 2016 · 3 comments

Comments

@Icelandjack
Copy link

When applying foldFree id I got

foldFree id :: Monad m => Free m a -> m a

same type as

retract :: Monad m => Free m a -> m a

and at a quick glance they appear to be equal: if so should that be added as a law? I googled foldFree id and didn't find much.

@Icelandjack
Copy link
Author

Addendum: is there a name or use for

iterM wrap :: (MonadFree f m, Functor f) => Free f a -> m a

@Icelandjack
Copy link
Author

As original question, does

hoistFree id :: Functor f => Free f a -> Free f a

equal id and should it be added as a law of hoistFree.

@fumieval
Copy link
Collaborator

fumieval commented Mar 9, 2016

Laws should be clarified for methods of a type class; for existing function they don't have to be.

iterM wrap is sometimes useful to transform a free monad to an other free monad. There are already conversion functions though.

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

2 participants