Module

# Data.Eq

Package
prelude
Repository
purerl/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

• `eq :: a -> a -> Boolean`

#### Instances

• `Eq Boolean`
• `Eq Int`
• `Eq Number`
• `Eq Char`
• `Eq String`
• `Eq Unit`
• `Eq Void`
• `(Eq a) => Eq (Array a)`
• `(RowToList row list, EqRecord list row) => Eq (Record row)`
• `Eq (Proxy a)`
• `Eq (Proxy2 a)`
• `Eq (Proxy3 a)`

### #(==)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)

### #Eq1Source

``class Eq1 :: (Type -> Type) -> Constraint``class Eq1 f  where``

The `Eq1` type class represents type constructors with decidable equality.

#### Members

• `eq1 :: forall a. Eq a => f a -> f a -> Boolean`

#### Instances

• `Eq1 Array`

### #notEq1Source

``notEq1 :: forall f a. Eq1 f => Eq a => f a -> f a -> Boolean``

### #EqRecordSource

``class EqRecord :: RowList Type -> Row Type -> Constraint``class EqRecord rowlist row  where``

A class for records where all fields have `Eq` instances, used to implement the `Eq` instance for records.

#### Members

• `eqRecord :: forall rlproxy. rlproxy rowlist -> Record row -> Record row -> Boolean`

#### Instances

• `EqRecord Nil row`
• `(EqRecord rowlistTail row, Cons key focus rowTail row, IsSymbol key, Eq focus) => EqRecord (Cons key focus rowlistTail) row`