Skip to content

Commit

Permalink
refactor(#45): optional is too constrained -> optional doesn't need…
Browse files Browse the repository at this point in the history
… Plus part of Alternative (#47)
  • Loading branch information
srghma authored Oct 14, 2020
1 parent 3c9239d commit 6a20755
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Data/Maybe.purs
Original file line number Diff line number Diff line change
Expand Up @@ -274,5 +274,5 @@ fromJust (Just x) = x
-- | optional empty = pure Nothing
-- | optional (pure x) = pure (Just x)
-- | ```
optional :: forall f a. Alternative f => f a -> f (Maybe a)
optional :: forall f a. Alt f => Applicative f => f a -> f (Maybe a)
optional a = map Just a <|> pure Nothing

0 comments on commit 6a20755

Please sign in to comment.