|
|
|
|
|
by ecedeno
164 days ago
|
|
Your example produces very distinguishable results. e.g. if Array.first finds a nil value it returns Optional<Type?>.some(.none), and if it doesn't find any value it returns Optional<Type?>.none The two are not equal, and only the second one evaluates to true when compared to a naked nil. |
|
In languages such as OCaml, Haskell and Rust this of course works as you say.