Qualified imports and REPL output in GHCi 8.0.1

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 Sent with [ProtonMail](https://protonmail.com) Secure Email.

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
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

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@gmail.com
To: Atrudyjane
On Dec 6, 2016, at 23:59, Atrudyjane via Haskell-Cafe
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
participants (2)
-
Alexis King
-
Atrudyjane