Class: Tweed::Monads::List

Inherits:
Tweed::Monad show all
Defined in:
lib/tweed/monads/list.rb

Instance Method Summary collapse

Methods inherited from Tweed::Monad

[], #bind, #lift_m2, return

Instance Method Details

#+(other) ⇒ Object



15
16
17
# File 'lib/tweed/monads/list.rb', line 15

def +(other)
  self.class.new(self.to_a + other.to_a)
end

#==(other) ⇒ Object



27
28
29
# File 'lib/tweed/monads/list.rb', line 27

def ==(other)
  self.to_a == other.to_a
end

#inspectObject



19
20
21
# File 'lib/tweed/monads/list.rb', line 19

def inspect
  "#{self.class.inspect} :: #{@sequence.inspect}"
end

#to_aObject



23
24
25
# File 'lib/tweed/monads/list.rb', line 23

def to_a
  @sequence.to_a
end