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

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

Cookbook.Ingredients.Lists.Modify

Description

Library for modifying data within a list, and transforming lists in certain ways. While that's vague, so is the definition of To Modify.

Synopsis

Documentation

rev :: [a] -> [a]Source

Reverses a list.

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

Removes all occurances of an element from a list. See MDN1 in the source for a run-down on why it's implemented here and in Continuous.

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

Splits a list on an element, making a list of lists based on the element as a seperator.

between :: Eq a => [a] -> (a, a) -> [a]Source

Returns the data between two items.

linesBetween :: Eq a => [[a]] -> ([a], [a]) -> [[a]]Source

Implementation of between that works on a list of lists, and using Contains rather than elem.

intersperse :: [a] -> a -> [a]Source

Put an element after every element of a list, not including the last element.

(?) :: a -> a -> Bool -> aSource

An equivelant to the terenary operator for Haskell.

surroundedBy :: Eq a => [a] -> (a, a) -> [[a]]Source

Returns a list of all elements surrounded by elements. Basically a between which works more than once.