Safe Haskell  None 

Language  Haskell2010 
Extensions 

Synopsis
 newtype Result a = Result {}
 pattern Error :: String > Result a
 pattern Success :: a > Result a
 result :: (String > b) > (a > b) > Result a > b
 fromEither :: Either String a > Result a
 toEither :: Result a > Either String a
 fromSuccess :: a > Result a > a
 toMonadFail :: MonadFail m => Result a > m a
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.