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

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

Cookbook.Ingredients.Tupples.Look

Description

Library for using tupples as an associative list. It can be thought of like a map in Clojure, or a database of key-value pairs. This is also the general-purpose tupple library, so there's stragglers.

Synopsis

Documentation

look :: Eq a => [(a, b)] -> a -> Maybe bSource

Look up an lval in a list of tupples.

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

Returns all elements where the lval matches the element.

swp :: (a, b) -> (b, a)Source

Swap the lval with the rval, and vice-versa.

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

Removes all matches of the lval.

group :: [a] -> [(a, a)]Source

Turns a list into as many double-tupples (a,a) as it can, dropping items from uneven lists.