Class: Just

Inherits:
Object
  • Object
show all
Includes:
Maybe
Defined in:
lib/data.maybe.rb

Instance Method Summary collapse

Methods included from Maybe

#flat_map, #get_or_else, #initialize, #map, #to_s, #when

Methods included from UnionType

#when

Methods included from Helper

#alias_names

Methods included from Control::Monad

#>>, #flat_map

Methods included from Control::Applicative

#apply

Methods included from Control::Functor

#map

Instance Method Details

#==(other) ⇒ Object



111
112
113
114
115
116
117
118
# File 'lib/data.maybe.rb', line 111

def ==(other)
  case other
  when Just
    other.map { |v| return v == @v }
  else
    false
  end
end