[project @ 2004-10-18 18:24:59 by igloo]
[ghc-hetmet.git] / ghc / docs / users_guide / ghci.xml
index 374b28c..8914901 100644 (file)
@@ -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>
@@ -906,6 +906,19 @@ Prelude> :mycd ..
 Prelude> :def make (\_ -> return ":! ghc &ndash;&ndash;make Main")
 </screen>
 
+          <para>We can define a command that reads GHCi input from a
+          file.  This might be useful for creating a set of bindings
+          that we want to repeatedly load into the GHCi session:</para>
+
+<screen>
+Prelude> :def . readFile
+Prelude> :. cmds.ghci
+</screen>
+
+          <para>Notice that we named the command
+          <literal>:.</literal>, by analogy with the
+          &lsquo;<literal>.</literal>&rsquo; Unix shell command that
+          does the same thing.</para>
        </listitem>
       </varlistentry>