
#12199: GHC is oblivious to injectivity when solving an equality constraint -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.1 checker) | Keywords: TypeFamilies, Resolution: | Injective Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): [https://www.reddit.com/r/haskell/comments/4oeidw/type_family_dependencies_an... gelisam points out] an even simpler failing example that doesn't involve GADTs. Even worse, it's cited as an example that should typecheck from section 5.3 of the [http://ics.p.lodz.pl/%7Estolarek/_media/pl:research :stolarek_peyton-jones_eisenberg_injectivity_extended.pdf original injective type families paper]! {{{#!hs {-# LANGUAGE TypeFamilyDependencies #-} type family F a = b | b -> a fid :: (F a ~ F b) => a -> b fid x = x }}} {{{ Could not deduce: a ~ b from the context: F a ~ F b }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12199#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler