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

Safe HaskellNone
LanguageHaskell2010

Music.Score.Internal.Util

Synopsis

Documentation

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

Divide a list into parts of maximum length n. > category : List > depends : base

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

 Map over the indices and elements of list. > category : List > depends : base

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

Duplicate an element. > category: Combinator, Tuple > depends: base

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

Unfold a partial function. This is a simpler version of unfoldr. > category: Function, List > depends: base

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

Map over first elements of a list. Biased on first element for shorter lists. > category: List > depends: base

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

Map over all but the first and last elements of a list. Biased on middle elements for shorter lists. > category: List > depends: base

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

Map over last elements of a list. Biased on last element for shorter lists. > category: List > depends: base

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

Extract the first consecutive sublist for which the predicate returns true, or the empty list if no such sublist exists. > category: List > depends: base

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

Returns all rotations of the given list. Given an infinite list, returns an infinite list of rotated infinite lists. > category: List > depends: base

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 -> d Source

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

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 b Source

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

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

Case matching on lists. > category: List > depends: base

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

Merge lists. > category: List > depends: base

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

Merge lists. > category: List > depends: base

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

composed :: [b -> b] -> b -> b Source

Compose all functions. > category: Function > depends: base

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

Separate a ratio. > category: Math > depends: base

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

Nicer printing of ratio as ordinary fractions. > category: Math > depends: base

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 -> Double Source

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

single :: Prism' [a] a Source

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

inspecting :: Eq a => (b -> a) -> b -> b -> Bool Source