Class: MPrelude::Maybe::Just

Inherits:
MPrelude::Maybe show all
Defined in:
lib/mprelude.rb

Overview

Nothing

Instance Method Summary collapse

Instance Method Details

#bind {|value| ... } ⇒ Maybe

Evalute applicative block

Yields:

  • (value)

Returns:



65
66
67
# File 'lib/mprelude.rb', line 65

def bind
  yield(value)
end

#fmapMaybe::Just<Object>

Evalute functor block

Returns:



58
59
60
# File 'lib/mprelude.rb', line 58

def fmap
  Just.new(yield(value))
end