approximate-equality: Newtype wrappers for approximate equality

[ bsd3, data, library ] [ Propose Tags ] [ Report a vulnerability ]

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 Num typeclass.) 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.

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.0, 1.1, 1.1.0.1, 1.1.0.2
Dependencies base (>=3 && <5), type-level-natural-number (>=1.0 && <2.1) [details]
License BSD-3-Clause
Author Gregory Crosswhite
Maintainer Gregory Crosswhite <gcrosswhite@gmail.com>
Category Data
Home page http://github.com/gcross/approximate-equality
Source repo head: git clone git://github.com/gcross/approximate-equality.git
this: git clone git://github.com/gcross/approximate-equality.git(tag 1.1.0.2)
Uploaded by GregoryCrosswhite at 2014-08-16T21:33:21Z
Distributions LTSHaskell:1.1.0.2, NixOS:1.1.0.2, Stackage:1.1.0.2
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 4089 total (21 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Successful builds reported [all 1 reports]