Documentation ¶
Overview ¶
Package options provides cross type transformations for `mo.Option`.
The functions provided by this package are not methods of `mo.Option` due to the lack of method type parameters on methods. This is part of the design decision of the Go's generics as explained here: https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#No-parameterized-methods
Providing these methods as a separate package also matches Go's primitives and standard library: - The `string` type don't have methods, but there we have the `strings` package. - The `[]byte` type don't have methods, but there we have the `bytes` package. - The `io.Reader` defines a single method, and all manipulations of a reader is done on packages `io` and `ioutil`.