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

Safe HaskellSafe-Inferred

DDC.Core.Transform.Snip

Description

Snip out nested applications.

Synopsis

Documentation

class Snip c whereSource

Class of things that can have things snipped out of them.

Methods

snip :: Ord n => Config -> c n -> c nSource

Snip out nested applications as anonymous bindings.

      f (g x) (h y)
  ==> let ^ = g x in ^ = h y in f ^1 ^0

Instances

Snip (Module a) 
Snip (Exp a) 

data Config Source

Snipper configuration.

Constructors

Config 

Fields

configSnipOverApplied :: Bool

Introduce new bindings for over-applied functions.

configSnipLetBody :: Bool

Ensure the body of a let-expression is a variable.

configZero :: ConfigSource

Snipper configuration with all flags set to False.