DAY #60

This is the implementation behind optionals in swift:

1
2
3
4
enum Optional<T> {
  case some(T)
  case none
}

It is an algebraic data type. Swift has syntax to help make optionals more usable (if let, guard let, etc.)

Originally published 10/15/2021 @ https://pittcsc.org/ Discord

Published here on 09/20/2022. Blog published date reflects the original date of publication.