Skip to content

Add catMaybes #6

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

Merged
merged 1 commit into from
May 22, 2014
Merged

Add catMaybes #6

merged 1 commit into from
May 22, 2014

Conversation

garyb
Copy link
Member

@garyb garyb commented May 22, 2014

No description provided.

@@ -218,6 +219,9 @@ foreign import map
mapMaybe :: forall a b. (a -> Maybe b) -> [a] -> [b]
mapMaybe f = concatMap (maybe [] singleton <<< f)

catMaybes :: forall a. [Maybe a] -> [a]
catMaybes = concatMap (maybe [] singleton)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe I should just do mapMaybe id?

paf31 added a commit that referenced this pull request May 22, 2014
@paf31 paf31 merged commit 9772fb2 into master May 22, 2014
@paf31 paf31 deleted the cat-maybes branch May 22, 2014 20:59
@paf31
Copy link
Contributor

paf31 commented May 22, 2014

Looks good thanks.

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

Successfully merging this pull request may close these issues.

2 participants