module UnitsOfMeasure [] type cm [] type inch type Shape<[]'u> = | Circle of float<'u> | Square of float<'u> | Triangle of float<'u> * float<'u> | Rectangle of float<'u> * float<'u> let GetArea shape = match shape with | Circle(radius) -> 3.14 * radius * radius | Square(width) -> width * width | Triangle(``base``, height) -> ``base`` * height / 2.0 | Rectangle(width, height) -> width * height