[GHC] #12842: DatatypeContexts in data types and data families

#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

#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 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 simonpj): Data type contexts are a mis-feature, since removed. I'm not sure what your question is, but I think we could consign data type contexts to history. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12842#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 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): Yeah I know they're going to be removed, I just would have thought that given {{{#!hs data (a ~ b) => a :~: b = Refl }}} the type of `Refl` should be `Refl :: (a ~ b) => a :~: b` similar to {{{#!hs data a :~: b where Refl :: a :~: a }}} I'll close -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12842#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12842: DatatypeContexts in data types and data families -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: task | Status: closed Priority: lowest | Milestone: Component: Compiler | Version: 8.0.1 Resolution: invalid | 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: | -------------------------------------+------------------------------------- Changes (by Iceland_jack): * status: new => closed * resolution: => invalid -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12842#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC