tidal-1.7.3: Pattern language for improvised music
Safe HaskellSafe-Inferred
LanguageHaskell2010

Sound.Tidal.Utils

Synopsis

Documentation

mapBoth :: (a -> a) -> (a, a) -> (a, a) Source #

mapPartTimes :: (a -> a) -> ((a, a), (a, a)) -> ((a, a), (a, a)) Source #

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

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

delta :: Num a => (a, a) -> a Source #

mid :: Fractional a => (a, a) -> a Source #

The midpoint of two values

removeCommon :: Eq a => [a] -> [a] -> ([a], [a]) Source #

(!!!) :: [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]

nth :: Int -> [a] -> Maybe a Source #

Safer version of !! -

accumulate :: Num t => [t] -> [t] Source #

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

enumerate a list of things

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

wordsBy :: (a -> Bool) -> [a] -> [[a]] Source #

split given list of a by given single a, e.g.

>>> wordsBy (== ':') "bd:3"
["bd", "3"]

fromRight :: b -> Either a b -> b Source #