Re-added missing maybe_bind to prelude Maybe module.
commit5570cee85e3d42409af3de890d7b7d40ce7d3ef5
authorDominic Mulligan <dominic.p.mulligan@googlemail.com>
dateFri 20 Jan 2012, 14:02 (15 years ago)
parentd282d56
lib/prelude/maybe.idr+8
@@ -61,3 +61,11 @@ 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+maybe_bind : Maybe a -> (a -> Maybe b) -> Maybe b
70+maybe_bind Nothing k = Nothing
71+maybe_bind (Just x) k = k x