evm-opcodes-0.1.0: Opcode types for Ethereum Virtual Machine (EVM)

EVM.Opcode.Traversal

Description

This module exposes a generic method of traversing Opcode's.

Synopsis

# Documentation

data OpcodeMapper m a b Source #

An OpcodeMapper is a collection of four mapping functions that can map any Opcode' a to an Opcode' b. For each of the three opcodes that are annotated, JUMP, JUMPI and JUMPDEST, a separate mapping function is specified, and for any other opcode, a general mapping function is specified that falls back to the same opcode of type Opcode' b.

See translate for an example of usage.

Constructors

 OpcodeMapper FieldsmapOnJump :: a -> m (Opcode' b) mapOnJumpi :: a -> m (Opcode' b) mapOnJumpdest :: a -> m (Opcode' b) mapOnOther :: Opcode' a -> m (Maybe (Opcode' b))

mapOpcodeM :: forall m a b. Monad m => OpcodeMapper m a b -> Opcode' a -> m (Opcode' b) Source #

Given an OpcodeMapper and an Opcode' a, produce m (Opcode' b).