From 1f35e3ac4ac5b74cdeb30058bc01ab36766b25c8 Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 16 Aug 2002 09:36:36 +0000 Subject: [PATCH] [project @ 2002-08-16 09:36:36 by simonmar] Be a bit clearer about the current directory when GHCi is started, and mention that you might have to ':cd' to the right place before you can load something. --- ghc/docs/users_guide/ghci.sgml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/ghc/docs/users_guide/ghci.sgml b/ghc/docs/users_guide/ghci.sgml index 0919b20..54952ec 100644 --- a/ghc/docs/users_guide/ghci.sgml +++ b/ghc/docs/users_guide/ghci.sgml @@ -102,8 +102,7 @@ Prelude> Loading source files Suppose we have the following Haskell source code, which we - place in a file Main.hs in the current - directory: + place in a file Main.hs: main = print (fac 20) @@ -112,6 +111,24 @@ fac 0 = 1 fac n = n * fac (n-1) + You can save Main.hs anywhere you like, + but if you save it somewhere other than the current + directoryIf you started up GHCi from the command + line then GHCi's current directory is the same as the current + directory of the shell from which it was started. If you started + GHCi from the “Start” menu in Windows, then the + current directory is probably something like + C:\Documents and Settings\user + name. then we will + need to change to the right directory in GHCi: + + +Prelude> :cd dir + + + where dir is the directory (or + folder) in which you saved Main.hs. + To load a Haskell source file into GHCi, use the :load command: :load -- 1.7.10.4