Thursday, March 31, 2011

wumpus-drawing

Copperbox revision 2279.

I've updated the demos in Wumpus-Drawing.

One thing I noticed when updating the Shapes is that the "synthetic properties" might not be a good idea in the face of affine scaling. I'll have to look into this...

wumpus-drawing

Copperbox revision 2278.

I've updated Shapes to work with the changes to anchors and affine transformations. Fortunately Shapes can work with pure anchors - this is much more convenient that having monadic ones.

wumpus-basic

Copperbox revision 2277.

I've made anchors pure values again - though I'll need to update Wumpus-Drawing to validate that this makes sense.

Also, I've made more types instances of the affine classes. One pitfall is that I've had to make Images transformable only if they have scalar units. This was something I got rid of from Wumpus-Core, where it was called the PsPoint type class. In Wumpus-Core it was used as a restriction on almost all the affine instances,  now important objects, e.g. Points and Vectors, are only constrained by the numerical classes and Ord. So its reintroduction as a constraint on Images and "ImageAns" is unfortunate but tolerable in the wider scheme of things.

wumpus-basic

Copperbox revision 2276.

I've updated Wumpus-Basic to with with the affine transformation changes to Wumpus-Core. I haven't looked at changing the type of Anchors yet.

wumpus-core

Copperbox revision 2275.

I've re-instated the more general type signatures for the affine classes, now that Point and Vec2 have instances that are no longer hampered by InterpretUnit. This is very good news for Wumpus-Basic as it should mean Anchors no longer need be monadic "queries". It also means the changes between the previous release of Wumpus-Core are much smaller.

wumpus-core

Copperbox revision 2274.

I've re-implemented the affine transformations on Points and Vectors as simple functions rather than matrix / homogeneous coordinate operations.

This has good implications for the unit handling as it means Real and Floating are enough to compute transformations: the unit doesn't need to be cast to Double, which needs InterpretUnit. Thus it looks like the classes can be generalized back to what they were in 0.43.0 with the exception that scale should work with Double for the scaling factors and not the unit - u.

wumpus

Copperbox revision 2273.

I've updated Wumpus-Rhythm and Wumpus-Tree to compile again.

I've had to disable some functionality in Tree due to affine transformations becoming monadic in Wumpus-Basic / Wumpus-Core. Rather than update Tree accordingly, the best thing to do is re-evaluate whether affine trafos really need to use InterpretUnit - which makes them monadic. Unfortunately this is a lot of change again... 

Wednesday, March 30, 2011

wumpus-drawing

Copperbox revision 2272.

I've replaced the old connectors code - both in the libraries and demos. The new connector code does have some issues to iron out - the ArrowCircuit example draws a wonky bar at the moment.

wumpus-drawing

Copperbox revision 2271.

I've updated the demos to work with the text and PosObject changes.

wumpus-drawing

Copperbox revision 2270.

I've re-implemented rotated text with the new PosObject. Rotation is now only supported for single line text, but as the implementation is a lot simpler I don't consider this a great loss.

wumpus-basic

Copperbox revision 2269.

I've re-worked the naming scheme in the PosObject module for "PosImage" this is the object created by running a PosObject. PosImage is now called LocRectImage - this is consistent with other Wumpus-Basic objects that are prefixed by the abbreviated names of their input.

Tuesday, March 29, 2011

wumpus-drawing

Copperbox revision 2268.

I've implemented limited fills for DocText. Previously fills were a DocText transformer:

> rfill :: u -> DocText u -> DocText u

Now, they are a construction function:

> rfillString :: u -> String -> DocText u

It's easy to post-transform both the Orientation object produced by the query part of a DocText and the BoundingBox produced by the LocImage, unfortunately fill behaviour needs the LocImage pre-transforming - shifting it right for a right-fill. I can't do this, as I need to render the Image to know how much to initially move it by.

The previous DocText got round this by tracking width, but this would mean changing the DocText type which I don't particularly want to do. So, I'll see if I can live with limited fill.

wumpus-drawing

Copperbox revision 2267.

DocText is now largely working - re-implementing left and right fill is outstanding. The new implementation is much simpler.

wumpus-basic

Copperbox revision 2266.

