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

Copyright(c) Hans Hoglund 2012-2014
LicenseBSD-style
Maintainerhans@hanshoglund.se
Stabilityexperimental
Portabilitynon-portable (TF,GNTD)
Safe HaskellNone
LanguageHaskell2010

Music.Time.Bound

Contents

Description

 

Synopsis

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.

Constructors

Bound 

Fields

getBound :: (Span, a)
 

Instances

Functor Bound 
Eq a => Eq (Bound a) 
Show a => Show (Bound a) 
Semigroup a => Semigroup (Bound a) 
Wrapped (Bound a) 
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) 
Typeable (* -> *) Bound 
type Unwrapped (Bound a) = (Span, a) 

Construction

bounds :: Time -> Time -> a -> Bound a Source

Add bounds.

bounding :: Span -> a -> Bound a Source

Add bounds.

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