{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE MagicHash #-}

#if __GLASGOW_HASKELL__ >= 701
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE Trustworthy #-}
#endif

#if __GLASGOW_HASKELL__ >= 705
{-# LANGUAGE PolyKinds #-}
#endif

#include "HsBaseConfig.h"

module Generics.Deriving.Eq (
  -- * Generic Eq class
    GEq(..)

  -- * Default definition
  , geqdefault

  -- * Internal Eq class
  , GEq'(..)

  ) where

import           Control.Applicative (Const, ZipList)

import           Data.Char (GeneralCategory)
import           Data.Int
import qualified Data.Monoid as Monoid (First, Last)
import           Data.Monoid (All, Any, Dual, Product, Sum)
import           Data.Version (Version)
import           Data.Word

import           Foreign.C.Error
import           Foreign.C.Types
import           Foreign.ForeignPtr (ForeignPtr)
import           Foreign.Ptr
import           Foreign.StablePtr (StablePtr)

import           Generics.Deriving.Base

import           GHC.Exts hiding (Any)

import           System.Exit (ExitCode)
import           System.IO (BufferMode, Handle, HandlePosn, IOMode, SeekMode)
import           System.IO.Error (IOErrorType)
import           System.Posix.Types

#if MIN_VERSION_base(4,4,0)
import           Data.Complex (Complex)
#endif

#if MIN_VERSION_base(4,7,0)
import           Data.Proxy (Proxy)
#endif

#if MIN_VERSION_base(4,8,0)
import           Data.Functor.Identity (Identity)
import           Data.Monoid (Alt)
import           Data.Void (Void)
import           Numeric.Natural (Natural)
#endif

#if MIN_VERSION_base(4,9,0)
import           Data.List.NonEmpty (NonEmpty)
import qualified Data.Semigroup as Semigroup (First, Last)
import           Data.Semigroup (Arg(..), Max, Min, WrappedMonoid)
#endif

--------------------------------------------------------------------------------
-- Generic show
--------------------------------------------------------------------------------

class GEq' f where
  geq' :: f a -> f a -> Bool

instance GEq' V1 where
  geq' :: forall (a :: k). V1 a -> V1 a -> Bool
geq' V1 a
_ V1 a
_ = Bool
True

instance GEq' U1 where
  geq' :: forall (a :: k). U1 a -> U1 a -> Bool
geq' U1 a
_ U1 a
_ = Bool
True

instance (GEq c) => GEq' (K1 i c) where
  geq' :: forall (a :: k). K1 i c a -> K1 i c a -> Bool
geq' (K1 c
a) (K1 c
b) = forall a. GEq a => a -> a -> Bool
geq c
a c
b

-- No instances for P or Rec because geq is only applicable to types of kind *

instance (GEq' a) => GEq' (M1 i c a) where
  geq' :: forall (a :: k). M1 i c a a -> M1 i c a a -> Bool
geq' (M1 a a
a) (M1 a a
b) = forall {k} (f :: k -> *) (a :: k). GEq' f => f a -> f a -> Bool
geq' a a
a a a
b

instance (GEq' a, GEq' b) => GEq' (a :+: b) where
  geq' :: forall (a :: k). (:+:) a b a -> (:+:) a b a -> Bool
geq' (L1 a a
a) (L1 a a
b) = forall {k} (f :: k -> *) (a :: k). GEq' f => f a -> f a -> Bool
geq' a a
a a a
b
  geq' (R1 b a
a) (R1 b a
b) = forall {k} (f :: k -> *) (a :: k). GEq' f => f a -> f a -> Bool
geq' b a
a b a
b
  geq' (:+:) a b a
_      (:+:) a b a
_      = Bool
False

instance (GEq' a, GEq' b) => GEq' (a :*: b) where
  geq' :: forall (a :: k). (:*:) a b a -> (:*:) a b a -> Bool
