OK, it's done. In GHC you can specify kinds in data type decls type synonym decls class decls explicit for-alls For example data T (x :: *->*) = MkT type Composer c = forall (x :: * -> *) (y :: * -> *) (z :: * -> *). (c y z) -> (c x y) -> (c x z); And you can put kind signatures on arbitrary types, rather like you can put type signatures on arbitrary expressions. No kind polymorphism though! All this is in the HEAD. You'll need to build from source to get it until we make a release. Simon | -----Original Message----- | From: Ashley Yakeley [mailto:ashley@semantic.org] | 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 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 | wanted p | and q to both have kind '* -> *', giving CMap0 kind '(* -> *) | -> (* -> *) | -> *'. | | Here's another example: | | type Composer c = forall x y z. (c y z) -> (c x y) -> (c x z); | | Haskell gives x, y and z all the kind '*'. But I wanted them | to have kind | '* -> *', giving c the kind '(* -> *) -> (* -> *) -> *' and | Composer the | kind '(* -> *) -> (* -> *) -> * -> *'. | | It's not currently possible to specify kinds, is it? Actually I think | polymorphic kinds would be nice, but I can't say I | desperately need them. | I'd just like to be able to specify kinds somehow. For instance: | | data CMap0 (p ::: * -> *) (q ::: * -> *) = MkCMap0; | | ...or perhaps | | data ({* -> *} p,{* -> *} q) => CMap0 p q = MkCMap0; | | ...or whatever. | | | -- | Ashley Yakeley, Seattle WA | | _______________________________________________ | Haskell mailing list | Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell |