|
| Sidekick | | Stability | experimental | | Maintainer | thanos@sians.org |
|
|
|
|
|
| Description |
| General-purpose helper functions.
|
|
| Synopsis |
|
|
|
|
| List processing
|
|
| takeWhileUnique :: Eq a => [a] -> [a] | Source |
|
| Keep taking until you reach two consequtive same values.
|
|
| joinWith :: [a] -> [[a]] -> [a] | Source |
|
| Join a list of lists together, using another list as a separator.
Like python's sep.join(list).
|
|
| joinWith' :: [a] -> [a] -> [a] -> [[a]] -> [a] | Source |
|
| Like joinWith, but it accepts start and end terms.
|
|
| functionize |
|
|
| Get rid of the body of a list.
|
|
| protectWith :: Eq a => a -> [a] -> [a] -> [a] | Source |
|
This is a smarter version of takeWhileUnique, in the sense
that it looks all the way back to find a repetition, while
takeWhileUnique only looks at the previous value.
e.g.
takeWhileUnique [0, 1, 2, 0, 1, 2, ...] is bottom,
while protectWith would return [0, 1, 2, guard].
|
|
| Pretty-printing
|
|
| showAll :: Show a => (a -> String) -> [a] -> String | Source |
|
| Display each showable item of a list on a separate line.
|
|
| Boolean testing
|
|
| passAny :: [a -> Bool] -> a -> Bool | Source |
|
| From a given list of tests, check if a given element satisfies any of them.
|
|
| passAll :: [a -> Bool] -> a -> Bool | Source |
|
| From a given list of tests, check if a given element satisfies all of them.
|
|
| failAny :: [a -> Bool] -> a -> Bool | Source |
|
| From a given list of tests, check if a given element fails any of them.
|
|
| failAll :: [a -> Bool] -> a -> Bool | Source |
|
| From a given list of tests, check if a given element fails all of them.
|
|
| Produced by Haddock version 2.4.2 |