Creates a new Sequence with start before the first element, sep between them, and end after the last element
Creates a new Sequence with start before the first element, sep between them, and end after the last element
Item to place before the first element
Removes duplicates from a sequence using a f to provide keys used for determining equality of elements When a duplicate is removed a reducer function r is used to determine what to keep.
Removes duplicates from a sequence using a f to provide keys used for determining equality of elements When a duplicate is removed a reducer function r is used to determine what to keep.
Warning this class does NOT preserve ordering of the elements!
Example (Not That Order was not preserved)
xs = List(1->2, 1->3, 1->2, 2->1, 3->4, 4->1, 4-> -1, 5->1) ys = RicherSeq(xs).removeDuplicatesBy(_._1)(List(_,_).maxBy(_._2)) ys == Vector((5,1), (1,3), (2,1), (3,4), (4,1))
Function that turns an element into some other type B used for equality checks
Tie breaker function that chooses which to keep
Starts at head and gets all elements until the end function returns true
Starts at head and gets all elements until the end function returns true
function to determine last element to include in the result