Eq package:ghc-prim

The Eq class defines equality (==) and inequality (/=). All the basic datatypes exported by the Prelude are instances of Eq, and Eq may be derived for any datatype whose constituents are also instances of Eq. The Haskell Report defines no laws for Eq. However, instances are encouraged to follow these properties:
  • Reflexivity x == x = True
  • Symmetry x == y = y == x
  • Transitivity if x == y && y == z = True, then x == z = True
  • Extensionality if x == y = True and f is a function whose return type is an instance of Eq, then f x == f y = True
  • Negation x /= y = not (x == y)
Comparing underlying pointers for equality. Use GHC.Exts from the base package instead of importing this module directly.
Compare the underlying pointers of two values for equality. Returns 1 if the pointers are equal and 0 otherwise. The two values must be of the same type, of kind Type. See also reallyUnsafePtrEquality#, which doesn't have such restrictions.
Compare the underlying pointers of two unlifted values for equality. This is less dangerous than reallyUnsafePtrEquality, since the arguments are guaranteed to be evaluated. This means there is no risk of accidentally comparing a thunk. It's however still more dangerous than e.g. sameArray#.