[project @ 1996-07-15 16:16:46 by partain]
[ghc-hetmet.git] / ghc / compiler / deSugar / intro.lit
1 \section[Desugar_intro]{Introduction}
2
3 This pass of the \Haskell{} compiler converts a typechecked program in
4 @AbsSyntax@ form into a list of @CoreBinding@s, a much simpler form
5 more suitable for subsequent passes.  The basic tasks in this
6 ``desugaring'' are:
7 \begin{enumerate}
8 \item
9 Compile pattern-matching into equivalent code, mainly case-expressions.
10
11 \item
12 Convert list comprehensions into equivalent code.
13
14 \item
15 Make explicit all of the implicit activity due to overloading,
16 dictionaries, etc., etc.
17 \end{enumerate}
18
19 For the basic desugaring process, we assume familiarity with Phil
20 Wadler's chapter~5 in SLPJ.  The code here will be recognizable by the
21 avid reader of that chapter.  The main difference you will see is that
22 this code uses a simple monad to pass around the name supply; if
23 you've read much of this compiler's code, the idioms used will be
24 grievously familiar.