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

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

import Control.DeepSeq (NFData, rnf)
import Data.Biapplicative
import Data.Bifoldable
import Data.Bitraversable
import Data.Hashable (Hashable, hash, hashWithSalt)
import Data.Hashable.Lifted
  ( Hashable1,
    Hashable2,
    defaultLiftHashWithSalt,
    hashWithSalt1,
    liftHashWithSalt,
    liftHashWithSalt2,
  )
import Data.Semigroup
import GHC.Generics (Generic)

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

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

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

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

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

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

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

instance (Hashable a, Hashable b, Hashable c, Hashable d, Hashable e, Hashable f) => Hashable1 (T7 a b c d e f) where
  liftHashWithSalt :: (Int -> a -> Int) -> Int -> T7 a b c d e f a -> Int
liftHashWithSalt = (Int -> a -> Int) -> Int -> T7 a b c d e f a -> Int
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, Hashable e) => Hashable2 (T7 a b c d e) where
  liftHashWithSalt2 :: (Int -> a -> Int)
-> (Int -> b -> Int) -> Int -> T7 a b c d e a b -> Int
liftHashWithSalt2 Int -> a -> Int
h1 Int -> b -> Int
h2 Int
slt (T7 a
a b
b c
c d
d e
e a
f b
g) =
    (Int
slt Int -> a -> Int
forall a. Hashable a => Int -> a -> Int
`hashWithSalt` a
a Int -> b -> Int
forall a. Hashable a => Int -> a -> Int
`hashWithSalt` b
b Int -> c -> Int
forall a. Hashable a => Int -> a -> Int
`hashWithSalt` c
c Int -> d -> Int
forall a. Hashable a => Int -> a -> Int
`hashWithSalt` d
d Int -> e -> Int
forall a. Hashable a => Int -> a -> Int
`hashWithSalt` e
e) Int -> a -> Int
`h1` a
f Int -> b -> Int
`h2` b
g

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

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

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

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

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

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