[GHC] #7485: Tuple constraints not properly kinded
GHC
ghc-devs at haskell.org
Tue Jan 6 16:25:20 UTC 2015
#7485: Tuple constraints not properly kinded
-------------------------------------+-------------------------------------
Reporter: goldfire | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 7.7
Resolution: invalid | Keywords:
Operating System: Unknown/Multiple | ConstraintKinds
Type of failure: None/Unknown | Architecture:
Blocked By: | Unknown/Multiple
Related Tickets: | Test Case:
| Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by goldfire):
Replying to [comment:3 crockeea]:
> Is @simonpj 's comment
> > `(,)` has to have a particular kind
> still true with advent of `-XPolyKinds`?
Yes. The problem is that `(,)` isn't really poly-kinded. It's not, for
example, `k -> k -> k`. It's either `* -> * -> *` or `Constraint ->
Constraint -> Constraint`, and there's no way of saying this in normal
Haskell. So, we have the hack Simon describes above.
One possible way forward is to follow the NoSubKinds route: introduce a
new type `ValueKind` parameterized by elements of `data StarOrConstraint =
Star | Ct`. Then `*` would be a synonym for `ValueKind Star` and
`Constraint` would be `ValueKind Ct`. We would then have `(,) :: forall (x
:: StarOrConstraint). ValueKind x -> ValueKind x -> ValueKind x`. This
would be very hard to implement before merging my DependentHaskell branch
though, because it requires kind synonyms and other funny business.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7485#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list