I've changed the representation of PosObject so the orientation is a (contextual) query to get the orientation rather than a pure value. It has been difficult to get usable types for the text objects in Wumpus-Drawing, so I think this change is appropriate[*]. It makes the PosObject type equivalent to the type of Arrowheads.


[*] The types in Wumpus are regrettably so complicated that it is difficult to tell without working through the consequences in the code.

wumpus

Copperbox revision 2265.

More work on PosObject and replacing the old text objects in Wumpus-Drawing. The new text objects still has a lot of work to do - rotation for single line text, multi-line "simple" text, ...

Monday, March 28, 2011

wumpus-drawing

Copperbox revision 2264.

Updates Wumpus-Drawing to work with the name changes to Wumpus-Basic.

Note, there is still a fair amount of stubbed code in Wumpus-Drawing that I've still to work through.

wumpus-basic

Copperbox revision 2263.

I've changed the names of the PosImage and ObjectPos modules and datatypes.

As "PosImage" wasn't an Image like say LocImage, calling it PosObject is better. As I didn't want both PosObject and ObjectPos, ObjectPos has become Orientation.

wumpus-basic

Copperbox revision 2262.

First work updating the text objects in Wumpus-Drawing to use the new PosImage type. All the objects are running again, though some operations are currently stubbed out. However, I'm not sure the types are quite right at the moment.

Sunday, March 27, 2011

wumpus-basic

Copperbox revision 2261.

I've added list based concatenation and concat-with-separators to PosImage:

wumpus-basic

Copperbox revision 2260.

I've changed the representation of PosImage to use the new representation.

Also I've deleted PosThetaImage - it wouldn't be able to support concatenation like PosImage. Where Wumpus-Drawing used PosThetaImage for rotated text it will have to put a pre-rotated text LocImage into a PosImage instead.

wumpus-basic

Copperbox revision 2259.

More work on concatenation with alignment for the revised PosImage type.

wumpus-basic

Copperbox revision 2258.

Preliminary work on a new representation of PosImage that supports flexible concatenation.

I haven't worked up the new object enough yet to replace the old one, and I''l have to work out a scheme for writing move vectors that displace the second PosImage - the current way of calculating them says nothing about what is actually going on.

Saturday, March 26, 2011

wumpus-basic

Copperbox revision 2257.

I've added "orthonormal" versions of the LocImage concat combinators to LocThetaImage.

wumpus-basic

Copperbox revision 2256.

Initial work adding concat operations (cf. pretty print libs) to LocImage. I've rather overlooked that LocImage supports concat operations: AdvGraphic naturally supports them but so does LocImage if we just move the start point - LocImage is too primitive to account for a notion of border.

Some of the clunky chain operations in Wumpus-Drawing can be superseded by concat operations on LocImages and other moveable graphic objects.

wumpus

Copperbox revision 2254.

Changes to the directory structure of Wumpus-Drawing's Text modules, also updated PosImage in Wumpus-Basic to support baseline positioning. Both these are a prelude to reworking the Text modules in Wumpus-Basic. I don't intend to work on the internals of Text much, but the current API's are not up to scratch.

Copperbox revision 2255.

Deleted the old directory Wumpus.Drawing.Turtle that had been hanging around since Turtle moved into Wumpus-Drawing's Extras namespace.

Friday, March 25, 2011

wumpus-drawing

Copperbox revision 2253.

Place holder work for drawing axes. Unfortunately, work on axes is going to be dependent on improving the text label API provided by Wumpus.Drawing.Text.

wumpus-drawing

Copperbox revision 2252.

I've re-implemented grid drawing, it is now properly configurable e.g line widths, colours, number of sub-divisions. Also, it uses a new protocol for properties which doesn't need to add extra fields to the DrawingContext. 

wumpus-drawing

Copperbox revision 2251.

Updates to the Text modules to account for function name changes in Wumpus-Basic.

wumpus-basic

Copperbox revisions 2249 and 2250.

I've revised the FontLoader module hierarchy. Also I've changed the representation of CatPrim so it is just a newtype and changed the textline functions to have long winded names - the previous names will probably be reclaimed by Wumpus-Drawing.

Thursday, March 24, 2011

zmidi-emit

Copperbox revision 2248.

I've changed some of the data type and function names - hopefully the revised names are less arbitrary.

wumpus-drawing

Copperbox revision 2247.

