    {-# LANGUAGE FlexibleInstances #-}
    -----------------------------------------------------------------------------
    -- |
    -- Module     : Data.AEq
    -- Copyright  : Copyright (c) 2010, Patrick Perry <patperry@gmail.com>
    -- License    : BSD3
    -- Maintainer : Patrick Perry <patperry@gmail.com>
    -- Stability  : experimental
    --
    -- A type class for approximate and exact equalilty comparisons and instances
    -- for common data types.
    module Data.AEq (
        AEq(..),
        ) where

    import Foreign
    import Foreign.C.Types
    import Data.Complex
    import Numeric.IEEE

    infix 4 ===, ~==

    -- | Types with approximate and exact equality comparisons.
    class Eq a => AEq a where
        -- | An exact equality comparison.
        --
        -- For real 'IEEE' types, two values are equivalent in the
        -- following cases:
        --
        --   * both values are @+0@;
        --
        --   * both values are @-0@;
        --
        --   * both values are nonzero and equal to each other
        --     (according to '==');
        --
        --   * both values are @NaN@ with the same payload and sign.
        --
        -- For complex 'IEEE' types, two values are equivalent if their
        -- real and imaginary parts are equivalent.
        --
        (===) :: a -> a -> Bool
        (===) = a -> a -> Bool
    forall a. Eq a => a -> a -> Bool
    (==)
        {-# INLINE (===) #-}

        -- | An approximate equality comparison operator.
        --
        -- For real 'IEEE' types, two values are approximately equal in the
        -- following cases:
        --
        --   * at least half of their significand bits agree;
        --
        --   * both values are less than 'epsilon';
        --
        --   * both values are @NaN@.
        --
        -- For complex 'IEEE' types, two values are approximately equal in the
        -- followiing cases:
        --
        --   * their magnitudes are approximately equal and the angle between
        --     them is less than @32*'epsilon'@;
        --
        --   * both magnitudes are less than 'epsilon';
        --
        --   * both have a @NaN@ real or imaginary part.
        --
        -- Admitedly, the @32@ is a bit of a hack.  Future versions of the
        -- library may switch to a more principled test of the angle.
        --
        (~==) :: a -> a -> Bool
        (~==) = a -> a -> Bool
    forall a. Eq a => a -> a -> Bool
    (==)
        {-# INLINE (~==) #-}

    approxEqIEEE :: (IEEE a) => a -> a -> Bool
    approxEqIEEE :: forall a. IEEE a => a -> a -> Bool
    approxEqIEEE a
    x a
    y =
        ( a -> a -> Int
    forall a. IEEE a => a -> a -> Int
    sameSignificandBits a
    x a
    y Int -> Int -> Bool
    forall a. Ord a => a -> a -> Bool
    >= Int
    d
        Bool -> Bool -> Bool
    || (a -> a
    forall a. Num a => a -> a
    abs a
    x a -> a -> Bool
    forall a. Ord a => a -> a -> Bool
    < a
    forall a. IEEE a => a
    epsilon Bool -> Bool -> Bool
    && a -> a
    forall a. Num a => a -> a
    abs a
    y a -> a -> Bool
    forall a. Ord a => a -> a -> Bool
    < a
    forall a. IEEE a => a
    epsilon)
        Bool -> Bool -> Bool
    || (a -> Bool
    forall a. RealFloat a => a -> Bool
    isNaN a
    x Bool -> Bool -> Bool
    && a -> Bool
    forall a. RealFloat a => a -> Bool
    isNaN a
    y)
        )
      where
        d :: Int
    d = (a -> Int
    forall a. RealFloat a => a -> Int
    floatDigits a
    x Int -> Int -> Int
    forall a. Num a => a -> a -> a
    + Int
    1) Int -> Int -> Int
    forall a. Integral a => a -> a -> a
    `div` Int
    2
    {-# INLINE approxEqIEEE #-}

    identicalComplexIEEE :: (IEEE a) => Complex a -> Complex a -> Bool
    identicalComplexIEEE :: forall a. IEEE a => Complex a -> Complex a -> Bool
    identicalComplexIEEE (a
    x1 :+ a
    y1) (a
    x2 :+ a
    y2) =
        (a -> a -> Bool
    forall a. IEEE a => a -> a -> Bool
    identicalIEEE a
    x1 a
    x2) Bool -> Bool -> Bool
    && (a -> a -> Bool
    forall a. IEEE a => a -> a -> Bool
    identicalIEEE a
    y1 a
    y2)
    {-# INLINE identicalComplexIEEE #-}

    approxEqComplexIEEE :: (IEEE a) => Complex a -> Complex a -> Bool
    approxEqComplexIEEE :: forall a. IEEE a => Complex a -> Complex a -> Bool
    approxEqComplexIEEE Complex a
    z1 Complex a
    z2 = let
        (a
    r1,a
    c1) = Complex a -> (a, a)
    forall a. RealFloat a => Complex a -> (a, a)
    polar Complex a
    z1
        (a
    r2,a
    c2) = Complex a -> (a, a)
    forall a. RealFloat a => Complex a -> (a, a)
    polar Complex a
    z2
        angle :: a
    angle = a -> a
    forall a. Num a => a -> a
    abs (a
    c1 a -> a -> a
    forall a. Num a => a -> a -> a
    - a
    c2)
        in ( ( a -> a -> Bool
    forall a. IEEE a => a -> a -> Bool
    approxEqIEEE a
    r1 a
    r2
             Bool -> Bool -> Bool
    && (a
    angle a -> a -> Bool
    forall a. Ord a => a -> a -> Bool
    < a
    32a -> a -> a
    forall a. Num a => a -> a -> a
    *a
    forall a. IEEE a => a
    epsilon Bool -> Bool -> Bool
    || a
    angle a -> a -> Bool
    forall a. Ord a => a -> a -> Bool
    > a
    2a -> a -> a
    forall a. Num a => a -> a -> a
    *(a
    forall a. Floating a => a
    pi a -> a -> a
    forall a. Num a => a -> a -> a
    - a
    16a -> a -> a
    forall a. Num a => a -> a -> a
    *a
    forall a. IEEE a => a
    epsilon) Bool -> Bool -> Bool
    || a -> Bool
    forall a. RealFloat a => a -> Bool
    isNaN a
    angle)
             )
           Bool -> Bool -> Bool
    || (a
    r1 a -> a -> Bool
    forall a. Ord a => a -> a -> Bool
    < a
    forall a. IEEE a => a
    epsilon Bool -> Bool -> Bool
    && a
    r2 a -> a -> Bool
    forall a. Ord a => a -> a -> Bool
    < a
    forall a. IEEE a => a
    epsilon)
           )
    {-# INLINE approxEqComplexIEEE #-}

    instance AEq Float where
        === :: Float -> Float -> Bool
    (===) = Float -> Float -> Bool
    forall a. IEEE a => a -> a -> Bool
    identicalIEEE
        {-# INLINE (===) #-}
        ~== :: Float -> Float -> Bool
    (~==) = Float -> Float -> Bool
    forall a. IEEE a => a -> a -> Bool
    approxEqIEEE
        {-# INLINE (~==) #-}

    instance AEq Double where
        === :: Double -> Double -> Bool
    (===) = Double -> Double -> Bool
    forall a. IEEE a => a -> a -> Bool
    identicalIEEE
        {-# INLINE (===) #-}
        ~== :: Double -> Double -> Bool
    (~==) = Double -> Double -> Bool
    forall a. IEEE a => a -> a -> Bool
    approxEqIEEE
        {-# INLINE (~==) #-}

    instance AEq (Complex Float) where
        === :: Complex Float -> Complex Float -> Bool
    (===) = Complex Float -> Complex Float -> Bool
    forall a. IEEE a => Complex a -> Complex a -> Bool
    identicalComplexIEEE
        {-# INLINE (===) #-}
        ~== :: Complex Float -> Complex Float -> Bool
    (~==) = Complex Float -> Complex Float -> Bool
    forall a. IEEE a => Complex a -> Complex a -> Bool
    approxEqComplexIEEE
        {-# INLINE (~==) #-}

    instance AEq (Complex Double) where
        === :: Complex Double -> Complex Double -> Bool
    (===) = Complex Double -> Complex Double -> Bool
    forall a. IEEE a => Complex a -> Complex a -> Bool
    identicalComplexIEEE
        {-# INLINE (===) #-}
        ~== :: Complex Double -> Complex Double -> Bool
    (~==) = Complex Double -> Complex Double -> Bool
    forall a. IEEE a => Complex a -> Complex a -> Bool
    approxEqComplexIEEE
        {-# INLINE (~==) #-}

    instance AEq CFloat where
        === :: CFloat -> CFloat -> Bool
    (===) = CFloat -> CFloat -> Bool
    forall a. IEEE a => a -> a -> Bool
    identicalIEEE
        {-# INLINE (===) #-}
        ~== :: CFloat -> CFloat -> Bool
    (~==) = CFloat -> CFloat -> Bool
    forall a. IEEE a => a -> a -> Bool
    approxEqIEEE
        {-# INLINE (~==) #-}

    instance AEq CDouble where
        === :: CDouble -> CDouble -> Bool
    (===) = CDouble -> CDouble -> Bool
    forall a. IEEE a => a -> a -> Bool
    identicalIEEE
        {-# INLINE (===) #-}
        ~== :: CDouble -> CDouble -> Bool
    (~==) = CDouble -> CDouble -> Bool
    forall a. IEEE a => a -> a -> Bool
    approxEqIEEE
        {-# INLINE (~==) #-}

    instance AEq (Complex CFloat) where
        === :: Complex CFloat -> Complex CFloat -> Bool
    (===) = Complex CFloat -> Complex CFloat -> Bool
    forall a. IEEE a => Complex a -> Complex a -> Bool
    identicalComplexIEEE
        {-# INLINE (===) #-}
        ~== :: Complex CFloat -> Complex CFloat -> Bool
    (~==) = Complex CFloat -> Complex CFloat -> Bool
    forall a. IEEE a => Complex a -> Complex a -> Bool
    approxEqComplexIEEE
        {-# INLINE (~==) #-}

    instance AEq (Complex CDouble) where
        === :: Complex CDouble -> Complex CDouble -> Bool
    (===) = Complex CDouble -> Complex CDouble -> Bool
    forall a. IEEE a => Complex a -> Complex a -> Bool
    identicalComplexIEEE
        {-# INLINE (===) #-}
        ~== :: Complex CDouble -> Complex CDouble -> Bool
    (~==) = Complex CDouble -> Complex CDouble -> Bool
    forall a. IEEE a => Complex a -> Complex a -> Bool
    approxEqComplexIEEE
        {-# INLINE (~==) #-}

    instance AEq Bool
    instance AEq Char
    instance AEq Int
    instance AEq Int8
    instance AEq Int16
    instance AEq Int32
    instance AEq Int64
    instance AEq Integer
    instance AEq Ordering
    instance AEq Word
    instance AEq Word8
    instance AEq Word16
    instance AEq Word32
    instance AEq Word64
    instance AEq ()
    instance AEq WordPtr
    instance AEq IntPtr
    instance AEq (StablePtr a)
    instance AEq (Ptr a)
    instance AEq (FunPtr a)
    instance AEq (ForeignPtr a)
    instance AEq CChar
    instance AEq CSChar
    instance AEq CUChar
    instance AEq CShort
    instance AEq CUShort
    instance AEq CInt
    instance AEq CUInt
    instance AEq CLong
    instance AEq CULong
    instance AEq CPtrdiff
    instance AEq CSize
    instance AEq CWchar
    instance AEq CSigAtomic
    instance AEq CLLong
    instance AEq CULLong
    instance AEq CIntPtr
    instance AEq CUIntPtr
    instance AEq CIntMax
    instance AEq CUIntMax
    instance AEq CClock
    instance AEq CTime

    eqListsWith :: (a -> a -> Bool) -> [a] -> [a] -> Bool
    eqListsWith :: forall a. (a -> a -> Bool) -> [a] -> [a] -> Bool
    eqListsWith a -> a -> Bool
    f (a
    x:[a]
    xs) (a
    y:[a]
    ys) = a -> a -> Bool
    f a
    x a
    y Bool -> Bool -> Bool
    && (a -> a -> Bool) -> [a] -> [a] -> Bool
    forall a. (a -> a -> Bool) -> [a] -> [a] -> Bool
    eqListsWith a -> a -> Bool
    f [a]
    xs [a]
    ys
    eqListsWith a -> a -> Bool
    _ [] [] = Bool
    True
    eqListsWith a -> a -> Bool
    _ [a]
    _  [a]
    _  = Bool
    False
    {-# INLINE eqListsWith #-}

    instance (AEq a) => AEq [a] where
        === :: [a] -> [a] -> Bool
    (===) = (a -> a -> Bool) -> [a] -> [a] -> Bool
    forall a. (a -> a -> Bool) -> [a] -> [a] -> Bool
    eqListsWith a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (===)
        {-# INLINE (===) #-}
        ~== :: [a] -> [a] -> Bool
    (~==) = (a -> a -> Bool) -> [a] -> [a] -> Bool
    forall a. (a -> a -> Bool) -> [a] -> [a] -> Bool
    eqListsWith a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==)
        {-# INLINE (~==) #-}

    instance (AEq a) => AEq (Maybe a) where
        === :: Maybe a -> Maybe a -> Bool
    (===) Maybe a
    Nothing  Maybe a
    Nothing  = Bool
    True
        (===) (Just a
    x) (Just a
    y) = a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) a
    x a
    y
        (===) Maybe a
    _ Maybe a
    _ = Bool
    False
        {-# INLINE (===) #-}

        ~== :: Maybe a -> Maybe a -> Bool
    (~==) Maybe a
    Nothing  Maybe a
    Nothing  = Bool
    True
        (~==) (Just a
    x) (Just a
    y) = a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) a
    x a
    y
        (~==) Maybe a
    _ Maybe a
    _ = Bool
    False
        {-# INLINE (~==) #-}

    instance (AEq a, AEq b) => AEq (Either a b) where
        === :: Either a b -> Either a b -> Bool
    (===) (Left a
    a1)  (Left a
    a2)  = a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) a
    a1 a
    a2
        (===) (Right b
    b1) (Right b
    b2) = b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) b
    b1 b
    b2
        (===) Either a b
    _ Either a b
    _ = Bool
    False
        {-# INLINE (===) #-}

        ~== :: Either a b -> Either a b -> Bool
    (~==) (Left a
    a1)  (Left a
    a2)  = a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) a
    a1 a
    a2
        (~==) (Right b
    b1) (Right b
    b2) = b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) b
    b1 b
    b2
        (~==) Either a b
    _ Either a b
    _ = Bool
    False
        {-# INLINE (~==) #-}

    instance (AEq a, AEq b) => AEq (a,b) where
        === :: (a, b) -> (a, b) -> Bool
    (===) (a
    a1,b
    b1) (a
    a2,b
    b2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) b
    b1 b
    b2)
            )
        {-# INLINE (===) #-}

        ~== :: (a, b) -> (a, b) -> Bool
    (~==) (a
    a1,b
    b1) (a
    a2,b
    b2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) b
    b1 b
    b2)
            )
        {-# INLINE (~==) #-}

    instance (AEq a, AEq b, AEq c) => AEq (a,b,c) where
        === :: (a, b, c) -> (a, b, c) -> Bool
    (===) (a
    a1,b
    b1,c
    c1) (a
    a2,b
    b2,c
    c2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) c
    c1 c
    c2)
            )
        {-# INLINE (===) #-}

        ~== :: (a, b, c) -> (a, b, c) -> Bool
    (~==) (a
    a1,b
    b1,c
    c1) (a
    a2,b
    b2,c
    c2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) c
    c1 c
    c2)
            )
        {-# INLINE (~==) #-}

    instance (AEq a, AEq b, AEq c, AEq d) => AEq (a,b,c,d) where
        === :: (a, b, c, d) -> (a, b, c, d) -> Bool
    (===) (a
    a1,b
    b1,c
    c1,d
    d1) (a
    a2,b
    b2,c
    c2,d
    d2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) d
    d1 d
    d2)
            )
        {-# INLINE (===) #-}

        ~== :: (a, b, c, d) -> (a, b, c, d) -> Bool
    (~==) (a
    a1,b
    b1,c
    c1,d
    d1) (a
    a2,b
    b2,c
    c2,d
    d2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) d
    d1 d
    d2)
            )
        {-# INLINE (~==) #-}

    instance (AEq a, AEq b, AEq c, AEq d, AEq e) => AEq (a,b,c,d,e) where
        === :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool
    (===) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) e
    e1 e
    e2)
            )
        {-# INLINE (===) #-}

        ~== :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool
    (~==) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) e
    e1 e
    e2)
            )
        {-# INLINE (~==) #-}

    instance (AEq a, AEq b, AEq c, AEq d, AEq e, AEq f) => AEq (a,b,c,d,e,f) where
        === :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool
    (===) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) f
    f1 f
    f2)
            )
        {-# INLINE (===) #-}

        ~== :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool
    (~==) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) f
    f1 f
    f2)
            )
        {-# INLINE (~==) #-}

    instance (AEq a, AEq b, AEq c, AEq d, AEq e, AEq f, AEq g) => AEq (a,b,c,d,e,f,g) where
        === :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool
    (===) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1,g
    g1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2,g
    g2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) f
    f1 f
    f2)
            Bool -> Bool -> Bool
    && (g -> g -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) g
    g1 g
    g2)
            )
        {-# INLINE (===) #-}

        ~== :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool
    (~==) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1,g
    g1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2,g
    g2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) f
    f1 f
    f2)
            Bool -> Bool -> Bool
    && (g -> g -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) g
    g1 g
    g2)
            )
        {-# INLINE (~==) #-}

    instance (AEq a, AEq b, AEq c, AEq d, AEq e, AEq f, AEq g, AEq h) => AEq (a,b,c,d,e,f,g,h) where
        === :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool
    (===) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1,g
    g1,h
    h1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2,g
    g2,h
    h2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) f
    f1 f
    f2)
            Bool -> Bool -> Bool
    && (g -> g -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) g
    g1 g
    g2)
            Bool -> Bool -> Bool
    && (h -> h -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) h
    h1 h
    h2)
            )
        {-# INLINE (===) #-}

        ~== :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool
    (~==) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1,g
    g1,h
    h1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2,g
    g2,h
    h2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) f
    f1 f
    f2)
            Bool -> Bool -> Bool
    && (g -> g -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) g
    g1 g
    g2)
            Bool -> Bool -> Bool
    && (h -> h -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) h
    h1 h
    h2)
            )
        {-# INLINE (~==) #-}

    instance (AEq a, AEq b, AEq c, AEq d, AEq e, AEq f, AEq g, AEq h, AEq i) => AEq (a,b,c,d,e,f,g,h,i) where
        === :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool
    (===) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1,g
    g1,h
    h1,i
    i1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2,g
    g2,h
    h2,i
    i2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) f
    f1 f
    f2)
            Bool -> Bool -> Bool
    && (g -> g -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) g
    g1 g
    g2)
            Bool -> Bool -> Bool
    && (h -> h -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) h
    h1 h
    h2)
            Bool -> Bool -> Bool
    && (i -> i -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) i
    i1 i
    i2)
            )
        {-# INLINE (===) #-}

        ~== :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool
    (~==) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1,g
    g1,h
    h1,i
    i1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2,g
    g2,h
    h2,i
    i2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) f
    f1 f
    f2)
            Bool -> Bool -> Bool
    && (g -> g -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) g
    g1 g
    g2)
            Bool -> Bool -> Bool
    && (h -> h -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) h
    h1 h
    h2)
            Bool -> Bool -> Bool
    && (i -> i -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) i
    i1 i
    i2)
            )
        {-# INLINE (~==) #-}

    instance (AEq a, AEq b, AEq c, AEq d, AEq e, AEq f, AEq g, AEq h, AEq i, AEq j) => AEq (a,b,c,d,e,f,g,h,i,j) where
        === :: (a, b, c, d, e, f, g, h, i, j)
    -> (a, b, c, d, e, f, g, h, i, j) -> Bool
    (===) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1,g
    g1,h
    h1,i
    i1,j
    j1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2,g
    g2,h
    h2,i
    i2,j
    j2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) f
    f1 f
    f2)
            Bool -> Bool -> Bool
    && (g -> g -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) g
    g1 g
    g2)
            Bool -> Bool -> Bool
    && (h -> h -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) h
    h1 h
    h2)
            Bool -> Bool -> Bool
    && (i -> i -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) i
    i1 i
    i2)
            Bool -> Bool -> Bool
    && (j -> j -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) j
    j1 j
    j2)
            )
        {-# INLINE (===) #-}

        ~== :: (a, b, c, d, e, f, g, h, i, j)
    -> (a, b, c, d, e, f, g, h, i, j) -> Bool
    (~==) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1,g
    g1,h
    h1,i
    i1,j
    j1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2,g
    g2,h
    h2,i
    i2,j
    j2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) f
    f1 f
    f2)
            Bool -> Bool -> Bool
    && (g -> g -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) g
    g1 g
    g2)
            Bool -> Bool -> Bool
    && (h -> h -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) h
    h1 h
    h2)
            Bool -> Bool -> Bool
    && (i -> i -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) i
    i1 i
    i2)
            Bool -> Bool -> Bool
    && (j -> j -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) j
    j1 j
    j2)
            )
        {-# INLINE (~==) #-}

    instance (AEq a, AEq b, AEq c, AEq d, AEq e, AEq f, AEq g, AEq h, AEq i, AEq j, AEq k) => AEq (a,b,c,d,e,f,g,h,i,j,k) where
        === :: (a, b, c, d, e, f, g, h, i, j, k)
    -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool
    (===) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1,g
    g1,h
    h1,i
    i1,j
    j1,k
    k1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2,g
    g2,h
    h2,i
    i2,j
    j2,k
    k2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) f
    f1 f
    f2)
            Bool -> Bool -> Bool
    && (g -> g -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) g
    g1 g
    g2)
            Bool -> Bool -> Bool
    && (h -> h -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) h
    h1 h
    h2)
            Bool -> Bool -> Bool
    && (i -> i -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) i
    i1 i
    i2)
            Bool -> Bool -> Bool
    && (j -> j -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) j
    j1 j
    j2)
            Bool -> Bool -> Bool
    && (k -> k -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) k
    k1 k
    k2)
            )
        {-# INLINE (===) #-}

        ~== :: (a, b, c, d, e, f, g, h, i, j, k)
    -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool
    (~==) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1,g
    g1,h
    h1,i
    i1,j
    j1,k
    k1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2,g
    g2,h
    h2,i
    i2,j
    j2,k
    k2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) f
    f1 f
    f2)
            Bool -> Bool -> Bool
    && (g -> g -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) g
    g1 g
    g2)
            Bool -> Bool -> Bool
    && (h -> h -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) h
    h1 h
    h2)
            Bool -> Bool -> Bool
    && (i -> i -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) i
    i1 i
    i2)
            Bool -> Bool -> Bool
    && (j -> j -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) j
    j1 j
    j2)
            Bool -> Bool -> Bool
    && (k -> k -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) k
    k1 k
    k2)
            )
        {-# INLINE (~==) #-}

    instance (AEq a, AEq b, AEq c, AEq d, AEq e, AEq f, AEq g, AEq h, AEq i, AEq j, AEq k, AEq l) => AEq (a,b,c,d,e,f,g,h,i,j,k,l) where
        === :: (a, b, c, d, e, f, g, h, i, j, k, l)
    -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool
    (===) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1,g
    g1,h
    h1,i
    i1,j
    j1,k
    k1,l
    l1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2,g
    g2,h
    h2,i
    i2,j
    j2,k
    k2,l
    l2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) f
    f1 f
    f2)
            Bool -> Bool -> Bool
    && (g -> g -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) g
    g1 g
    g2)
            Bool -> Bool -> Bool
    && (h -> h -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) h
    h1 h
    h2)
            Bool -> Bool -> Bool
    && (i -> i -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) i
    i1 i
    i2)
            Bool -> Bool -> Bool
    && (j -> j -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) j
    j1 j
    j2)
            Bool -> Bool -> Bool
    && (k -> k -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) k
    k1 k
    k2)
            Bool -> Bool -> Bool
    && (l -> l -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) l
    l1 l
    l2)
            )
        {-# INLINE (===) #-}

        ~== :: (a, b, c, d, e, f, g, h, i, j, k, l)
    -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool
    (~==) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1,g
    g1,h
    h1,i
    i1,j
    j1,k
    k1,l
    l1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2,g
    g2,h
    h2,i
    i2,j
    j2,k
    k2,l
    l2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) f
    f1 f
    f2)
            Bool -> Bool -> Bool
    && (g -> g -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) g
    g1 g
    g2)
            Bool -> Bool -> Bool
    && (h -> h -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) h
    h1 h
    h2)
            Bool -> Bool -> Bool
    && (i -> i -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) i
    i1 i
    i2)
            Bool -> Bool -> Bool
    && (j -> j -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) j
    j1 j
    j2)
            Bool -> Bool -> Bool
    && (k -> k -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) k
    k1 k
    k2)
            Bool -> Bool -> Bool
    && (l -> l -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) l
    l1 l
    l2)
            )
        {-# INLINE (~==) #-}

    instance (AEq a, AEq b, AEq c, AEq d, AEq e, AEq f, AEq g, AEq h, AEq i, AEq j, AEq k, AEq l, AEq m) => AEq (a,b,c,d,e,f,g,h,i,j,k,l,m) where
        === :: (a, b, c, d, e, f, g, h, i, j, k, l, m)
    -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool
    (===) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1,g
    g1,h
    h1,i
    i1,j
    j1,k
    k1,l
    l1,m
    m1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2,g
    g2,h
    h2,i
    i2,j
    j2,k
    k2,l
    l2,m
    m2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) f
    f1 f
    f2)
            Bool -> Bool -> Bool
    && (g -> g -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) g
    g1 g
    g2)
            Bool -> Bool -> Bool
    && (h -> h -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) h
    h1 h
    h2)
            Bool -> Bool -> Bool
    && (i -> i -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) i
    i1 i
    i2)
            Bool -> Bool -> Bool
    && (j -> j -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) j
    j1 j
    j2)
            Bool -> Bool -> Bool
    && (k -> k -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) k
    k1 k
    k2)
            Bool -> Bool -> Bool
    && (l -> l -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) l
    l1 l
    l2)
            Bool -> Bool -> Bool
    && (m -> m -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) m
    m1 m
    m2)
            )
        {-# INLINE (===) #-}

        ~== :: (a, b, c, d, e, f, g, h, i, j, k, l, m)
    -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool
    (~==) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1,g
    g1,h
    h1,i
    i1,j
    j1,k
    k1,l
    l1,m
    m1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2,g
    g2,h
    h2,i
    i2,j
    j2,k
    k2,l
    l2,m
    m2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) f
    f1 f
    f2)
            Bool -> Bool -> Bool
    && (g -> g -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) g
    g1 g
    g2)
            Bool -> Bool -> Bool
    && (h -> h -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) h
    h1 h
    h2)
            Bool -> Bool -> Bool
    && (i -> i -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) i
    i1 i
    i2)
            Bool -> Bool -> Bool
    && (j -> j -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) j
    j1 j
    j2)
            Bool -> Bool -> Bool
    && (k -> k -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) k
    k1 k
    k2)
            Bool -> Bool -> Bool
    && (l -> l -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) l
    l1 l
    l2)
            Bool -> Bool -> Bool
    && (m -> m -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) m
    m1 m
    m2)
            )
        {-# INLINE (~==) #-}

    instance (AEq a, AEq b, AEq c, AEq d, AEq e, AEq f, AEq g, AEq h, AEq i, AEq j, AEq k, AEq l, AEq m, AEq n) => AEq (a,b,c,d,e,f,g,h,i,j,k,l,m,n) where
        === :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n)
    -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool
    (===) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1,g
    g1,h
    h1,i
    i1,j
    j1,k
    k1,l
    l1,m
    m1,n
    n1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2,g
    g2,h
    h2,i
    i2,j
    j2,k
    k2,l
    l2,m
    m2,n
    n2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) f
    f1 f
    f2)
            Bool -> Bool -> Bool
    && (g -> g -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) g
    g1 g
    g2)
            Bool -> Bool -> Bool
    && (h -> h -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) h
    h1 h
    h2)
            Bool -> Bool -> Bool
    && (i -> i -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) i
    i1 i
    i2)
            Bool -> Bool -> Bool
    && (j -> j -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) j
    j1 j
    j2)
            Bool -> Bool -> Bool
    && (k -> k -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) k
    k1 k
    k2)
            Bool -> Bool -> Bool
    && (l -> l -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) l
    l1 l
    l2)
            Bool -> Bool -> Bool
    && (m -> m -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) m
    m1 m
    m2)
            Bool -> Bool -> Bool
    && (n -> n -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) n
    n1 n
    n2)
            )
        {-# INLINE (===) #-}

        ~== :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n)
    -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool
    (~==) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1,g
    g1,h
    h1,i
    i1,j
    j1,k
    k1,l
    l1,m
    m1,n
    n1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2,g
    g2,h
    h2,i
    i2,j
    j2,k
    k2,l
    l2,m
    m2,n
    n2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) f
    f1 f
    f2)
            Bool -> Bool -> Bool
    && (g -> g -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) g
    g1 g
    g2)
            Bool -> Bool -> Bool
    && (h -> h -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) h
    h1 h
    h2)
            Bool -> Bool -> Bool
    && (i -> i -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) i
    i1 i
    i2)
            Bool -> Bool -> Bool
    && (j -> j -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) j
    j1 j
    j2)
            Bool -> Bool -> Bool
    && (k -> k -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) k
    k1 k
    k2)
            Bool -> Bool -> Bool
    && (l -> l -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) l
    l1 l
    l2)
            Bool -> Bool -> Bool
    && (m -> m -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) m
    m1 m
    m2)
            Bool -> Bool -> Bool
    && (n -> n -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) n
    n1 n
    n2)
            )
        {-# INLINE (~==) #-}

    instance (AEq a, AEq b, AEq c, AEq d, AEq e, AEq f, AEq g, AEq h, AEq i, AEq j, AEq k, AEq l, AEq m, AEq n, AEq o) => AEq (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) where
        === :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
    -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool
    (===) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1,g
    g1,h
    h1,i
    i1,j
    j1,k
    k1,l
    l1,m
    m1,n
    n1,o
    o1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2,g
    g2,h
    h2,i
    i2,j
    j2,k
    k2,l
    l2,m
    m2,n
    n2,o
    o2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) f
    f1 f
    f2)
            Bool -> Bool -> Bool
    && (g -> g -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) g
    g1 g
    g2)
            Bool -> Bool -> Bool
    && (h -> h -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) h
    h1 h
    h2)
            Bool -> Bool -> Bool
    && (i -> i -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) i
    i1 i
    i2)
            Bool -> Bool -> Bool
    && (j -> j -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) j
    j1 j
    j2)
            Bool -> Bool -> Bool
    && (k -> k -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) k
    k1 k
    k2)
            Bool -> Bool -> Bool
    && (l -> l -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) l
    l1 l
    l2)
            Bool -> Bool -> Bool
    && (m -> m -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) m
    m1 m
    m2)
            Bool -> Bool -> Bool
    && (n -> n -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) n
    n1 n
    n2)
            Bool -> Bool -> Bool
    && (o -> o -> Bool
    forall a. AEq a => a -> a -> Bool
    (===) o
    o1 o
    o2)
            )
        {-# INLINE (===) #-}

        ~== :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
    -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool
    (~==) (a
    a1,b
    b1,c
    c1,d
    d1,e
    e1,f
    f1,g
    g1,h
    h1,i
    i1,j
    j1,k
    k1,l
    l1,m
    m1,n
    n1,o
    o1) (a
    a2,b
    b2,c
    c2,d
    d2,e
    e2,f
    f2,g
    g2,h
    h2,i
    i2,j
    j2,k
    k2,l
    l2,m
    m2,n
    n2,o
    o2) =
            (  (a -> a -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) a
    a1 a
    a2)
            Bool -> Bool -> Bool
    && (b -> b -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) b
    b1 b
    b2)
            Bool -> Bool -> Bool
    && (c -> c -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) c
    c1 c
    c2)
            Bool -> Bool -> Bool
    && (d -> d -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) d
    d1 d
    d2)
            Bool -> Bool -> Bool
    && (e -> e -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) e
    e1 e
    e2)
            Bool -> Bool -> Bool
    && (f -> f -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) f
    f1 f
    f2)
            Bool -> Bool -> Bool
    && (g -> g -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) g
    g1 g
    g2)
            Bool -> Bool -> Bool
    && (h -> h -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) h
    h1 h
    h2)
            Bool -> Bool -> Bool
    && (i -> i -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) i
    i1 i
    i2)
            Bool -> Bool -> Bool
    && (j -> j -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) j
    j1 j
    j2)
            Bool -> Bool -> Bool
    && (k -> k -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) k
    k1 k
    k2)
            Bool -> Bool -> Bool
    && (l -> l -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) l
    l1 l
    l2)
            Bool -> Bool -> Bool
    && (m -> m -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) m
    m1 m
    m2)
            Bool -> Bool -> Bool
    && (n -> n -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) n
    n1 n
    n2)
            Bool -> Bool -> Bool
    && (o -> o -> Bool
    forall a. AEq a => a -> a -> Bool
    (~==) o
    o1 o
    o2)
            )
        {-# INLINE (~==) #-}