[][src]Module type_freak::maybe

Trait-level equivalences to Option.

The trait Maybe corresponds to Option. The types Just and Nothing corresponds Some and None respectively.

use typenum::consts::*;
use type_freak::maybe::{Maybe, Just, Nothing, Unwrap, UnwrapOr};

type Opt1 = Just<U3>;
type Opt2 = Nothing;

type Val1 = Unwrap<Opt1>;       // U3
type Val2 = UnwrapOr<Opt1, U0>; // U3
type Val3 = UnwrapOr<Opt2, U0>; // U0

Structs

Just

A type analogous to Some.

MaybeFilterFunctor

A Functor that filters a Maybe type by a Functor.

MaybeMapFunctor

A Functor that maps a Maybe type by a Functor.

Nothing

A type analogous to None.

UnwrapFunctor

A Functor that unwraps Just.

UnwrapOrFunctor

A Functor that unwraps Just, or returns Defaultvalue if Nothing.

Traits

Maybe

A trait analogous to Option.

Type Definitions

MaybeFilter
MaybeMap
Unwrap
UnwrapOr