{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE StrictData #-}

module Data.Tuple.Strict.T6
  ( T6 (..),
  )
where

import Control.DeepSeq (NFData, rnf)
import Data.Bifoldable
import Data.Bifunctor
import Data.Bitraversable
import Data.Functor.Classes (Eq1 (liftEq), Eq2 (liftEq2))
import Data.Hashable (Hashable, hash, hashWithSalt)
import Data.Hashable.Lifted
  ( Hashable1,
    Hashable2,
    defaultLiftHashWithSalt,
    hashWithSalt1,
    liftHashWithSalt,
    liftHashWithSalt2,
  )
import Data.Semigroup
import GHC.Generics (Generic)

data T6 a b c d e f
  = T6 a b c d e f
  deriving stock (T6 a b c d e f
forall a. a -> a -> Bounded a
forall a b c d e f.
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e,
 Bounded f) =>
T6 a b c d e f
maxBound :: T6 a b c d e f
$cmaxBound :: forall a b c d e f.
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e,
 Bounded f) =>
T6 a b c d e f
minBound :: T6 a b c d e f
$cminBound :: forall a b c d e f.
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e,
 Bounded f) =>
T6 a b c d e f
Bounded, T6 a b c d e f -> T6 a b c d e f -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall a b c d e f.
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) =>
T6 a b c d e f -> T6 a b c d e f -> Bool
/= :: T6 a b c d e f -> T6 a b c d e f -> Bool
$c/= :: forall a b c d e f.
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) =>
T6 a b c d e f -> T6 a b c d e f -> Bool
== :: T6 a b c d e f -> T6 a b c d e f -> Bool
$c== :: forall a b c d e f.
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) =>
T6 a b c d e f -> T6 a b c d e f -> Bool
Eq, T6 a b c d e f -> T6 a b c d e f -> Bool
T6 a b c d e f -> T6 a b c d e f -> Ordering
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall {a} {b} {c} {d} {e} {f}.
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) =>
Eq (T6 a b c d e f)
forall a b c d e f.
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) =>
T6 a b c d e f -> T6 a b c d e f -> Bool
forall a b c d e f.
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) =>
T6 a b c d e f -> T6 a b c d e f -> Ordering
forall a b c d e f.
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) =>
T6 a b c d e f -> T6 a b c d e f -> T6 a b c d e f
min :: T6 a b c d e f -> T6 a b c d e f -> T6 a b c d e f
$cmin :: forall a b c d e f.
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) =>
T6 a b c d e f -> T6 a b c d e f -> T6 a b c d e f
max :: T6 a b c d e f -> T6 a b c d e f -> T6 a b c d e f
$cmax :: forall a b c d e f.
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) =>
T6 a b c d e f -> T6 a b c d e f -> T6 a b c d e f
>= :: T6 a b c d e f -> T6 a b c d e f -> Bool
$c>= :: forall a b c d e f.
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) =>
T6 a b c d e f -> T6 a b c d e f -> Bool
> :: T6 a b c d e f -> T6 a b c d e f -> Bool
$c> :: forall a b c d e f.
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) =>
T6 a b c d e f -> T6 a b c d e f -> Bool
<= :: T6 a b c d e f -> T6 a b c d e f -> Bool
$c<= :: forall a b c d e f.
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) =>
T6 a b c d e f -> T6 a b c d e f -> Bool
< :: T6 a b c d e f -> T6 a b c d e f -> Bool
$c< :: forall a b c d e f.
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) =>
T6 a b c d e f -> T6 a b c d e f -> Bool
compare :: T6 a b c d e f -> T6 a b c d e f -> Ordering
$ccompare :: forall a b c d e f.
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) =>
T6 a b c d e f -> T6 a b c d e f -> Ordering
Ord, ReadPrec [T6 a b c d e f]
ReadPrec (T6 a b c d e f)
ReadS [T6 a b c d e f]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
forall a b c d e f.
(Read a, Read b, Read c, Read d, Read e, Read f) =>
ReadPrec [T6 a b c d e f]
forall a b c d e f.
(Read a, Read b, Read c, Read d, Read e, Read f) =>
ReadPrec (T6 a b c d e f)
forall a b c d e f.
(Read a, Read b, Read c, Read d, Read e, Read f) =>
Int -> ReadS (T6 a b c d e f)
forall a b c d e f.
(Read a, Read b, Read c, Read d, Read e, Read f) =>
ReadS [T6 a b c d e f]
readListPrec :: ReadPrec [T6 a b c d e f]
$creadListPrec :: forall a b c d e f.
(Read a, Read b, Read c, Read d, Read e, Read f) =>
ReadPrec [T6 a b c d e f]
readPrec :: ReadPrec (T6 a b c d e f)
$creadPrec :: forall a b c d e f.
(Read a, Read b, Read c, Read d, Read e, Read f) =>
ReadPrec (T6 a b c d e f)
readList :: ReadS [T6 a b c d e f]
$creadList :: forall a b c d e f.
(Read a, Read b, Read c, Read d, Read e, Read f) =>
ReadS [T6 a b c d e f]
readsPrec :: Int -> ReadS (T6 a b c d e f)
$creadsPrec :: forall a b c d e f.
(Read a, Read b, Read c, Read d, Read e, Read f) =>
Int -> ReadS (T6 a b c d e f)
Read, Int -> T6 a b c d e f -> ShowS
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall a b c d e f.
(Show a, Show b, Show c, Show d, Show e, Show f) =>
Int -> T6 a b c d e f -> ShowS
forall a b c d e f.
(Show a, Show b, Show c, Show d, Show e, Show f) =>
[T6 a b c d e f] -> ShowS
forall a b c d e f.
(Show a, Show b, Show c, Show d, Show e, Show f) =>
T6 a b c d e f -> String
showList :: [T6 a b c d e f] -> ShowS
$cshowList :: forall a b c d e f.
(Show a, Show b, Show c, Show d, Show e, Show f) =>
[T6 a b c d e f] -> ShowS
show :: T6 a b c d e f -> String
$cshow :: forall a b c d e f.
(Show a, Show b, Show c, Show d, Show e, Show f) =>
T6 a b c d e f -> String
showsPrec :: Int -> T6 a b c d e f -> ShowS
$cshowsPrec :: forall a b c d e f.
(Show a, Show b, Show c, Show d, Show e, Show f) =>
Int -> T6 a b c d e f -> ShowS
Show, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a b c d e f x. Rep (T6 a b c d e f) x -> T6 a b c d e f
forall a b c d e f x. T6 a b c d e f -> Rep (T6 a b c d e f) x
$cto :: forall a b c d e f x. Rep (T6 a b c d e f) x -> T6 a b c d e f
$cfrom :: forall a b c d e f x. T6 a b c d e f -> Rep (T6 a b c d e f) x
Generic)

