Module

Data.Eq

Package
purescript-prelude
Repository
purescript/purescript-prelude

#EqSource

class Eq a  where

The Eq type class represents types which support decidable equality.

Eq instances should satisfy the following laws:

  • Reflexivity: x == x = true
  • Symmetry: x == y = y == x
  • Transitivity: if x == y and y == z then x == z

Note: The Number type is not an entirely law abiding member of this class due to the presence of NaN, since NaN /= NaN. Additionally, computing with Number can result in a loss of precision, so sometimes values that should be equivalent are not.

Members

Instances

#(==)Source

Operator alias for Data.Eq.eq (non-associative / precedence 4)

#notEqSource

notEq :: forall a. Eq a => a -> a -> Boolean

notEq tests whether one value is not equal to another. Shorthand for not (eq x y).

#(/=)Source

Operator alias for Data.Eq.notEq (non-associative / precedence 4)