Options
All
  • Public
  • Public/Protected
  • All
Menu

The Eq is a type class used to determine equality between 2 instances of the same type. Any 2 instances x and y are equal if eqv(x, y) is true. Moreover, eqv should form an equivalence relation.

Example:

const F = eqOf(Option)

F.eqv(Some(1), Some(1)) // true
F.eqv(Some(1), None)    // false

MUST obey the laws defined in EqLaws.

CREDITS: this type class is inspired by the equivalent in Haskell's standard library and the implementation is inspired by the Typelevel Cats project.

Type parameters

  • A

Hierarchy

  • Eq

Implemented by

Index

Methods

Methods

eqv

  • eqv(lh: A, rh: A): boolean
  • Parameters

    • lh: A
    • rh: A

    Returns boolean

Static testEq

  • testEq<A>(lh: A, rh: A): boolean
  • Tests equality for two values of type A by using the type's registered Eq instance, falling back to the universal equality defined by is and IEquals (in funfix-core) in case no such Eq<A> is implemented.

    Type parameters

    • A

    Parameters

    • lh: A
    • rh: A

    Returns boolean

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc