Stability | experimental |
---|---|

Maintainer | Patrick Perry <patperry@stanford.edu> |

A type class for approximate and exact equalilty comparisons and instances for common data types.

# Documentation

class Eq a => AEq a whereSource

A reliable way to test if two values are exactly equal. For floating
point values, this will consider `NaN`

to be (===) to `NaN`

.

An approximate equality comparison operator. For `RealFloat`

values,
```
(~==) x y = (x == y)
|| (abs (x - y) < epsilon)
|| (eqRel delta x y)
|| (isNaN x && isNaN y)
```

.
For Complex numbers, the if the real and imaginary parts are not
approximately equal, the polar forms are compared, instead.

AEq Bool | |

AEq Double | |

AEq Float | |

AEq Int | |

AEq Int8 | |

AEq Int16 | |

AEq Int32 | |

AEq Int64 | |

AEq Word | |

AEq Word8 | |

AEq Word16 | |

AEq Word32 | |

AEq Word64 | |

AEq () | |

AEq a => AEq [a] | |

(RealFloat a, AEq a) => AEq (Complex a) | |

AEq a => AEq (Maybe a) | |

(AEq a, AEq b) => AEq (Either a b) | |

(AEq a, AEq b) => AEq (a, b) | |

(AEq a, AEq b, AEq c) => AEq (a, b, c) | |

(AEq a, AEq b, AEq c, AEq d) => AEq (a, b, c, d) |