approximate-equality: Newtype wrappers for approximate equality
The purpose of this module is to provide newtype wrappers that allow one to effectively override the equality operator of a value so that it is approximate rather than exact. The wrappers use type annotations to specify the tolerance; the
Digits type constructor has been provided for specifying the tolerance using type-level natural numbers. Instances for all of the classes in the numerical hierarchy have been provided for the wrappers, so the wrapped values can mostly be used in the same way as the original values. (In fact, most of the time one doesn't even have to wrap the starting values, since expressions such as
(1+sqrt 2/3) are automatically wrapped thanks to the
fromIntegral method of the
See the documentation for Data.Eq.Approximate for more detailed information on how to use this package.
New in version 1.1: Added explicit Show constraints to the Show instances, as the Num class in the newest version of GHC (wisely) no longer includes Show as a constraint.
|Versions [RSS] [faq]||1.0, 1.1, 126.96.36.199, 188.8.131.52|
|Dependencies||base (>=3 && <4.6), type-level-natural-number (==1.0.*) [details]|
|Maintainer||Gregory Crosswhite <email@example.com>|
|Uploaded||by GregoryCrosswhite at 2012-05-04T10:52:40Z|
|Distributions||LTSHaskell:184.108.40.206, NixOS:220.127.116.11, Stackage:18.104.22.168|
|Downloads||3390 total (30 in the last 30 days)|
|Rating||(no votes yet) [estimated by Bayesian average]|
Docs uploaded by user
Build status unknown [no reports yet]