Skip to content

Type-Level Programming Opportunities #7

@ChrisEPhifer

Description

@ChrisEPhifer

As I was refactoring the Interval module, it occurred to me that there are a few opportunities for some really fancy Haskell.

Wouldn't it be really cool if, instead of working with values that describe other values (see: the two notions of Quality), these "describer" values were types?

That is, instead of Quality being a type with values Major, Minor, etc, why not have types Major, Minor, etc. that describe values such as Chord and Interval?

This would take away some of the run-time computational burden (around, for example, doing arithmetic on qualities), and, with care, would let us sit back while our types do all of the heavy lifting (for a fairly high up-front cost.)

Metadata

Metadata

Labels

brainstormingIdea-dumping and feedback on said idea dumps

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions