#2893: Implement "Quantified contexts" proposal
---------------------------------+------------------------------------------
Reporter: porges | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: _|_
Component: Compiler | Version: 6.10.1
Severity: normal | Resolution:
Keywords: proposal | Difficulty: Unknown
Testcase: | Os: Unknown/Multiple
Architecture: Unknown/Multiple |
---------------------------------+------------------------------------------
Changes (by simonpj):
* difficulty: => Unknown
* milestone: => _|_
Comment:
I had trouble following the proposal. I didn't see how Section 3
addressed the issues raised in Sections 1 and 2. For example, to avoid
the cascade of `Typeable2`, `Typeable3` etc classes the solution is
presumably polymorphism at the kind level. (Tim Sheard's language Omega
has this.)
Still, I recognise the merit of quantification in contexts. Indeed, Ralf
Hinze and I suggested it back in 2000 in Section 7 of
[http://research.microsoft.com/en-us/um/people/simonpj/papers/derive.htm
Derivable type classes]. (This section is rather independent of the rest
of the paper.)
However, attractive as it is, it's quite a big step to add something akin
to local instance declarations. Our ICFP'08 paper
[http://research.microsoft.com/~simonpj/papers/assoc-types/index.htm Type
checking with open type functions] relies rather crucially on ''not''
having such local instances. (We've managed to simplify the algorithm
quite a bit since then, but it still relies on that assumption.)
So I'm not sure I see how to make quantified contexts compatible with type
functions, and all the other stuff in Haskell. But their lack is clearly
a wart, and one that may become more pressing.
Meanwhile, clarifying the proposal would be a good thing, even if it's not
adopted right away.
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2893#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs