GHCi is being too "helpful"

Philip Weaver philip.weaver at gmail.com
Fri Jan 25 10:57:17 EST 2008


You want -fno-print-bind-results, which can be passed to ghci at the command
line or set within ghci using :set.

I found your answer in this guide:
http://www.haskell.org/ghc/docs/latest/html/users_guide/interactive-evaluation.html

- Phil

On Jan 25, 2008 7:37 AM, Dinko Tenev <dinko.tenev at gmail.com> wrote:

> Hi everyone,
>
> When evaluating an IO monad in GHCi from the 6.6.1 distribution, the
> REPL tries to be a bit too smart about printing out the returned
> value.  For example, () values are not printed:
>
>    Prelude System.Directory> setCurrentDirectory "work"
>    Prelude System.Directory>
>
> ...but String, or, as far as I can see, any other values, do get printed:
>
>    Prelude System.Directory> getCurrentDirectory
>    "/home/shinobi"
>    Prelude System.Directory> set
>
> In my particular case, the value printed is a 250,000-element list --
> waiting for the value to print out is not an option.  I don't want to
> see the whole list at once, but do need to examine parts of it,
> subject it to intermediate transformations, etc.
>
> Is there any way to suppress this output and revert to the old
> behavior, where the value was simply bound to "it", without being
> printed?
>
>
> Thanks,
>
> D. Tenev
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20080125/49ecf02b/attachment-0001.htm


More information about the Glasgow-haskell-users mailing list