Eq

generics. Eq

new Eq()

The generics Eq class. Provides a generic equals method for all data structures which derive from it

Version:
  • 3.0.0
Source:
Example
const {Type} = require('futils').adt;
const {Eq} = require('futils').generics;

const Int = Type('Int', ['value']).
    deriving(Eq);

const one = Int(1);
const two = Int(2);
const eno = Int(1);

one.equals(eno); // -> true
one.equals(two); // -> false
one.equals(1);   // -> false