`maybe def f v` returns `def` if `v=Nothing` and `f x` if `v=Just x`.
gitlab #31
Change-Id: I3319ee8e9e4cf678aece4878c1fb2ddf33395bc4
fromMaybe default maybeValue = match maybeValue with
Just v -> v
_ -> default
-
-
+
+"`maybe def f v` returns `def` if `v=Nothing` and `f x` if `v=Just x`."
+maybe :: b -> (a -> <e> b) -> Maybe a -> <e> b
+maybe n _ Nothing = n
+maybe _ f (Just x) = f x
+
"""
Provides a default value if the first parameter is Nothing.
The default value is evaluated only if needed. The function