Module: Monad

Included in:
Array, Distribution, Expectation, Maybe, Simulation
Defined in:
lib/do_notation/monad.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(m) ⇒ Object



21
22
23
# File 'lib/do_notation/monad.rb', line 21

def self.included m
  m.extend ClassMethods
end

Instance Method Details

#>>(n) ⇒ Object



17
18
19
# File 'lib/do_notation/monad.rb', line 17

def >> n
  bind_const { n }
end

#bind_const(&block) ⇒ Object



13
14
15
# File 'lib/do_notation/monad.rb', line 13

def bind_const &block
  bind { |_| block.call() }
end