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

Morley.Michelson.Optimizer

Description

Optimizer for typed instructions.

It's quite experimental and incomplete.

Synopsis

Documentation

optimize :: Instr inp out -> Instr inp out Source #

Optimize a typed instruction by replacing some sequences of instructions with smaller equivalent sequences. Applies default set of rewrite rules.

optimizeWithConf :: OptimizerConf -> Instr inp out -> Instr inp out Source #

Optimize a typed instruction using a custom set of rules. The set is divided into several stages, as applying some rules can prevent others to be performed.

defaultOptimizerConf :: OptimizerConf Source #

Default config - all commonly useful rules will be applied to all the code.

defaultRulesAndPushPack :: [Rule] Source #

We do not enable pushPack rule by default because it is potentially dangerous. There are various code processing functions that may depend on constants, e. g. string transformations. need helper

orRule :: (Rule -> Rule) -> (Rule -> Rule) -> Rule -> Rule Source #

Combine two rule fixpoints.

orSimpleRule :: (Rule -> Rule) -> Rule -> Rule -> Rule Source #

Combine a rule fixpoint and a simple rule.

newtype Rule Source #

Constructors

Rule 

Fields

data OptimizerConf Source #

Constructors

OptimizerConf 

Fields

Instances

Instances details
Default OptimizerConf Source # 
Instance details

Defined in Morley.Michelson.Optimizer

Methods

def :: OptimizerConf #