abstract class CRZ::Containers::Option(A)

Overview

base class

Included Modules

Direct Known Subclasses

Defined in:

crz/option.cr

Class Method Summary

Instance Method Summary

Macro Summary

Instance methods inherited from module CRZ::Monad(A)

<<(other : Monad(B)) : Monad(A) forall B <<, >=(block : A -> Monad(B)) : Monad(B) forall B >=, >>(other : Monad(B)) : Monad(B) forall B >>, ap(func : Applicative(A -> B)) : Applicative(B) forall B ap, map(&block : A -> B) : Monad(B) forall B map

Instance methods inherited from module CRZ::Applicative(A)

*(func : Applicative(A -> B)) : Applicative(B) forall B *

Class methods inherited from module CRZ::Applicative(A)

of(value : A) : Applicative(A) forall A of

Instance methods inherited from module CRZ::Functor(A)

replace(other : Functor(B), v : A) : Functor(A) replace

Class Method Detail

def self.of(value : T) : Option(T) forall T #

[View source]

Instance Method Detail

def bind(&block : A -> Option(B)) : Option(B) forall B #

[View source]
def flat_map(&block : A -> Option(B)) : Option(B) forall B #

[View source]
def get : A #

[View source]
def get_or_else(default : A) : A #

[View source]
def has_value : Bool #

[View source]
def to_s #
Description copied from class Object

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.


[View source]
def unwrap : A #

[View source]
def unwrap_or_else(default : A) : A #

[View source]

Macro Detail

macro match(val, cases) #

[View source]