Zodish.Type.Optional (zodish v0.2.4)
View SourceMakes a given type optional, where you can also define a default
value to be used when the value is nil.
Summary
Functions
Assigns a default value to be used when the value is either missing or nil. Alternatively, you can provide a zero-arity function or an MFA that should generate the default value.
Makes the given inner_type optional (either missing or nullable).
Types
@type t() :: t(Zodish.Type.t())
@type t(inner_type) :: %Zodish.Type.Optional{ default: inner_type | (-> inner_type) | mfa() | nil, inner_type: inner_type }