Closed hanshoglund closed 10 years ago
I believe this is mainly a matter of choosing the right Monoids for meta-info. Maybe-based ones are OK, list-based ones are not. This makes sense, as meta-info is really not supposed to handle occurences, but (potentially) variable properties.
For list-like types (i.e. annotations), it might be sufficient to use nub
. Consider
import Control.Arrow
import Data.AffineSpace.Relative
import Music.Prelude.Basic
mapIf p f = uncurry mplus . first f . mpartition p
accentConsonances p = mapIf (isConsonance . (.-. asPitch p) . head . getPitches) accentAll
main = open $ showAnnotations $ accentConsonances c $ annotate "H" $ scat [c..c']
Fixed, wrote a sketchy paragraph in the User Guide explaining how list-based Monoids can not be used.
For example