give equal rights to types and classes! :)
Bulat Ziganshin
bulatz at HotPOP.com
Wed Feb 1 11:58:56 EST 2006
Hello Johannes,
Tuesday, January 31, 2006, 5:34:44 PM, you wrote:
JW> Bulat Ziganshin wrote:
>> instead of writing
>> foo :: (Num a, Monad m) => a -> m ()
>> allow to write
>> foo :: Num -> Monad ()
JW> as has been noted, that would be special treatment
JW> for unary type classes with argument of kind *.
not sure. multi-parameter type classes will be equivalent to
parametric types:
class (Monad m) => Stream m h ...
foo :: Stream m h -> m ()
equals to
foo :: (Stream m h) => h -> m ()
JW> Also, *if* we want such a shorthand, it is not clear whether we want
JW> existential or forall typing per default. Referring to your example,
JW> the "foo" function must be able to return a value in *each* monad
JW> that the caller specifies at the call site, while we were discussing
JW> functions that make their own choice of returning *some* monad instance.
*i* mean just syntax sugar, short-hand for existing forall
declarations, which i'm using a lot just now
btw, on the http://haskell.galois.com/trac/haskell-prime/wiki/PartialTypeSigs
author mean using underscore for "(exists a . a)" types
--
Best regards,
Bulat mailto:bulatz at HotPOP.com
More information about the Haskell-prime
mailing list