List +Data -package

module Data.List
base Data.List
Operations on lists.
listToMaybe :: [a] -> Maybe a
base Data.Maybe
The listToMaybe function returns Nothing on an empty list or Just a of the list.
listArray :: (IArray a e, Ix i) => (i, i) -> [e] -> a i e
array Data.Array.IArray
Constructs an immutable array from a list of initial elements. The list gives the elements of the array in ascending order beginning with the lowest index.
listArray :: Ix i => (i, i) -> [e] -> Array i e
array Data.Array
Construct an array from a pair of bounds and a list of values in index order.
listify :: Typeable r => (r -> Bool) -> GenericQ [r]
syb Data.Generics.Schemes
Get a list of all entities that meet a predicate
fromList :: Eq key => (key -> Int32) -> [(key, val)] -> IO (HashTable key val)
base Data.HashTable
Convert a list of key/value pairs into a hash table. Equality on keys is taken from the Eq instance for the key type.
maybeToList :: Maybe a -> [a]
base Data.Maybe
The maybeToList function returns an empty list when given Nothing or a singleton list when not given Nothing.
toList :: HashTable key val -> IO [(key, val)]
base Data.HashTable
Converts a hash table to a list of key/value pairs.
toList :: Foldable t => t a -> [a]
base Data.Foldable
List of elements of a structure.
ekList :: Network -> Node -> Node -> (Network, Double)
fgl Data.Graph.Inductive.Query.MaxFlow2
fmToList :: Ord a => FiniteMap a b -> [(a, b)]
fgl Data.Graph.Inductive.Internal.FiniteMap
fromAscList :: [(Key, a)] -> IntMap a
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
O(n). Build a map from a list of key/value pairs are in ascending order. > fromAscList [(3,"b"), (5,"a")] == fromList [(3, "b"), (5, "a")] > fromAscList [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "b")]
fromAscList :: [Key] -> IntSet
containers Data.IntSet
O(n). Build a set from an ascending list of elements. The precondition (input list is ascending) is not checked.
fromAscList :: Eq a => [a] -> Set a
containers Data.Set
O(n). Build a set from an ascending list in linear time. The precondition (input list is ascending) is not checked.
fromAscList :: Eq k => [(k, a)] -> Map k a
containers Data.Map.Lazy, containers Data.Map.Strict
O(n). Build a map from an ascending list in linear time. The precondition (input list is ascending) is not checked. > fromAscList [(3,"b"), (5,"a")] == fromList [(3, "b"), (5, "a")] > fromAscList [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "b")] > valid (fromAscList [(3,"b"), (5,"a"), (5,"b")]) == True > valid (fromAscList [(5,"a"), (3,"b"), (5,"b")]) == False
fromAscListWith :: (a -> a -> a) -> [(Key, a)] -> IntMap a
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
O(n). Build a map from a list of key/value pairs are in ascending order, with a combining function on equal keys. The precondition (input list is ascending) is not checked. > fromAscListWith (++) [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "ba")]
fromAscListWith :: Eq k => (a -> a -> a) -> [(k, a)] -> Map k a
containers Data.Map.Lazy, containers Data.Map.Strict
O(n). Build a map from an ascending list in linear time with a combining function for equal keys. The precondition (input list is ascending) is not checked. > fromAscListWith (++) [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "ba")] > valid (fromAscListWith (++) [(3,"b"), (5,"a"), (5,"b")]) == True > valid (fromAscListWith (++) [(5,"a"), (3,"b"), (5,"b")]) == False
fromAscListWithKey :: (Key -> a -> a -> a) -> [(Key, a)] -> IntMap a
containers Data.IntMap.Strict
O(n). Build a map from a list of key/value pairs are in ascending order, with a combining function on equal keys. The precondition (input list is ascending) is not checked. > fromAscListWith (++) [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "ba")]
fromAscListWithKey :: (Key -> a -> a -> a) -> [(Key, a)] -> IntMap a
containers Data.IntMap.Lazy
O(n). Build a map from a list of key/value pairs are in ascending order, with a combining function on equal keys. The precondition (input list is ascending) is not checked. > let f key new_value old_value = (show key) ++ ":" ++ new_value ++ "|" ++ old_value > fromAscListWithKey f [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "5:b|a")]
fromAscListWithKey :: Eq k => (k -> a -> a -> a) -> [(k, a)] -> Map k a
containers Data.Map.Lazy, containers Data.Map.Strict
O(n). Build a map from an ascending list in linear time with a combining function for equal keys. The precondition (input list is ascending) is not checked. > let f k a1 a2 = (show k) ++ ":" ++ a1 ++ a2 > fromAscListWithKey f [(3,"b"), (5,"a"), (5,"b"), (5,"b")] == fromList [(3, "b"), (5, "5:b5:ba")] > valid (fromAscListWithKey f [(3,"b"), (5,"a"), (5,"b"), (5,"b")]) == True > valid (fromAscListWithKey f [(5,"a"), (3,"b"), (5,"b"), (5,"b")]) == False

Show more results