namespace Loa.
import Loa/Boolean.
import Loa/True.
import Loa/False.
export partial class Maybe {
public otherwise: a -> a.
public isSome -> Boolean.
public isNone -> Boolean.
}
export class None {
is Maybe<_>.
public isSome =>
False.
public isNone =>
True.
public otherwise: a fallback =>
fallback.
}
class Some {
is Maybe.
private var a value.
public init of: a value =>
value: value.
public isSome =>
True.
public isNone =>
False.
public otherwise: _ =>
self value.
}