Wednesday, February 9, 2011

wumpus-basic

Copperbox revision 2124.

I've removed the PointSupplyM class and MonUnit type family.

MonUnit was a hack to get around some the problem that Monads have kind (* -> *) so didn't appear to work well with the DUnit fmaily from Wumpus-Core. By using fully saturated type instances for the TraceDrawing monads and changing the definition of the TraceM class I think I've removed the need for MonUnit:

type instance DUnit (TraceDrawing u a)    = u
type instance DUnit (TraceDrawingT u m a) = u

class TraceM (m :: * -> *) where
  trace  :: u ~ DUnit (m ()) => HPrim u -> m ()

I've added scaling factors for a "snapping grid" to the DrawingContext. Grid coordinates can do much of what PointSupplyM was intended to achieve, although the Turtle monad in Wumpus-Drawing will now be broken - and its likely I'll drop Turtle rather than fix it, at least for the time being.

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.