X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdocs%2Fusers_guide%2Ffaq.sgml;h=beda1cb7c6c984aae01af1dba94f04b8e2e3a305;hb=dc6afe4242238aa1a7a5d3a150a346d23dd6ea22;hp=0c274d79c86e7b78a11f2748782394bd416dc5de;hpb=12718d149717b5e209081dcc3ac5dd33f62e8c6d;p=ghc-hetmet.git diff --git a/ghc/docs/users_guide/faq.sgml b/ghc/docs/users_guide/faq.sgml index 0c274d7..beda1cb 100644 --- a/ghc/docs/users_guide/faq.sgml +++ b/ghc/docs/users_guide/faq.sgml @@ -156,6 +156,17 @@ + The build fails in readline. + + It has been reported that if you have multiple versions + of the readline library installed on Linux, then this may + cause the build to fail. If you have multiple versions of + readline, try uninstalling all except the most recent + version. + + + + When I try to start ghci (probably one I compiled myself) it says ghc-5.02: not built for interactive use @@ -323,7 +334,122 @@ details. + + If I explicitely set the buffering on a Handle to + "NoBuffering" I'm not able to enter EOF by typing + "Ctrl-D". + + + This is a consequence of Unixy terminal semantics. Unix + does line buffering on terminals in the kernel as part of the + terminal processing, unless you turn it off. However, the + Ctrl-D processing is also part of the terminal processing + which gets turned off when the kernel line buffering is + disabled. So GHC tries its best to get NoBuffering semantics + by turning off the kernel line buffering, but as a result you + lose Ctrl-D. C'est la vie. + + + + + If I print out a string using putStr, + and then attempt to read some input using + hGetLine, I don't see the output from the + putStr. + + + The stdout handle is line-buffered by + default, which means that output sent to the handle is only + flushed when a newline (/n) is output, the + buffer is full, or hFlush is called on the + Handle. The right way to make the text appear without sending + a newline is to use hFlush: + + + import System.IO + main = do + putStr "how are you today? " + hFlush stdout + input <- hGetLine + ... + + You'll probably find that the behaviour differs when + using GHCi: the hFlush isn't necessary to + make the text appear. This is because in GHCi we turn off the + buffering on stdout, because this is + normally what you want in an interpreter: output appears as it + is generated. + + + + + I can't get finalizers to work properly. My program + sometimes just prints + <<loop>>. + + + Chances are that your program is trying to write a + message to stdout or + stderr in the finalizer. Handles have + finalizers themselves, and since finalizers don't keep other + finalized values alive, the stdout and + stderr Handles may be finalized before your + finalizer runs. If this happens, your finalizer will block on + the handle, and probably end up receiving a + NonTermination exception (which is printed + as <<loop>>). + + + + + + Does GHC implement any kind of extensible records? + + + No, extensible records are not implemented in GHC. + Hugs + implements TRex, one extensible record variant. The problem + is that the record design space is large, and seems to lack + local optima. And all reasonable variants break backward + compatibility. As a result, nothing much happens. + + + + + Why do I get errors about missing include files when + compiling with or + ? + + + Certain options, such as , turn on + via-C compilation, instead of using the native code generator. + Include files named by options + or in foreign import declarations are only + used in via-C compilation mode. See for more details. + + + + + How do I compile my program for profiling without + overwriting the object files and hi files + I've already built? + + You can select alternative suffixes for object files and + interface files, so you can have several builds of the same + code coexisting in the same directory. For example, to + compile with profiling, you might do this: + + ghc --make -prof -o foo-prof -osuf p.o -hisuf p.hi Main + + See for more details on + the and + options. + + + +