$ ghci
___ ___ _
/ _ \ /\ /\/ __(_)
- / /_\// /_/ / / | | GHC Interactive, version 4.11, For Haskell 98.
+ / /_\// /_/ / / | | GHC Interactive, version 5.00, For Haskell 98.
/ /_\\/ __ / /___| | http://www.haskell.org/ghc/
\____/\/ /_/\____/|_| Type :? for help.
<screen>
Prelude> 1+2
3
-PrePrelude> let x = 42 in x / 9
+Prelude> let x = 42 in x / 9
4.666666666666667
Prelude>
</screen>
$ ghci -package text
___ ___ _
/ _ \ /\ /\/ __(_)
- / /_\// /_/ / / | | GHC Interactive, version 4.11, For Haskell 98.
+ / /_\// /_/ / / | | GHC Interactive, version 5.00, For Haskell 98.
/ /_\\/ __ / /___| | http://www.haskell.org/ghc/
\____/\/ /_/\____/|_| Type :? for help.
</varlistentry>
<varlistentry>
- <term><literal>:quit</literal> <replaceable>module</replaceable></term>
+ <term><literal>:quit</literal></term>
<indexterm><primary><literal>:quit</literal></primary></indexterm>
<listitem>
<para>Quits GHCi. You can also quit by typing a control-D
<variablelist>
<varlistentry>
+ <term>GHCi complains about <function>main</function> not being
+ in scope when I load a module.</term>
+ <indexterm><primary><function>main</function></primary><secondary>with GHCi</secondary>
+ </indexterm>
+ <listitem>
+ <para>You probably omitted the <literal>module</literal>
+ declaration at the top of the module, which causes the
+ module name to default to <literal>Main</literal>. In
+ Haskell, the <literal>Main</literal> module must define a
+ function called <function>main</function>. Admittedly this
+ doesn't make a great deal of sense for an interpreter, but
+ the rule was kept for compatibility with GHC.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><literal>System.exit</literal> causes GHCi to exit!</term>
<indexterm><primary><literal>System.exit</literal></primary><secondary>in
GHCi</secondary></indexterm>