[GHC] #12976: GHCi displays the kinds of unboxed tuples incorrectly
GHC
ghc-devs at haskell.org
Wed Dec 14 16:22:06 UTC 2016
#12976: GHCi displays the kinds of unboxed tuples incorrectly
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: GHCi | Version: 8.0.2
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: Other
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
This can be reproduced in GHCi 8.0.2 or HEAD. First, a preamble:
{{{
$ inplace/bin/ghc-stage2 --interactive
GHCi, version 8.1.20161208: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/rgscott/.ghci
λ> :set -fprint-explicit-runtime-reps -fprint-explicit-kinds -fprint-
explicit-foralls -XUnboxedTuples -XTemplateHaskell -XMagicHash
λ> :m + GHC.Exts Language.Haskell.TH Language.Haskell.TH.Lib
Language.Haskell.TH.Syntax
}}}
The kind of `(#,#)` is reported correctly:
{{{
(#,#) :: forall (k0 :: RuntimeRep) (k1 :: RuntimeRep).
TYPE k0 -> TYPE k1 -> TYPE 'UnboxedTupleRep
}}}
But when you give it an argument, it seems to default `TYPE k1` to `*` for
some reason!
{{{
λ> :k (#,#) Int#
(#,#) Int# :: * -> TYPE 'UnboxedTupleRep
}}}
This is a blatant lie, as this kind-checks:
{{{
λ> :k (#,#) Int# Int#
(#,#) Int# Int# :: TYPE 'UnboxedTupleRep
}}}
The effect is even more noticeable when you throw `TemplateHaskell` into
the mix:
{{{
λ> :k $(unboxedTupleT 2)
$(unboxedTupleT 2) :: * -> * -> TYPE 'UnboxedTupleRep
λ> :k $(unboxedTupleT 2) Int#
$(unboxedTupleT 2) Int# :: * -> TYPE 'UnboxedTupleRep
λ> :k $(conT (unboxedTupleTypeName 2))
$(conT (unboxedTupleTypeName 2)) :: * -> * -> TYPE 'UnboxedTupleRep
λ> :k $(conT (unboxedTupleTypeName 2)) Int#
$(conT (unboxedTupleTypeName 2)) Int# :: * -> TYPE 'UnboxedTupleRep
}}}
All of these kinds should be reporting the `RuntimeRep`s that GHC is
//actually// using under the hood.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12976>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list