Sound.SC3.Lang.Collection

Synopsis

# Documentation

fill :: Int -> (Int -> a) -> [a]Source

size :: [a] -> IntSource

ignoringIndex :: (a -> b) -> a -> Int -> bSource

collect :: (a -> Int -> b) -> [a] -> [b]Source

select :: (a -> Int -> Bool) -> [a] -> [a]Source

reject :: (a -> Int -> Bool) -> [a] -> [a]Source

detect :: (a -> Int -> Bool) -> [a] -> Maybe aSource

detectIndex :: (a -> Int -> Bool) -> [a] -> Maybe IntSource

inject :: a -> (a -> b -> a) -> [b] -> aSource

any' :: (a -> Int -> Bool) -> [a] -> BoolSource

every :: (a -> Int -> Bool) -> [a] -> BoolSource

count :: (a -> Int -> Bool) -> [a] -> IntSource

occurencesOf :: Eq a => a -> [a] -> IntSource

sum' :: Num a => (b -> Int -> a) -> [b] -> aSource

maxItem :: Ord b => (a -> Int -> b) -> [a] -> bSource

minItem :: Ord b => (a -> Int -> b) -> [a] -> bSource

series :: Num a => Int -> a -> a -> [a]Source

Arithmetic series (size, start, step)

geom :: Num a => Int -> a -> a -> [a]Source

Geometric series (size, start, grow)

fib :: Num a => Int -> a -> a -> [a]Source

Fibonacci series (size, initial step, start)

rand :: Random a => Int -> a -> a -> IO [a]Source

Random values (size, min, max) - ought this be in floating?

rand2 :: (Num a, Random a) => Int -> a -> IO [a]Source

Random values in the range -abs to +abs (size, abs)

first :: [t] -> Maybe tSource

The first element.

last' :: [t] -> Maybe tSource

The last element.

indexOf :: Eq a => [a] -> a -> Maybe IntSource

flip elemIndex

indexOfEqual :: Eq a => [a] -> a -> Maybe IntSource

indexOf

indexOfGreaterThan :: Ord a => a -> [a] -> Maybe IntSource

Collection is sorted, index of first greater element.

indexIn :: (Ord a, Num a) => a -> [a] -> IntSource

Collection is sorted, index of nearest element.

indexInBetween :: (Ord a, Fractional a) => a -> [a] -> aSource

Collection is sorted, linearly interpolated fractional index.

keep :: Int -> [a] -> [a]Source

drop' :: Int -> [a] -> [a]Source

extendSequences :: [[a]] -> [[a]]Source

flop :: [[a]] -> [[a]]Source

choose :: [a] -> IO aSource

separateAt :: (a -> a -> Bool) -> [a] -> ([a], [a])Source

separate :: (a -> a -> Bool) -> [a] -> [[a]]Source

clump :: Int -> [a] -> [[a]]Source

clumps :: [Int] -> [a] -> [[a]]Source

integrate :: Num a => [a] -> [a]Source

dx -> d

differentiate :: Num a => [a] -> [a]Source

d -> dx

rotate :: Int -> [a] -> [a]Source

Rotate n places to the left (ie. rotate 1 [1, 2, 3] is [2, 3, 1]).

normalizeSum :: Fractional a => [a] -> [a]Source

Ensure sum of elements is one.

zipWith_c :: (a -> b -> c) -> [a] -> [b] -> [c]Source

Variant that cycles the shorter input.

zip_c :: [a] -> [b] -> [(a, b)]Source