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

Fix ListT MMonad instance #188

Closed
ivan-timokhin opened this issue Dec 10, 2016 · 3 comments
Closed

Fix ListT MMonad instance #188

ivan-timokhin opened this issue Dec 10, 2016 · 3 comments

Comments

@ivan-timokhin
Copy link
Contributor

Current instance (e3fc775) is

instance MMonad ListT where
    embed f m = Select (enumerate (embed f m))

…which is just an infinite loop, unless I'm completely misunderstanding something.

For a simple demonstration,

runEffect $ for (enumerate $ pure False) (lift . print)

prints False, whereas

runEffect $ for (enumerate $ embed lift $ pure False) (lift . print)

loops indefinitely, even though embed lift should be equal to id by MMonad laws.

@Gabriella439
Copy link
Owner

I verified that both examples succeed and produced the same result after this fix. The fix is up on Hackage as pipes-4.3.2

@ivan-timokhin
Copy link
Contributor Author

Thanks!

@Gabriella439
Copy link
Owner

You're welcome!

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