On 29 July 2013 00:35, William ML Leslie <[email protected]> wrote: > So, you say, "f takes a List of Ord", and the caller says "here is my > List of T, and if you take a look around I think you'll find that T > has an Ord instance".
Well, that's sort of it. I should be clearer about T: If you want to pass the value v to a function with argument type Foo, which is a type class, v must either have type V with some Foo instance that we can infer, or v must itself have type Foo, in which case the source of v has provided us with the instance. So it's reasonable to accept an argument of type Foo and supply it to a function expecting a Foo, and have both the real type and the instance forwarded just as the value is. Even though most languages with some interface concept work more-or-less this way, viewing these things as dependant arguments make the original cast from V to Foo more flexible. -- William Leslie Notice: Likely much of this email is, by the nature of copyright, covered under copyright law. You absolutely may reproduce any part of it in accordance with the copyright law of the nation you are reading this in. Any attempt to deny you those rights would be illegal without prior contractual agreement. _______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