geq' (a a
a1 :*: b a
b1) (a a
a2 :*: b a
b2) = forall {k} (f :: k -> *) (a :: k). GEq' f => f a -> f a -> Bool
geq' a a
a1 a a
a2 Bool -> Bool -> Bool
&& forall {k} (f :: k -> *) (a :: k). GEq' f => f a -> f a -> Bool
geq' b a
b1 b a
b2

-- Unboxed types
instance GEq' UAddr where
  geq' :: forall (a :: k). UAddr a -> UAddr a -> Bool
geq' (UAddr Addr#
a1) (UAddr Addr#
a2)     = Int# -> Bool
isTrue# (Addr# -> Addr# -> Int#
eqAddr# Addr#
a1 Addr#
a2)
instance GEq' UChar where
  geq' :: forall (a :: k). UChar a -> UChar a -> Bool
geq' (UChar Char#
c1) (UChar Char#
c2)     = Int# -> Bool
isTrue# (Char# -> Char# -> Int#
eqChar# Char#
c1 Char#
c2)
instance GEq' UDouble where
  geq' :: forall (a :: k). UDouble a -> UDouble a -> Bool
geq' (UDouble Double#
d1) (UDouble Double#
d2) = Int# -> Bool
isTrue# (Double#
d1 Double# -> Double# -> Int#
==## Double#
d2)
instance GEq' UFloat where
  geq' :: forall (a :: k). UFloat a -> UFloat a -> Bool
geq' (UFloat Float#
f1) (UFloat Float#
f2)   = Int# -> Bool
isTrue# (Float# -> Float# -> Int#
eqFloat# Float#
f1 Float#
f2)
instance GEq' UInt where
  geq' :: forall (a :: k). UInt a -> UInt a -> Bool
geq' (UInt Int#
i1) (UInt Int#
i2)       = Int# -> Bool
isTrue# (Int#
i1 Int# -> Int# -> Int#
==# Int#
i2)
instance GEq' UWord where
  geq' :: forall (a :: k). UWord a -> UWord a -> Bool
geq' (UWord Word#
w1) (UWord Word#
w2)     = Int# -> Bool
isTrue# (Word# -> Word# -> Int#
eqWord# Word#
w1 Word#
w2)

#if !(MIN_VERSION_base(4,7,0))
isTrue# :: Bool -> Bool
isTrue# = id
#endif


class GEq a where
  geq :: a -> a -> Bool


