Module: MonadPlus

Included in:
Array, Maybe
Defined in:
lib/do_notation/monad_plus.rb

Instance Method Summary collapse

Instance Method Details

#guard(p) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/do_notation/monad_plus.rb', line 2

def guard p
  if p
    unit(mzero)
  else
    mzero
  end
end