3

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?

pad
  • 41,040
  • 7
  • 92
  • 166
Paul Nikonowicz
  • 3,883
  • 21
  • 39

1 Answers1

5

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.

pad
  • 41,040
  • 7
  • 92
  • 166