ddc-core-simpl-0.3.1.1: Disciplined Disciple Compiler code transformations.

Safe HaskellNone

DDC.Core.Transform.Prune

Description

Erase contained let-bindings that have no uses.

Contained bindings are ones that do not perform effects that are visible to anything in the calling context. This includes allocation and read effects, but not writes or any globally visible effects.

Synopsis

Documentation

data PruneInfo Source

A summary of what the prune transform did.

Constructors

PruneInfo 

Fields

infoBindingsErased :: Int

How many let-bindings we erased.

pruneModuleSource

Arguments

:: (Show a, Show n, Ord n, Pretty n) 
=> Profile n

Profile of the language we're in

-> Module a n 
-> Module a n 

Erase pure let-bindings in a module that have no uses.

pruneXSource

Arguments

:: (Show a, Show n, Ord n, Pretty n) 
=> Profile n

Profile of the language we're in

-> KindEnv n

Kind environment

-> TypeEnv n

Type environment

-> Exp a n 
-> TransformResult (Exp a n) 

Erase pure let-bindings in an expression that have no uses.