Commit df87e59e authored by ross's avatar ross

[project @ 2004-10-03 16:17:08 by ross]

spelling
parent c61f8941
......@@ -144,7 +144,7 @@
<listitem>
<para>New commands: <literal>:browse</literal>, <literal>:set
args</literal>, <literal>:set prog</literal>, <literal>:show
binadings</literal>, and <literal>:show modules</literal> (see
bindings</literal>, and <literal>:show modules</literal> (see
<xref linkend="ghci-commands">).</para>
</listitem>
<listitem>
......
......@@ -103,7 +103,7 @@
<programlisting>
main = print (array (1,1) [(1,2), (1,3)])</programlisting>
GHC's implemetation of <literal>array</literal> takes the value of an
GHC's implementation of <literal>array</literal> takes the value of an
array slot from the last (index,value) pair in the list, and does no
checking for duplicates. The reason for this is efficiency, pure and simple.
</para>
......
......@@ -120,7 +120,7 @@
<indexterm><primary><option>-ddump-simpl</option></primary></indexterm>
</term>
<listitem>
<para>simplifer output (Core-to-Core passes)</para>
<para>simplifier output (Core-to-Core passes)</para>
</listitem>
</varlistentry>
......@@ -504,7 +504,7 @@ Main.skip2{-r1L6-} =
fromInt.t4GS = (fromInt{-r3JX-} _4) d.Num.t4Gt
--# The `+' class method (Unique: r3JH) selects the addition code
--# from a `Num' dictionary (now an explicit lamba'd argument).
--# from a `Num' dictionary (now an explicit lambda'd argument).
--# Because Core is 2nd-order lambda-calculus, type applications
--# and lambdas (/\) are explicit. So `+' is first applied to a
--# type (`_4'), then to a dictionary, yielding the actual addition
......
......@@ -30,7 +30,7 @@
</listitem>
</itemizedlist>
<para>Both ways require you to bootrap from intermediate
<para>Both ways require you to bootstrap from intermediate
<literal>HC</literal> files: these are the stylised C files
generated by GHC when it compiles Haskell source. Basically
the idea is to take the HC files for GHC itself to the target
......@@ -225,7 +225,7 @@
descriptor (gotten from <literal>Posix.handleToFd</literal>)
before the first read, but this doesn't work on FreeBSD
(although rumour has it that recent versions of FreeBSD
changed the behavour to match other OSs). A workaround for
changed the behaviour to match other OSs). A workaround for
all systems is to open the FIFO for writing yourself, before
(or at the same time as) opening it for reading.</para>
</listitem>
......@@ -336,7 +336,7 @@ details.</para>
</varlistentry>
<varlistentry>
<term>If I explicitely set the buffering on a Handle to
<term>If I explicitly set the buffering on a Handle to
"NoBuffering" I'm not able to enter EOF by typing
"Ctrl-D".</term>
......
......@@ -108,7 +108,7 @@ extern HsInt foo(HsInt a0);</programlisting>
<literal>main()</literal>, which arranges to invoke
<literal>Main.main</literal> in the Haskell program. However,
you might want to link some Haskell code into a program which
has a main function written in another languagem, say C. In
has a main function written in another language, say C. In
order to do this, you have to initialize the Haskell runtime
system explicitly.</para>
......@@ -280,7 +280,7 @@ declaration itself:
</programlisting>
When compiling this module, GHC will generate a C file that includes
the specified <option>-&num;include</option>. However, GHC
<emphasis>disables</emphasis> cross-module inlinding for such foreign
<emphasis>disables</emphasis> cross-module inlining for such foreign
calls, because it doesn't transport the <option>-&num;include</option>
information across module boundaries. (There is no fundamental reason for this;
it was just tiresome to implement. The wrapper, which unboxes the arguments
......@@ -327,7 +327,7 @@ to be inlined across modules, use the command-line and package-configuration
<listitem>
<para>Useful for short-term allocation when the allocation
is intended to scope over a given <literal>IO</literal>
compuatation. This kind of allocation is commonly used
computation. This kind of allocation is commonly used
when marshalling data to and from FFI functions.</para>
<para>In GHC, <literal>alloca</literal> is implemented
......@@ -366,7 +366,7 @@ to be inlined across modules, use the command-line and package-configuration
<para>If all else fails, then you need to resort to
<literal>Foreign.malloc</literal> and
<literal>Foreign.free</literal>. These are just wrappers
around the C funcitons of the same name, and their
around the C functions of the same name, and their
efficiency will depend ultimately on the implementations
of these functions in your platform's C library. We
usually find <literal>malloc</literal> and
......@@ -376,14 +376,14 @@ to be inlined across modules, use the command-line and package-configuration
</varlistentry>
<varlistentry>
<term><literal>Foreign.Marhsal.Pool</literal></term>
<term><literal>Foreign.Marshal.Pool</literal></term>
<listitem>
<para>Pools are currently implemented using
<literal>malloc/free</literal>, so while they might be a
more convenient way to structure your memory allocation
than using one of the other forms of allocation, they
won't be any more efficient. We do plan to provide an
improved-performance implementaiton of Pools in the
improved-performance implementation of Pools in the
future, however.</para>
</listitem>
</varlistentry>
......
......@@ -1149,7 +1149,7 @@
</row>
<row>
<entry><option>-no-hs-main</option></entry>
<entry>Don't asssume this program contains <literal>main</literal></entry>
<entry>Don't assume this program contains <literal>main</literal></entry>
<entry>static</entry>
<entry>-</entry>
</row>
......
......@@ -10,7 +10,7 @@
</footnote>
is GHC's interactive environment, in which Haskell expressions can
be interactively evaluated and programs can be interpreted. If
you're famililar with <ulink url="http://www.haskell.org/hugs/">Hugs</ulink><indexterm><primary>Hugs</primary>
you're familiar with <ulink url="http://www.haskell.org/hugs/">Hugs</ulink><indexterm><primary>Hugs</primary>
</indexterm>, then you'll be right at home with GHCi. However, GHCi
also has support for interactively loading compiled code, as well as
supporting all<footnote><para>except <literal>foreign export</literal>, at the moment</para>
......@@ -668,7 +668,7 @@ Wed Mar 14 12:23:13 GMT 2001
</sect2>
</sect1>
<sect1 id="ghci-invokation">
<sect1 id="ghci-invocation">
<title>Invoking GHCi</title>
<indexterm><primary>invoking</primary><secondary>GHCi</secondary></indexterm>
<indexterm><primary><option>&ndash;&ndash;interactive</option></primary></indexterm>
......@@ -765,7 +765,7 @@ $ ghci -lm
</listitem>
<listitem>
<para>the standard library search path for your system,
which on some systems may be overriden by setting the
which on some systems may be overridden by setting the
<literal>LD_LIBRARY_PATH</literal> environment
variable.</para>
</listitem>
......
......@@ -619,7 +619,7 @@ clunky env var1 var1
</programlisting>
<para>
The semantics should be clear enough. The qualifers are matched in order.
The semantics should be clear enough. The qualifiers are matched in order.
For a <literal>&lt;-</literal> qualifier, which I call a pattern guard, the
right hand side is evaluated and matched against the pattern on the left.
If the match fails then the whole guard fails and the next equation is
......@@ -957,7 +957,7 @@ like expressions. More specifically:
<title>Liberalised type synonyms</title>
<para>
Type synonmys are like macros at the type level, and
Type synonyms are like macros at the type level, and
GHC does validity checking on types <emphasis>only after expanding type synonyms</emphasis>.
That means that GHC can be very much more liberal about type synonyms than Haskell 98:
<itemizedlist>
......@@ -1006,7 +1006,7 @@ You can apply a type synonym to a partially applied type synonym:
foo :: Generic Id []
</programlisting>
After epxanding the synonym, <literal>foo</literal> has the legal (in GHC) type:
After expanding the synonym, <literal>foo</literal> has the legal (in GHC) type:
<programlisting>
foo :: forall x. x -> [x]
</programlisting>
......@@ -1458,7 +1458,7 @@ be acyclic</emphasis>. So these class declarations are OK:
<para>
<emphasis>All of the class type variables must be reachable (in the sense
mentioned in <xref linkend="type-restrictions"/>)
from the free varibles of each method type
from the free variables of each method type
</emphasis>. For example:
......@@ -1589,7 +1589,7 @@ get any more information about <literal>tv</literal>.
<para>
Note
that the reachability condition is weaker than saying that <literal>a</literal> is
functionally dependendent on a type variable free in
functionally dependent on a type variable free in
<literal>type</literal> (see <xref
linkend="functional-dependencies"/>). The reason for this is there
might be a "hidden" dependency, in a superclass perhaps. So
......@@ -1775,7 +1775,7 @@ GHC is also conservative about committing to an overlapping instance. For examp
f x = op x
</programlisting>
From the RHS of f we get the constraint <literal>C [b]</literal>. But
GHC does not commit to the second instance declaration, because in a paricular
GHC does not commit to the second instance declaration, because in a particular
call of f, b might be instantiate to Int, so the first instance declaration
would be appropriate. So GHC rejects the program. If you add <option>-fallow-incoherent-instances</option>
GHC will instead silently pick the second instance, without complaining about
......@@ -1947,7 +1947,7 @@ allowing these idioms interesting idioms.
<sect2 id="implicit-parameters">
<title>Implicit parameters</title>
<para> Implicit paramters are implemented as described in
<para> Implicit parameters are implemented as described in
"Implicit parameters: dynamic scoping with static types",
J Lewis, MB Shields, E Meijer, J Launchbury,
27th ACM Symposium on Principles of Programming Languages (POPL'00),
......@@ -2118,7 +2118,7 @@ problem that monads seem over-kill for certain sorts of problem, notably:
</para>
<itemizedlist>
<listitem> <para> distributing a supply of unique names </para> </listitem>
<listitem> <para> distributing a suppply of random numbers </para> </listitem>
<listitem> <para> distributing a supply of random numbers </para> </listitem>
<listitem> <para> distributing an oracle (as in QuickCheck) </para> </listitem>
</itemizedlist>
......@@ -2405,7 +2405,7 @@ is implicitly added by Haskell.
</para>
<para>
The functions <literal>f2</literal> and <literal>g2</literal> have rank-2 types;
the <literal>forall</literal> is on the left of a function arrrow. As <literal>g2</literal>
the <literal>forall</literal> is on the left of a function arrow. As <literal>g2</literal>
shows, the polymorphic type on the left of the function arrow can be overloaded.
</para>
<para>
......@@ -2578,7 +2578,7 @@ matching.
<title>Type inference</title>
<para>
In general, type inference for arbitrary-rank types is undecideable.
In general, type inference for arbitrary-rank types is undecidable.
GHC uses an algorithm proposed by Odersky and Laufer ("Putting type annotations to work", POPL'96)
to get a decidable algorithm by requiring some help from the programmer.
We do not yet have a formal specification of "some help" but the rule is this:
......@@ -2907,7 +2907,7 @@ A pattern type signature can occur in any pattern. For example:
<listitem>
<para>
A pattern type signature can be on an arbitrary sub-pattern, not
ust on a variable:
just on a variable:
<programlisting>
......@@ -3323,7 +3323,7 @@ These and many other examples are given in papers by Hongwei Xi, and Tim Sheard.
<itemizedlist>
<listitem><para>
Data type declarations have a 'where' form, as exemplified above. The type signature of
each constructor is independent, and is implicitly univerally quantified as usual. Unlike a normal
each constructor is independent, and is implicitly universally quantified as usual. Unlike a normal
Haskell data type declaration, the type variable(s) in the "<literal>data Term a where</literal>" header
have no scope. Indeed, one can write a kind signature instead:
<programlisting>
......@@ -4211,7 +4211,7 @@ Assertion failures can be caught, see the documentation for the
{-# DEPRECATED f, C, T "Don't use these" #-}
</programlisting>
<para>When you compile any module that imports and uses any
of the specifed entities, GHC will print the specified
of the specified entities, GHC will print the specified
message.</para>
</listitem>
</itemizedlist>
......@@ -4267,7 +4267,7 @@ key_function :: Int -> String -> (Bool, Double)
The normal unfolding machinery will then be very keen to
inline it.</para>
<para>Syntactially, an <literal>INLINE</literal> pragma for a
<para>Syntactically, an <literal>INLINE</literal> pragma for a
function can be put anywhere its type signature could be
put.</para>
......@@ -4317,7 +4317,7 @@ key_function :: Int -> String -> (Bool, Double)
number</emphasis>; the phase number decreases towards zero.
If you use <option>-dverbose-core2core</option> you'll see the
sequence of phase numbers for successive runs of the
simpifier. In an INLINE pragma you can optionally specify a
simplifier. In an INLINE pragma you can optionally specify a
phase number, thus:</para>
<itemizedlist>
......@@ -4562,7 +4562,7 @@ data S = S {-# UNPACK #-} !Int {-# UNPACK #-} !Int
<sect1 id="rewrite-rules">
<title>Rewrite rules
<indexterm><primary>RULES pagma</primary></indexterm>
<indexterm><primary>RULES pragma</primary></indexterm>
<indexterm><primary>pragma, RULES</primary></indexterm>
<indexterm><primary>rewrite rules</primary></indexterm></title>
......@@ -4728,7 +4728,7 @@ same type.
<para>
GHC makes absolutely no attempt to verify that the LHS and RHS
of a rule have the same meaning. That is undecideable in general, and
of a rule have the same meaning. That is undecidable in general, and
infeasible in most interesting cases. The responsibility is entirely the programmer's!
</para>
......@@ -4760,7 +4760,7 @@ This rule will cause the compiler to go into an infinite loop.
for matching a rule LHS with an expression. It seeks a substitution
which makes the LHS and expression syntactically equal modulo alpha
conversion. The pattern (rule), but not the expression, is eta-expanded if
necessary. (Eta-expanding the epression can lead to laziness bugs.)
necessary. (Eta-expanding the expression can lead to laziness bugs.)
But not beta conversion (that's called higher-order matching).
</para>
......@@ -5126,7 +5126,7 @@ If you add <option>-dppr-debug</option> you get a more detailed listing.
<listitem>
<para>
The defintion of (say) <function>build</function> in <filename>GHC/Base.lhs</filename> looks llike this:
The definition of (say) <function>build</function> in <filename>GHC/Base.lhs</filename> looks llike this:
<programlisting>
build :: forall a. (forall b. (a -> b -> b) -> b -> b) -> [a]
......@@ -5175,7 +5175,7 @@ program even if fusion doesn't happen. More rules in <filename>GHC/List.lhs</fi
f x = ({-# CORE "foo" #-} show) ({-# CORE "bar" #-} x)
</programlisting>
Sematically, this is equivalent to:
Semantically, this is equivalent to:
<programlisting>
g x = show x
......
......@@ -633,7 +633,7 @@ the links in "Start/Programs/Glasgow Haskell Compiler" if you do this.)
<para>
It is OK to put GHC tree in a directory whose path involves spaces. However,
don't do this if you use want to use GHC with the Cygwin tools,
because Cygwin can get confused when this happpens.
because Cygwin can get confused when this happens.
We havn't quite got to the bottom of this, but so far as we know it's not
a problem with GHC itself. Nevertheless, just to keep life simple we usually
put GHC in a place with a space-free path.
......
......@@ -258,7 +258,7 @@ MAIN MAIN 0 0.0 0.0 100.0 100.0
{-# SCC "name" #-} &lt;expression&gt;
</programlisting>
<para>where <literal>"name"</literal> is an aribrary string,
<para>where <literal>"name"</literal> is an arbitrary string,
that will become the name of your cost centre as it appears
in the profiling output, and
<literal>&lt;expression&gt;</literal> is any Haskell
......@@ -490,7 +490,7 @@ x = nfib 25
over time. This is useful for detecting the causes of
<firstterm>space leaks</firstterm>, when your program holds on to
more memory at run-time that it needs to. Space leaks lead to
longer run-times due to heavy garbage collector ativity, and may
longer run-times due to heavy garbage collector activity, and may
even cause the program to run out of memory altogether.</para>
<para>To generate a heap profile from your program:</para>
......@@ -809,7 +809,7 @@ x = nfib 25
<para>The definition of retainers is designed to reflect a
common cause of space leaks: a large structure is retained by
an unevaluated computation, and will be released once the
compuation is forced. A good example is looking up a value in
computation is forced. A good example is looking up a value in
a finite map, where unless the lookup is forced in a timely
manner the unevaluated lookup will cause the whole mapping to
be retained. These kind of space leaks can often be
......
......@@ -80,7 +80,7 @@
</screen>
<para>RTS options taken from the <envar>GHCRTS</envar> environment
variable can be overriden by options given on the command
variable can be overridden by options given on the command
line.</para>
</sect2>
......
......@@ -136,7 +136,7 @@
will not get confused.</para>
<para>In batch compilation mode, the name of the object file can
also be overriden using the <option>-o</option> option, and the
also be overridden using the <option>-o</option> option, and the
name of the interface file can be specified directly using the
<option>-ohi</option> option.</para>
</sect2>
......@@ -597,7 +597,7 @@ $ ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `arch`
it used when it last compiled the file. If the source file's
modification date is earlier than the <filename>.o</filename>
file's date (i.e. the source hasn't changed since the file was
last compiled), and the reompilation checking is on, GHC will be
last compiled), and the recompilation checking is on, GHC will be
clever. It compares the version numbers on the things it needs
this time with the version numbers on the things it needed last
time (gleaned from the interface file of the module being
......@@ -986,7 +986,7 @@ module A where
</programlisting>
In a <emphasis>source</emphasis> program
this would declare TA to have no constructors (a GHC extension: see <xref linkend="nullary-types"/>),
but in an hi-boot file it means "I don't know or care what the construtors are".
but in an hi-boot file it means "I don't know or care what the constructors are".
This is the most common form of data type declaration, because it's easy to get right.</para>
<para>
You <emphasis>can</emphasis> also write out the constructors but, if you do so, you must write
......
......@@ -333,7 +333,7 @@ ghc &ndash;&ndash;make Main.hs
<listitem>
<para>GHC doesn't have to be restarted for each compilation,
which means it can cache information between compilations.
Compiling a muli-module program with <literal>ghc
Compiling a multi-module program with <literal>ghc
&ndash;&ndash;make</literal> can be up to twice as fast as
running <literal>ghc</literal> individually on each source
file.</para>
......@@ -358,7 +358,7 @@ ghc &ndash;&ndash;make Main.hs
pragma (see <xref linkend="source-file-options"/>).</para>
<para>If the program needs to be linked with additional objects
(say, some auxilliary C code), then the object files can be
(say, some auxiliary C code), then the object files can be
given on the command line and GHC will include them when linking
the executable.</para>
......@@ -1710,7 +1710,7 @@ and maintaining internal tables of global addresses.
only)</primary></indexterm> Means to pass the like-named
option to GCC; it says to use the Version 8 SPARC
instructions, notably integer multiply and divide. The
similiar <option>-m*</option> GCC options for SPARC also
similar <option>-m*</option> GCC options for SPARC also
work, actually.</para>
</listitem>
</varlistentry>
......@@ -1779,7 +1779,7 @@ statements or clauses.
<para>GHC can also read in External Core files as source; just give the <literal>.hcr</literal> file on
the command line, instead of the <literal>.hs</literal> or <literal>.lhs</literal> Haskell source.
A current infelicity is that you need to give teh <literal>-fglasgow-exts</literal> flag too, because
A current infelicity is that you need to give the <literal>-fglasgow-exts</literal> flag too, because
ordinary Haskell 98, when translated to External Core, uses things like rank-2 types.</para>
</sect1>
......
......@@ -6,7 +6,7 @@
<para>This section describes other program(s) which we distribute,
that help with the Great Haskell Programming Task.</para>
<!-- comment: hasktags documentation losely based on that for hstags -->
<!-- comment: hasktags documentation loosely based on that for hstags -->
<sect1 id ="hasktags">
<title>Ctags and Etags for Haskell: <command>hasktags</command></title>
......@@ -34,7 +34,7 @@ find -name \*.\*hs | xargs hasktags
<para>This will find all haskell source files in the current directory and below, and create tags files indexing them in the current directory.</para>
<para><command>hasktags</command> is a simple program that uses simple
parsing rules to find definitions of functions, constructors, and types. It isn't guranteed to find everything, and will sometimes create false index entries, but it usually gets the job done fairly well. In particular, at present, functions are only indexed if a type signature is given for them.</para>
parsing rules to find definitions of functions, constructors, and types. It isn't guaranteed to find everything, and will sometimes create false index entries, but it usually gets the job done fairly well. In particular, at present, functions are only indexed if a type signature is given for them.</para>
<para>Before hasktags, there used to be <command>fptags</command> and <command>hstags</command>, which did essentially the same job, however neither of these seem to be maintained any more.</para>
......@@ -547,7 +547,7 @@ tags:
source. They are useful for making a <literal>#let</literal>-like
macro whose expansion uses other <literal>#let</literal> macros.
Plain <literal>#let</literal> prepends <literal>hsc_</literal>
to the macro name and wraps the defininition in a
to the macro name and wraps the definition in a
<literal>printf</literal> call.</para>
</sect2>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment