[GHC] #12803: Functional dependencies and type families
#12803: Functional dependencies and type families -------------------------------------+------------------------------------- Reporter: simonpj | Owner: 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: -------------------------------------+------------------------------------- Consider {{{ type family F a :: * class C a b | a -> b instance C p (F q) => C p [q] }}} Is the instance decl OK under the liberal coverage condition? That is, does `(C t [s1], C t [s2])` mean that `(s1 ~ s2)`? NO! The context of the instance declaration means that `p -> F q` but that does not imply `p -> q` unless `F` is injective! So this program is wrongly accepted. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12803> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12803: Functional dependencies and type families -------------------------------------+------------------------------------- Reporter: simonpj | Owner: Type: bug | Status: new Priority: normal | 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: | -------------------------------------+------------------------------------- Description changed by simonpj: @@ -17,0 +17,2 @@ + + I realised this when investigating #10778. New description: Consider {{{ type family F a :: * class C a b | a -> b instance C p (F q) => C p [q] }}} Is the instance decl OK under the liberal coverage condition? That is, does `(C t [s1], C t [s2])` mean that `(s1 ~ s2)`? NO! The context of the instance declaration means that `p -> F q` but that does not imply `p -> q` unless `F` is injective! So this program is wrongly accepted. I realised this when investigating #10778. -- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12803#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12803: Functional dependencies and type families -------------------------------------+------------------------------------- Reporter: simonpj | Owner: Type: bug | Status: new Priority: normal | 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 Simon Peyton Jones <simonpj@…>): In [changeset:"2cdd9bd5208e3ad78d7a3b8b82c8ae1be486b34d/ghc" 2cdd9bd5/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="2cdd9bd5208e3ad78d7a3b8b82c8ae1be486b34d" Take account of injectivity when doing fundeps This fixes Trac #12803. Yikes! See Note [Care with type functions]. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12803#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12803: Functional dependencies and type families -------------------------------------+------------------------------------- Reporter: simonpj | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: fixed | 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 simonpj): * status: new => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12803#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC