# a -> (a, b)

Evaluate a computation with the given initial state and environment, returning the final state and output, discarding the final value.
O(log n). Retrieve an element by its index, i.e. by its zero-based index in the sequence sorted by keys. If the index is out of range (less than zero, greater or equal to size of the map), error is called. > elemAt 0 (fromList [(5,"a"), (3,"b")]) == (3,"b") > elemAt 1 (fromList [(5,"a"), (3,"b")]) == (5, "a") > elemAt 2 (fromList [(5,"a"), (3,"b")]) Error: index out of range
gmapT with accumulation
Evaluate a computation with the given initial state and environment, returning the final state and output, discarding the final value.
Evaluate a computation with the given initial state and environment, returning the final value and output, discarding the final state.
O(log n). Find smallest key greater or equal to the given one and return the corresponding (key, value) pair. > lookupGE 3 (fromList [(3,'a'), (5,'b')]) == Just (3, 'a') > lookupGE 4 (fromList [(3,'a'), (5,'b')]) == Just (5, 'b') > lookupGE 6 (fromList [(3,'a'), (5,'b')]) == Nothing
O(log n). Find smallest key greater than the given one and return the corresponding (key, value) pair. > lookupGT 4 (fromList [(3,'a'), (5,'b')]) == Just (5, 'b') > lookupGT 5 (fromList [(3,'a'), (5,'b')]) == Nothing
O(log n). Find largest key smaller or equal to the given one and return the corresponding (key, value) pair. > lookupLE 2 (fromList [(3,'a'), (5,'b')]) == Nothing > lookupLE 4 (fromList [(3,'a'), (5,'b')]) == Just (3, 'a') > lookupLE 5 (fromList [(3,'a'), (5,'b')]) == Just (5, 'b')
O(log n). Find largest key smaller than the given one and return the corresponding (key, value) pair. > lookupLT 3 (fromList [(3,'a'), (5,'b')]) == Nothing > lookupLT 4 (fromList [(3,'a'), (5,'b')]) == Just (3, 'a')
O(min(n1,n2)). zip takes two sequences and returns a sequence of corresponding pairs. If one input is short, excess elements are discarded from the right end of the longer sequence.
zip takes two lists and returns a list of corresponding pairs. If one input list is short, excess elements of the longer list are discarded.
A pairing/concatenation operator for builder primitives, both bounded and fixed size. For example, > toLazyByteString (primFixed (char7 >*< char7) ('x','y')) = "xy" We can combine multiple primitives using >*< multiple times. > toLazyByteString (primFixed (char7 >*< char7 >*< char7) ('x',('y','z'))) = "xyz"
listens f m is an action that executes the action m and adds the result of applying f to the output to the value of the computation. *  f m = liftM (id *** f) (listen >
The mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a ByteString, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new ByteString.
The mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a ByteString, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new list.
The mapAccumR function behaves like a combination of map and foldr; it applies a function to each element of a ByteString, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new ByteString.