Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
onBasis gets the matrix equivalent of the Transformation #36
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:
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.