Algebraic Data Types in Swift

11 thoughts
last posted Feb. 8, 2015, 9:19 p.m.

1 earlier thought

0

Ugh, looks like you can't recurse in enums.

enum Tree {
    case Empty
    case Leaf(Int)
    case Node(Tree, Tree)
}

kills the REPL with a Bus error: 10.

9 later thoughts