disco-0.1.6: Functional programming language for teaching discrete math.
Copyrightdisco team and contributors
LicenseBSD-3-Clause
Maintainerbyorgey@gmail.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Disco.Desugar

Description

Desugaring the typechecked surface language to a (still typed) simpler language.

Synopsis

Running desugaring computations

runDesugar :: Sem '[Fresh] a -> a Source #

Run a desugaring computation.

Programs, terms, and properties

desugarDefn :: Member Fresh r => Defn -> Sem r DTerm Source #

Desugar a definition (consisting of a collection of pattern clauses with bodies) into a core language term.

desugarTerm :: Member Fresh r => ATerm -> Sem r DTerm Source #

Desugar a typechecked term.

desugarProperty :: Member Fresh r => AProperty -> Sem r DTerm Source #

Desugar a property by wrapping its corresponding term in a test frame to catch its exceptions & convert booleans to props.

Case expressions and patterns

desugarBranch :: Member Fresh r => ABranch -> Sem r DBranch Source #

Desugar a branch of a case expression.

desugarGuards :: Member Fresh r => Telescope AGuard -> Sem r (Telescope DGuard) Source #

Desugar the list of guards in one branch of a case expression. Pattern guards essentially remain as they are; boolean guards get turned into pattern guards which match against true.