ivory-opts-0.1.0.6: Ivory compiler optimizations.

Safe HaskellNone
LanguageHaskell2010

Ivory.Opts.CSE

Contents

Synopsis

Documentation

cseFold :: Proc -> Proc Source #

Find each common sub-expression and extract it to a new variable, making any sharing explicit. However, this function should never move evaluation of an expression earlier than it would have occurred in the source program, which means that sometimes an expression must be re-computed on each of several execution paths.

Orphan instances

MuRef Stmt Source # 
Instance details

Associated Types

type DeRef Stmt :: * -> * #

Methods

mapDeRef :: Applicative f => (forall b. (MuRef b, DeRef Stmt ~ DeRef b) => b -> f u) -> Stmt -> f (DeRef Stmt u) #

MuRef Expr Source # 
Instance details

Associated Types

type DeRef Expr :: * -> * #

Methods

mapDeRef :: Applicative f => (forall b. (MuRef b, DeRef Expr ~ DeRef b) => b -> f u) -> Expr -> f (DeRef Expr u) #

(MuRef a, DeRef [a] ~ DeRef a) => MuRef [a] Source # 
Instance details

Associated Types

type DeRef [a] :: * -> * #

Methods

mapDeRef :: Applicative f => (forall b. (MuRef b, DeRef [a] ~ DeRef b) => b -> f u) -> [a] -> f (DeRef [a] u) #