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 various forms of title, subtitle etc. and related meta-data.
- data Title
- denoteTitle :: Title -> Title
- getTitle :: Title -> [String]
- getTitleAt :: Title -> Int -> Maybe String
- title :: (HasMeta a, HasPosition a) => Title -> a -> a
- titleDuring :: HasMeta a => Span -> Title -> a -> a
- subtitle :: (HasMeta a, HasPosition a) => Title -> a -> a
- subtitleDuring :: HasMeta a => Span -> Title -> a -> a
- subsubtitle :: (HasMeta a, HasPosition a) => Title -> a -> a
- subsubtitleDuring :: HasMeta a => Span -> Title -> a -> a
- withTitle :: (Title -> Score a -> Score a) -> Score a -> Score a
Title type
A title is a sequence of String
values, representing the name of a work or part of a work.
An arbitrary depth of title sections can be used.
Title is an instance of IsString
and can be used with the OverloadedStrings
extension as
follows:
title "Le Nozze di Figaro" subtitle "Atto primo" subsubtitle "Scena I" subsubtitle "Scena II" ... subtitle "Atto secundo" ...
Creating and modifying
denoteTitle :: Title -> Title Source
Denote a title to a lower level, i.e title becomes subtitle, subtitle becomes subsubtitle etc.
getTitle :: Title -> [String] Source
Extract the title as a descending list of title levels (i.e. title, subtitle, subsubtitle...).
getTitleAt :: Title -> Int -> Maybe String Source
Extract the title of the given level. Semantic function.
Adding titles to scores
title :: (HasMeta a, HasPosition a) => Title -> a -> a Source
Set title of the given score.
titleDuring :: HasMeta a => Span -> Title -> a -> a Source
Set title of the given part of a score.
subtitle :: (HasMeta a, HasPosition a) => Title -> a -> a Source
Set subtitle of the given score.
subtitleDuring :: HasMeta a => Span -> Title -> a -> a Source
Set subtitle of the given part of a score.
subsubtitle :: (HasMeta a, HasPosition a) => Title -> a -> a Source
Set subsubtitle of the given score.
subsubtitleDuring :: HasMeta a => Span -> Title -> a -> a Source
Set subsubtitle of the given part of a score.