FunLand: Algebraic("Container") Data Types for Elixir - Prerelease

Nice!

Structs are product types. I wonder in what way we could simulate Sum types in Elixir. What I can think of so far is to ‘emulate’ them by having a struct where one of the keys is only ever one of a small subset of allowed atoms.

1 Like