I've fixed the bug with Shapes where the anchor calculation was wrong after affine transformation. There was also a bug in the CtxTranslate instances in Wumpus-Basic for Points, Vectors and BoundingBoxes.

wumpus-drawing

Copperbox revision 2246.

I've updated Shapes to work with the new affine transformation scheme. Unfortunately anchor calculation has a bug at the moment...

wumpus-basic

Copperbox revision 2245.

I've changed affine transformations to be monomorphic, operating only on Images and Graphics (Graphic is a special case of Image).

This is quite a radical step - while it makes Wumpus less expressive, it does make a lot of sense. Now affine transforms are can only be performed on things that are tangibly within an affine frame. Previously, a LocImage could be transformed even though it isn't really an affine object until it's placed with the `at` operator.

Pragmatically, limiting the affine operations to a single type removes the all the problems with the affine type classes and their horrible contexts to enforce units. That said, Wumpus still needs helper classes for transformations in Wumpus-Core (the DRotate family) and it currently has the CtxRotate family of classes, though the latter might be replaceable as they are just functorial operations.

Wednesday, March 23, 2011

wumpus-basic

Copperbox revision 2244.

I've implemented affine instances for the Context Funs and reworked the Affine classes to allow them. The classes are unfortunately rather convoluted - I've had to re-introduce DUnit. Essentially they are just sufficient to get the named operations "rotate", "scale" etc. working, they don't embody a valuable structural coherence.

wumpus-basic

Copperbox revision 2243.

First work re-instating affine operations. It looks like I will need two type classes for each operation (scale, rotate...) one for contextual types that know the current font size (e.g Image, LocImage) and a non-contextual one for Points, Vectors etc. that passes in font size as an extra parameter so units can be interpreted explicitly.

This is obviously not ideal...

wumpus-core

Copperbox revision 2242.

I've changed the affine transformation naming scheme to use a d prefix rather than affine - the new version is both shorter and more indicative (providing you know d stands for Double...).

Tuesday, March 22, 2011

wumpus-basic

Copperbox revision 2241.

I've trivially updated Wumpus-Basic to work with the affine transformation changes to Wumpus-Core. However, I haven't looked at the affine instances yet, instead I've just commented out the old code until I decide on new implementations of Rotate, Scale etc.

wumpus-core

Copperbox revision 2240.

I've removed the Boundary type class. It was introducing a FunDep that I don't think I was using properly, also it should probably be re-implemented in Wumpus-Basic to be unit / context aware if it is still useful to higher layers.

wumpus-core

Copperbox revision 2239.

I've devalued the affine transformations in Wumpus-Core - that is, I've given the existing classes longer, more cumbersome names in the expectation that higher-level software will define its own affine operations and want the good names - scale, rotate, translate etc.

Because Wumpus-Core is oblivious to context for contextual units, its makeshift unit handling via the class PsDouble was actually counter-productive (making things more complicated). So I've removed the Unit module where PsDouble was defined as part of this work.

wumpus-rhythm

Copperbox revision 2238.

I've updated Wumpus-Rhythm to work with the Font Loader changes in Wumpus-Basic and Wumpus-Drawing.

wumpus

Copperbox revision 2237.

I've changed the representation of "safe" / loadable fonts. This means Wumpus-Basic no longer needs the GhostScript font map, instead the "Safe Fonts" module - now called StandardFontDefs - resolves the GhostScript file names. If the font name mapping is wrong for a alternative version of GhostScript (Wumpus is developed with 8.54) a different module to StandardFontDefs can be defined and imported instead.

Monday, March 21, 2011

wumpus-drawing

Copperbox revision 2236.

I've updated the demos in Wumpus-Drawing to use the new FontLoader module.

wumpus

Copperbox revision 2235.

Initial work on a top level font loader.

The font loading code in the demos is too convoluted, so it's time I improved it. I'd been resisting doing this because I didn't want the font loader API to depend on environment variables, but I've decided its better to use environment variables if the overall code is better.

Sunday, March 20, 2011

wumpus

Copperbox revision 2234.

I've added offsets to the connect source and destination so they can draw parallel lines.

Here is a drawing of the latest Connectors demo:

wumpus

Copperbox revision 2233.

I've added support for separators at the source and destination of connectors to add spacing if required. Plus I've added the first "box" - an idea from PSTricks, boxes have a connector-like API but instead of connecting with a line they draw a box around the source and destination.

