ddc-source-tetra-0.4.3.1: Disciplined Disciple Compiler source language.

Safe HaskellNone
LanguageHaskell98

DDC.Source.Tetra.Transform.Prep

Description

A light simplification pass before conversion of desugared code to Core.

Synopsis

Documentation

type S = State (Bool, Text, Int) Source #

State holding a variable name prefix and counter to create fresh variable names.

evalState :: Text -> S a -> a Source #

Evaluate a desguaring computation, using the given prefix for freshly introduced variables.

newVar :: Text -> S (Bind, Bound) Source #

Allocate a new named variable, yielding its associated bind and bound.

desugarModule :: Module Source -> S (Module Source) Source #

Desguar a module.

We keep applying the prep transforms we have until they stop making progress.