Collection of functions of more general purpose.

- avg :: Fractional a => [a] -> a
- zero :: Num a => a
- one :: Num a => a
- iterateStn :: Int -> (s -> (a, s)) -> s -> ([a], s)
- singleOutElems :: [a] -> [(a, [a])]
- spanfilter :: (a -> Bool) -> [a] -> ([a], [a])
- spanfilterSt :: (a -> s -> (Bool, s)) -> [a] -> s -> (([a], [a]), s)
- break' :: (a -> Bool) -> [a] -> ([a], [a], [a])
- break1 :: (a -> Bool) -> [a] -> ([a], a, [a])
- unbreak :: ([a], [a], [a]) -> [a]
- unbreak1 :: ([a], a, [a]) -> [a]
- type AssocList k v = [(k, v)]
- boundedBy :: Ord a => a -> (a, a) -> a
- isbetween :: Ord a => a -> a -> a -> Bool
- minmax :: Ord a => (a, a) -> (a, a)
- perhaps :: (a -> Bool) -> Maybe a -> Bool
- removeMember :: Eq a => a -> [a] -> [a]
- removeMembers :: Eq a => [a] -> [a] -> [a]

# Documentation

avg :: Fractional a => [a] -> aSource

iterateStn :: Int -> (s -> (a, s)) -> s -> ([a], s)Source

singleOutElems :: [a] -> [(a, [a])]Source

spanfilter :: (a -> Bool) -> [a] -> ([a], [a])Source

spanfilter cond xs = (filter cond xs, filter (not . cond) xs)

spanfilterSt :: (a -> s -> (Bool, s)) -> [a] -> s -> (([a], [a]), s)Source

break' :: (a -> Bool) -> [a] -> ([a], [a], [a])Source

break cond (A ++ B ++ C) = (A,B,C) where for each x in A: not cond x /\ for each x in B: cond x /\ if C=(x:_): not cond x

break1 :: (a -> Bool) -> [a] -> ([a], a, [a])Source

break1 cond (A ++ [B] ++ C) = (A,B,C) where for each x in A: not cond x /\ cond B /\ if C=(x:_): not cond x

perhaps :: (a -> Bool) -> Maybe a -> BoolSource

perhaps p Nothing = False, and perhaps p (Just a) = p a

removeMember :: Eq a => a -> [a] -> [a]Source

removeMembers :: Eq a => [a] -> [a] -> [a]Source