3 ms·
Well, yes, you can add a rectangle quite easily: type Shape = | Circle of float | Square of float | Rectangle of float * float The
by couchand 12y ago
Well, yes, you can add a rectangle quite easily:
type Shape =
| Circle of float
| Square of float
| Rectangle of float * float
The thought about adding new shapes (mentioned several times in this thread) is just misplaced. If you're releasing library code people should not be extending your built-in types, that's bad form -- consumers of a library should interact with it through interfaces only.