Tuesday, January 7, 2014

config-check

Copperbox revision 3072.

I've implemented a new combinator imall to apply a checker to all members of an IntMap based an all in Data.List. Unfortunately imall has an operational leak when combined with pattern matching on cases - we must know that uninteresting cases have to produce True so that all (interesting) cases can be combined to produce True for a successful check.

Ideally I'd like to avoid pattern matching for uninteresting cases but as pattern matching is built-in to Haskell this would generate Non-exhaustive pattern exceptions.

Monday, January 6, 2014

config-check

Copperbox revision 3071.

I've added an onlyif combinator that proceeds only if the initial guard is true, but doesn't fail if it isn't. This will allow conditional checkers that don't produce warnings if they aren't relevant.

I've had to change the internal answer type from a simple Either to accommodate the short-circuit success that onlyif needs.

Sunday, January 5, 2014

config-check

Copperbox revision 3070.

Minor style changes to improve writing checkers - the path operator[*] has been given a very low precedence which lets it play well with the Applicative combinators.

Added an mget combinator to make projections (gets) returning Maybe values deterministic - code can act as if the projection is successful, if it has failed it is transparently caught by the underlying Either monad.


[*] The path operator has changed its ASCII name. The current name may not be final - naming ASCII operators is a bane of programming in Haskell.

config-check

Copperbox revision 3069.

More work on ConfigCheck, particularly it now has a run function that runs multiple checkers on a configuration and returns a list of failures.

Also, it seems (top-level) pattern matching would not be that valuable for writing checkers - configs are expected to have many fields so pattern matching is cumbersome. This is fine - it means there is not much loss of clarity / directness if we bury the config in a Reader monad (which forfeits top-level pattern matching).

Saturday, January 4, 2014

config-check

Copperbox revision 3068.

A new project / tool for validating configurations.

A configuration is some user data represented as normal Haskell datatypes - however it is expected that configurations will already contain some errors (or at least bad smells) - after all, the configuration may originally be specified in XML, as text etc. Thus, the standard Haskell Way of developing highly refined datatypes with advanced type system features that prevent errors won't work for us, instead ConfigCheck tests instantiated simple datatypes (configurations) with Lint-like rules that identify bad or erroneous data.

The core of ConfigCheck is a static parser monad - i.e. a parser monad that doesn't consume input (it is expected to make multiple, user-directed passes over the Config datatypes). Designing the static parser monad is easy; designing a good API / set of combinators to specify rules already looks more challenging. I'm not sure the API should even look like the regular parser monad combinators Haskell programmers are used to.

Wednesday, January 1, 2014

OpenVG-0.7.0 and OpenVGRaw-0.4.0 - new releases

Copperbox revision 3067.

I've made new releases of OpenVG and OpenVGRaw for Hackage. These fix build problems encountered with GHC 7.6.3 and work with Platform 2013.2.0.0.

OpenVG and OpenVGRaw

Copperbox revisions 3065 and 3066.

I've updated the Windows install instructions. Revision 3065 mixed up changes between OpenVG and OpenVGRaw - revision 3066 fixed this slip.


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.