inilist-0.2.0.0: Processing for .ini files with duplicate sections and options

Copyright© Mike Meyer, 2015
LicenseBSD3
Maintainermwm@mired.org
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.AList

Contents

Description

A module to encapsulate associative lists.

Synopsis

Data

data AList key value Source

An AList is a list of of (key, value) pairs. Such pairs are referred to as an item in the following.

Instances

(Show key, Show value) => Show (AList key value) 
Monoid (AList k v) 

Convert

fromList :: [(k, v)] -> AList k v Source

fromList creates an AList from a List of items.

toList :: AList k v -> [(k, v)] Source

toList returns a List of the items in an AList.

toMap :: Ord k => AList k v -> Map k v Source

toMap converts to a Map. Behavior with multiple keys is undefined.

fromMap :: Ord k => Map k v -> AList k v Source

fromMap creates an AList from a Map, though I'm not sure why you'd want to do that.

Query

isEmpty :: AList k v -> Bool Source

isEmpty returns True if the AList is empty.

lookupAll :: Eq k => k -> AList k v -> [v] Source

lookupAll returns a List of all items with the given key.

lookupFirst :: Eq k => k -> AList k v -> Maybe v Source

lookupFirst finds the first value with a matching key, if there is one.

lookupBy :: (k -> Bool) -> AList k v -> AList k v Source

lookupBy returns an AList of all items with keys matched by the function.

member :: Eq k => k -> AList k v -> Bool Source

member returns true if the given key is used in the AList.

values :: AList k v -> [v] Source

values returns a List of the values in the AList.

keys :: AList k v -> [k] Source

keys returns a List of the keys in the AList.

Modify

insert :: k -> v -> AList k v -> AList k v Source

insert a key, value pair at the head of the AList.

append :: k -> v -> AList k v -> AList k v Source

append a key, value pair to the end of the AList.

deleteAll :: Eq k => k -> AList k v -> AList k v Source

deleteAll all values associated with a key.

deleteFirst :: Eq k => k -> AList k v -> AList k v Source

deleteFirst deletes the first value with a given key.

deleteBy :: (k -> Bool) -> AList k v -> AList k v Source

deleteBy deletes all values with keys matched by the function.