music-score-1.7.1: Musical score and part representation.

Safe HaskellNone

Music.Score.Internal.Util

Synopsis

Documentation

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

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

Group a list into sublists whereever a predicate holds. The matched element is the first in the sublist.

 splitWhile isSpace "foo bar baz"
    ===> ["foo"," bar"," baz"]

 splitWhile (> 3) [1,5,4,7,0,1,2]
    ===> [[1],[5],[4],[7,0,1,2]]
 category : List
 depends : base

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

Break up a list into parts of maximum length n, inserting the given list as separator. Useful for breaking up strings, as in breakList 80 n str.

 category : List
 depends : base

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

dup :: a -> (a, a)Source

unf :: (a -> Maybe a) -> a -> [a]Source

mapF :: (b -> b) -> [b] -> [b]Source

mapT :: (b -> b) -> [b] -> [b]Source

mapL :: (b -> b) -> [b] -> [b]Source

mapFTL :: (a -> b) -> (a -> b) -> (a -> b) -> [a] -> [b]Source

Map over first, middle and last elements of list. Biased on first, then on first and last for short lists.

 category: List
 depends: base

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

rots :: [a] -> [[a]]Source

rotl :: [a] -> [a]Source

 category: List
 depends: base

rotr :: [a] -> [a]Source

 category: List
 depends: base

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

 category: List
 depends: base

curry3 :: ((a, b, c) -> d) -> a -> b -> c -> dSource

uncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> dSource

untripl :: (a, b, c) -> ((a, b), c)Source

tripl :: ((a, b), c) -> (a, b, c)Source

tripr :: (a, (b, c)) -> (a, b, c)Source

partial2 :: (a -> b -> Bool) -> a -> b -> Maybe bSource

partial3 :: (a -> b -> c -> Bool) -> a -> b -> c -> Maybe cSource

list :: r -> ([a] -> r) -> [a] -> rSource

merge :: Ord a => [a] -> [a] -> [a]Source

mergeBy :: (a -> a -> Ordering) -> [a] -> [a] -> [a]Source

mergeBy' :: (a -> a -> Bool) -> [a] -> [a] -> [a]Source

composed :: [b -> b] -> b -> bSource

unRatio :: Integral a => Ratio a -> (a, a)Source

showRatio :: (Integral a, Show a) => Ratio a -> StringSource

retainUpdates :: Eq a => [a] -> [Maybe a]Source

replic :: Integral a => a -> b -> [b]Source

swap :: (a, b) -> (b, a)Source

withNext :: [a] -> [(a, Maybe a)]Source

withPrev :: [a] -> [(Maybe a, a)]Source

withPrevNext :: [a] -> [(Maybe a, a, Maybe a)]Source

mapWithNext :: (a -> Maybe a -> b) -> [a] -> [b]Source

mapWithPrev :: (Maybe a -> a -> b) -> [a] -> [b]Source

mapWithPrevNext :: (Maybe a -> a -> Maybe a -> b) -> [a] -> [b]Source

toDouble :: Real a => a -> DoubleSource

through :: Applicative f => Lens' s a -> Lens s t a b -> Lens (f s) (f t) (f a) (f b)Source

floor' :: RealFrac a => a -> aSource

inspecting :: Eq a => (b -> a) -> b -> b -> BoolSource