morley-1.20.0: Developer tools for the Michelson Language
Safe HaskellSafe-Inferred
LanguageHaskell2010

Morley.Michelson.FailPattern

Description

Typical usages of FAILWITH instruction.

Synopsis

Documentation

data TypicalFailWith Source #

This data type captures typical ways to use FAILWITH instruction. Each constructor corresponds to a usage pattern.

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.

The instruction MUST be linearized to the left (see linearizeLeft).

modifyTypicalFailWith :: HasCallStack => (MText -> SomeConstant) -> 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.