music-score-1.7.1: Musical score and part representation.

Portabilitynon-portable (TF,GNTD)
Safe HaskellNone




Warning This module is experimental.


Bound type

newtype Bound a Source

Bound restricts the start and stop time of a value, and prevents access to values outside the bounds.

Bound is especially useful to restrict the range of a Behavior. If we have a value with can only be reasonably defined for a particular time range, we can represent it as Bound Behavior. This is isomorphic to a Note Segment, and bounded whitnesses the isomorphism.

Bound is not Foldable or Traversable, as that would allow us to access values outside the bounds. However, we can still access values of a Bound Behavior in a safe manner using trim or splice.




getBound :: (Span, a)


Functor Bound 
Typeable1 Bound 
Eq a => Eq (Bound a) 
Show a => Show (Bound a) 
Semigroup a => Semigroup (Bound a) 
Wrapped (Bound a)

Unsafe: Do not use Wrapped instances

Transformable a => Transformable (Bound a)

Bound transform by transforming the bounded value as well as the bounds.

(HasPosition a, HasDuration a) => HasDuration (Bound a) 
HasPosition a => HasPosition (Bound a) 
(HasPosition a, Splittable a) => Splittable (Bound a) 
Reversible a => Reversible (Bound a) 
Rewrapped (Bound a) (Bound b) 


bounds :: Time -> Time -> a -> Bound aSource

Add bounds.

bounding :: Span -> a -> Bound aSource

Add bounds.

 (s,x)^.note = (bounding s . transform s) x