struct Monads::Left(E)

Defined in:

monads/either.cr

Constructors

Instance Method Summary

Instance methods inherited from struct Monads::Either(E, Nil)

<=>(other : Right)
<=>(other : Left)
<=>
, inspect(io) inspect, left? left?, map_or(default : U, lambda : T -> U) forall U map_or, or(monad : Either) or, right? right?, to_s to_s, value! : E | T value!, value_or(element : U) forall U value_or

Constructor methods inherited from struct Monads::Either(E, Nil)

new new

Class methods inherited from struct Monads::Either(E, Nil)

return(value : T) : Right(T) return

Instance methods inherited from struct Monads::Monad(Nil)

>>(other : Monad(U)) forall U >>, |(other : _ -> Monad(U)) forall U |, bind(lambda : T -> Monad(U)) forall U bind

Constructor methods inherited from struct Monads::Monad(Nil)

new new, return(v : T) : self return

Instance methods inherited from struct Monads::Functor(Nil)

fmap(lambda : T -> U) fmap, initialize initialize

Constructor methods inherited from struct Monads::Functor(Nil)

new new

Constructor Detail

def self.new(data : E) #

[View source]

Instance Method Detail

def <=>(other : Left) #

[View source]
def <=>(other : Right) #

[View source]
def <=>(other : Either) #

[View source]
def <=>(other : LeftException) #

[View source]
def bind(lambda : _ -> _) : Left(E) #

[View source]
def fmap(lambda : _ -> _) : Left(E) #

[View source]
def map_or(default : U, lambda : _ -> _) forall U #

[View source]
def or(monad : Either) #

[View source]
def or(lambda : E -> _) #

[View source]
def value_or(lambda : E -> _) #

[View source]
def value_or(element : U) forall U #

[View source]