wumpus

Copperbox revision 2232.

More work on connectors, including a loop and double right-angles.

wumpus

Copperbox revision 2231.

Initial work re-implementing connectors. In Wumpus-Drawing I've started a new directory for connectors as they are different to paths. More code will move into this directory as work continues. The new connectors have drawing properties in the DrawingContext - this will have them more convenient to use in drawings.

Saturday, March 19, 2011

wumpus

Copperbox revision 2230.

I've renamed the vertexPath and curvedPath functions in Wumpus-Basic so I use the names for the operations on the Path data type in Wumpus-Drawing. I'm working on improving connectors in Wumpus-Drawing and the public Path operation names were just too ugly.

wumpus-drawing

Copperbox revision 2229.

I've updated the demos to work with the latest changes to Wumpus-Basic. I think I've restored all the code in the demos that got commented out during the unit changes.

wumpus-basic

Copperbox revision 2228.

I've updated the TraceDrawing API so it favours Anchors as opposed to Points. This seems to make sense as for all but simple draws, positioning is expected to be mostly by anchors (derived from objects) rather than explicit points.

Friday, March 18, 2011

wumpus

Copperbox revision 2227.

I've changed the text_margin in the Drawing Context, the previous value was much too large. Also I've updated the Automata example so the loops and labels draw again.

wumpus-rhythm

Copperbox revision 2226.

Updated to work with changes to Wumpus-Basic and Wumpus-Drawing.

wumpus-drawing

Copperbox revision 2225.

I've updated the rest of Wumpus-Drawing to work with the changes back to ContextFun in Wumpus-Basic. The examples are working again - but there is still some commented out code where unit changes have "monadized" some operations.

wumpus-drawing

Copperbox revision 2224.

First round of work updating the code to work with the latest Wumpus-Basic. Arrows and dots are updated.

Thursday, March 17, 2011

wumpus-basic

Copperbox revision 2223.

I've added affine instances for the graphic objects. Unfortunately the have horrible class contexts, but they seem to work.

wumpus-basic

Copperbox revision 2222.

I've systematized the unit conversion operators - arity versions are in ContextFun, aliases with meaningful names are in the respective graphic object modules.

wumpus-basic

Copperbox revision 2221.

I've added back ContextFun and changed the graphics objects to use the respective arity CF function.

There were semantic problems with the Object type class having unit and bind that are removed by going back to ContextFuns. The drawback seems to be that I can't build an overloaded unit converter function, also affine translations on ContextFuns are still to do...

Wednesday, March 16, 2011

wumpus

Copperbox revision 2220.

I've tidied up the spare operations on the graphic objects in Wumpus-Basic - by spare I mean operations that aren't in the Basis interface.

wumpus-rhythm

Copperbox revision 2219.

I've updated the Djembe code to work with the unit changes to the Wumpus libraries. The test drawing now seems to work properly, so it seems show that the last twenty days work has been useful.

wumpus-drawing

Copperbox revision 2218.

All the examples now compile again, though some have code commented out. This is because Anchors have become monadic, so the APIs to use them need to change.

wumpus

Copperbox revision 2217.

More work updating Wumpus-Drawing to work with the unit changes to Wumpus-Basic. The examples up to IterDraw now compile, though I've had to comment out some code in Automata that needs a re-think.

Tuesday, March 15, 2011

wumpus-drawing

Copperbox revision 2216.

I've updated all the shapes to work with the unit changes to Wumpus-Basic. Lots of the code is quite scruffy - I've concentrated on getting it to compile, rather than tried to re-think it (even though it merits a re-think).

wumpus

Copperbox revision 2215.

More work updating Wumpus-Drawing. I've got the first couple of shapes updated, although doing this highlighted a problem that Wumpus-Core defines potentially bad instances for the affine instances for Point, Vec2 and BoundingBox - it defines them with a polymorphic unit constrained by the PsDouble class. This is not universal.

wumpus

Copperbox revision 2214.

Work getting Wumpus-Drawing to work with the unit and representation changes in Wumpus-Basic. Some more demos now compile, but the NewText demo at least has drawing errors.

wumpus-drawing

Copperbox revision 2213.

First round of work updating to compile with latest changes to Wumpus-Basic.

wumpus-basic

Copperbox revision 2212.

