From: Ian Lynagh Date: Sat, 14 Jul 2007 00:13:46 +0000 (+0000) Subject: Update the ghci "loading" section of the user guide X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=84d072eaeeeb3decfc39a96c033b9fa2ec3baec5 Update the ghci "loading" section of the user guide --- diff --git a/docs/users_guide/ghci.xml b/docs/users_guide/ghci.xml index 059b52c..d3efd2a 100644 --- a/docs/users_guide/ghci.xml +++ b/docs/users_guide/ghci.xml @@ -219,19 +219,17 @@ Ok, modules loaded: Main. Prelude> :! ghc -c D.hs Prelude> :load A -Skipping D ( D.hs, D.o ) -Compiling C ( C.hs, interpreted ) Compiling B ( B.hs, interpreted ) +Compiling C ( C.hs, interpreted ) Compiling A ( A.hs, interpreted ) Ok, modules loaded: A, B, C, D. *Main> - In the messages from the compiler, we see that it skipped D, - and used the object file D.o. The message - Skipping module - indicates that compilation for module - isn't necessary, because the source and everything it depends on + In the messages from the compiler, we see that there is no line + for D. This is because + it isn't necessary to compile D, + because the source and everything it depends on is unchanged since the last compilation. At any time you can use the command @@ -247,7 +245,7 @@ B ( B.hs, interpreted ) A ( A.hs, interpreted ) *Main> - If we now modify the source of D (or pretend to: using Unix + If we now modify the source of D (or pretend to: using the Unix command touch on the source file is handy for this), the compiler will no longer be able to use the object file, because it might be out of date: @@ -256,9 +254,6 @@ A ( A.hs, interpreted ) *Main> :! touch D.hs *Main> :reload Compiling D ( D.hs, interpreted ) -Skipping C ( C.hs, interpreted ) -Skipping B ( B.hs, interpreted ) -Skipping A ( A.hs, interpreted ) Ok, modules loaded: A, B, C, D. *Main> @@ -274,8 +269,8 @@ Ok, modules loaded: A, B, C, D. *Main> :! ghc -c C.hs *Main> :load A Compiling D ( D.hs, interpreted ) -Compiling C ( C.hs, interpreted ) Compiling B ( B.hs, interpreted ) +Compiling C ( C.hs, interpreted ) Compiling A ( A.hs, interpreted ) Ok, modules loaded: A, B, C, D. @@ -298,8 +293,6 @@ Ok, modules loaded: A, B, C, D. *Main> :load A -Skipping D ( D.hs, D.o ) -Skipping C ( C.hs, C.o ) Compiling B ( B.hs, interpreted ) Compiling A ( A.hs, interpreted ) Ok, modules loaded: A, B, C, D. @@ -310,7 +303,7 @@ Ok, modules loaded: A, B, C, D. when working on a large program is to occasionally run ghc ––make to compile the whole project (say before you go for lunch :-), then continue working in the - interpreter. As you modify code, the new modules will be + interpreter. As you modify code, the changed modules will be interpreted, but the rest of the project will remain compiled.