-the @Main@ module of the compiler,\srcloc{main/Main.lhs} or into the
-Core-to-Core simplification driver,\srcloc{simplCore/SimplCore.lhs} or
-into the STG-to-STG driver.\srcloc{simplStg/SimplStg.lhs}
+the @Main@ module of the compiler\srcloc{main/Main.lhs}, or into the
+Core-to-Core simplification driver\srcloc{simplCore/SimplCore.lhs}, or
+into the STG-to-STG driver\srcloc{simplStg/SimplStg.lhs}.
the code you add to the compiler. To this end, here is a list of
monads already in use in the compiler:
\begin{description}
the code you add to the compiler. To this end, here is a list of
monads already in use in the compiler:
\begin{description}
To carry a name supply around; do a @getUnique@ when you
need one. Used in several parts of the compiler.
To carry a name supply around; do a @getUnique@ when you
need one. Used in several parts of the compiler.
Quite a complicated monad; carries around a substitution, some
source-location information, and a @UniqueSupply@; also plumbs
typechecker success/failure back up to the right place.
Quite a complicated monad; carries around a substitution, some
source-location information, and a @UniqueSupply@; also plumbs
typechecker success/failure back up to the right place.
Carries around a @UniqueSupply@ and source-location information (to
put in pattern-matching-failure error messages).
Carries around a @UniqueSupply@ and source-location information (to
put in pattern-matching-failure error messages).
Carries around an environment that maps variables to addressing modes
(e.g., ``in this block, @f@ is at @Node@ offset 3''); also, carries
around stack- and heap-usage information. Quite tricky plumbing, in
part so that the ``Abstract~C'' output will be produced lazily.
Carries around an environment that maps variables to addressing modes
(e.g., ``in this block, @f@ is at @Node@ offset 3''); also, carries
around stack- and heap-usage information. Quite tricky plumbing, in
part so that the ``Abstract~C'' output will be produced lazily.
way through the compiler. These are notable in that you are allowed
to see/make-use-of all of their constructors:
\begin{description}
way through the compiler. These are notable in that you are allowed
to see/make-use-of all of their constructors:
\begin{description}
-\item[Abstract Haskell syntax:]\srcloc{abstractSyn/AbsSyn.lhs} Access
-via the @AbsSyn@ interface. An example of what you should {\em not}
+\item[Abstract Haskell syntax:]\srcloc{abstractSyn/AbsSyn.lhs}%
+Access via the @AbsSyn@ interface. An example of what you should {\em not}
do is import the @AbsSynFuns@ (or @HsBinds@ or ...) interface
directly. @AbsSyn@ tells you what you're supposed to see.
do is import the @AbsSynFuns@ (or @HsBinds@ or ...) interface
directly. @AbsSyn@ tells you what you're supposed to see.
-\item[Core syntax:]\srcloc{coreSyn/*Core.lhs} Core syntax is
-parameterised, and you should access it {\em via one of the
+\item[Core syntax:]\srcloc{coreSyn/*Core.lhs}%
+Core syntax is parameterised, and you should access it {\em via one of the
parameterisations}. The most common is @PlainCore@; another is
@TaggedCore@. Don't use @CoreSyn@, though.
parameterisations}. The most common is @PlainCore@; another is
@TaggedCore@. Don't use @CoreSyn@, though.
\end{description}
The second major group of datatypes are the ``basic entity''
datatypes; these are notable in that you don't need to know their
representation to use them. Several have already been mentioned:
\begin{description}
\end{description}
The second major group of datatypes are the ``basic entity''
datatypes; these are notable in that you don't need to know their
representation to use them. Several have already been mentioned:
\begin{description}
interface onto the world of @UniTypes@; accessible via the
@AbsUniType@ interface. You should import operations on all the {\em
pieces} of @UniTypes@ (@TyVars@, @TyVarTemplates@, @TyCons@,
interface onto the world of @UniTypes@; accessible via the
@AbsUniType@ interface. You should import operations on all the {\em
pieces} of @UniTypes@ (@TyVars@, @TyVarTemplates@, @TyCons@,
behind @AbsUniType@'s back!} (Otherwise, we won't discover the
shortcomings of the interface...)
behind @AbsUniType@'s back!} (Otherwise, we won't discover the
shortcomings of the interface...)
-\item[``Core'' literals:]\srcloc{basicTypes/CoreLit.lhs} These are
-the unboxed literals used in Core syntax onwards. Interface: @CoreLit@.
+\item[``Core'' literals:]\srcloc{basicTypes/CoreLit.lhs}%
+These are the unboxed literals used in Core syntax onwards. Interface: @CoreLit@.
A generic environment datatype, plus a generally useful set of
operations, is provided via the @GenericEnv@ interface. We encourage
you to use this, rather than roll your own; then your code will
A generic environment datatype, plus a generally useful set of
operations, is provided via the @GenericEnv@ interface. We encourage
you to use this, rather than roll your own; then your code will
environment stuff (of which there is plenty) is built on @GenericEnv@,
so there are plenty of examples to follow.
environment stuff (of which there is plenty) is built on @GenericEnv@,
so there are plenty of examples to follow.
When you need something unique for fast comparisons. Interface:
@Unique@. This interface also provides a simple @UniqueSupply@ monad;
often just the thing...
When you need something unique for fast comparisons. Interface:
@Unique@. This interface also provides a simple @UniqueSupply@ monad;
often just the thing...
-\item[Wired-in standard prelude knowledge:]\srcloc{prelude/} The
-compiler has to know a lot about the standard prelude. What it knows
+\item[Wired-in standard prelude knowledge:]\srcloc{prelude/}%
+The compiler has to know a lot about the standard prelude. What it knows
is in the @compiler/prelude@ directory; all the rest of the compiler
gets its prelude knowledge through the @AbsPrel@ interface.
is in the @compiler/prelude@ directory; all the rest of the compiler
gets its prelude knowledge through the @AbsPrel@ interface.