on master help sign in
Changes to prelude Maybe.idr file: removing class instances that were already defined, as well as fixing a type error.
commit1ea199334e7fc412c986ac0d6ae0077d4c6097a4 authorDominic Mulligan <dominic.p.mulligan@googlemail.com> dateFri 20 Jan 2012, 13:57 (15 years ago) parent2f5f607
1 file changed−14
lib/prelude/maybe.idr−14
lib/prelude/maybe.idr−14
@@ -61,17 +61,3 @@ mapMaybe f (x::xs) =
6161 case f x of
6262 Nothing => mapMaybe f xs
6363 Just j => j :: mapMaybe f xs
64−
65−--------------------------------------------------------------------------------
66−-- Class instances
67−--------------------------------------------------------------------------------
68−
69−instance Functor Maybe where
70− fmap f Nothing = Nothing
71− fmap f (Just j) = Just (f j)
72−
73−instance Monad Maybe where
74− return = Just
75−
76− (>>=) Nothing m = Nothing
77− (>>=) (Just j) m = m j