The linear-grammar package

[Tags:bsd3, library, test]

This library provides some simple tools for building abstract syntax trees, representing linear equations and (inclusive) inequalities. As an example:

 12x + 3y - 4z + 12 <= 43x - 7b + 8q

Would look like...

 f = (12 :: Rational) .*. EVar "x" .+.
     (3 :: Rational) .*. EVar "y" .+.
     (-4 :: Rational) .*. EVar "z" .+.
     ELit 12
     .<=.
     (43 :: Rational) .*. EVar "x" .+.
     (-7 :: Rational) .*. EVar "b" .+.
     (8 :: Rational) .*. EVar "q"

I've added some overloading functionality, to help ease the verbosity of the above statements - an IsString instance, and some other utilities. To pack the equation into standard form, use the sandardForm function:

 stdF = standardForm f

Properties

Versions 0.0.0.1, 0.0.0.2, 0.0.0.3, 0.0.0.4, 0.0.0.5, 0.0.0.6, 0.0.0.7, 0.0.1, 0.0.1.1, 0.0.1.2, 0.0.1.3, 0.0.1.4, 0.0.1.5, 0.0.1.6, 0.0.2, 0.0.2.1 (info)
Dependencies base (>=4.6 && <5), containers, QuickCheck [details]
License BSD3
Author Athan Clark <athan.clark@gmail.com>
Maintainer Athan Clark <athan.clark@gmail.com>
Stability Unknown
Category Math, Algebra
Source repository head: git clone https://github.com/athanclark/linear-grammar.git
Uploaded Sat Jun 13 14:27:27 UTC 2015 by athanclark
Distributions NixOS:0.0.2.1
Downloads 1472 total (25 in the last 30 days)
Votes
0 []
Status Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees