Monday, November 17, 2008

ZMidi

Copperbox revision 336.

I've replaced Parsec with a handmade parser monad (actually a combination of ErrorT WriterT State) in ReadMidi. I wasn't using anything adventurous from Parsec as reading Midi only doesn't require lookahead, and I wanted to add a WriterT for logging. As Parsec 2 is not a monad transformer I was getting the wrong type for logging - Either ParseError (a,String) - this isn't useful as I only want the logging if the parse fails. The new monad has the type - (Either ParseErr a, String) - so the log is accessible on success or failure, but the run function throws out the log on success.

Blog Archive

About Me

My photo
Disambiguating biog as there are a few Stephen Tetley's in the world. I'm neither a cage fighter or yachtsman. I studied Fine Art in the nineties (foundation Bradford 1992, degree Cheltenham 1992 - 95) then Computing part-time at Leeds Met graduating in 2003. I'm the Stephen Tetley on Haskell Cafe and Stackoverflow.