
7 Feb
2013
7 Feb
'13
5:07 p.m.
Hello all, In the ALSA Midi package, there is an example, where he first sets up client, port, queue and stuff. All of these are IO actions, and there are a number of nested "do"s. Then in the innermost "do" he has all the pieces together and starts playing. In this case the actual "song" is coded in the innermost do. My question is: how can I inject a song from outside. Of course I could make it another parameter, which would have to travel through all the "do"s, but I already have more than enough parameters. Then I tried fmap. But the actual playing is an IO operation itself, so I cannot write a pure function and fmap it over the Monad. Any ideas? -- Martin