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

Safe HaskellNone
LanguageHaskell98

DDC.Source.Tetra.Transform.Guards

Description

Desugar guards and nested patterns to match expressions.

Synopsis

Documentation

type S = State (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 #

Desugar guards and nested patterns to match expressions.