Why do Bind1 and Bind2 have different signatures?
type T() =
let bind(v, f) = v
member self.Bind1 = bind
member self.Bind2(a, b) = bind(a, b)
fsi reports them as
type T =
class
new : unit -> T
member Bind2 : a:'a * b:'b -> 'a
member Bind1 : (obj * obj -> obj)
end
This happened when I was playing with some calculation expressions and couldn't understand why I was getting a Bind error message that was not defined. The style of Bind1 did not work, Bind2 did, and I could not understand why.
For the same objects, they return the same result:
> q.Bind1(1:>obj,3:>obj);;
val it : obj = 1
> q.Bind2(1:>obj,3:>obj);;
val it : obj = 1
>
Using Microsoft F # Interactive, (c) Microsoft Corporation, All rights reserved F # Version 1.9.7.4, compilation for version .NET Framework version 4.0.21006
source
share