[project @ 2004-08-26 08:48:25 by simonmar]
authorsimonmar <unknown>
Thu, 26 Aug 2004 08:48:25 +0000 (08:48 +0000)
committersimonmar <unknown>
Thu, 26 Aug 2004 08:48:25 +0000 (08:48 +0000)
Add the :def . readFile example.

ghc/docs/users_guide/ghci.xml

index 374b28c..fcdf986 100644 (file)
@@ -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>