| 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.Duration
Description
- module Music.Time.Transform
- class HasDuration a where
- duration :: (Transformable a, HasDuration a) => Lens' a Duration
- stretchTo :: (Transformable a, HasDuration a) => Duration -> a -> a
Documentation
module Music.Time.Transform
The HasDuration class
class HasDuration a where Source
Class of values that have a duration.
For any type that is also Transformable, you should ensure that:
(transforms x)^.duration=transforms (x^.duration)
Instances
| HasDuration Char | |
| HasDuration Double | |
| HasDuration Int | |
| HasDuration () | |
| HasDuration Span | |
| HasDuration Duration | |
| (HasPosition a, Transformable a) => HasDuration [a] | |
| HasDuration a => HasDuration (Sum a) | |
| HasDuration a => HasDuration (Product a) | |
| HasDuration a => HasDuration (Min a) | |
| HasDuration a => HasDuration (Max a) | |
| HasDuration (Note a) | |
| HasDuration (Voice a) | |
| HasDuration a => HasDuration (AddMeta a) | |
| HasDuration (Event a) | |
| HasDuration (Score a) | |
| (HasDuration v, Transformable v) => HasDuration (Aligned v) | |
| HasDuration (Rhythm a) | |
| (HasDuration a, HasDuration b) => HasDuration (Either a b) | |
| HasDuration a => HasDuration (a, b) | |
| HasDuration b => HasDuration (a, b, c) |
Absolute duration
duration :: (Transformable a, HasDuration a) => Lens' a Duration Source
Access the duration.
stretchTo :: (Transformable a, HasDuration a) => Duration -> a -> a Source
Stretch a value to have the given duration.