I've replaced the ArgN type functions with ArgDiff - a type function representing the different in arguments between Objects e.g a LocImage and an Image has ArgDiff of a Point.

ArgDiff seems more flexible than the positional ArgN type functions.

wumpus-basic

Copperbox revision 2211.

More work on bindQuery classes - I've now sorted it out so the arity 1, 2 and 3 cases are regular. The DrawingPrimtives code is now as good as I will get it - it's a pity the Wumpus-Basic objects cannot be functors but accepting this, the notation in DrawingPrimitives is quite good. 

wumpus-basic

Copperbox revision 2210.

First work overloading bindQuery. I've made a new notation for arity 1 and arity 2 cases - unfortunately the current classes are quite different. I'll see if I can revise the definition of the arity 1 case so it is in line with arity 2. The code that uses the new overloaded combinators in DrawingPrimtives is a lot more pleasant.

wumpus-basic

Copperbox revision 2209.

I've managed to implement the promote and lift arity families of functions as classes with type families. The implementations are a bit far out, but the syntactic convenience is gets some way back towards the old Context Functions.

Monday, March 14, 2011

wumpus-basic

Copperbox revision 2208.

I've re-introduced the DUnit type family. I want to see if I can improve the bind-query interface with type families, so I've removed the fundep use in TraceDrawing - DUnit takes the place of the fundep.

wumpus-basic

Copperbox revision 2207.

I've combined the UMonad, LocalCtx, Annotate, ImageAns and Hyperlink classes that all work on the Image types into one class. This makes logical sense, they are compatible and I was forgetting to define all the separate classes for every object.

wumpus-basic

Copperbox revision 2206.

I've made the queries in the QueryDC module polymorphic again so they can run in TraceDrawing or Query without lifting functions. Having lifting functions made the code horrible.

wumpus-basic

Copperbox revision 2205.

I've removed the UnitConvertExt typeclass - all the instances were the same so the functionality is now implemented with afunction uconvertF that relies on Functor / fmap.

Sunday, March 13, 2011

wumpus

Copperbox revision 2204.

More work updating Wumpus-Drawing to work with the unit changes in Wumpus-Core and Wumpus-Basic. The first shapes - Circle and Diamond - are updated and compiling again.

wumpus-basic

Copperbox revision 2203.

I've had to make Anchors monadic Queries rather than pure functions. Shapes in Wumpus-Drawing now need to interpret the unit size within the Drawing Context so they can produce anchors, hence the type had to change.

wumpus

Copperbox revision 2202.

More work on updating Wumpus-Drawing to use the new Image types from Wumpus-Basic.

Saturday, March 12, 2011

wumpus

Copperbox revision 2201.

I've started work updating Wumpus-Basic to compile with the unit changes to Core and Basic. Not having a nice infix bind operator is beginning to look like a problem - I don't have a bind as I'm moving between different types which are roughly the same reader/writer monad. One improvement might be to do away with the LocQuery and LocThetaQuery objects if I can.

wumpus-basic

Copperbox revision 2200.

I've added the SVG "font delta" optimization to the TraceDrawing monads. This groups font attributes at a higher level in the SVG tree, so child elements don't have to print "font family" "font size" etc. on every text element.

wumpus-basic

Copperbox revision 2199.

More work filling out the reworked Image types and updates to the QueryDC module so it uses only the InterpretUnit type class for unit conversion. Previously QueryDC had two versions of each function to deal with contextual units (em, en, ...) and absolute units (PostScript point - Double, centimeter, ...).

Friday, March 11, 2011

wumpus-basic

Copperbox revision 2198.

Work on systematizing the combinators for Image, LocImage etc. I think I'm happy with the new formulation - basically they are the combinators from the superseded ContextFun module with some work on the naming scheme as there are arity differences and so they can't be type class methods.

wumpus-basic

Copperbox revision 2197.

I've implemented the wrapped primitive change hinted at yesterday, to enable monadic operations on Images and Graphics. Because I need to pass unit information at the type level, using the Monad class is ruled out so I have my own class UMonad. Naturally I loose the do-notation.

Thursday, March 10, 2011

wumpus-basic

Copperbox revision 2196.

I've updated Displacement and PosImage so now all the modules are changed to use the new Image types, although some functions are commented out and the Image constructors need systematizing.

wumpus-basic

