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

Safe HaskellNone
LanguageHaskell2010

Generics.SOP.Eq

Description

Generic equality.

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

Synopsis

Documentation

geq :: (Generic a, All2 Eq (Code a)) => a -> a -> Bool Source #

Generic equality.

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

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

instance Eq T where
  (==) = geq