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 (Standalone - ghc)
Safe HaskellSafe
LanguageHaskell98

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

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.