Skip to content

Commit

Permalink
optimize mapMaybe manually lest it gets a layz return type
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingo60 committed May 10, 2018
1 parent 281407c commit ed1d1be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frege/prelude/Maybe.fr
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ catMaybes xs = [ a | Just a <- xs ]
If this is 'Nothing', no element is added on to the result list.
If it just 'Just' _b_, then _b_ is included in the result list.
-}
mapMaybe f = catMaybes map f
mapMaybe f xs = catMaybes (map f xs)

--- give the first element of a list or 'Nothing'
listToMaybe xs = listToMaybe xs.toList where -- reexported from frege.prelude.Maybe
Expand Down

0 comments on commit ed1d1be

Please sign in to comment.