colah/ImplicitCAD — pull request #56 by matthewSorensen (2012-08-25 20:03:36+00:00)
Title: Convert output formats to use Data.Text.Lazy and SVG combinator library

While poking around with the internals of ImplicitCAD in order to develop a package that adds [GHCLive](https://github.com/shapr/ghclive) support\*, I noticed that all of the functions that convert objects to various output formats directly concatenate strings. In order to reduce memory consumption and accelerate the output process, I converted everything to either use Data.Text.Lazy builders or (in the case of SVG) special combinator libraries.

The largest impact these commits have is the introduction of a few new dependencies:

* text >= 0.11.1.0. As your convention for dependencies seems be not specifying package versions, I omitted this requirement from implicit.cabal - however, it won't compile with anything less than 0.11.1.0.

* blaze-svg, which in turn requires blaze-markup >= 0.5

* mtl, in order to provide the Reader monad.

Otherwise, there are no public-facing API changes at this time - although starting a discussion about refactoring the output API seems smart.

Note that I couldn't find particularly good test cases for openscad output - especially for objects that invoke the ExtrudeRM codepath. I suspect this module is correct, but some more verification wouldn't hurt.

\* This may just be the killer application for GHCLive - it's a really cool combination!