diagrams/diagrams-core — pull request #36 by bergey (2013-03-22 19:37:43+00:00)
Title: onBasis gets the matrix equivalent of the Transformation

closes #22

This is a helper function to avoid writing the same code for every backend and every vector space. It makes a couple of assumptions about HasBasis implementations, which are true of the instances in Data.Basis and Diagrams, but might not be true in general:

- that decompose returns all basis functions, not just those with non-zero coefficients

- that the basis functions are returned in a meaningful order

The new function onBasis returns a list of vectors. The length of the list should be the same as the number of components in each vector, but that is not explicit in the type. The specialized version in TwoD.Transform returns a pair of vectors, instead of a list. (See next pull request, against diagrams-lib.)

This code ended up being identical to that in Diagrams.Backend.Show renderTransf. The diagrams-lib pull request modifies that function to use the new onBasis function.