{-# 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.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 T6 a b c d e f
= T6 a b c d e f
deriving stock (T6 a b c d e f
T6 a b c d e f -> T6 a b c d e f -> Bounded (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
(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)
-> Eq (T6 a b c d e f)
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, Eq (T6 a b c d e f)
Eq (T6 a b c d e f)
-> (T6 a b c d e f -> T6 a b c d e f -> Ordering)
-> (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)
-> (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)
-> (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 -> T6 a b c d e f)
-> Ord (T6 a b c d e 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 -> Ordering
T6 a b c d e f -> T6 a b c d e f -> T6 a b c d e f
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
$cp1Ord :: 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)
Ord, ReadPrec [T6 a b c d e f]
ReadPrec (T6 a b c d e f)
Int -> ReadS (T6 a b c d e f)
ReadS [T6 a b c d e f]
(Int -> ReadS (T6 a b c d e f))
-> ReadS [T6 a b c d e f]
-> ReadPrec (T6 a b c d e f)
-> ReadPrec [T6 a b c d e f]
-> Read (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
[T6 a b c d e f] -> ShowS
T6 a b c d e f -> String
(Int -> T6 a b c d e f -> ShowS)
-> (T6 a b c d e f -> String)
-> ([T6 a b c d e f] -> ShowS)
-> Show (T6 a b c d e f)
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 x. T6 a b c d e f -> Rep (T6 a b c d e f) x)
-> (forall x. Rep (T6 a b c d e f) x -> T6 a b c d e f)
-> Generic (T6 a b c d e f)
forall x. Rep (T6 a b c d e f) x -> T6 a b c d e f
forall x. T6 a b c d e f -> Rep (T6 a b c d e f) x
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)
deriving stock instance Foldable (T6 a b c d e)
deriving stock instance Functor (T6 a b c d e)
deriving stock instance Traversable (T6 a b c d e)
instance (Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Applicative (T6 a b c d e) where
pure :: a -> T6 a b c d e a
pure a
f = a -> b -> c -> d -> e -> a -> T6 a b c d e a
forall a b c d e f. a -> b -> c -> d -> e -> f -> T6 a b c d e f
T6 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 a
f
T6 a
a b
b c
c d
d e
e a -> b
f <*> :: 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' =
a -> b -> c -> d -> e -> b -> T6 a b c d e b
forall a b c d e f. a -> b -> c -> d -> e -> f -> T6 a b c d e f
T6 (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') (a -> b
f a
f')
instance (Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monad (T6 a b c d e) where
return :: a -> T6 a b c d e a
return = a -> T6 a b c d e a
forall (f :: * -> *) a. Applicative f => a -> f a
pure
T6 a
a b
b c
c d
d e
e a
f >>= :: 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' -> a -> b -> c -> d -> e -> b -> T6 a b c d e b
forall a b c d e f. a -> b -> c -> d -> e -> f -> T6 a b c d e f
T6 (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') 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) = 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
hashWithSalt :: Int -> T6 a b c d e f -> Int
hashWithSalt = Int -> T6 a b c d e f -> Int
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 :: (Int -> a -> Int) -> Int -> T6 a b c d e a -> Int
liftHashWithSalt = (Int -> a -> Int) -> Int -> T6 a b c d e 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) => Hashable2 (T6 a b c d) where
liftHashWithSalt2 :: (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 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 -> 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 = a -> b -> c -> d -> e -> f -> T6 a b c d e f
forall a b c d e f. a -> b -> c -> d -> e -> f -> T6 a b c d e f
T6 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
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) = 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
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 = a -> b -> c -> d -> e -> f -> T6 a b c d e f
forall a b c d e f. a -> b -> c -> d -> e -> f -> T6 a b c d e f
T6 (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)
stimes :: 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) = a -> b -> c -> d -> e -> f -> T6 a b c d e f
forall a b c d e f. a -> b -> c -> d -> e -> f -> T6 a b c d e f
T6 (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)
instance Bifunctor (T6 x y z w) where
bimap :: (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) = x -> y -> z -> w -> b -> d -> T6 x y z w b d
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)
instance Bifoldable (T6 x y z w) where
bifoldMap :: (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 m -> m -> m
forall a. Semigroup a => a -> a -> a
<> b -> m
g b
b
instance Bitraversable (T6 x y z w) where
bitraverse :: (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) = x -> y -> z -> w -> c -> d -> T6 x y z w c d
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 (c -> d -> T6 x y z w c d) -> f c -> f (d -> T6 x y z w c d)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a -> f c
f a
a f (d -> T6 x y z w c d) -> f d -> f (T6 x y z w c d)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> b -> f d
g b
b