
#13963: Runtime representation confusingly displayed -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- 8.3.20170605: {{{
:set -XRankNTypes -XTypeInType import GHC.Exts (TYPE, RuntimeRep(LiftedRep)) type Pair (a::TYPE rep) (b::TYPE rep') rep'' = forall (r::TYPE rep''). (a -> b -> r) -> r :kind Pair Pair :: * -> * -> * :kind Pair Int Pair Int :: * -> * :kind Pair Int Float Pair Int Float :: * :kind Pair Int Float LiftedRep Pair Int Float LiftedRep :: * }}}
It still behaves oddly with `-fprint-explicit-runtime-reps` enabled {{{
:set -fprint-explicit-runtime-reps :kind Pair Pair :: * -> * -> forall (rep'' :: RuntimeRep) -> * :kind Pair Int Pair Int :: * -> forall (rep'' :: RuntimeRep) -> * :kind Pair Int Float Pair Int Float :: * :kind Pair Int Float LiftedRep Pair Int Float LiftedRep :: * }}}
I would have also expected to see `Pair`'s kind displayed something like this {{{#!hs forall {rep :: RuntimeRep} {rep' :: RuntimeRep}. TYPE rep -> TYPE rep' -> forall (rep'' :: RuntimeRep) -> * }}} which is how the kind of the corresponding `newtype` gets displayed {{{
newtype Pair2 (a::TYPE rep) (b::TYPE rep') rep'' = P2 (forall (r::TYPE rep''). (a -> b -> r) -> r) :kind Pair2 Pair2 :: forall {rep :: RuntimeRep} {rep' :: RuntimeRep}. TYPE rep -> TYPE rep' -> forall (rep'' :: RuntimeRep) -> * }}}
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13963 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler