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

Applicative instance for Only #270

Open
robinp opened this issue Dec 5, 2018 · 2 comments
Open

Applicative instance for Only #270

robinp opened this issue Dec 5, 2018 · 2 comments

Comments

@robinp
Copy link

robinp commented Dec 5, 2018

This would be useful to do fmap join . sequenceA . listToMaybe on a query which normally returns [Only (Maybe a)]. With the magic sequence this becomes Only (Maybe a).

@robinp
Copy link
Author

robinp commented Dec 5, 2018

Or, to golf more, join . fromOnly . sequenceA . listToMaybe to get Maybe a.

@phadej
Copy link

phadej commented Jan 30, 2019

Only is defined in http://hackage.haskell.org/package/Only package

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