Copperbox revision 2195.

I've think I've updated AdvanceGraphic to work with the new Image types - as it needs Displacement to work I haven't been able to test it. The code is somewhat strange as I've had to build a special binding combinator for Images. Images cannot support return as there is no empty Primitive - images are like writer except they are a semigroup on the logging answer rather than a monoid. So while its possible to implement bind, it is not so useful as a combinator - it can only consume initial input, it can't reuse it. Thus I've had to make "opbind", which is essentially:

 opbind op gf fn = let a = run gf in let b = run (fn a) in a `op` b

Update - I've worked out a scheme to get back monadic return and bind by changing the representation of primitives in Wumpus-Basic to make them a monoid rather than a semigroup. However I won't implement it until I've changed Displacement and PosImage to use the new Image types.

wumpus-basic

Copperbox revision 2194.

I've updated Bounded to work with the new Image types. Still to update are AdvanceGraphic, Displacement and PosImage.

wumpus-basic

Copperbox revision 2193.

I've completely re-worked the Image and Graphic objects to transparently support units - even contextual ones like em and en. This has meant removing the ContextFun types and instead coding Image, LocImage, Connector as singular newtype wrapped functions.

To support answers with the type system enforcing the unit type the new objects are no longer functors. Actually they weren't really functors previously - but the underlying CF1, CF2, CF3 context funs were. The result of this is that combining the new objects needs special purpose combinators as bind, fmap etc. can no longer be used. I've coded enough combinators to translate the drawing primitives but I haven't treated them systematically.

Also some of the objects - Bounded, PosImage, AdvGraphic and the displacement functions - haven't yet been updated. Currently only the new demo VerySimple.hs works.

Wednesday, March 9, 2011

wumpus-core

Copperbox revision 2192.

I've specialized RotateAbout and its derived functions so the point-of-rotation has Double for the unit - i.e. it represents PostScript points.

This helps instances with more general units as they are translating into a specific type/unit rather than a polymorphic one. It also seems to make seems given that translate is fixed to PostScript points - rotate-about can be seen as a translate, rotate, then reversed translate.

Tuesday, March 8, 2011

wumpus-basic

Copperbox revision 2191.

I've added an in-progress experiment with new Image and Graphic types. The new types avoid the (conceptual) overhead of ContextFuns which made the old types functors (good - lots of predefined operators) but otherwise added complexity to the types.

The main problem with the new types, which I haven't addressed yet, is that within their newtype wrappers they have different arities - this means any classes that operate on them will have very exotic types and two are illustrated below. Maybe I'll switch to parametrized modules instead, but they lack convenience - operators cannot be infix as they are always a record selector projecting on a concrete instance.


class Annotate t s | t -> s where
  annotate  :: t r u -> s u -> t r u
  decorate  :: t r u -> (r u -> s u) -> t r u
   
class IgnoreAns t s | t -> s where
  ignoreAns :: forall (u :: *) (r :: * -> *). t r u -> s u
  replaceAns :: r1 u ->  t r u -> t r1 u

Monday, March 7, 2011

wumpus-basic

Copperbox revision 2190.

More work on the absolute and relative unit functions for the base objects. Plus removing the CtxSize instances for the absolute units Double and Centimer - this will make for better distinction at the type level.

wumpus-basic

Copperbox revision 2189.

I've fleshed out the DrawingPrimtives module so all the relevant functions have AU (absolute units) and RU (relative units) versions.

All the other objects - BoundedGraphic, AdvanceGraphic, ... - will need AU and RU versions.

Sunday, March 6, 2011

wumpus-basic

Copperbox revision 2188.

The dichotomy between relative and absolute units has larger consequences for Wumpus-Drawing than I realized, so I'm extending the query and drawing primitive modules in Wumpus-Basic to include functions for both units where necessary.

Because absolute units can implement the CtxSize class by ignoring the scaling factor, I initially imagined that higher-level objects could all just use CtxSize. However, this doesn't work for shapes as CtxSize doesn't work with affine transformations nicely. Also Trace Drawings seem to make more sense when limited to absolute units.

wumpus-basic

Copperbox revision 2187.

I've changed code - mostly queries on the DrawingContext but also TraceDrawing - to use CtxSize rather than PsDouble as the constraint on units. Using CtxSize allows types of drawing to be made with Em, En etc.

