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

Safe HaskellNone

DDC.Core.Transform.Beta

Description

Beta-reduce applications of a explicit lambda abstractions to variables and values.

Synopsis

Documentation

data BetaReduceInfo Source

A summary of what the beta reduction transform did.

Constructors

BetaReduceInfo 

Fields

infoTypes :: Int

Number of type applications reduced.

infoWits :: Int

Number of witness applications reduced.

infoValues :: Int

Number of value applications reduced.

infoValuesLetted :: Int

Number of redexes let-bound.

infoValuesSkipped :: Int

Number of applications that we couldn't reduce.

betaReduceSource

Arguments

:: forall c a n . (Ord n, TransformUpMX (Writer BetaReduceInfo) c) 
=> Bool

Let-bind redexes.

-> c a n 
-> TransformResult (c a n) 

Beta-reduce applications of a explicit lambda abstractions to variables and values.

If the flag is set then if we find a lambda abstraction that is applied to a redex then let-bind the redex and substitute the new variable instead.