-- | @since 0.1.3
deriving stock instance Foldable (T6 a b c d e)

-- | @since 0.1.3
deriving stock instance Functor (T6 a b c d e)

-- | @since 0.1.3
deriving stock instance Traversable (T6 a b c d e)

-- | @since 0.1.5
instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq1 (T6 a b c d e) where
  liftEq :: forall a b.
(a -> b -> Bool) -> T6 a b c d e a -> T6 a b c d e b -> Bool
liftEq = forall (f :: * -> * -> *) a b c d.
Eq2 f =>
(a -> b -> Bool) -> (c -> d -> Bool) -> f a c -> f b d -> Bool
liftEq2 forall a. Eq a => a -> a -> Bool
(==)

-- | @since 0.1.5
instance (Eq a, Eq b, Eq c, Eq d) => Eq2 (T6 a b c d) where
  liftEq2 :: forall a b c d.
(a -> b -> Bool)
-> (c -> d -> Bool) -> T6 a b c d a c -> T6 a b c d b d -> Bool
liftEq2 a -> b -> Bool
e1 c -> d -> Bool
e2 (T6 a
a b
b c
c d
d a
e c
f) (T6 a
a' b
b' c
c' d
d' b
e' d
f') =
    a
a forall a. Eq a => a -> a -> Bool
== a
a' Bool -> Bool -> Bool
&& b
b forall a. Eq a => a -> a -> Bool
== b
b' Bool -> Bool -> Bool
&& c
c forall a. Eq a => a -> a -> Bool
== c
c' Bool -> Bool -> Bool
&& d
d forall a. Eq a => a -> a -> Bool
== d
d' Bool -> Bool -> Bool
&& a -> b -> Bool
e1 a
e b
e' Bool -> Bool -> Bool
&& c -> d -> Bool
e2 c
f d
f'

-- | @since 0.1.3
instance (Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Applicative (T6 a b c d e) where
  pure :: forall a. a -> T6 a b c d e a
pure a
f = forall a b c d e f. a -> b -> c -> d -> e -> f -> T6 a b c d e f
T6 forall a. Monoid a => a
mempty forall a. Monoid a => a
mempty forall a. Monoid a => a
mempty forall a. Monoid a => a
mempty forall a. Monoid a => a
mempty a
f
  T6 a
a b
b c
c d
d e
e a -> b
f <*> :: forall a b.
T6 a b c d e (a -> b) -> T6 a b c d e a -> T6 a b c d e b
<*> T6 a
a' b
b' c
c' d
d' e
e' a
f' =
    forall a b c d e f. a -> b -> c -> d -> e -> f -> T6 a b c d e f
T6 (a
a forall a. Semigroup a => a -> a -> a
<> a
a') (b
b forall a. Semigroup a => a -> a -> a
<> b
b') (c
c forall a. Semigroup a => a -> a -> a
<> c
c') (d
d forall a. Semigroup a => a -> a -> a
<> d
d') (e
e forall a. Semigroup a => a -> a -> a
<> e
e') (a -> b
f a
f')

-- | @since 0.1.3
instance (Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monad (T6 a b c d e) where
  return :: forall a. a -> T6 a b c d e a
return = forall (f :: * -> *) a. Applicative f => a -> f a
pure
  T6 a
a b
b c
c d
d e
e a
f >>= :: forall a b.
T6 a b c d e a -> (a -> T6 a b c d e b) -> T6 a b c d e b
>>= a -> T6 a b c d e b
g = case a -> T6 a b c d e b
g a
f of
    T6 a
a' b
b' c
c' d
d' e
e' b
f' -> forall a b c d e f. a -> b -> c -> d -> e -> f -> T6 a b c d e f
T6 (a
a forall a. Semigroup a => a -> a -> a
<> a
a') (b
b forall a. Semigroup a => a -> a -> a
<> b
b') (c
c forall a. Semigroup a => a -> a -> a
<> c
c') (d
d forall a. Semigroup a => a -> a -> a
<> d
d') (e
e forall a. Semigroup a => a -> a -> a
<> e
e') b
f'

instance (Hashable a, Hashable b, Hashable c, Hashable d, Hashable e, Hashable f) => Hashable (T6 a b c d e f) where
  hash :: T6 a b c d e f -> Int
hash (T6 a
a b
b c
c d
d e
e f
f) = forall a. Hashable a => a -> Int
hash a
a forall a. Hashable a => Int -> a -> Int
`hashWithSalt` b
b forall a. Hashable a => Int -> a -> Int
`hashWithSalt` c
c forall a. Hashable a => Int -> a -> Int
`hashWithSalt` d
d forall a. Hashable a => Int -> a -> Int
`hashWithSalt` e
e forall a. Hashable a => Int -> a -> Int
`hashWithSalt` f
f
  hashWithSalt :: Int -> T6 a b c d e f -> Int
hashWithSalt = forall (f :: * -> *) a.
(Hashable1 f, Hashable a) =>
Int -> f a -> Int
hashWithSalt1

instance (Hashable a, Hashable b, Hashable c, Hashable d, Hashable e) => Hashable1 (T6 a b c d e) where
  liftHashWithSalt :: forall a. (Int -> a -> Int) -> Int -> T6 a b c d e a -> Int
liftHashWithSalt = forall (f :: * -> * -> *) a b.
(Hashable2 f, Hashable a) =>
(Int -> b -> Int) -> Int -> f a b -> Int
defaultLiftHashWithSalt

instance (Hashable a, Hashable b, Hashable c, Hashable d) => Hashable2 (T6 a b c d) where
  liftHashWithSalt2 :: forall a b.
(Int -> a -> Int)
-> (Int -> b -> Int) -> Int -> T6 a b c d a b -> Int
liftHashWithSalt2 Int -> a -> Int
h1 Int -> b -> Int
h2 Int
slt (T6 a
a b
b c
c d
d a
e b
f) =
    (Int
slt forall a. Hashable a => Int -> a -> Int
`hashWithSalt` a
a forall a. Hashable a => Int -> a -> Int
`hashWithSalt` b
b forall a. Hashable a => Int -> a -> Int
`hashWithSalt` c
c forall a. Hashable a => Int -> a -> Int
`hashWithSalt` d
d) Int -> a -> Int
`h1` a
e Int -> b -> Int
`h2` b
f

instance (Monoid a, Monoid b, Monoid c, Monoid d, Monoid e, Monoid f) => Monoid (T6 a b c d e f) where
  mempty :: T6 a b c d e f
mempty = forall a b c d e f. a -> b -> c -> d -> e -> f -> T6 a b c d e f
T6 forall a. Monoid a => a
mempty forall a. Monoid a => a
mempty forall a. Monoid a => a
mempty forall a. Monoid a => a
mempty forall a. Monoid a => a
mempty forall a. Monoid a => a
mempty

-- | @since 0.1.4
instance (NFData a, NFData b, NFData c, NFData d, NFData e, NFData f) => NFData (T6 a b c d e f) where
  rnf :: T6 a b c d e f -> ()
rnf (T6 a
a b
b c
c d
d e
e f
f) = forall a. NFData a => a -> ()
rnf a
a seq :: forall a b. a -> b -> b
`seq` forall a. NFData a => a -> ()
rnf b
b seq :: forall a b. a -> b -> b
`seq` forall a. NFData a => a -> ()
rnf c
c seq :: forall a b. a -> b -> b
`seq` forall a. NFData a => a -> ()
rnf d
d seq :: forall a b. a -> b -> b
`seq` forall a. NFData a => a -> ()
rnf e
e seq :: forall a b. a -> b -> b
`seq` forall a. NFData a => a -> ()
rnf f
f

instance (Semigroup a, Semigroup b, Semigroup c, Semigroup d, Semigroup e, Semigroup f) => Semigroup (T6 a b c d e f) where
  T6 a
a1 b
b1 c
c1 d
d1 e
e1 f
f1 <> :: T6 a b c d e f -> T6 a b c d e f -> T6 a b c d e f
<> T6 a
a2 b
b2 c
c2 d
d2 e
e2 f
f2 = forall a b c d e f. a -> b -> c -> d -> e -> f -> T6 a b c d e f
T6 (a
a1 forall a. Semigroup a => a -> a -> a
<> a
a2) (b
b1 forall a. Semigroup a => a -> a -> a
<> b
b2) (c
c1 forall a. Semigroup a => a -> a -> a
<> c
c2) (d
d1 forall a. Semigroup a => a -> a -> a
<> d
d2) (e
e1 forall a. Semigroup a => a -> a -> a
<> e
e2) (f
f1 forall a. Semigroup a => a -> a -> a
<> f
f2)
  stimes :: forall b. Integral b => b -> T6 a b c d e f -> T6 a b c d e f
stimes b
ii (T6 a
a b
b c
c d
d e
e f
f) = forall a b c d e f. a -> b -> c -> d -> e -> f -> T6 a b c d e f
T6 (forall a b. (Semigroup a, Integral b) => b -> a -> a
stimes b
ii a
a) (forall a b. (Semigroup a, Integral b) => b -> a -> a
stimes b
ii b
b) (forall a b. (Semigroup a, Integral b) => b -> a -> a
stimes b
ii c
c) (forall a b. (Semigroup a, Integral b) => b -> a -> a
stimes b
ii d
d) (forall a b. (Semigroup a, Integral b) => b -> a -> a
stimes b
ii e
e) (forall a b. (Semigroup a, Integral b) => b -> a -> a
stimes b
ii f
f)

-- | @since 0.1.3
instance Bifunctor (T6 x y z w) where
  bimap :: forall a b c d.
(a -> b) -> (c -> d) -> T6 x y z w a c -> T6 x y z w b d
bimap a -> b
f c -> d
g (T6 x
x y
y z
z w
w a
a c
b) = forall a b c d e f. a -> b -> c -> d -> e -> f -> T6 a b c d e f
T6 x
x y
y z
z w
w (a -> b
f a
a) (c -> d
g c
b)

-- | @since 0.1.3
instance Bifoldable (T6 x y z w) where
  bifoldMap :: forall m a b.
Monoid m =>
(a -> m) -> (b -> m) -> T6 x y z w a b -> m
bifoldMap a -> m
f b -> m
g (T6 x
_ y
_ z
_ w
_ a
a b
b) = a -> m
f a
a forall a. Semigroup a => a -> a -> a
<> b -> m
g b
b

-- | @since 0.1.3
instance Bitraversable (T6 x y z w) where
  bitraverse :: forall (f :: * -> *) a c b d.
Applicative f =>
(a -> f c) -> (b -> f d) -> T6 x y z w a b -> f (T6 x y z w c d)
bitraverse a -> f c
f b -> f d
g (T6 x
x y
y z
z w
w a
a b
b) = forall a b c d e f. a -> b -> c -> d -> e -> f -> T6 a b c d e f
T6 x
x y
y z
z w
w forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a -> f c
f a
a forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> b -> f d
g b
b