my.optional

Members

Aliases

Optional
alias Optional(T) = SumType!(None, Some!T)
Undocumented in source.

Functions

hasValue
bool hasValue(T v)
Undocumented in source. Be warned that the author may not have intended to support it.
none
Optional!T none()

Optional with no value

orElse
U orElse(T v, U or)
Undocumented in source. Be warned that the author may not have intended to support it.
orElse
T orElse(T v, T or)
Undocumented in source. Be warned that the author may not have intended to support it.
orElse
T orElse(T v, OrT or)
Undocumented in source. Be warned that the author may not have intended to support it.
orElse
U orElse(T v, OrT or)
Undocumented in source. Be warned that the author may not have intended to support it.
some
Optional!T some(T value)

An optional containing a value.

Structs

None
struct None

No value in the Optional.

Some
struct Some(T)

A value.

Meta

Authors

Joakim Brännström (joakim.brannstrom@gmx.com)

Definition of an optional type using sumtype.