Saturday, March 5, 2011

wumpus-core

Copperbox revision 2186.

I've renamed some of the path functions in the Picture module.

wumpus-basic

Copperbox revision 2185.

I've updated Wumpus-Basic to work with the AfmUnit changes to Wumpus-Core.

Note - almost all the graphic queries in Wumpus-Basic use PsDouble rather then CxSize as the class constraint on the polymorphic unit. This is now wrong, but I'm not sure when I'll change it.

wumpus-core

Copperbox revision 2184.

I've re-worked the AfmUnit (previously PtScale) data type. It now seems to make more numeric sense - a value of 600 represents 600 Units (where a Point is 1000). Previously this value would be 0.6, but as font files express values as 600 etc. it makes sense to follow their example.

wumpus-core

Copperbox revision 2183.

I've tidied up the unit code removing the PsPoint type - this was a newtype wrapper over Double to indicate that it properly represented PostScript's point unit. However I felt it was actually adding more noise rather than clarifying things.

Friday, March 4, 2011

wumpus-basic

Copperbox revision 2182.

More work on units - I've added a new example AltUnits which seems to work for Em and Em units. Free combination of units in a TraceDrawing seems to work correctly too.

wumpus-basic

Copperbox revision 2181.

I've changed drawing to work with contextual units - that is units that potentially have access to the current font size. This means I should be able to define em and en for example that are scaling factors of Point size rather than regular scalar units like PostScript point or centimeter. 

This is just the first round of work, I haven't yet looked at displacement or what to do about answer types (e.g the bounding boxes returned by a PosGraphic). 

wumpus-core

Copperbox revision 2180.

I've changed the Picture API so all the functions that operate with sizes are fixed to Double for the unit. This pushes supporting parametric units (or not) to clients, which seems sensible for two reasons. Firstly, the annotation burden with the previous function signatures was too high. Secondly, units need careful thought - so it is better to handle them properly in client code than present a half solution in Wumpus-Core.

Thursday, March 3, 2011

wumpus-drawing

Copperbox revision 2179.

Updated to work with the unit changes to Wumpus-Core and Wumpus-Basic. Only a couple of the demos have been updated, the rest won't currently work.

wumpus-basic

Copperbox revision 2178.

I've reworked the unit conversion code again. This time I think it works with "contextual units" like Em and En which are really scaling factors of the current point size, though I have to get Wumpus-Drawing and Wumpus-Rhythm back up to speed before I can test it.

wumpus-basic

Copperbox revision 2177.

I've changed the Image and ImageAns types so the answer of an Image is always parametric on the unit u.

Possibly this will be restricting - but it seems it will be the only way to change the units of an Image. So far the Image answers in Wumpus are all parametric on unit: BoundingBox - answer of BoundedGraphic, Vec2 - answer of AdvGraphic, Ellispe and the other shapes.

wumpus

Copperbox revision 2176.

More work on unit conversion - I've added an automatic type specialization class Unit to Wumpus-Core, but in practice it seems to be less useful than I thought.

I've updated the UnitConvert module in Wumpus-Basic, however, the functionality here cannot handle contextual units (em, en, etc.). It looks like I'll have to add some interpretation of units to the Dislacement and DrawingPrimtives modules instead.

Wednesday, March 2, 2011

wumpus-basic

Copperbox revision 2175.

I've changed the unit tracking strategy at the type level. It's an improvement, though I haven't managed to simplify the types (which I was hoping to do as well).

Tuesday, March 1, 2011

wumpus-core

Copperbox revision 2174.

I've updated the demos to work with the revision to the Picture types and added a compatibility module of unit specialized constructors. This should lessen some of the type annotation burden that the new changes have imposed.

wumpus-core

Copperbox revision

I've changed the internal Picture representation to fix the unit to Double (PostScript point) rather than be parametric.

The previous changes to better support units didn't actually improve matters for Wumpus-Rhythm, so I've been re-thinking the types in their entirety. The first result is I no longer think Picture, PrimPath etc. warrant being parametric by unit. As they are final types - used for generating output, opaque and only marginally transformable - it looks like they can be fixed to Double without loosing any functionality. This simplifies Wumpus-Core - no need for the DUnit type family hack; and it stops the Picture types being artificially functorial. The downside is that Points in drawings will need more type annotation.

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.