Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Type family naming conventions #73

Closed
hanshoglund opened this issue Aug 26, 2013 · 2 comments
Closed

Type family naming conventions #73

hanshoglund opened this issue Aug 26, 2013 · 2 comments
Labels

Comments

@hanshoglund
Copy link
Member

(Below, TF means type family and CT means concrete type.)

How should the increasing number of TFs in music-score be named?

There are no standard convention, for example vector-space uses Diff, Scalar etc, while diagrams uses V.

The long names read nice, but often conflict with a concrete type name. For example we often have Music.Score.Pitch a ~ Music.Pitch.Pitch, or even Music.Time.DurationT (Score a) ~ Music.Time.Duration.

Possible solutions

Short TF, long CT

  • P a ~ Pitch
  • Does not scale well, imagine if we split out pitch, time, articulation etc. Then we would end up with P a, T a, R a etc.

Long suffixed TF, long CT

  • PitchOf a ~ Pitch, TimeOf (Score a) ~ Time, ArticulationOf a ~ Western.Articulation

Both TF and CT long (use qualifiers)

  • Pitch a ~ Pitch.Pitch
  • Slightly confusing (but will work with good documentation, export lists etc)
  • Does not work for Time and Duration (both TF and CT have to live in Music.Time)
    • We could circumvent this by restricting Transformable to the CTs and remove the TFs for the time-based functionality. Is the simplicity gained worth the loss of scores with different time representations?
@hanshoglund
Copy link
Member Author

See complete proposals here

@hanshoglund
Copy link
Member Author

We settle for Both TF and CT. Qualified imports in preludes are OK. Note that the CT should be visible by default. We solve the Time/Duration collision by simplifying and using only the CTs (this approach was used in the thesis).

hanshoglund added a commit that referenced this issue Sep 16, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant