Skip to content

Commit

Permalink
refactor(purescript#45): optional is too constrained -> optional do…
Browse files Browse the repository at this point in the history
…esn't need Plus part of Alternative
  • Loading branch information
srghma authored May 3, 2020
1 parent 570edf7 commit 7dfd508
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 7dfd508

Please sign in to comment.