curry-frontend-1.0.3: Compile the functional logic language Curry to several intermediate formats

Copyright(c) 2001 - 2004 Wolfgang Lux
Martin Engelke
2011 - 2015 Björn Peemöller
2015 Jan Tikovsky
2016 - 2017 Finn Teegen
LicenseBSD-3-clause
Maintainerbjp@informatik.uni-kiel.de
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Transformations.Desugar

Description

The desugaring pass removes all syntactic sugar from the module. In particular, the output of the desugarer will have the following properties.

  • No guarded right hand sides occur in equations, pattern declarations, and case alternatives. In addition, the declaration lists (`where`-blocks) of the right hand sides are empty; local declarations are transformed into let expressions.
  • Patterns in equations and case alternatives are composed only of
  • literals,
  • variables,
  • constructor applications, and
  • as patterns applied to literals or constructor applications.
  • Expressions are composed only of
  • literals,
  • variables,
  • constructors,
  • (binary) applications,
  • case expressions,
  • let expressions, and
  • expressions with a type signature.
  • Functional patterns are replaced by variables and are integrated in a guarded right hand side using the (=:<=) operator.
  • Records are transformed into ordinary data types by removing the fields. Record construction and pattern matching are represented using solely the record constructor. Record selections are represented using selector functions which are generated for each record declaration, and record updated are represented using case-expressions that perform the update.
  • The type environment will be extended by new function declarations for:
  • Record selections, and
  • Converted lambda expressions.

As we are going to insert references to real prelude entities, all names must be properly qualified before calling this module.

Documentation