| 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.Note
Contents
Description
Note type
A value Note value, representing a suspended stretch of some Transformable
value. We can access the value in bothits original and note form using note
and notee, respectively.
Placing a value inside Note makes it invariant under delay, however the inner
value can still be delayed using .fmap delay
Instances
Construction
note :: Iso (Duration, a) (Duration, b) (Note a) (Note b) Source
View a note value as a pair of the original value and a stretch factor.
notee :: (Transformable a, Transformable b) => Lens (Note a) (Note b) a b Source
Access the note value.
Taking a value out carries out the stretch (using the Transformable instance),
while putting a value in carries out the reverse transformation.
>>>view notee $ (2,3::Duration)^.note6
>>>set notee 6 $ (2,1::Duration)^.note(2,3)^.note
durationNote :: Iso' Duration (Note ()) Source
A note value as a duration carrying an associated value. Whitness by picking a trivial value.
>>>2^.durationNote(2,())^.note