Method: Immutable::List#flatten

Defined in:
lib/immutable/list.rb

#flattenList Also known as: concat

Concatenates a list of lists.

Returns:

  • (List)

    the concatenated list.



227
228
229
# File 'lib/immutable/list.rb', line 227

def flatten
  foldr(Nil) { |x, xs| x + xs }
end