[Haskell-beginners] Intervals?

Nathan Holden nathanmholden at gmail.com
Tue May 19 14:43:04 EDT 2009


I have been trying to optimize some research I was doing in my spare time.

To spare complexity, it involves music-- I have a class, defining each note
in an octave, and I want to write a function that will convert between two
notes and an interval-- so, for instance:

Foo As {- A sharp-- can't use # -} B = 1

because in the standard scale, A# and B are one semitone apart.

My question, however, boils primarily down to this: Is there a way to make

Foo :: Note -> Note -> Int
Foo a b = a-b

work?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20090519/c6e23588/attachment.html


More information about the Beginners mailing list