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 |
Provides meta-data attribution for composer, lyricist etc.
- data Attribution
- attribution :: String -> String -> Attribution
- attributions :: [(String, String)] -> Attribution
- getAttribution :: Attribution -> String -> Maybe String
- attribute :: (HasMeta a, HasPosition a) => Attribution -> a -> a
- attributeDuring :: HasMeta a => Span -> Attribution -> a -> a
- composer :: (HasMeta a, HasPosition a) => String -> a -> a
- composerDuring :: HasMeta a => Span -> String -> a -> a
- lyricist :: (HasMeta a, HasPosition a) => String -> a -> a
- lyricistDuring :: HasMeta a => Span -> String -> a -> a
- arranger :: (HasMeta a, HasPosition a) => String -> a -> a
- arrangerDuring :: HasMeta a => Span -> String -> a -> a
- withAttribution :: String -> (String -> Score a -> Score a) -> Score a -> Score a
- withAttribution' :: (Attribution -> Score a -> Score a) -> Score a -> Score a
Attribution type
data Attribution Source
An attributions is a simple map from keys to values used to gather information such as composer, lyricist, orchestrator, performer, etc.
Attribution is a Semigroup
, and compose by choosing the leftmost value in each
category. For example
attribution "composer" "H" <> attribution "composer" "S" <> attribution "lyricist" "S" ===> attributions [("composer","H"),("lyricist","S")]
Any kind of attribution can be added, and backends may recognize or ignore categories as they see fit. The following categories are normally recognized:
composer lyricist arranger performer dedication year copyright information
Show Attribution | |
Monoid Attribution | |
Semigroup Attribution | |
Typeable * Attribution |
attribution :: String -> String -> Attribution Source
Make an Attribution
a single key and value.
attributions :: [(String, String)] -> Attribution Source
Make an Attribution
from keys and values.
getAttribution :: Attribution -> String -> Maybe String Source
Extract an the given attributions value. Semantic function.
Adding attribution to scores
attribute :: (HasMeta a, HasPosition a) => Attribution -> a -> a Source
Set the given attribution in the given score.
attributeDuring :: HasMeta a => Span -> Attribution -> a -> a Source
Set the given attribution in the given part of a score.
composer :: (HasMeta a, HasPosition a) => String -> a -> a Source
Set composer of the given score.
composerDuring :: HasMeta a => Span -> String -> a -> a Source
Set composer of the given part of a score.
lyricist :: (HasMeta a, HasPosition a) => String -> a -> a Source
Set lyricist of the given score.
lyricistDuring :: HasMeta a => Span -> String -> a -> a Source
Set lyricist of the given part of a score.
arranger :: (HasMeta a, HasPosition a) => String -> a -> a Source
Set arranger of the given score.
arrangerDuring :: HasMeta a => Span -> String -> a -> a Source
Set arranger of the given part of a score.
Extracting attribution
withAttribution :: String -> (String -> Score a -> Score a) -> Score a -> Score a Source
Extract attribution values of the given category from a score.
withAttribution' :: (Attribution -> Score a -> Score a) -> Score a -> Score a Source
Extract all attribution values from a score.