Module: Identity

Extended by:
Monad
Defined in:
lib/do_notation/monads/identity.rb

Class Method Summary collapse

Methods included from Monad

bind_const, compose, run

Class Method Details

.bind(obj, &fn) ⇒ Object



11
12
13
# File 'lib/do_notation/monads/identity.rb', line 11

def bind(obj, &fn)
  fn.call(obj)
end

.unit(obj) ⇒ Object



7
8
9
# File 'lib/do_notation/monads/identity.rb', line 7

def unit(obj)
  obj
end