OK, so it does look as though it's the same idea as that described in our paper. Good.
I have not implemented, yet. As always my implementation priorities are strongly influenced by my perception of whether some enhancement would be used. Maybe you can outline why such a change would be useful to you? I only have the example in our paper as motivation so far. Simon | -----Original Message----- | From: Ashley Yakeley [mailto:[EMAIL PROTECTED]] | Sent: 20 February 2002 01:08 | To: Simon Peyton-Jones; Haskell List | Subject: RE: foralls in class assertions | | | At 2002-02-19 09:21, Simon Peyton-Jones wrote: | | >I don't know if it makes sense. You've written down some syntax, | >but it's not clear to me what you intend by it. | | Hmm... it should be straightforward... | | > instance (forall a. Eq a => Eq (f a)) => Eq (Rose f a) where.. | | I assume that the 'a' quantified in (forall a. ...) is not | the same as | the 'a' in 'Rose f a'? | | >| instance | >| ( | >| forall a. HasIdentity (m a a), | >| forall a b c. Composable (m b c) (m a b) (m a c) | >| ) => | >| Category m; | | This means 'if for all a, "HasIdentity (m a a)", and also for | all a b c, | "Composable (m b c) (m a b) (m a c)", then "Category m"'. | | "(forall a. HasIdentity (m a a))" as a class assertion declares a | property of m. It says that for all types a, there's an instance | "HasIdentity (m a a)". | | >| Or even allow the foralls their own context: | >| | >| foo :: (forall a. (C a b) => D a c) => T b c; | | This means foo has type (T b c), where for every type a for | which there's | an instance "C a b", there's an instance "D a c". | | >| class | >| ( | >| forall a. HasIdentity (m a a), | >| forall a b c. Composable (m b c) (m a b) (m a c) | >| ) => | >| Category m; | | Personally I think the 'superclass' arrow in class | declarations should | point the other way, as in '<='. After all, instances of the | class imply | instances of the superclasses, not the other way around. | | But that aside, this means '"Category" is a class on m, | provided that for | all types a, there's an instance "HasIdentity (m a a)", and | also for all | types a b c, there's an instance "Composable (m b c) (m a b) | (m a c)"'. | | | -- | Ashley Yakeley, Seattle WA | | _______________________________________________ | Haskell mailing list | [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell | _______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell