[GHC] #10832: Generalize injective type families
GHC
ghc-devs at haskell.org
Fri Jul 7 10:43:48 UTC 2017
#10832: Generalize injective type families
-------------------------------------+-------------------------------------
Reporter: jstolarek | Owner: jstolarek
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler (Type | Version: 7.11
checker) | Keywords: TypeFamilies,
Resolution: | InjectiveFamilies
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #6018 | Differential Rev(s): Phab:D1287
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Iceland_jack):
Are we exploring avenues like
[https://ghc.haskell.org/trac/ghc/ticket/6018#comment:48 head-injectivity]
or partial injectivity? Richard's example tells us `x ~ Just y` if `F x ~
True`
{{{#!hs
type family
F a where
F (Just x) = True
F Nothing = False
}}}
but similarly
{{{#!hs
type family
G a where
G (Just x) = (x, x)
G Nothing = (Int, Int)
}}}
means `x ~ Int` if `G (Just x) ~ (Int, Int)` — is that useful?
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10832#comment:18>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list