This follows the approach taken in Brent Yorgey's diagrams package, using Conal Elliott's vector-space classes. This allows us to get rid of the rather unidiomatic and arguably overly-polymorphic Graphics.Implicit.SaneOperators. Since this has been removed, we can now begin pulling out the many type annotations strewn about the codebase. The recently introduced Criterion benchmark confirms that this has no measurable effect on performance, Before After Object 1/STL write 235.7 ± 9.3 ms 236.0 ± 12.8 ms Object 2/STL write 1.54 ± 0.99 ms 1.44 ± 0.28 us Note that I make no attempt to enforce any separate between AffineSpaces and VectorSpaces here. This is work for a later patch. Additionally, a small performance gain may be had by strictifying and unpacking the fields of R3 and R2. This, however, would require that a `data` type be defined and all packing/unpacking of vectors would need to happen with the appropriate data constructor. Given this is even more invasive a change than the current patch, this is left as future work. Conflicts: Graphics/Implicit/Export/RayTrace.hs Graphics/Implicit/ObjectUtil/GetImplicit3.hs
Fixes, Graphics/Implicit/Export/RayTrace.hs:213:65: Couldn't match type `ℝ' with `Int' When using functional dependencies to combine Additive ℕ ℝ ℝ, arising from the dependency `a b -> c' in the instance declaration at Graphics/Implicit/SaneOperators.hs:92:10 Additive Int ℝ Int, arising from a use of `+' at Graphics/Implicit/Export/RayTrace.hs:213:65 In the first argument of `xy', namely `(a + s)' In the second argument of `($)', namely `xy (a + s) (b + s)' I'm not sure how this could have worked previously. Perhaps this is a GHC 7.6-ism?
* Actual changes to the language have been held back till future commits, so this should be backwards compatible. * A proper AST intermediary stage. We now go: Code -> AST -> Execution ... instead of doing interpretation during parsing, which was a really horible idea. * We now use De Brujin indices for function arguments, instead of modifying the VarLookup and looking up every single symbol every function call. * Execution code has been cleaned up using the State monad. * Big performance increases on execution! This can mean big performance differences rendering objects that depend on functions.