fadno-1.1.8: Minimal library for music generation and notation
Safe HaskellNone
LanguageHaskell2010

Fadno.Util

Synopsis

Documentation

diff :: Num a => [a] -> [a] Source #

zipTail :: (a -> a -> c) -> [a] -> [c] Source #

integ :: Int -> [Int] -> [Int] Source #

trace :: String -> a -> a Source #

trace with brackets.

trace' :: Show a => String -> a -> a Source #

trace with output of result.

trace1 :: Show b => String -> b -> a -> a Source #

trace with extra variable, not showing result.

trace1' :: (Show a, Show b) => String -> b -> a -> a Source #

trace with extra variable and output of result.

popping :: MonadState s m => Int -> Lens' s [a] -> ([a] -> m b) -> m b Source #

pop items off a stateful list, use for monadic function.

popping' :: MonadState s m => Int -> Lens' s [a] -> ([a] -> m b) -> m (Maybe b) Source #

popping but only runs function if popped items are non-empty

popping1 :: MonadState s m => Lens' s [a] -> (a -> m b) -> m (Maybe b) Source #

popping with only head

wrapSucc :: (Bounded a, Enum a, Eq a) => a -> a Source #

succ with wraparound.

wrapPred :: (Bounded a, Enum a, Eq a) => a -> a Source #

pred with wraparound.

mutating :: MonadState s m => Lens' s a -> (a -> a) -> m (a, a) Source #

do monadic over -- (%=) -- with pass-through of (before,after)

maybe' :: Maybe a -> b -> (a -> b) -> b Source #

reorganize maybe for chaining on Just

median :: Integral a => [a] -> Maybe a Source #

normalize :: (Num a, Ord a) => [a] -> [a] Source #

lfsr :: Int -> Int -> Int -> [Bool] Source #

rehMarks :: [String] Source #

generate A .. Z, AA .. AZ, BA .. BZ, .. AAA etc

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

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

allTuples :: Int -> [a] -> [[a]] Source #

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

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

filterOnKeys :: Ord a => [a] -> Map a b -> Map a b Source #

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