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

Copyright(c) 2014 by Nate Pisarski
LicenseBSD3
Maintainernathanpisarski@gmail.com
StabilityStable
PortabilityPortable (Cookbook)
Safe HaskellSafe
LanguageHaskell98

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 -> Int Source #

Counts the occurrences an element has within a list.

contains :: Eq a => [a] -> [a] -> Bool Source #

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 a Source #

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

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

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 -> Bool Source #

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

isBefore :: Eq a => [a] -> [a] -> Bool Source #

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] -> Bool Source #

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