class Kind::Maybe::Typed

Public Class Methods

new(kind) click to toggle source
# File lib/kind/maybe/typed.rb, line 10
def initialize(kind)
  @kind = kind
end

Public Instance Methods

[](arg)
Alias for: new
inspect() click to toggle source
# File lib/kind/maybe/typed.rb, line 22
def inspect
  "Kind::Maybe<#{@kind}>"
end
new(arg) click to toggle source
# File lib/kind/maybe/typed.rb, line 14
def new(arg)
  value = Monad::Value[arg]

  @kind === value ? Maybe::Some[value] : Maybe::NONE_INSTANCE
end
Also aliased as: []

Private Instance Methods

__call_before_expose_the_arg_in_a_block(arg) click to toggle source
# File lib/kind/maybe/typed.rb, line 28
def __call_before_expose_the_arg_in_a_block(arg)
  value = Monad::Value[arg]

  @kind === value ? value : Maybe::NONE_INSTANCE
end