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

Safe HaskellSafe
LanguageHaskell98

DDC.Core.Transform.Snip

Description

Snip out nested applications.

Synopsis

Documentation

class Snip c where Source

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

Methods

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

Snip out nested applications as anonymous bindings.

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

Instances

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.

configPreserveLambdas :: Bool

Treat lambda abstractions as atomic, and don't snip them.

configZero :: Config Source

Snipper configuration with all flags set to False.