Skip to content

Broken types in identifiers bound by :print

GHCi, version 8.0.1: http://www.haskell.org/ghc/  :? for help
Prelude> :print show
show = (_t1::Show a => a -> String)
Prelude> :t _t1

<interactive>:1:1: error:
    No instance for (Show a) arising from a use of it

Furthermore:

Prelude> _t1 "foo"

<interactive>:3:5: error:ghc: panic! (the 'impossible' happened)
  (GHC version 8.0.1 for x86_64-unknown-linux):
	No skolem info: a_a1hz

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

Prelude> 

Enabling -fprint-explicit-foralls, I think, reveals the issue:

Prelude> :set -fprint-explicit-foralls 
Prelude> :print id
id = (_t2::a1 -> a1)
Prelude> :t id
id :: forall {a}. a -> a
Prelude> :t _t2
_t2 :: a1 -> a1

Similar behavior albeit with a different panic message happens on 7.8.4 and 7.10.3 as verified by bennofs over IRC:

GHCi, version 7.10.3: http://www.haskell.org/ghc/  :? for help
Prelude> :print print
print = (_t1::Show a => a -> IO ())
Prelude> _t1
ghc: panic! (the 'impossible' happened)
  (GHC version 7.10.3 for x86_64-unknown-linux):
	tcTyVarDetails a_apc

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
  1. 6.3 doesn't exhibit this issue:
GHCi, version 7.6.3: http://www.haskell.org/ghc/  :? for help
Prelude> :print id
id = (_t1::forall a. a -> a)
Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information