Saturday, September 20, 2008

HNotate

Copperbox revision 261.

The Abc backend now uses a new output scheme which allows it do beaming.

Previously the output built a pretty printed Doc that was wrapped up with a phantom type layer. With the change to using score file templates there is not so much need for this phantom typed doc - HNotate doesn't export the phantom typed doc to users so the responsibility to generate correct output is entirely internal. And it had always felt very heavyweight, as my struggles to get it to do what I wanted showed.

So now its being replaced by a State monad that works like the Writer monad, but with some quirks - the output can't be an instance of Monoid because the append operation has to be controllable on the fly. This is how Abc beaming works - at the start of the beam group the append operator is changed from (<+>) spaced, to (<>) no space then reverted to spaced at the end of the beam.

The next step is to change the LilyPond backend, which will hopefully corroborate the advantages of the new scheme.

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.