We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf33800 commit 4e6a10fCopy full SHA for 4e6a10f
src/Data/Maybe.purs
@@ -10,6 +10,7 @@ import Control.Plus (class Plus)
10
11
import Data.Eq (class Eq1)
12
import Data.Functor.Invariant (class Invariant, imapF)
13
+import Data.Generic.Rep (class Generic)
14
import Data.Ord (class Ord1)
15
16
-- | The `Maybe` type is used to represent optional values and can be seen as
@@ -216,6 +217,8 @@ instance showMaybe :: Show a => Show (Maybe a) where
216
217
show (Just x) = "(Just " <> show x <> ")"
218
show Nothing = "Nothing"
219
220
+derive instance genericMaybe :: Generic (Maybe a) _
221
+
222
-- | Takes a default value, a function, and a `Maybe` value. If the `Maybe`
223
-- | value is `Nothing` the default value is returned, otherwise the function
224
-- | is applied to the value inside the `Just` and the result is returned.
0 commit comments