[GHC] #8026: DatatypeContexts should be fixed, not deprecated
GHC
ghc-devs at haskell.org
Tue Sep 23 07:23:57 UTC 2014
#8026: DatatypeContexts should be fixed, not deprecated
-------------------------------------+-------------------------------------
Reporter: gidyn | Owner:
Type: feature | Status: new
request | Milestone:
Priority: normal | Version: 7.6.3
Component: Compiler | Keywords:
Resolution: | Architecture: Unknown/Multiple
Operating System: | Difficulty: Unknown
Unknown/Multiple | Blocked By:
Type of failure: | Related Tickets:
None/Unknown |
Test Case: |
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
Comment (by gidyn):
I think we actually have 2 implementation proposals here:
- tokyo's rules add type constraints, whenever the data type appears in an
explicit type signature or when the constructor is used
- use regular type inference
The second implementation would give different results for `c` and `d`:
{{{
c :: Proxy (HasEq a) -> () -- what constraints are used here???
c _ = ()
}}}
No type constraint is added, because none is inferred by the definition of
`c`.
{{{
data Dynamic = forall a. Typeable a => MkDyn a
d :: Dynamic -> Maybe Bool
d (MkDyn y) | Just (MkHasEq z) <- cast y = Just (z == z) -- where does
the Eq constraint come from??
d _ = Nothing
}}}
`DatatypeContexts` wouldn't have any effect in this case.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8026#comment:20>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list