<VariableList>
<VarListEntry>
-<Term><Literal>fromInt</Literal> method in class <Literal>Num</Literal>:</Term>
+<Term><Function>fromInt</Function> method in class <Literal>Num</Literal>:</Term>
<ListItem>
<Para>
It's there. Converts from
</ListItem>
</VarListEntry>
<VarListEntry>
-<Term><Literal>toInt</Literal> method in class <Literal>Integral</Literal>:</Term>
+<Term><Function>toInt</Function> method in class <Literal>Integral</Literal>:</Term>
<ListItem>
<Para>
Converts from Integral
don't recommend that you use any module names beginning with <Literal>Prel</Literal> in
your own programs. The <Literal>Prel</Literal> modules are always available: in fact,
you can get access to several extensions this way (for some you might
-need to give the <Literal>-fglasgow-exts</Literal><IndexTerm><Primary>-fglasgow-exts option</Primary></IndexTerm>
+need to give the <Option>-fglasgow-exts</Option><IndexTerm><Primary>-fglasgow-exts option</Primary></IndexTerm>
flag).
</Para>
The extension libraries provided by both GHC and Hugs are described in
the
<ULink
-URL="http://www.dcs.gla.ac.uk/fp/software/ghc/hg-libs/hg-libs.html"
->GHC/Hugs Extension Library Document</ULink
->
+URL="libs.html">GHC/Hugs Extension Library Document</ULink>
</Para>
</Sect1>
<Para>
If you rely on the implicit <Literal>import Prelude</Literal> that GHC normally does
for you, and if you don't use any weird flags (notably
-<Literal>-fglasgow-exts</Literal>), and if you don't import the Glasgow extensions
+<Option>-fglasgow-exts</Option>), and if you don't import the Glasgow extensions
interface, <Literal>GlaExts</Literal>, then GHC should work <Emphasis>exactly</Emphasis> as the
Haskell report says (modulo a few minor issues, see <XRef LinkEnd="vs-Haskell-defn">).
</Para>
<Para>
-If you turn on <Literal>-fglasgow-exts</Literal>, a new world opesn up to you and the compiler
+If you turn on <Option>-fglasgow-exts</Option>, a new world opesn up to you and the compiler
will recognise and parse unboxed values properly, and provide access to the
various interfaces libraries described here (and piles of other goodies.)
</Para>
<Para>
The <Literal>CCall</Literal> module defines the classes <Literal>CCallable</Literal> and <Literal>CReturnable</Literal>,
along with instances for the primitive types (<Literal>Int</Literal>, <Literal>Int#</Literal>, <Literal>Float</Literal>,
-<Literal>Float#</Literal> etc.) GHC knows to import this module if you use <Literal>_ccall_</Literal>,
+<Literal>Float#</Literal> etc.) GHC knows to import this module if you use <Function>_ccall_</Function>,
but if you need to define your own instances of these classes, you
will need to import <Literal>CCall</Literal> explicitly.
</Para>
<Para>
-More information on how to use <Literal>_ccall_</Literal> can be found in <XRef LinkEnd="glasgow-ccalls">.
+More information on how to use <Function>_ccall_</Function> can be found in <XRef LinkEnd="glasgow-ccalls">.
</Para>
</Sect2>
The <Literal>GlaExts</Literal> interface provides access to extensions that only GHC
implements. These currently are: unboxed types, including the
representations of the primitive types (Int, Float, etc.), and the
-GHC primitive operations (<Literal>+#</Literal>, <Literal>==#</Literal>, etc.).
+GHC primitive operations (<Function>+#</Function>, <Function>==#</Function>, etc.).
</Para>
<Para>
<Para>
Unboxed tuples aren't really exported by <Literal>PrelGHC</Literal>, they're available
-by default with <Literal>-fglasgow-exts</Literal>. An unboxed tuple looks like this:
+by default with <Option>-fglasgow-exts</Option>. An unboxed tuple looks like this:
</Para>
<Para>
</ProgramListing>
-because <Literal>x</Literal> has an unboxed tuple type.
+because <VarName>x</VarName> has an unboxed tuple type.
</Para>
</ListItem>
<Para>
If you really want to know their exact equivalents in C, see
-<Literal>ghc/includes/StgTypes.h</Literal> in the GHC source tree.
+<Filename>ghc/includes/StgTypes.h</Filename> in the GHC source tree.
</Para>
<Para>
</Para>
<Para>
-The primitive versions of <Literal>encodeDouble</Literal>/<Literal>decodeDouble</Literal>:
+The primitive versions of <Function>encodeDouble</Function>/<Function>decodeDouble</Function>:
</Para>
<Para>
<Para>
The data type for <Literal>Integer</Literal> is either a small integer,
represented by an <Literal>Int</Literal>, or a large integer represented
-using the pieces requird by GMP's <Literal>MP_INT</Literal> in <Literal>gmp.h</Literal>
-(see <Literal>gmp.info</Literal> in <Literal>ghc/includes/runtime/gmp</Literal>). It comes out as:
+using the pieces required by GMP's <Literal>MP_INT</Literal> in <Filename>gmp.h</Filename>
+(see <Filename>gmp.info</Filename> in <Filename>ghc/includes/runtime/gmp</Filename>). It comes out as:
</Para>
<Para>
Haskell <Literal>Array</Literal> interface is implemented using <Literal>Array#</Literal>—in that an
<Literal>Array#</Literal> is indexed only by <Literal>Int#</Literal>s, starting at zero. It is also
more primitive by virtue of being unboxed. That doesn't mean that it
-isn't a heap-allocated object - of course, it is. Rather, being
+isn't a heap-allocated object—of course, it is. Rather, being
unboxed means that it is represented by a pointer to the array itself,
and not to a thunk which will evaluate to the array (or to bottom).
The components of an <Literal>Array#</Literal> are themselves boxed.
</Para>
<Para>
-The last of these, <Literal>indexAddrOffAddr#</Literal>, extracts an <Literal>Addr#</Literal> using an offset
+The last of these, <Function>indexAddrOffAddr#</Function>, extracts an <Literal>Addr#</Literal> using an offset
from another <Literal>Addr#</Literal>, thereby providing the ability to follow a chain of
C pointers.
</Para>
<Para>
Only unsafe-freeze has a primitive. (Safe freeze is done directly in Haskell
-by copying the array and then using <Literal>unsafeFreeze</Literal>.)
+by copying the array and then using <Function>unsafeFreeze</Function>.)
</Para>
<Para>
</Para>
<Para>
-The <Literal>makeStablePointer</Literal> function converts a value into a stable
+The <Function>makeStablePointer</Function> function converts a value into a stable
pointer. It is part of the <Literal>IO</Literal> monad, because we want to be sure
we don't allocate one twice by accident, and then only free one of the
copies.
</Para>
<Para>
-There is also a C procedure <Literal>FreeStablePtr</Literal> which frees a stable pointer.
+There is also a C procedure <Function>FreeStablePtr</Function> which frees a stable pointer.
</Para>
</Sect2>