Fwd: Re: Re[2]: [Haskell-cafe] Why do I have to specify (Monad m) here again?

David Tolpin david.tolpin at gmail.com
Sun Feb 18 14:43:26 EST 2007



------- Forwarded message -------
From: "David Tolpin" <dvd at davidashen.net>
To: "Sebastian Sylvan" <sebastian.sylvan at gmail.com>
Cc: "David House" <dmhouse at gmail.com>, haskell-cafe at haskell.org
Subject: Re: Re[2]: [Haskell-cafe] Why do I have to specify (Monad m) here again?
Date: Sun, 18 Feb 2007 23:38:59 +0400

>> Why the compiler cannot infer  class constraint on m from class definition in instance definition while it can in function type definition?
>
> But it can't! If you give a type to a function, it will assume zero
> class constraints unless you specify them (just like it will when you
> give a type to an instance declaration). If you do something like:
>

Hi Sebastian,

it is not the example I brought. In the example I brought I showed how in
function type declaration assertion that an instance of a class is also an
instance of the other class is used. Take a look at my example. According
to what part of the type system logic type inference in instances is not
implemented?

David




More information about the Haskell-Cafe mailing list