[GHC] #2893: Implement "Quantified contexts" proposal
GHC
cvs-ghc at haskell.org
Sat Jun 30 14:07:01 CEST 2012
#2893: Implement "Quantified contexts" proposal
---------------------------------+------------------------------------------
Reporter: porges | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: _|_
Component: Compiler | Version: 6.10.1
Keywords: proposal | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: None/Unknown
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------+------------------------------------------
Changes (by sjoerd_visscher):
* cc: sjoerd@… (added)
Comment:
I don't see why this needs "local instances". The instances are not the
problem, we can already do polymorphic instances, i.e. instance Monoid
[a]. Even specifying the forall constraint now (accidentally) works in GHC
7.4.1.
As I see it, the problem is with matching the need for a constraint with
the available constraints or instances. See #7019, the error is "Could not
deduce (Monoid [b]) from the context (forall a. Monoid [a])".
Even g from the previous comment now compiles (with ConstraintKinds and
UndecidableInstances), except when evaluating it, you get the error:
"Could not deduce (forall b. Foo [b]) arising from a use of `g'".
So it seems that with implementing ConstraintKinds, there has been made a
big step towards an implementation of quantified contexts.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2893#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list