|
definition: |
maybe :: b -> (a -> b) -> Maybe a -> b maybe n _ Nothing = n maybe _ f (Just x) = f x |
|
demand: |
argument 3 |
|
deterministic: |
deterministic operation |
|
documentation: |
| The `maybe` function 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. |
|
failfree: |
(_, _, _) |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,_,{Nothing}) |-> _ || (_,_,{Just}) |-> _}
|
|
name: |
maybe |
|
precedence: |
no precedence defined |
|
result-values: |
_ |
|
signature: |
a -> (b -> a) -> Maybe b -> a |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
yes |
|
totally-defined: |
reducible on all ground data terms |