Friday, February 25, 2011

wumpus-basic

Copperbox revision 2168.

I've added support to convert the units for various drawing objects Image, PosImage, TraceDrawing etc.

The code is unfortunately more contrived than I had expected. Changing units in Wumpus-Core is just a functorial traversal, but this isn't the case in Wumpus-Basic. Also in Wumpus-Basic, the many of the objects are type synonyms with kind (* -> * -> *) so there is no opportunity to encapsulate conversion in a type class. Instead I've had to code the type specific cases with unique functions that look the same if you squint.

Wumpus-Rhythm has a compelling use for unit conversion, so it will be a test-case to gauge whether the new code is satisfactory if not pretty.

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.