Commit b9de0b09 authored by Ross Paterson's avatar Ross Paterson
Browse files

Typos, and add an extra blank line in #! scripts to make them legal

literate scripts.
parent 5da35150
......@@ -62,7 +62,7 @@
<para>Specifically, the HPS describes what a Haskell
package is, how these packages interact with the language,
and what Haskell implementations must to do to support packages.
The HPS also specifies some infrasturucture (code) that makes
The HPS also specifies some infrastructure (code) that makes
it easy for library authors to build and distribute conforming packages.
</para>
<para>The HPS is only one contribution to the Library Infrastructure project.
......@@ -89,7 +89,7 @@ regardless of the Haskell implementation or installation platform.</para>
<note><para>Would some name other than "Haskell Package System" be better?</para></note>
<para>The HPS also
supports library authors by providing an instrastructure that automates the
supports library authors by providing an infrastructure that automates the
process of building and packaging simple libraries. It is not necessary to use
this code&mdash;indeed complex libraries may exceed its abilities&mdash;but it should
handle many cases with no trouble.</para>
......@@ -99,14 +99,14 @@ handle many cases with no trouble.</para>
<para>The HPS serves a number of different people:
<itemizedlist>
<listitem><para>
<emphasis>Joe User</emphasis> is simply a Haskell user. He does not download new pacakges. Nevertheless,
<emphasis>Joe User</emphasis> is simply a Haskell user. He does not download new packages. Nevertheless,
he needs to know about his Haskell compiler's <function>-package</function> flag (see <xref linkend="compiler-reqts">).
</para>
</listitem>
<listitem><para>
<emphasis>Bob the Builder</emphasis> and <emphasis>Sam Sysadmin</emphasis> both download, build,
and install new pacakges. The only difference between the two is that Sam has root permission,
and can install pacakges in more globally-visible places.
and install new packages. The only difference between the two is that Sam has root permission,
and can install packages in more globally-visible places.
</para>
</listitem>
<listitem><para> <emphasis>Roland RPM</emphasis>, <emphasis>Donald
......@@ -155,13 +155,14 @@ a <emphasis>package description</emphasis>, which she puts in <filename>~/coll/p
name: angela-coll
version: 1
</programlisting>
She also creates a two-line Haskell file <filename>~/coll/Setup.lhs</filename> as follows:
She also creates a three-line Haskell file <filename>~/coll/Setup.lhs</filename> as follows:
<programlisting>
#! runhugs
> import Distribution.Simple( main )
</programlisting>
The first line arranges that when Angela executes <filename>Setup.lhs</filename> as a shell script,
the shell will invoke <command>ruhugs</command>, which will in turn run <literal>main</literal> imported
the shell will invoke <command>runhugs</command>, which will in turn run <literal>main</literal> imported
from the library <literal>Distribution.Simple</literal>. This library implements the HPS simple build infrastructure.
</para>
<para> Now she is ready to go. She types:
......@@ -215,7 +216,7 @@ Each package has:
<listitem><para>A globally-unique <emphasis>package name</emphasis>, containing no spaces. Chaos will result
if two distinct packages with the same name are installed on the same system. How unique package names are
handed out is not part of this specification, but there will presumably be some global web site where
pacakge authors can go to register a package name. </para>
package authors can go to register a package name. </para>
</listitem>
<listitem><para>A <emphasis>version</emphasis>, consisting of a sequence of one or more integers.
</para></listitem>
......@@ -227,7 +228,7 @@ greater than 2.4".
</listitem>
<listitem><para>
<emphasis>A list of exposed modules</emphasis>. Not all of the modules that comprise a package implementation are necessarily
exposed to a pacakge client.
exposed to a package client.
The ability to expose some, but not all, of the modules making up a package
is rather like using an explicit export list on a Haskell module.</para>
</listitem>
......@@ -241,8 +242,8 @@ from the name, and dots to separate the version components. For example, "hunit
<sect2 id="packages-and-haskell"><title>Packages and the Haskell language</title>
<para>A complete Haskell program will consist of one or more modules (including <literal>Main</literal>)
compiled against one or more packages (of which the Prelude is one). These pacakges are not referred to
explicitly in the Haskell source; instead, the pacakges simply populate the hierarchical space of module names.
compiled against one or more packages (of which the Prelude is one). These packages are not referred to
explicitly in the Haskell source; instead, the packages simply populate the hierarchical space of module names.
</para>
<para>Complete programs must obey the following invariant. <emphasis>Consider all the Haskell modules that
constitute a complete program: no two modules must have the same module name.</emphasis></para>
......@@ -254,8 +255,8 @@ used to determine when two entities are the same, is simply a pair of the module
<para>The invariant is unsatisfactory, however, because it does not support abstraction at
the package level. For example, a module with an internal (hidden, non-exposed) module called <literal>Foo</literal>
cannot be used in the same program as another package with an unrelated internal module also called <literal>Foo</literal>.
Nor can a program use two pacakges, P and Q, which depend on different versions of the same underlying package R.
We consided more sophisticated schemes, in which (for example) the package name, or package ID, is implicitly
Nor can a program use two packages, P and Q, which depend on different versions of the same underlying package R.
We considered more sophisticated schemes, in which (for example) the package name, or package ID, is implicitly
made part of every module name. But (a) there is a big design space, and (b) it places new requirements on the
implementations. Hence a conservative starting point.</para>
</sect2>
......@@ -475,7 +476,7 @@ already-installed package. By default, installing a package installs it exposed
existing installed package of the same name (and presumably different version).
</para>
<para>Hiding or exposing a package is an operation that can be performed, by &hc-pkg;,
on any package. It is quite distinct from the question of which modules in a pacakge are hidden or
on any package. It is quite distinct from the question of which modules in a package are hidden or
exposed (see <xref linkend="package-descr">), which is a property of the package itself. Only the exposed
modules of an exposed package populate the module name space seen by a Haskell <literal>import</literal> statement.
</para>
......@@ -509,7 +510,7 @@ check that no user has a user package depending on P.</para>
<para>
By default, the module namespace is populated only by the exposed modules of exposed packages.
This can be overridden using the <function>-package</function> flag, which temporarily exposes a
particular package, hiding any other pacakges of the same name.</para>
particular package, hiding any other packages of the same name.</para>
<note><para>Question: what does <function>-package hunit-1.2 -package hunit-1.3</function> do?
Does the second override the first? Or are they both in scope? I think the former.</para>
<para>Question: what if the -package flag breaks the registration invariants? For example, the
......@@ -573,7 +574,7 @@ allows a user to make a new package known to the compiler, and to ask what packa
<arg choice=req><replaceable>field</replaceable> </arg>
</cmdsynopsis></entry>
<Entry><para>Extract the specifed field of the package description for the specified package.
<Entry><para>Extract the specified field of the package description for the specified package.
</para></entry></row>
</tbody></tgroup>
......@@ -583,7 +584,7 @@ such as "<function>hunit</function>". To determine which package is meant, &hc-
registered user packages and then the shared packages. If no such package exists, the command fails; that is, it does nothing,
returning a non-zero error code.
If only a name is specified, &hc-pkg; fails
unless the name identifies a unique package among the user packages, or among the shared pacakges. As usual, the
unless the name identifies a unique package among the user packages, or among the shared packages. As usual, the
user packages win.
</para>
<note><para>Can we give the <option>-user</option> flag to <command>hide</command>, <command>expose</command>,
......@@ -756,7 +757,7 @@ on Windows it will be <filename>Program Files</filename>. The setup script will
<listitem>
<para><option>--shared</option>: if present, this flag is
passed to &hc-pkg; so that the package is
registed as shared. This flag has no effect if
registered as shared. This flag has no effect if
<function>--install-prefix</function> is used, because in
that case &hc-pkg; is not called.</para>
</listitem>
......@@ -861,11 +862,12 @@ if you want something more elaborate, you can (a) modify the simple build infras
<sect2><title>Overview</title>
<para>
The simple build infrastructure works as follows. First, Angela puts the following Hasell
The simple build infrastructure works as follows. First, Angela puts the following Haskell
file <function>Setup.lhs</function> in the
root of her tree:
<programlisting>
#! runghc
> import Distribution.Simple
</programlisting>
Second, she writes a package description <function>pkg.desc</function> in the syntax of <xref linkend="sbi-pkg-desc">,
......@@ -891,7 +893,7 @@ for an HPS package distribution (<xref linkend="setup">).
In fact, <function>Distribution.Simple.defaultMain</function> conforms to the specification of <xref linkend="setup-spec">, and when it builds
a distribution, it includes <function>./Setup.lhs</function> in the tarball, ready to be run by Bob the Builder.
However, <function>Distribution.Simple.defaultMain</function> of course implements a richer interface than that required by
<xref linkend="setup-spec">, becuase it's intended to support Angela as well as Bob.
<xref linkend="setup-spec">, because it's intended to support Angela as well as Bob.
The full specification is in <xref linkend="sbi-setup">.
</para>
</sect2>
......
Supports Markdown
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