Copyright | (c) Hans Hoglund 2012-2014 |
---|---|
License | BSD-style |
Maintainer | hans@hanshoglund.se |
Stability | experimental |
Portability | non-portable (TF,GNTD) |
Safe Haskell | None |
Language | Haskell2010 |
- module Music.Time.Position
- class HasDuration a => Splittable a where
- chunks :: (Transformable a, Splittable a) => Duration -> a -> [a]
Documentation
module Music.Time.Position
The Splittable class
class HasDuration a => Splittable a where Source
Class of values that can be split.
Instances should satisfy:
(beginning
t x)^.duration
+ (ending
t x)^.duration
= x^.duration
(beginning
t x)^.duration
= tmin
x^.duration
iff t >= 0 (ending
t x)^.duration
= x^.duration
- (tmin
x^.duration
) iff t >= 0
(Note that any of these three laws can be derived from the other two, so it is sufficient to prove two!).
split :: Duration -> a -> (a, a) Source
Split a value at the given duration and return both parts.
beginning :: Duration -> a -> a Source
Split a value at the given duration and return only the first part.
ending :: Duration -> a -> a Source
Split a value at the given duration and return only the second part.
Splittable Char | |
Splittable Double | |
Splittable Int | |
Splittable () | |
Splittable Duration | |
(Splittable a, Transformable a) => Splittable (Note a) | |
(Transformable a, Splittable a) => Splittable (Voice a) | |
Splittable a => Splittable (AddMeta a) |
Miscellaneous
chunks :: (Transformable a, Splittable a) => Duration -> a -> [a] Source