[GHC] #12842: DatatypeContexts in data types and data families
GHC
ghc-devs at haskell.org
Wed Nov 16 04:45:27 UTC 2016
#12842: DatatypeContexts in data types and data families
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner:
Type: task | Status: new
Priority: lowest | 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:
-------------------------------------+-------------------------------------
Does datatype contexts only apply for non-phantom variables? Figured I'd
ask
{{{#!hs
{-# Language DatatypeContexts, TypeFamilies #-}
-- F :: Foo a b
data (a ~ b) => Foo a b = F
}}}
and
{{{#!hs
{-# Language DatatypeContexts, KindSignatures, DatatypeContexts,
DataKinds, TypeFamilies #-}
data N = O | S N
-- FO :: Fin (S n) n' O
data family Fin (n::N) (a::N) (b::N)
data instance (n ~ n') => Fin (S n) n' O = FO
}}}
It surprised me to see the first two of these (yes I know, datatype
contexts):
{{{#!hs
-- F :: x -> Foo x x
data (a ~ b) => Foo a b = F a
-- F :: x -> Foo x x
data (a ~ b) => Foo a b = F b
-- F :: x -> x -> Foo x x
data (a ~ b) => Foo a b = F a b
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12842>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list