Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Computational Expression using Zero

When using a computational expression, the first definition works but the second does not for Zero.

What is the difference between this:

member o.Zero() = 3

and this:

member o.Zero = fun() -> 3

The first evaluates to unit -> int and the second to (unit -> int). What is the difference?

like image 722
Paul Nikonowicz Avatar asked Dec 08 '25 21:12

Paul Nikonowicz


1 Answers

If they are let-bounds, there is no difference. However, in a class definition the first o.Zero is a method while the second o.Zerois a property.

Computation expression expects a method named Zero; that's why it didn't work when you provided a property with the same name.

like image 157
pad Avatar answered Dec 10 '25 09:12

pad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!