I can use functions of modules and static member functions with the pipeline operator. Can I use it with non-static member functions?
My class:
type MyClass =
class
new() = {}
member this.isZero(number: int): bool =
number = 0
static member returnInt(): int =
33
end
Using the static member:
MyClass.returnInt() |> Console.WriteLine // prints 33
Using the non-static member:
let foo = new MyClass()
foo.isZero(2) |> Console.WriteLine // prints false
I want use the non-static function from my object. Invalid syntax:
let foo = new MyClass()
foo |> member MyClass.isZero(2) |> Console.WriteLine
I'm trying use the clear syntax of F#.
memberis never used anywhere else than in the actual member declarations. - TeaDrivenDevfoo.isZero(2)? - Fyodor Soikin