Safe Haskell | Safe |
---|---|
Language | Haskell98 |
- enumerate :: [a] -> [(Int, a)]
- mapFst :: (a -> b) -> (a, c) -> (b, c)
- mapFsts :: (a -> b) -> [(a, c)] -> [(b, c)]
- mapSnd :: (a -> b) -> (c, a) -> (c, b)
- mapSnds :: (a -> b) -> [(c, a)] -> [(c, b)]
- wordsBy :: (a -> Bool) -> [a] -> [[a]]
- maybeRead :: String -> Maybe Double
- fst' :: (t2, t1, t) -> t2
- snd' :: (t1, t2, t) -> t2
- thd' :: (t1, t, t2) -> t2
- mapFst' :: (a -> x) -> (a, b, c) -> (x, b, c)
- mapSnd' :: (b -> x) -> (a, b, c) -> (a, x, c)
- mapThd' :: (c -> x) -> (a, b, c) -> (a, b, x)
- mapFsts' :: (a -> x) -> [(a, b, c)] -> [(x, b, c)]
- mapSnds' :: (b -> x) -> [(a, b, c)] -> [(a, x, c)]
- mapThds' :: (c -> x) -> [(a, b, c)] -> [(a, b, x)]
- mapArcs :: (a -> a) -> [(a, a, x)] -> [(a, a, x)]
- mergelists :: [a] -> [a] -> [a]
- (!!!) :: [a] -> Int -> a
Documentation
enumerate :: [a] -> [(Int, a)] Source #
enumerate a list of things
>>>
enumerate ["foo","bar","baz"]
[(1,"foo"), (2,"bar"), (3,"baz")]
mapFsts :: (a -> b) -> [(a, c)] -> [(b, c)] Source #
apply function to the first value of each tuple in given list
mapSnds :: (a -> b) -> [(c, a)] -> [(c, b)] Source #
apply function to the second value of each tuple in given list
wordsBy :: (a -> Bool) -> [a] -> [[a]] Source #
split given list of a
by given single a, e.g.
>>>
wordsBy (== ':') "bd:3"
["bd", "3"]
mapFsts' :: (a -> x) -> [(a, b, c)] -> [(x, b, c)] Source #
apply function to the second value of each triple in given list
mapSnds' :: (b -> x) -> [(a, b, c)] -> [(a, x, c)] Source #
apply function to the second value of each triple in given list
mapThds' :: (c -> x) -> [(a, b, c)] -> [(a, b, x)] Source #
apply function to the third value of each triple in given list
mergelists :: [a] -> [a] -> [a] Source #
combines two lists by interleaving them
>>>
mergelists [1,2,3] [9,8,7]
[1,9,2,8,3,7]