hmatrix-syntax-0.1.2.1: MATLAB-like syntax for hmatrix vectors and matrices

Safe HaskellNone

Data.Packed.Syntax

Description

The main import. Modules using these quasiquoters need the following language pragma:

 {-# LANGUAGE QuasiQuotes, ViewPatterns #-}

Synopsis

Documentation

vec :: QuasiQuoterSource

Quasiquoter for vectors. For example, use as an expression:

 buildVec x = [vec| x, sin x |]

or use as a pattern:

 swap [vec| x, y |] = [vec| y, x |]

mat :: QuasiQuoterSource

Quasiquoter for matrices. For example, use as an expression:

 buildMat x y = [mat| x,     y;
                      x + y, sin y |]

or use as a pattern:

 adjugateMat2 [mat| a, b; c, d |] = [mat| d, -b; -c, a |]

If row sizes don't match, this will be caught at compile time.