Implementations of various lambda calculus based systems.Source codeContentsIndex
Sidekick
Stabilityexperimental
Maintainerthanos@sians.org
Contents
List processing
Pretty-printing
Boolean testing
Description
General-purpose helper functions.
Synopsis
takeWhileUnique :: Eq a => [a] -> [a]
joinWith :: [a] -> [[a]] -> [a]
joinWith' :: [a] -> [a] -> [a] -> [[a]] -> [a]
functionize
headfeet :: [a] -> [a]
protectWith :: Eq a => a -> [a] -> [a] -> [a]
showAll :: Show a => (a -> String) -> [a] -> String
passAny :: [a -> Bool] -> a -> Bool
passAll :: [a -> Bool] -> a -> Bool
failAny :: [a -> Bool] -> a -> Bool
failAll :: [a -> Bool] -> a -> Bool
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
headfeet :: [a] -> [a]Source
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] -> StringSource
Display each showable item of a list on a separate line.
Boolean testing
passAny :: [a -> Bool] -> a -> BoolSource
From a given list of tests, check if a given element satisfies any of them.
passAll :: [a -> Bool] -> a -> BoolSource
From a given list of tests, check if a given element satisfies all of them.
failAny :: [a -> Bool] -> a -> BoolSource
From a given list of tests, check if a given element fails any of them.
failAll :: [a -> Bool] -> a -> BoolSource
From a given list of tests, check if a given element fails all of them.
Produced by Haddock version 2.4.2