Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

Provides a typeclass for for comparing shapes that are approxmately the same size and have the same position in 2-d space.

## Synopsis

- class Show s => ApproxEq s
- approxEqual :: ApproxEq s => s -> s -> Float -> Bool
- (=~) :: ApproxEq s => s -> s -> Bool
- assertApproxEqual :: (ApproxEq s, HasCallStack) => s -> s -> Float -> Assertion
- (@?~) :: ApproxEq s => s -> s -> Assertion

# Documentation

approxEqual :: ApproxEq s => s -> s -> Float -> Bool Source #

Are two shapes identical to within a given tolerance?

(=~) :: ApproxEq s => s -> s -> Bool Source #

Are two shapes identical to within a given tolerance? Infix version where epsilon is fixed at 0.0001.

assertApproxEqual :: (ApproxEq s, HasCallStack) => s -> s -> Float -> Assertion Source #

Helpful assertion for testing.