[GHC] #14514: Higher-Rank Kinds work in ADT but not GADT
GHC
ghc-devs at haskell.org
Thu Nov 23 11:47:45 UTC 2017
#14514: Higher-Rank Kinds work in ADT but not GADT
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.2.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Iceland_jack):
I suppose the answer is that
[https://ghc.haskell.org/trac/ghc/ticket/14352#comment:1 “GHC never infers
a higher-rank kind”].
The correct way of writing this is explicitly quantifying over the kind of
`ext` when writing it as a GADT (as is done here:
[https://github.com/goldfirere/dependent-db/blob/master/Basics.hs#L134
TypeRepX])
{{{#!hs
data Exp :: WithAnyTag -> Type where
Var :: forall (ext::WithAnyTag). ext VarTag -> Exp ext
-- ..
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14514#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list