Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- unionLists :: (HasDebugCallStack, Outputable a, Eq a) => [a] -> [a] -> [a]
- minusList :: Ord a => [a] -> [a] -> [a]
- deleteBys :: (a -> a -> Bool) -> [a] -> [a] -> [a]
- type Assoc a b = [(a, b)]
- assoc :: Eq a => String -> Assoc a b -> a -> b
- assocMaybe :: Eq a => Assoc a b -> a -> Maybe b
- assocUsing :: (a -> a -> Bool) -> String -> Assoc a b -> a -> b
- assocDefault :: Eq a => b -> Assoc a b -> a -> b
- assocDefaultUsing :: (a -> a -> Bool) -> b -> Assoc a b -> a -> b
- hasNoDups :: Eq a => [a] -> Bool
- removeDups :: (a -> a -> Ordering) -> [a] -> ([a], [NonEmpty a])
- findDupsEq :: (a -> a -> Bool) -> [a] -> [NonEmpty a]
- insertNoDup :: Eq a => a -> [a] -> [a]
- equivClasses :: (a -> a -> Ordering) -> [a] -> [NonEmpty a]
- getNth :: Outputable a => [a] -> Int -> a
Documentation
unionLists :: (HasDebugCallStack, Outputable a, Eq a) => [a] -> [a] -> [a] Source #
Assumes that the arguments contain no duplicates
minusList :: Ord a => [a] -> [a] -> [a] Source #
Calculate the set difference of two lists. This is O((m + n) log n), where we subtract a list of n elements from a list of m elements.
Extremely short cases are handled specially: When m or n is 0, this takes O(1) time. When m is 1, it takes O(n) time.
assocDefault :: Eq a => b -> Assoc a b -> a -> b Source #
assocDefaultUsing :: (a -> a -> Bool) -> b -> Assoc a b -> a -> b Source #
removeDups :: (a -> a -> Ordering) -> [a] -> ([a], [NonEmpty a]) Source #
findDupsEq :: (a -> a -> Bool) -> [a] -> [NonEmpty a] Source #
insertNoDup :: Eq a => a -> [a] -> [a] Source #
\( O(n) \).
treats insertNoDup
x xsxs
as a set, inserting x
only
when an equal element couldn't be found in xs
.
equivClasses :: (a -> a -> Ordering) -> [a] -> [NonEmpty a] Source #
getNth :: Outputable a => [a] -> Int -> a Source #