I\'m trying to figure out the correct syntax to use the pipe operator |> into the creation of an object. Currently I\'m using a static member to create the object and just
Apparently, object constructors aren't composable. Discriminated union constructors don't seem to have this problem:
> 1 + 1 |> Some;;
val it : int option = Some 2
If you want to use the pipeline, Brian's answer is probably best. In this case, I'd consider just wrapping the entire expression with Shape( ).
There's always
(fun args -> new Shape(args))