Fwd: Re: Re[2]: [Haskell-cafe] Why do I have to specify (Monad m) here again?
------- Forwarded message ------- From: "David Tolpin" <dvd@davidashen.net> To: "Sebastian Sylvan" <sebastian.sylvan@gmail.com> Cc: "David House" <dmhouse@gmail.com>, haskell-cafe@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
participants (1)
-
David Tolpin