
ALT F# Discriminated Unions You can use discriminated unions to group "like- things" that have different attributes, which is helpful for data types that have exceptional cases. Shapes can be logically grouped but have different dimensions. F# Code Example: type Shape = | Rectangle of height: float * width: float | Circle of radius: float | Triangle of bottom: float * height: float | Pentagon of segment: float

ALT F# Declaring Modules You can use modules to encapsulate functions and type declarations. You can then use those modules in other files to access logically grouped elements. F# Example Code: module Calculator let add x y = x + y let subtract x y = x - y Let result = Calculator.add 1 1 printfn $"{result}"





























