cookbook-2.1.2.0: Tiered general-purpose libraries with domain-specific applications.

PortabilityPortable (Standalone - ghc)
StabilityStable
Maintainernathanpisarski@gmail.com
Safe HaskellSafe-Inferred

Cookbook.Ingredients.Functional.Break

Description

Library for breaking conditionally on lists. When one filters a list, it will filter all of the elements. When one filterBREAKS a list, it will stop collecting the list at a desired element. This library also includes functions for conditionally transforming a list.

Synopsis

Documentation

removeBreak :: (a -> Bool) -> [a] -> [a]Source

Drop a list until a predicate yields false, returning the false item and the rest of the list.

filterBreak :: (a -> Bool) -> [a] -> [a]Source

Collect a list until a predicate yields false for a value.

imbreak :: (a -> Bool) -> [a] -> BoolSource

Returns true if any element in the list yields true for a predicate.

btr :: (a -> Bool) -> (b, b) -> [a] -> [b]Source

Conditionally transform a list. If a predicate returns true, use lval. Otherwise, use rval.