Safe Haskell | Safe |
---|
- data IsolateError e
- isolateError :: a -> (e -> a) -> (Int -> Int -> a) -> IsolateError e -> a
- _NegativeSize :: Prism' (IsolateError e) ()
- _IsolateXFail :: Prism' (IsolateError e) e
- _UnexpectedConsumed :: Prism' (IsolateError e) (Int, Int)
Data type
data IsolateError e Source
Functor IsolateError | Map a function on the possible failure.
|
Extend IsolateError | Duplicate on the possible failure.
|
Eq e => Eq (IsolateError e) | |
Ord e => Ord (IsolateError e) | |
Show e => Show (IsolateError e) |
Reduction
isolateError :: a -> (e -> a) -> (Int -> Int -> a) -> IsolateError e -> aSource
>>>
isolateError 7 (\_ -> 8) (\_ _ -> 9) (_NegativeSize # ())
7
>>>
isolateError 7 (+10) (\_ _ -> 9) (_IsolateXFail # 99)
109
>>>
isolateError 7 (\_ -> 8) (+) (_UnexpectedConsumed # (12, 14))
26
Prisms
_NegativeSize :: Prism' (IsolateError e) ()Source
>>>
_NegativeSize # ()
NegativeSize
>>>
(_NegativeSize # ()) ^? _NegativeSize
Just ()
>>>
(_IsolateXFail # 8) ^? _NegativeSize
Nothing
>>>
(_UnexpectedConsumed # (12, 13)) ^? _NegativeSize
Nothing
_IsolateXFail :: Prism' (IsolateError e) eSource
>>>
_IsolateXFail # 8
IsolateXFail 8
>>>
(_NegativeSize # ()) ^? _IsolateXFail
Nothing
>>>
(_IsolateXFail # 8) ^? _IsolateXFail
Just 8
>>>
(_UnexpectedConsumed # (12, 13)) ^? _IsolateXFail
Nothing
_UnexpectedConsumed :: Prism' (IsolateError e) (Int, Int)Source
>>>
_UnexpectedConsumed # (12,13)
UnexpectedConsumed 12 13
>>>
(_NegativeSize # ()) ^? _UnexpectedConsumed
Nothing
>>>
(_IsolateXFail # 8) ^? _UnexpectedConsumed
Nothing
>>>
(_UnexpectedConsumed # (12, 13)) ^? _UnexpectedConsumed
Just (12,13)