Safe Haskell | None |
---|

List functions with continuations. This allows you to chain them and easily express things like 'take until f then take one more'.

- takeWhile :: (a -> Bool) -> ([a] -> [a]) -> [a] -> [a]
- takeWhile1 :: (a -> Bool) -> [a] -> [a]
- take :: Int -> ([a] -> [a]) -> [a] -> [a]
- filter :: (a -> Bool) -> (a -> Bool) -> ([a] -> [a]) -> [a] -> [a]
- mapAccumL :: (acc -> x -> (acc, y)) -> acc -> (acc -> [y]) -> [x] -> [y]
- break :: (a -> Bool) -> ([a] -> ([a], rest)) -> [a] -> ([a], rest)
- span :: (a -> Bool) -> ([a] -> ([a], rest)) -> [a] -> ([a], rest)
- break1 :: (a -> Bool) -> [a] -> ([a], [a])

# Documentation

takeWhile1 :: (a -> Bool) -> [a] -> [a] Source #

takeWhile plus one extra

mapAccumL :: (acc -> x -> (acc, y)) -> acc -> (acc -> [y]) -> [x] -> [y] Source #

Like `mapAccumL`

, except that you can do something with the final
state and append that to the list.

:: (a -> Bool) | |

-> ([a] -> ([a], rest)) | Given the list after the break, return (pre, post), where pre will be appended to the end of the first list. |

-> [a] | |

-> ([a], rest) |