I am trying to make music using the Haskell Library Euterpea. I load a file which has line "import Euterpea" into ghci.
If I run something like,
play $ a 1 qn
Then succesfully it runs and a sound is played on my speaker. But, if I tell it run something like
play $ note (1/4) (A,4)
then it throws errors
<interactive>:6:1: error:
* Couldn't match expected type: t0 -> (PitchClass, b0) -> t
with actual type: IO ()
* The function `play' is applied to three value arguments,
but its type `Music a1 -> IO ()' has only one
In the expression: play note (1 / 4) (A, 4)
In an equation for `it': it = play note (1 / 4) (A, 4)
* Relevant bindings include it :: t (bound at <interactive>:6:1)
<interactive>:6:6: error:
* Couldn't match expected type: Music a1
with actual type: Dur -> a0 -> Music a0
* Probable cause: `note' is applied to too few arguments
In the first argument of `play', namely `note'
In the expression: play note (1 / 4) (A, 4)
In an equation for `it': it = play note (1 / 4) (A, 4)
The above was supposed to, in the ideal case, play the quarter note of concert A (page-16 of Haskell School of Music)
Being unable to play this note expressions like this is stopping me from learning the book thoroughly. Could somone explain to my why it's not working.
Found the answer myself. Just kept on reading, and this issue is tackled on page-37