Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Data/Maybe.purs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Control.Plus (class Plus)

import Data.Eq (class Eq1)
import Data.Functor.Invariant (class Invariant, imapF)
import Data.Generic.Rep (class Generic)
import Data.Ord (class Ord1)

-- | The `Maybe` type is used to represent optional values and can be seen as
Expand Down Expand Up @@ -216,6 +217,8 @@ instance showMaybe :: Show a => Show (Maybe a) where
show (Just x) = "(Just " <> show x <> ")"
show Nothing = "Nothing"

derive instance genericMaybe :: Generic (Maybe a) _

-- | Takes a default value, a function, and a `Maybe` value. If the `Maybe`
-- | value is `Nothing` the default value is returned, otherwise the function
-- | is applied to the value inside the `Just` and the result is returned.
Expand Down