module UnionTypes // Learn more about F# at http://fsharp.org type Shape = | Circle of float | Square of float | Triangle of float * float | Rectangle of float * float 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