basic-sop-0.1.0.0: Basic examples and functions for generics-sop

Generics.SOP.Eq

Description

Generic equality.

This module contains a generic equality function defined using generics-sop.

generics-sop

Synopsis

geq :: (Generic a, All2 Eq (Code a)) => a -> a -> BoolSource

This function reimplements the built-in generic equality that you get by using deriving Eq.

deriving Eq

Assuming you have a Generic instance for a datatype T, you can use geq as follows:

Generic

T

geq

instance Eq T where (==) = geq