RE: Specifying Kinds of Types

2002-02-08 Thread Simon Peyton-Jones
o that. Yet.) Simon | -Original Message- | From: Ashley Yakeley [mailto:[EMAIL PROTECTED]] | Sent: 08 February 2002 11:26 | To: Haskell List | Subject: Specifying Kinds of Types | | | I'd like to be able to declare the kinds of new types and synonyms, | because sometimes Hask

Re: Specifying Kinds of Types

2002-02-08 Thread John Hughes
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.

Re: Specifying Kinds of Types

2002-02-08 Thread Daan Leijen
>I'd like to be able to declare the kinds of new types and synonyms, >because sometimes Haskell can't infer them. The kind inferencer normally works quite well in Haskell. Only when you use phantom types (ie. unused type variables), you sometimes have to guide the kind inferencer -- either with

Re: Specifying Kinds of Types

2002-02-08 Thread Ross Paterson
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

Re: Specifying Kinds of Types

2002-02-08 Thread Rijk J . C . van Haaften
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 '

Re: Specifying Kinds of Types

2002-02-08 Thread Lennart Augustsson
> data CMap0 (p ::: * -> *) (q ::: * -> *) = MkCMap0; Or data (CMap0 :: (* -> *) -> (* -> *) -> *) = MkCMap0 -- Lennart ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Specifying Kinds of Types

2002-02-08 Thread Koen Claessen
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 usefu

Specifying Kinds of Types

2002-02-08 Thread Ashley Yakeley
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 '* -> * -> *'. Actually, I wa