Ashley Yakeley wondered:
| I'd like to be able to declare the kinds of new types
| and synonyms, because sometimes Haskell can't infer
| them. For instance:
|
| data CMap0 p q = MkCMap0;
|
| Actually, I wanted p and q to both have kind '* - *'.
The following workaround might be
data CMap0 (p ::: * - *) (q ::: * - *) = MkCMap0;
Or
data (CMap0 :: (* - *) - (* - *) - *) = MkCMap0
-- Lennart
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
Ashley Yakeley wrote:
I'd like to be able to declare the kinds of new types and synonyms,
because sometimes Haskell can't infer them. For instance:
data CMap0 p q = MkCMap0;
Without evidence, Haskell assumes that p and q have kind '*' (as per sec.
4.6), and therefore CMap0 has kind '* - *
On Fri, Feb 08, 2002 at 12:39:30PM +0100, Rijk J.C.van Haaften wrote:
Ashley Yakeley wrote:
I'd like to be able to declare the kinds of new types and synonyms,
because sometimes Haskell can't infer them.
It is possible using a trick due to John Hughes. In
Proceedings of the 1999
Ashley Yakeley wrote:
I'd like to be able to declare the kinds of new types and synonyms,
because sometimes Haskell can't infer them. For instance:
data CMap0 p q = MkCMap0;
Without evidence, Haskell assumes that p and q have kind '*' (as per sec.
Yes. GHC already does this in interface files, and
it'd be rather easy to make it do so in source programs too.
It seems like the Right Thing to do. I'll do it.
(John suggests going to kind polymorphism, but that would
raise a bunch of new issues in GHC's impls so I won't do that.
Yet.)
Simon