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

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

Cookbook.Ingredients.Lists.Access

Description

Library for accessing the information from a list. Modify and Access are six in one and half-dozen in the other in a purely functional language, but the overall theme is this: Access is for functions which return portions of the list, or information about a list. Modify is the library which transforms a list.

Synopsis

Documentation

count :: Eq a => [a] -> a -> IntSource

Counts the occurrences an element has within a list.

contains :: Eq a => [a] -> [a] -> BoolSource

Checks to see if a list is a sub-list of the list.

qsort :: Ord a => [a] -> [a]Source

QuickSort implementation. Sorts a list of data quickly?

pull :: [a] -> Int -> Maybe aSource

Safe implementation of !!. Uses maybe instead of error.

refpos :: Eq a => ([a], [a]) -> a -> aSource

Referrential positioning. Find the position of an element in the first list, and return the element from the second list of the same position. In the event that the second list is shorter than the position where the element is found in the first list, it returns the parameter.

areAll :: Eq a => [a] -> a -> BoolSource

Test to make sure that all elements in a list are equal to a value.

isBefore :: Eq a => [a] -> [a] -> BoolSource

Re-implementation of isPrefixOf for some reason. Tests to see if a list is the first part of antoher list.

surrounds :: Eq a => (a, a) -> [a] -> BoolSource

Test to see if a list is surrounded by an item.