https://wiki.haskell.org/api.php?action=feedcontributions&user=Liquen&feedformat=atomHaskellWiki - User contributions [en]2021-07-30T01:38:03ZUser contributionsMediaWiki 1.27.4https://wiki.haskell.org/index.php?title=Numeric_Prelude&diff=46369Numeric Prelude2012-07-09T17:33:35Z<p>Liquen: /* Overview */</p>
<hr />
<div>Numeric Prelude provides an alternative numeric type class hierarchy,<br />
which also makes use of type features beyond Haskell 98, e.g. [[multi-parameter type class]]es.<br />
<br />
== Overview ==<br />
<br />
The hierarchy of numerical type classes is revised and oriented at algebraic structures. Axiomatics for fundamental operations are given as QuickCheck properties, superfluous super-classes like <hask>Show</hask> are removed, semantic and representation-specific operations are separated, the hierarchy of type classes is more fine grained, and identifiers are adapted to mathematical terms.<br />
<br />
There are both certain new type classes representing algebraic structures and new types of mathematical objects. Currently supported algebraic structures are<br />
* group (additive),<br />
* ring,<br />
* principal ideal domain,<br />
* field,<br />
* algebraic closures,<br />
* transcendental closures,<br />
* module and vector space,<br />
* normed space,<br />
* lattice,<br />
* differential algebra,<br />
* monoid.<br />
<br />
There is also a collection of mathematical object types, which is useful both for applications and testing the class hierarchy. The types are<br />
* lazy Peano number,<br />
* arbitrarily quantified non-negative lazy number (generalisation of Peano number),<br />
* complex number, quaternion,<br />
* residue class,<br />
* fraction,<br />
* partial fraction,<br />
* numbers equipped with physical units in two variants:<br />
** dynamically checked units,<br />
** statically checked dimension terms (E.g., speed can be expressed by type argument <hask>Mul Length (Recip Time)</hask>. This is overly restrictive but does not require type extensions.)<br />
* fixed point arithmetic with respect to arbitrary bases and numbers of fraction digits,<br />
* infinite precision number in an arbitrary positional system as lazy lists of digits supporting also numbers with terminating representations,<br />
* polynomial, power series, Laurent series<br />
* root set of a polynomial,<br />
* matrix (basics only),<br />
* algebra, e.g., multi-variate polynomial (basics only),<br />
* permutation group.<br />
<br />
Due to Haskell's flexible type system,<br />
you can combine all these types,<br />
e.g., fractions of polynomials, residue classes of polynomials,<br />
complex numbers with physical units,<br />
power series with real numbers as coefficients.<br />
<br />
Using the revised system requires hiding some of the standard functions<br />
provided by Prelude, which is fortunately supported by GHC.<br />
The library has basic Cabal support<br />
and a growing test-suite of QuickCheck tests<br />
for the implemented mathematical objects.<br />
<br />
Each data type now resides in a separate module.<br />
Cyclic dependencies could be eliminated by fixing some types in class methods.<br />
E.g., power exponents became simply Integer instead of Integral,<br />
which has also the advantage of reduced type defaulting.<br />
<br />
== Future plans ==<br />
<br />
The code still misses proper linear algebra code.<br />
<br />
A still unsolved problem arises for<br />
residue classes, matrix computations, infinite precision numbers,<br />
fixed point numbers, and others.<br />
It should be possible to assert statically<br />
that the arguments of a function are residue classes with<br />
respect to the same divisor, or that they are vectors of the same size.<br />
Possible ways out are encoding values in types or local type<br />
class instances. The latter one is still neither proposed nor<br />
implemented in any Haskell compiler.<br />
The modules are implemented in a way to keep all options open.<br />
That is, for each number type there is one module<br />
implementing the necessary operations<br />
which expect the context as a parameter.<br />
Then there are several modules<br />
which provide different interfaces through type class instances<br />
to these operations.<br />
<br />
<br />
== Links ==<br />
<br />
{{PackageInfoBox|name=numeric-prelude|darcs-code=numeric-prelude/}}<br />
<br />
* [http://projects.haskell.org/cgi-bin/mailman/listinfo/numeric-prelude Mailing list]<br />
* [http://trac.haskell.org/numeric-prelude/ Bug and Feature Tracker]<br />
* [http://haskell.org/communities/05-2008/html/report.html#numericprelude HCAR report]<br />
<br />
== See also ==<br />
<br />
* [[Mathematical prelude discussion]]<br />
<br />
[[Category:Mathematics]]</div>Liquenhttps://wiki.haskell.org/index.php?title=Numeric_Prelude&diff=46368Numeric Prelude2012-07-09T17:33:15Z<p>Liquen: /* Overview */</p>
<hr />
<div>Numeric Prelude provides an alternative numeric type class hierarchy,<br />
which also makes use of type features beyond Haskell 98, e.g. [[multi-parameter type class]]es.<br />
<br />
== Overview ==<br />
<br />
The hierarchy of numerical type classes is revised and oriented at algebraic<br />
structures. Axiomatics for fundamental operations are given as QuickCheck properties, superfluous super-classes like <hask>Show</hask> are removed, semantic and representation-specific operations are separated, the hierarchy of type classes is more fine grained, and identifiers are adapted to mathematical terms.<br />
<br />
There are both certain new type classes representing algebraic structures and new types of mathematical objects. Currently supported algebraic structures are<br />
* group (additive),<br />
* ring,<br />
* principal ideal domain,<br />
* field,<br />
* algebraic closures,<br />
* transcendental closures,<br />
* module and vector space,<br />
* normed space,<br />
* lattice,<br />
* differential algebra,<br />
* monoid.<br />
<br />
There is also a collection of mathematical object types, which is useful both for applications and testing the class hierarchy. The types are<br />
* lazy Peano number,<br />
* arbitrarily quantified non-negative lazy number (generalisation of Peano number),<br />
* complex number, quaternion,<br />
* residue class,<br />
* fraction,<br />
* partial fraction,<br />
* numbers equipped with physical units in two variants:<br />
** dynamically checked units,<br />
** statically checked dimension terms (E.g., speed can be expressed by type argument <hask>Mul Length (Recip Time)</hask>. This is overly restrictive but does not require type extensions.)<br />
* fixed point arithmetic with respect to arbitrary bases and numbers of fraction digits,<br />
* infinite precision number in an arbitrary positional system as lazy lists of digits supporting also numbers with terminating representations,<br />
* polynomial, power series, Laurent series<br />
* root set of a polynomial,<br />
* matrix (basics only),<br />
* algebra, e.g., multi-variate polynomial (basics only),<br />
* permutation group.<br />
<br />
Due to Haskell's flexible type system,<br />
you can combine all these types,<br />
e.g., fractions of polynomials, residue classes of polynomials,<br />
complex numbers with physical units,<br />
power series with real numbers as coefficients.<br />
<br />
Using the revised system requires hiding some of the standard functions<br />
provided by Prelude, which is fortunately supported by GHC.<br />
The library has basic Cabal support<br />
and a growing test-suite of QuickCheck tests<br />
for the implemented mathematical objects.<br />
<br />
Each data type now resides in a separate module.<br />
Cyclic dependencies could be eliminated by fixing some types in class methods.<br />
E.g., power exponents became simply Integer instead of Integral,<br />
which has also the advantage of reduced type defaulting.<br />
<br />
== Future plans ==<br />
<br />
The code still misses proper linear algebra code.<br />
<br />
A still unsolved problem arises for<br />
residue classes, matrix computations, infinite precision numbers,<br />
fixed point numbers, and others.<br />
It should be possible to assert statically<br />
that the arguments of a function are residue classes with<br />
respect to the same divisor, or that they are vectors of the same size.<br />
Possible ways out are encoding values in types or local type<br />
class instances. The latter one is still neither proposed nor<br />
implemented in any Haskell compiler.<br />
The modules are implemented in a way to keep all options open.<br />
That is, for each number type there is one module<br />
implementing the necessary operations<br />
which expect the context as a parameter.<br />
Then there are several modules<br />
which provide different interfaces through type class instances<br />
to these operations.<br />
<br />
<br />
== Links ==<br />
<br />
{{PackageInfoBox|name=numeric-prelude|darcs-code=numeric-prelude/}}<br />
<br />
* [http://projects.haskell.org/cgi-bin/mailman/listinfo/numeric-prelude Mailing list]<br />
* [http://trac.haskell.org/numeric-prelude/ Bug and Feature Tracker]<br />
* [http://haskell.org/communities/05-2008/html/report.html#numericprelude HCAR report]<br />
<br />
== See also ==<br />
<br />
* [[Mathematical prelude discussion]]<br />
<br />
[[Category:Mathematics]]</div>Liquenhttps://wiki.haskell.org/index.php?title=Numeric_Prelude&diff=46367Numeric Prelude2012-07-09T17:32:38Z<p>Liquen: </p>
<hr />
<div>Numeric Prelude provides an alternative numeric type class hierarchy,<br />
which also makes use of type features beyond Haskell 98, e.g. [[multi-parameter type class]]es.<br />
<br />
== Overview ==<br />
<br />
The hierarchy of numerical type classes is revised and oriented at algebraic<br />
structures. Axiomatics for fundamental operations are given as<br />
QuickCheck properties, superfluous super-classes like <hask>Show</hask> are removed, semantic and representation-specific operations are separated, the hierarchy of type classes is more fine grained, and identifiers<br />
are adapted to mathematical terms.<br />
<br />
There are both certain new type classes<br />
representing algebraic structures<br />
and new types of mathematical objects.<br />
Currently supported algebraic structures are<br />
* group (additive),<br />
* ring,<br />
* principal ideal domain,<br />
* field,<br />
* algebraic closures,<br />
* transcendental closures,<br />
* module and vector space,<br />
* normed space,<br />
* lattice,<br />
* differential algebra,<br />
* monoid.<br />
<br />
There is also a collection of mathematical object types,<br />
which is useful both for applications and<br />
testing the class hierarchy.<br />
The types are<br />
* lazy Peano number,<br />
* arbitrarily quantified non-negative lazy number (generalisation of Peano number),<br />
* complex number, quaternion,<br />
* residue class,<br />
* fraction,<br />
* partial fraction,<br />
* numbers equipped with physical units in two variants:<br />
** dynamically checked units,<br />
** statically checked dimension terms (E.g., speed can be expressed by type argument <hask>Mul Length (Recip Time)</hask>. This is overly restrictive but does not require type extensions.)<br />
* fixed point arithmetic with respect to arbitrary bases and numbers of fraction digits,<br />
* infinite precision number in an arbitrary positional system as lazy lists of digits supporting also numbers with terminating representations,<br />
* polynomial, power series, Laurent series<br />
* root set of a polynomial,<br />
* matrix (basics only),<br />
* algebra, e.g., multi-variate polynomial (basics only),<br />
* permutation group.<br />
<br />
Due to Haskell's flexible type system,<br />
you can combine all these types,<br />
e.g., fractions of polynomials, residue classes of polynomials,<br />
complex numbers with physical units,<br />
power series with real numbers as coefficients.<br />
<br />
Using the revised system requires hiding some of the standard functions<br />
provided by Prelude, which is fortunately supported by GHC.<br />
The library has basic Cabal support<br />
and a growing test-suite of QuickCheck tests<br />
for the implemented mathematical objects.<br />
<br />
Each data type now resides in a separate module.<br />
Cyclic dependencies could be eliminated by fixing some types in class methods.<br />
E.g., power exponents became simply Integer instead of Integral,<br />
which has also the advantage of reduced type defaulting.<br />
<br />
== Future plans ==<br />
<br />
The code still misses proper linear algebra code.<br />
<br />
A still unsolved problem arises for<br />
residue classes, matrix computations, infinite precision numbers,<br />
fixed point numbers, and others.<br />
It should be possible to assert statically<br />
that the arguments of a function are residue classes with<br />
respect to the same divisor, or that they are vectors of the same size.<br />
Possible ways out are encoding values in types or local type<br />
class instances. The latter one is still neither proposed nor<br />
implemented in any Haskell compiler.<br />
The modules are implemented in a way to keep all options open.<br />
That is, for each number type there is one module<br />
implementing the necessary operations<br />
which expect the context as a parameter.<br />
Then there are several modules<br />
which provide different interfaces through type class instances<br />
to these operations.<br />
<br />
<br />
== Links ==<br />
<br />
{{PackageInfoBox|name=numeric-prelude|darcs-code=numeric-prelude/}}<br />
<br />
* [http://projects.haskell.org/cgi-bin/mailman/listinfo/numeric-prelude Mailing list]<br />
* [http://trac.haskell.org/numeric-prelude/ Bug and Feature Tracker]<br />
* [http://haskell.org/communities/05-2008/html/report.html#numericprelude HCAR report]<br />
<br />
== See also ==<br />
<br />
* [[Mathematical prelude discussion]]<br />
<br />
[[Category:Mathematics]]</div>Liquen