[project @ 2003-08-06 15:26:02 by simonpj]
[ghc-hetmet.git] / ghc / docs / users_guide / win32-dlls.sgml
index 96b5f1c..cdaad9c 100644 (file)
@@ -10,14 +10,18 @@ The installer that installs GHC on Win32 also sets up the file-suffix associatio
 for ".hs" and ".lhs" files so that double-clicking them starts <command>ghci</command>.
 </para>
 <para>
-One little hitch happens if you right-click on a file, select "Open With..." and 
-then pick <command>ghci</command>.  If the filename has spaces in, what will happen is
-that GHC will get invoked like this:
+Be aware of that <command>ghc</command> and <command>ghci</command> do
+require filenames containing spaces to be escaped using quotes:
 <programlisting>
-  c:\ghc\bin\ghci \Documents and Settings\MyFile.lhs
+  c:\ghc\bin\ghci "c:\\Program Files\\Haskell\\Project.hs"
 </programlisting>
-So it looks to GHC as if there are three arguments, "\Documents", "and", and "Settings\MyFile.lhs".
+If the quotes are left off in the above command, <command>ghci</command> will
+interpret the filename as two, "c:\\Program" and "Files\\Haskell\\Project.hs".
 </para>
+
+<!-- not clear whether there are current editions of Win32 OSes that
+     doesn't do this by default.
+
 <para> Solution: don't use "Open With...", avoid spaces in file names, 
 or fiddle with the appropriate registry setting:
 <programlisting>
@@ -26,9 +30,49 @@ or fiddle with the appropriate registry setting:
 Notice how the "%1" argument is quoted (or not).
 </para>
 <para> This problem doesn't occur when double-clicking.
+</para>
+-->
 
+</sect1>
+
+<sect1>
+<title>
+Interacting with the terminal</title>
+
+<para>By default GHC builds applications that open a console window when they start.
+If you want to build a GUI-only application, with no console window, use the flag
+<literal>-optl-mwindows</literal> in the link step.
 </para>
 
+<para>For some reason, Mingw ships with the <literal>readline</literal> library,
+but not with the <literal>readline</literal> headers. As a result, GHC (like Hugs) does not
+use <literal>readline</literal> for interactive input on Windows.
+You can get a close simulation by using an emacs shell buffer!
+</para>
+
+</sect1>
+
+<sect1>
+<title>
+Differences in library behaviour </title>
+
+<para>
+Some of the standard Haskell libraries behave slightly differently on Windows.
+
+<itemizedlist>
+<listitem> <para>
+On Windows, the '<literal>^Z</literal>' character is interpreted as an
+end-of-file character, so if you read a file containing this character
+the file will appear to end just before it. To avoid this,
+use <literal>IOExts.openFileEx</literal> to open a file in binary
+(untranslated) mode or change an already opened file handle into
+binary mode using <literal>IOExts.hSetBinaryMode</literal>. The
+<literal>IOExts</literal> module is part of the
+<literal>lang</literal> package.
+</para>
+</listitem>
+</itemizedlist>
+</para>
 </sect1>
 
 <sect1>