tidal-0.9.4: Pattern language for improvised music

Sound.Tidal.Utils

Description

Synopsis

# Documentation

enumerate :: [a] -> [(Int, a)] Source #

enumerate a list of things

>>> enumerate ["foo","bar","baz"]
[(1,"foo"), (2,"bar"), (3,"baz")]


mapFst :: (a -> b) -> (a, c) -> (b, c) Source #

apply f to the first element of a tuple

mapFsts :: (a -> b) -> [(a, c)] -> [(b, c)] Source #

apply function to the first value of each tuple in given list

mapSnd :: (a -> b) -> (c, a) -> (c, b) Source #

apply f to the second element of a tuple

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"]


fst' :: (t2, t1, t) -> t2 Source #

shorthand for first element of triple

snd' :: (t1, t2, t) -> t2 Source #

shorthand for second element of triple

thd' :: (t1, t, t2) -> t2 Source #

shorthand for third element of triple

mapFst' :: (a -> x) -> (a, b, c) -> (x, b, c) Source #

apply f to the first element of a triple

mapSnd' :: (b -> x) -> (a, b, c) -> (a, x, c) Source #

apply f to the second element of a triple

mapThd' :: (c -> x) -> (a, b, c) -> (a, b, x) Source #

apply f to the third element of a triple

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

mapArcs :: (a -> a) -> [(a, a, x)] -> [(a, a, x)] Source #

map f over a given list of arcs

mergelists :: [a] -> [a] -> [a] Source #

combines two lists by interleaving them

>>> mergelists [1,2,3] [9,8,7]
[1,9,2,8,3,7]


(!!!) :: [a] -> Int -> a Source #

like !! selects nth element from xs, but wraps over at the end of xs

>>> map ((!!!) [1,3,5]) [0,1,2,3,4,5]
[1,3,5,1,3,5]