{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >=704
{-# LANGUAGE Safe #-}
#elif __GLASGOW_HASKELL__ >=702
{-# LANGUAGE Trustworthy #-}
#endif
module RERE.Tuples where
data Triple a b c = T !a !b !c
deriving (Triple a b c -> Triple a b c -> Bool
(Triple a b c -> Triple a b c -> Bool)
-> (Triple a b c -> Triple a b c -> Bool) -> Eq (Triple a b c)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall a b c.
(Eq a, Eq b, Eq c) =>
Triple a b c -> Triple a b c -> Bool
/= :: Triple a b c -> Triple a b c -> Bool
$c/= :: forall a b c.
(Eq a, Eq b, Eq c) =>
Triple a b c -> Triple a b c -> Bool
== :: Triple a b c -> Triple a b c -> Bool
$c== :: forall a b c.
(Eq a, Eq b, Eq c) =>
Triple a b c -> Triple a b c -> Bool
Eq, Eq (Triple a b c)
Eq (Triple a b c)
-> (Triple a b c -> Triple a b c -> Ordering)
-> (Triple a b c -> Triple a b c -> Bool)
-> (Triple a b c -> Triple a b c -> Bool)
-> (Triple a b c -> Triple a b c -> Bool)
-> (Triple a b c -> Triple a b c -> Bool)
-> (Triple a b c -> Triple a b c -> Triple a b c)
-> (Triple a b c -> Triple a b c -> Triple a b c)
-> Ord (Triple a b c)
Triple a b c -> Triple a b c -> Bool
Triple a b c -> Triple a b c -> Ordering
Triple a b c -> Triple a b c -> Triple a b c
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. (Ord a, Ord b, Ord c) => Eq (Triple a b c)
forall a b c.
(Ord a, Ord b, Ord c) =>
Triple a b c -> Triple a b c -> Bool
forall a b c.
(Ord a, Ord b, Ord c) =>
Triple a b c -> Triple a b c -> Ordering
forall a b c.
(Ord a, Ord b, Ord c) =>
Triple a b c -> Triple a b c -> Triple a b c
min :: Triple a b c -> Triple a b c -> Triple a b c
$cmin :: forall a b c.
(Ord a, Ord b, Ord c) =>
Triple a b c -> Triple a b c -> Triple a b c
max :: Triple a b c -> Triple a b c -> Triple a b c
$cmax :: forall a b c.
(Ord a, Ord b, Ord c) =>
Triple a b c -> Triple a b c -> Triple a b c
>= :: Triple a b c -> Triple a b c -> Bool
$c>= :: forall a b c.
(Ord a, Ord b, Ord c) =>
Triple a b c -> Triple a b c -> Bool
> :: Triple a b c -> Triple a b c -> Bool
$c> :: forall a b c.
(Ord a, Ord b, Ord c) =>
Triple a b c -> Triple a b c -> Bool
<= :: Triple a b c -> Triple a b c -> Bool
$c<= :: forall a b c.
(Ord a, Ord b, Ord c) =>
Triple a b c -> Triple a b c -> Bool
< :: Triple a b c -> Triple a b c -> Bool
$c< :: forall a b c.
(Ord a, Ord b, Ord c) =>
Triple a b c -> Triple a b c -> Bool
compare :: Triple a b c -> Triple a b c -> Ordering
$ccompare :: forall a b c.
(Ord a, Ord b, Ord c) =>
Triple a b c -> Triple a b c -> Ordering
$cp1Ord :: forall a b c. (Ord a, Ord b, Ord c) => Eq (Triple a b c)
Ord)
bimap :: (b -> b') -> (c -> c') -> Triple a b c -> Triple a b' c'
bimap :: (b -> b') -> (c -> c') -> Triple a b c -> Triple a b' c'
bimap b -> b'
f c -> c'
g (T a
a b
b c
c) = a -> b' -> c' -> Triple a b' c'
forall a b c. a -> b -> c -> Triple a b c
T a
a (b -> b'
f b
b) (c -> c'
g c
c)
fstOf3 :: Triple a b c -> a
fstOf3 :: Triple a b c -> a
fstOf3 (T a
a b
_ c
_) = a
a
sndOf3 :: Triple a b c -> b
sndOf3 :: Triple a b c -> b
sndOf3 (T a
_ b
b c
_) = b
b
trdOf3 :: Triple a b c -> c
trdOf3 :: Triple a b c -> c
trdOf3 (T a
_ b
_ c
c) = c
c