Safe Haskell | None |
---|---|
Language | Haskell2010 |
Extensions |
|
Documentation
Instances
result :: (String -> b) -> (a -> b) -> Result a -> b Source #
Case analysis for the Result
type.
Examples
>>>
let s = Success 0
>>>
let e = Error "critical"
>>>
result ("Bad: " ++) (("OK: " ++) . show) s
"OK: 0">>>
result ("Bad: " ++) (("OK: " ++) . show) e
"Bad: critical"
fromSuccess :: a -> Result a -> a Source #
Convert
to Result
aa
with a default value.