Alternative f => [f a] -> f a -base -opengl +containers

unions :: [IntMap a] -> IntMap a
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
The union of a list of maps. > unions [(fromList [(5, "a"), (3, "b")]), (fromList [(5, "A"), (7, "C")]), (fromList [(5, "A3"), (3, "B3")])] > == fromList [(3, "b"), (5, "a"), (7, "C")] > unions [(fromList [(5, "A3"), (3, "B3")]), (fromList [(5, "A"), (7, "C")]), (fromList [(5, "a"), (3, "b")])] > == fromList [(3, "B3"), (5, "A3"), (7, "C")]
unionsWith :: (a -> a -> a) -> [IntMap a] -> IntMap a
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
The union of a list of maps, with a combining operation. > unionsWith (++) [(fromList [(5, "a"), (3, "b")]), (fromList [(5, "A"), (7, "C")]), (fromList [(5, "A3"), (3, "B3")])] > == fromList [(3, "bB3"), (5, "aAA3"), (7, "C")]
unions :: Ord a => [Set a] -> Set a
containers Data.Set
The union of a list of sets: (unions == foldl union empty).
Node :: a -> Forest a -> Tree a
containers Data.Tree
deleteMax :: IntMap a -> IntMap a
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
O(min(n,W)). Delete the maximal key. Returns an empty map if the map is empty. Note that this is a change of behaviour for consistency with Map  versions prior to 0.5 threw an error if the IntMap was already empty.
deleteMin :: IntMap a -> IntMap a
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
O(min(n,W)). Delete the minimal key. Returns an empty map if the map is empty. Note that this is a change of behaviour for consistency with Map  versions prior to 0.5 threw an error if the IntMap was already empty.
reverse :: Seq a -> Seq a
containers Data.Sequence
O(n). The reverse of a sequence.
deleteMax :: Set a -> Set a
containers Data.Set
O(log n). Delete the maximal element. Returns an empty set if the set is empty.
deleteMin :: Set a -> Set a
containers Data.Set
O(log n). Delete the minimal element. Returns an empty set if the set is empty.
filter :: (a -> Bool) -> IntMap a -> IntMap a
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
O(n). Filter all values that satisfy some predicate. > filter (> "a") (fromList [(5,"a"), (3,"b")]) == singleton 3 "b" > filter (> "x") (fromList [(5,"a"), (3,"b")]) == empty > filter (< "a") (fromList [(5,"a"), (3,"b")]) == empty
updateMax :: (a -> Maybe a) -> IntMap a -> IntMap a
containers Data.IntMap.Strict
O(log n). Update the value at the maximal key. > updateMax (\ a -> Just ("X" ++ a)) (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "Xa")] > updateMax (\ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) == singleton 3 "b"
updateMax :: (a -> Maybe a) -> IntMap a -> IntMap a
containers Data.IntMap.Lazy
O(min(n,W)). Update the value at the maximal key. > updateMax (\ a -> Just ("X" ++ a)) (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "Xa")] > updateMax (\ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) == singleton 3 "b"
updateMin :: (a -> Maybe a) -> IntMap a -> IntMap a
containers Data.IntMap.Strict
O(log n). Update the value at the minimal key. > updateMin (\ a -> Just ("X" ++ a)) (fromList [(5,"a"), (3,"b")]) == fromList [(3, "Xb"), (5, "a")] > updateMin (\ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) == singleton 5 "a"
updateMin :: (a -> Maybe a) -> IntMap a -> IntMap a
containers Data.IntMap.Lazy
O(min(n,W)). Update the value at the minimal key. > updateMin (\ a -> Just ("X" ++ a)) (fromList [(5,"a"), (3,"b")]) == fromList [(3, "Xb"), (5, "a")] > updateMin (\ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) == singleton 5 "a"
(\\) :: IntMap a -> IntMap b -> IntMap a
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
Same as difference.
difference :: IntMap a -> IntMap b -> IntMap a
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
O(n+m). Difference between two maps (based on keys). > difference (fromList [(5, "a"), (3, "b")]) (fromList [(5, "A"), (7, "C")]) == singleton 3 "b"
intersection :: IntMap a -> IntMap b -> IntMap a
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
O(n+m). The (left-biased) intersection of two maps (based on keys). > intersection (fromList [(5, "a"), (3, "b")]) (fromList [(5, "A"), (7, "C")]) == singleton 5 "a"
union :: IntMap a -> IntMap a -> IntMap a
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
O(n+m). The (left-biased) union of two maps. It prefers the first map when duplicate keys are encountered, i.e. (union == unionWith const). > union (fromList [(5, "a"), (3, "b")]) (fromList [(5, "A"), (7, "C")]) == fromList [(3, "b"), (5, "a"), (7, "C")]
scanl1 :: (a -> a -> a) -> Seq a -> Seq a
containers Data.Sequence
scanl1 is a variant of scanl that has no starting value argument: > scanl1 f (fromList [x1, x2, ...]) = fromList [x1, x1 `f` x2, ...]
scanr1 :: (a -> a -> a) -> Seq a -> Seq a
containers Data.Sequence
scanr1 is a variant of scanr that has no starting value argument.

Show more results