Some builds an Option when value is present. Play: https://go.dev/play/p/iqz2n9n0tDM
(value T)
| 20 | // Some builds an Option when value is present. |
| 21 | // Play: https://go.dev/play/p/iqz2n9n0tDM |
| 22 | func Some[T any](value T) Option[T] { |
| 23 | return Option[T]{ |
| 24 | isPresent: true, |
| 25 | value: value, |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | // None builds an Option when value is absent. |
| 30 | // Play: https://go.dev/play/p/yYQPsYCSYlD |
no outgoing calls