AlbertoRuiz/hmatrix — pull request #4 by reinerp (2011-12-30 23:45:49+00:00)
Title: QuasiQuotes for hmatrix

This pull request implements vec and mat quasiquoters for hmatrix. The syntax follows that of the (currently out-of-date) hmatrix-static.

* I realise that supporting quasiquoters would add significant dependencies to hmatrix, namely Template Haskell and haskell-src-exts. If this dependency is too burdensome, then I will instead release the code as a separate package, hmatrix-syntax.

* This pull request is dependent on https://github.com/benmachine/haskell-src-meta/pull/10 and https://github.com/mboes/th-lift/pull/5

* Note that we depend on template-haskell-2.7, which comes with GHC 7.4. We do not support earlier versions of template haskell, because they do not support "unresolved infix" expressions, which are essential for getting the operator fixities correct in quasiquoters. (This is a somewhat subtle point to explain; see http://hackage.haskell.org/trac/ghc/ticket/4430)

* I have broken up the code into two commits. The first commit implements the quasiquoters by converting to lists and back; the second commit reimplements the quasiquoters using direct unchecked array accesses, for efficiency.