Safe Haskell | None |
---|---|
Language | Haskell2010 |
Typical usages of FAILWITH instruction.
Synopsis
- data TypicalFailWith
- typicalFailWithTag :: TypicalFailWith -> MText
- isTypicalFailWith :: Instr inp out -> Maybe TypicalFailWith
- modifyTypicalFailWith :: (HasCallStack, ConstantScope t, Typeable t) => (MText -> Value t) -> Instr inp out -> Instr inp out
Documentation
data TypicalFailWith Source #
This data type captures typical ways to use FAILWITH
instruction.
Each constructor corresponds to a usage pattern.
typicalFailWithTag :: TypicalFailWith -> MText Source #
Extract error tag out of TypicalFailWith
.
isTypicalFailWith :: Instr inp out -> Maybe TypicalFailWith Source #
Check whether given instruction ends with a typical FAILWITH
usage. It does not recursively check instructions that can be
passed to other instructions.
modifyTypicalFailWith :: (HasCallStack, ConstantScope t, Typeable t) => (MText -> Value t) -> Instr inp out -> Instr inp out Source #
If given instruction ends with a typical FAILWITH
usage, modify
the tag used there using given transformation function. It can
return any value, not necessarily a string.