Wednesday, December 15, 2010

wumpus-basic

Copperbox revision 1950.

I've reformulated the Graphic types again.

Instead of a single newtype with synonyms:

> newtype CF a = CF { unCF :: DrawingContext -> a}
> type LocCF u a = CF (Point2 u -> a)

I now have different newtypes for arity 0 and arity 1 & 2

> newtype CF a = CF { unCF :: DrawingContext -> a}
> newtype CF1 r1 a = CF { unCF1 :: DrawingContext -> r1 -> a}
> newtype CF2 r1 r2 a = CF { unCF2 :: DrawingContext -> r1 -> r2 -> a}

> type LocCF u a = CF1 (Point2 u) a

This should mean I can use standard Applicative and Monad combinators much more and depreciate the use of the arity combinators (prepro1, postpro2, situ1 etc.) in ContextFun.

At the moment I've just changed the types and got the Wumpus.Basic.* modules working, I haven't yet looked at improving the code or updated the Wumpus.Drawing.* modules.

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.