class Monads::Just(T)

Included Modules

Defined in:

monads/maybe.cr

Constructors

Instance Method Summary

Instance methods inherited from module Monads::RightBiased(T)

bind(&block : T -> U) : U forall U
bind(lambda : T -> U) : U forall U
bind
, equal?(rhs : RightBiased) : Bool
equal?(rhs : LeftBiased) : Bool
equal?
, failure? : Bool failure?, or(monad) or, success? : Bool success?, tee(&block : T -> U) forall U tee, value! : T value!, value_or(element : U) : T forall U
value_or(&block : -> U) : T forall U
value_or

Instance methods inherited from class Monads::Maybe(T)

bind(&block : T -> U) forall U
bind(lambda : T -> U) forall U
bind
, fmap(&block : T -> U) forall U fmap, just? just?, nothing? nothing?, or(monad : Result) or, tee(&block : T -> U) forall U tee, value! value!, value_or(element : U) forall U
value_or(&block : -> U) forall U
value_or

Constructor Detail

def self.new(data : T) #

[View source]

Instance Method Detail

def ==(other : self) : Bool #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


[View source]
def fmap(&block : T -> U) : Just(U) forall U #

[View source]
def inspect(io) #

[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]