#if __GLASGOW_HASKELL__ >= 701
  default geq :: (Generic a, GEq' (Rep a)) => a -> a -> Bool
  geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault
#endif

geqdefault :: (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault :: forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault a
x a
y = forall {k} (f :: k -> *) (a :: k). GEq' f => f a -> f a -> Bool
geq' (forall a x. Generic a => a -> Rep a x
from a
x) (forall a x. Generic a => a -> Rep a x
from a
y)

-- Base types instances
instance GEq () where
  geq :: () -> () -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance (GEq a, GEq b) => GEq (a, b) where
  geq :: (a, b) -> (a, b) -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance (GEq a, GEq b, GEq c) => GEq (a, b, c) where
  geq :: (a, b, c) -> (a, b, c) -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance (GEq a, GEq b, GEq c, GEq d) => GEq (a, b, c, d) where
  geq :: (a, b, c, d) -> (a, b, c, d) -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance (GEq a, GEq b, GEq c, GEq d, GEq e) => GEq (a, b, c, d, e) where
  geq :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance (GEq a, GEq b, GEq c, GEq d, GEq e, GEq f)
    => GEq (a, b, c, d, e, f) where
  geq :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance (GEq a, GEq b, GEq c, GEq d, GEq e, GEq f, GEq g)
    => GEq (a, b, c, d, e, f, g) where
  geq :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq a => GEq [a] where
  geq :: [a] -> [a] -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance (GEq (f p), GEq (g p)) => GEq ((f :+: g) p) where
  geq :: (:+:) f g p -> (:+:) f g p -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance (GEq (f p), GEq (g p)) => GEq ((f :*: g) p) where
  geq :: (:*:) f g p -> (:*:) f g p -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq (f (g p)) => GEq ((f :.: g) p) where
  geq :: (:.:) f g p -> (:.:) f g p -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq All where
  geq :: All -> All -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

#if MIN_VERSION_base(4,8,0)
instance GEq (f a) => GEq (Alt f a) where
  geq :: Alt f a -> Alt f a -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault
#endif

instance GEq Any where
  geq :: Any -> Any -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

#if !(MIN_VERSION_base(4,9,0))
instance GEq Arity where
  geq = geqdefault
#endif

#if MIN_VERSION_base(4,9,0)
instance GEq a => GEq (Arg a b) where
  geq :: Arg a b -> Arg a b -> Bool
geq (Arg a
a b
_) (Arg a
b b
_) = forall a. GEq a => a -> a -> Bool
geq a
a a
b
#endif

instance GEq Associativity where
  geq :: Associativity -> Associativity -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq Bool where
  geq :: Bool -> Bool -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq BufferMode where
  geq :: BufferMode -> BufferMode -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

#if defined(HTYPE_CC_T)
instance GEq CCc where
  geq :: CCc -> CCc -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
#endif

instance GEq CChar where
  geq :: CChar -> CChar -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq CClock where
  geq :: CClock -> CClock -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

#if defined(HTYPE_DEV_T)
instance GEq CDev where
  geq :: CDev -> CDev -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
#endif

instance GEq CDouble where
  geq :: CDouble -> CDouble -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq CFloat where
  geq :: CFloat -> CFloat -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

#if defined(HTYPE_GID_T)
instance GEq CGid where
  geq :: CGid -> CGid -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
#endif

instance GEq Char where
  geq :: Char -> Char -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

#if defined(HTYPE_INO_T)
instance GEq CIno where
  geq :: CIno -> CIno -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
#endif

instance GEq CInt where
  geq :: CInt -> CInt -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq CIntMax where
  geq :: CIntMax -> CIntMax -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq CIntPtr where
  geq :: CIntPtr -> CIntPtr -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq CLLong where
  geq :: CLLong -> CLLong -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq CLong where
  geq :: CLong -> CLong -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

#if defined(HTYPE_MODE_T)
instance GEq CMode where
  geq :: CMode -> CMode -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
#endif

#if defined(HTYPE_NLINK_T)
instance GEq CNlink where
  geq :: CNlink -> CNlink -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
#endif

#if defined(HTYPE_OFF_T)
instance GEq COff where
  geq :: COff -> COff -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
#endif

#if MIN_VERSION_base(4,4,0)
instance GEq a => GEq (Complex a) where
  geq :: Complex a -> Complex a -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault
#endif

instance GEq a => GEq (Const a b) where
  geq :: Const a b -> Const a b -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

#if defined(HTYPE_PID_T)
instance GEq CPid where
  geq :: CPid -> CPid -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
#endif

instance GEq CPtrdiff where
  geq :: CPtrdiff -> CPtrdiff -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

#if defined(HTYPE_RLIM_T)
instance GEq CRLim where
  geq :: CRLim -> CRLim -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
#endif

instance GEq CSChar where
  geq :: CSChar -> CSChar -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

#if defined(HTYPE_SPEED_T)
instance GEq CSpeed where
  geq :: CSpeed -> CSpeed -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
#endif

#if MIN_VERSION_base(4,4,0)
instance GEq CSUSeconds where
  geq :: CSUSeconds -> CSUSeconds -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
#endif

instance GEq CShort where
  geq :: CShort -> CShort -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq CSigAtomic where
  geq :: CSigAtomic -> CSigAtomic -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq CSize where
  geq :: CSize -> CSize -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

#if defined(HTYPE_SSIZE_T)
instance GEq CSsize where
  geq :: CSsize -> CSsize -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
#endif

#if defined(HTYPE_TCFLAG_T)
instance GEq CTcflag where
  geq :: CTcflag -> CTcflag -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
#endif

instance GEq CTime where
  geq :: CTime -> CTime -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq CUChar where
  geq :: CUChar -> CUChar -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

#if defined(HTYPE_UID_T)
instance GEq CUid where
  geq :: CUid -> CUid -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
#endif

instance GEq CUInt where
  geq :: CUInt -> CUInt -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq CUIntMax where
  geq :: CUIntMax -> CUIntMax -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq CUIntPtr where
  geq :: CUIntPtr -> CUIntPtr -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq CULLong where
  geq :: CULLong -> CULLong -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq CULong where
  geq :: CULong -> CULong -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

#if MIN_VERSION_base(4,4,0)
instance GEq CUSeconds where
  geq :: CUSeconds -> CUSeconds -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
#endif

instance GEq CUShort where
  geq :: CUShort -> CUShort -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq CWchar where
  geq :: CWchar -> CWchar -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

#if MIN_VERSION_base(4,9,0)
instance GEq DecidedStrictness where
  geq :: DecidedStrictness -> DecidedStrictness -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault
#endif

instance GEq Double where
  geq :: Double -> Double -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq a => GEq (Down a) where
  geq :: Down a -> Down a -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq a => GEq (Dual a) where
  geq :: Dual a -> Dual a -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance (GEq a, GEq b) => GEq (Either a b) where
  geq :: Either a b -> Either a b -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq Errno where
  geq :: Errno -> Errno -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq ExitCode where
  geq :: ExitCode -> ExitCode -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq Fd where
  geq :: Fd -> Fd -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq a => GEq (Monoid.First a) where
  geq :: First a -> First a -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

#if MIN_VERSION_base(4,9,0)
instance GEq a => GEq (Semigroup.First a) where
  geq :: First a -> First a -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault
#endif

instance GEq Fixity where
  geq :: Fixity -> Fixity -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq Float where
  geq :: Float -> Float -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq (ForeignPtr a) where
  geq :: ForeignPtr a -> ForeignPtr a -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq (FunPtr a) where
  geq :: FunPtr a -> FunPtr a -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq GeneralCategory where
  geq :: GeneralCategory -> GeneralCategory -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq Handle where
  geq :: Handle -> Handle -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq HandlePosn where
  geq :: HandlePosn -> HandlePosn -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

#if MIN_VERSION_base(4,8,0)
instance GEq a => GEq (Identity a) where
  geq :: Identity a -> Identity a -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault
#endif

instance GEq Int where
  geq :: Int -> Int -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq Int8 where
  geq :: Int8 -> Int8 -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq Int16 where
  geq :: Int16 -> Int16 -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq Int32 where
  geq :: Int32 -> Int32 -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq Int64 where
  geq :: Int64 -> Int64 -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq Integer where
  geq :: Integer -> Integer -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq IntPtr where
  geq :: IntPtr -> IntPtr -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq IOError where
  geq :: IOError -> IOError -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq IOErrorType where
  geq :: IOErrorType -> IOErrorType -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq IOMode where
  geq :: IOMode -> IOMode -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq c => GEq (K1 i c p) where
  geq :: K1 i c p -> K1 i c p -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq a => GEq (Monoid.Last a) where
  geq :: Last a -> Last a -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

#if MIN_VERSION_base(4,9,0)
instance GEq a => GEq (Semigroup.Last a) where
  geq :: Last a -> Last a -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault
#endif

instance GEq (f p) => GEq (M1 i c f p) where
  geq :: M1 i c f p -> M1 i c f p -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq a => GEq (Maybe a) where
  geq :: Maybe a -> Maybe a -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

#if MIN_VERSION_base(4,9,0)
instance GEq a => GEq (Max a) where
  geq :: Max a -> Max a -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq a => GEq (Min a) where
  geq :: Min a -> Min a -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault
#endif

#if MIN_VERSION_base(4,8,0)
instance GEq Natural where
  geq :: Natural -> Natural -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
#endif

#if MIN_VERSION_base(4,9,0)
instance GEq a => GEq (NonEmpty a) where
  geq :: NonEmpty a -> NonEmpty a -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault
#endif

instance GEq Ordering where
  geq :: Ordering -> Ordering -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq p => GEq (Par1 p) where
  geq :: Par1 p -> Par1 p -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq a => GEq (Product a) where
  geq :: Product a -> Product a -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

#if MIN_VERSION_base(4,7,0)
instance GEq
# if MIN_VERSION_base(4,9,0)
             (Proxy s)
# else
             (Proxy (s :: *))
# endif
             where
  geq :: Proxy s -> Proxy s -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault
#endif

instance GEq (Ptr a) where
  geq :: Ptr a -> Ptr a -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq (f p) => GEq (Rec1 f p) where
  geq :: Rec1 f p -> Rec1 f p -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq SeekMode where
  geq :: SeekMode -> SeekMode -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq (StablePtr a) where
  geq :: StablePtr a -> StablePtr a -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

#if MIN_VERSION_base(4,9,0)
instance GEq SourceStrictness where
  geq :: SourceStrictness -> SourceStrictness -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq SourceUnpackedness where
  geq :: SourceUnpackedness -> SourceUnpackedness -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault
#endif

instance GEq a => GEq (Sum a) where
  geq :: Sum a -> Sum a -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq (U1 p) where
  geq :: U1 p -> U1 p -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq (UAddr p) where
  geq :: UAddr p -> UAddr p -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq (UChar p) where
  geq :: UChar p -> UChar p -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq (UDouble p) where
  geq :: UDouble p -> UDouble p -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq (UFloat p) where
  geq :: UFloat p -> UFloat p -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq (UInt p) where
  geq :: UInt p -> UInt p -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq (UWord p) where
  geq :: UWord p -> UWord p -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

instance GEq Version where
  geq :: Version -> Version -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

#if MIN_VERSION_base(4,8,0)
instance GEq Void where
  geq :: Void -> Void -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
#endif

instance GEq Word where
  geq :: Word -> Word -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq Word8 where
  geq :: Word8 -> Word8 -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq Word16 where
  geq :: Word16 -> Word16 -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq Word32 where
  geq :: Word32 -> Word32 -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq Word64 where
  geq :: Word64 -> Word64 -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

instance GEq WordPtr where
  geq :: WordPtr -> WordPtr -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

#if MIN_VERSION_base(4,9,0)
instance GEq m => GEq (WrappedMonoid m) where
  geq :: WrappedMonoid m -> WrappedMonoid m -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault
#endif

instance GEq a => GEq (ZipList a) where
  geq :: ZipList a -> ZipList a -> Bool
geq = forall a. (Generic a, GEq' (Rep a)) => a -> a -> Bool
geqdefault

#if MIN_VERSION_base(4,10,0)
instance GEq CBool where
  geq :: CBool -> CBool -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)

# if defined(HTYPE_BLKSIZE_T)
instance GEq CBlkSize where
  geq :: CBlkSize -> CBlkSize -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
# endif

# if defined(HTYPE_BLKCNT_T)
instance GEq CBlkCnt where
  geq :: CBlkCnt -> CBlkCnt -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
# endif

# if defined(HTYPE_CLOCKID_T)
instance GEq CClockId where
  geq :: CClockId -> CClockId -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
# endif

# if defined(HTYPE_FSBLKCNT_T)
instance GEq CFsBlkCnt where
  geq :: CFsBlkCnt -> CFsBlkCnt -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
# endif

# if defined(HTYPE_FSFILCNT_T)
instance GEq CFsFilCnt where
  geq :: CFsFilCnt -> CFsFilCnt -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
# endif

# if defined(HTYPE_ID_T)
instance GEq CId where
  geq :: CId -> CId -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
# endif

# if defined(HTYPE_KEY_T)
instance GEq CKey where
  geq :: CKey -> CKey -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
# endif

# if defined(HTYPE_TIMER_T)
instance GEq CTimer where
  geq :: CTimer -> CTimer -> Bool
geq = forall a. Eq a => a -> a -> Bool
(==)
# endif
#endif