Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

Safe HaskellNone

Util.Then

Description

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

Synopsis

Documentation

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

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

takeWhile plus one extra

take :: Int -> ([a] -> [a]) -> [a] -> [a] Source #

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

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.

break Source #

Arguments

:: (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) 

span :: (a -> Bool) -> ([a] -> ([a], rest)) -> [a] -> ([a], rest) Source #

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

Break right after the function returns True.