| 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 |
Music.Time.Split
Description
- 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:
(beginningt x)^.duration+ (endingt x)^.duration= x^.duration(beginningt x)^.duration= tminx^.durationiff t >= 0 (endingt x)^.duration= x^.duration- (tminx^.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!).
Methods
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.
Instances
| 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