Class: Fr::Maybe::None_

Inherits:
Fr::Maybe show all
Defined in:
lib/fr/maybe.rb

Constant Summary

Constants inherited from Fr::Maybe

None

Instance Method Summary collapse

Methods inherited from Fr::Maybe

bind, plus, run, unit, zero

Methods included from Fr::Monoid

#filter, #guard, #sum

Methods included from Fr::Monad

#applyM, #composeM, #filterM, #foldM, #forM, #join, #liftM, #mapM, #sequence, #unlessM, #whenM, #zipM

Methods included from Functor

#void

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



57
58
59
# File 'lib/fr/maybe.rb', line 57

def ==(other)
  None_ === other
end

#fold(default) ⇒ Object



45
46
47
# File 'lib/fr/maybe.rb', line 45

def fold(default)
  default
end

#inspectObject



63
64
65
# File 'lib/fr/maybe.rb', line 63

def inspect
  "Fr.none"
end

#mapObject



41
42
43
# File 'lib/fr/maybe.rb', line 41

def map
  self
end

#none?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/fr/maybe.rb', line 53

def none?
  true
end

#some?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/fr/maybe.rb', line 49

def some?
  false
end