[Haskell-cafe] Qualified imports and REPL output in GHCi 8.0.1

Atrudyjane atrudyjane at protonmail.com
Wed Dec 7 08:21:14 UTC 2016


That did it, thank you Alexis! The Haskell Book says to turn Prelude back on before trying out the qualified import examples, so that's what happened.

Andrea



Sent with [ProtonMail](https://protonmail.com) Secure Email.


-------- Original Message --------
Subject: Re: [Haskell-cafe] Qualified imports and REPL output in GHCi 8.0.1
Local Time: December 7, 2016 2:05 AM
UTC Time: December 7, 2016 8:05 AM
From: lexi.lambda at gmail.com
To: Atrudyjane <atrudyjane at protonmail.com>
haskell-cafe at haskell.org <haskell-cafe at haskell.org>

Since Bool is already imported unqualified from the Prelude, GHC favors
printing the unqualified version. If I include the -XNoImplicitPrelude
option to disable the implicit import of the Prelude, I get the behavior
you expect:

$ ghci -XNoImplicitPrelude
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
ghci> import qualified Data.Bool
ghci> :t Data.Bool.bool
Data.Bool.bool :: a -> a -> Data.Bool.Bool -> a

Alexis

> On Dec 6, 2016, at 23:59, Atrudyjane via Haskell-Cafe <haskell-cafe at haskell.org> wrote:
>
> When I do a qualified import such as:
> λ> import qualified Data.Bool
>
> then query a type, this is the output.
> λ> :t Data.Bool.bool
> Data.Bool.bool :: a -> a -> Bool -> a
>
> Was expecting:
> λ> :t Data.Bool.bool
> Data.Bool.bool :: a -> a -> Data.Bool.bool -> a
>
> I experimented with changing the -fno-implicit-import-qualified flag and the result was the same. Is there an option that needs to be set to show the expected behavior?
>
> Regards,
> Andrea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20161207/1a659724/attachment.html>


More information about the Haskell-Cafe mailing list