evm-opcodes-0.1.0: Opcode types for Ethereum Virtual Machine (EVM)
Copyright2018 Simon Shine
LicenseMIT
MaintainerSimon Shine <shreddedglory@gmail.com>
Safe HaskellNone
LanguageHaskell2010

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 

Fields

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).