utility-ht-0.0.13: Various small helper functions for Lists, Maybes, Tuples, Functions

Safe HaskellSafe
LanguageHaskell98

Data.List.Reverse.StrictSpine

Description

The functions in this module process the list from the end. They do not access elements at the beginning if not necessary. You can apply the function only to infinite lists. Use these functions if the list is short and the test is expensive.

Synopsis

Documentation

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

Like reverse . List.dropWhile p . reverse.

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

Like reverse . List.takeWhile p . reverse.

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

span p xs == (dropWhile p xs, takeWhile p xs)