packages feed

approximate-equality

Newtype wrappers for approximate equality

view on Hackage

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.
versionuploadeduploaderchanges
1.1.0.2 files2014-08-16 21:33 UTCGregoryCrosswhite+3/−3 lines, 1 filesPVP ok
1.1.0.1 files2014-08-16 21:31 UTCGregoryCrosswhite+13/−4 lines, 1 filesdep ~basedep ~type-level-natural-numberPVP ok
1.1 files2012-05-04 10:52 UTCGregoryCrosswhite+7/−2 lines, 2 filesdep ~basePVP ok
1.0 files2010-08-03 04:14 UTCGregoryCrosswhite+536/−0 lines, 4 filesdep +basedep +type-level-natural-numbersetup-changed

Dependencies of approximate-equality-1.1.0.2

base >=3 && <5 4.22.0.0 → 4.22.1.0
2026-12-01 12:38 UTC4.22.1.0 HSEC-2023-0007+388/−6 lines, 9 filesdep ~ghc-internalPVP: major bump suggested
2025-12-19 11:52 UTC4.22.0.0 HSEC-2023-0007+886/−215 lines, 28 filesdep ~ghc-internalPVP ok
2026-03-27 12:26 UTC4.21.2.0 HSEC-2023-0007+10/−3 lines, 4 filesdep ~ghc-internalPVP ok
2025-12-27 10:31 UTC4.21.1.0 HSEC-2023-0007+17/−5 lines, 4 filesdep ~ghc-internalPVP ok
2024-12-16 09:24 UTC4.21.0.0 HSEC-2023-0007+1170/−396 lines, 39 filesdep ~ghc-internalPVP ok

showing 5 of 61 versions

type-level-natural-number >=1.0 && <2.1 1.1.1 → 2.0
2014-03-30 18:38 UTC2.0+15/−14 lines, 2 files
2012-11-06 04:37 UTC1.1.1+27/−5 lines, 3 filesPVP ok
2010-10-14 01:22 UTC1.1+21/−10 lines, 3 filesPVP ok
2010-07-30 20:03 UTC1.0+148/−0 lines, 4 filesdep +basesetup-changed

Reverse dependencies

3 packages depend on approximate-equality

acme-everything 2018.11.18 requires approximate-equality >=0
hgeometry-combinatorial 0.14 requires approximate-equality >=1.1.0.2
hgeometry-ipe 0.13 requires approximate-equality >=1.1.0.2