{-# LANGUAGE MagicHash #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_HADDOCK not-home #-}
module GHC.Ix (
Ix(..), indexError
) where
import GHC.Enum
import GHC.Num
import GHC.Base
import GHC.Real( fromIntegral )
import GHC.Show
import GHC.Tuple (Solo (..))
class (Ord a) => Ix a where
{-# MINIMAL range, (index | unsafeIndex), inRange #-}
range :: (a,a) -> [a]
index :: (a,a) -> a -> Int
unsafeIndex :: (a,a) -> a -> Int
inRange :: (a,a) -> a -> Bool
rangeSize :: (a,a) -> Int
unsafeRangeSize :: (a,a) -> Int
{-# INLINE index #-}
index (a, a)
b a
i | (a, a) -> a -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a, a)
b a
i = (a, a) -> a -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a, a)
b a
i
| Bool
otherwise = Int
hopelessIndexError
unsafeIndex (a, a)
b a
i = (a, a) -> a -> Int
forall a. Ix a => (a, a) -> a -> Int
index (a, a)
b a
i
rangeSize b :: (a, a)
b@(a
_l,a
h) | (a, a) -> a -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a, a)
b a
h = (a, a) -> a -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a, a)
b a
h Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
1
| Bool
otherwise = Int
0
unsafeRangeSize b :: (a, a)
b@(a
_l,a
h) = (a, a) -> a -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a, a)
b a
h Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
1
{-# NOINLINE indexError #-}
{-# SPECIALISE [2] indexError :: (Int,Int) -> Int -> String -> b #-}
indexError :: Show a => (a,a) -> a -> String -> b
indexError :: forall a b. Show a => (a, a) -> a -> String -> b
indexError (a, a)
rng a
i String
tp
= String -> b
forall a. String -> a
errorWithoutStackTrace (String -> ShowS
showString String
"Ix{" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ShowS
showString String
tp ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ShowS
showString String
"}.index: Index " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
Bool -> ShowS -> ShowS
showParen Bool
True (Int -> a -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
0 a
i) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
String -> ShowS
showString String
" out of range " ShowS -> ShowS
forall a b. (a -> b) -> a -> b
$
Bool -> ShowS -> ShowS
showParen Bool
True (Int -> (a, a) -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
0 (a, a)
rng) String
"")
hopelessIndexError :: Int
hopelessIndexError :: Int
hopelessIndexError = String -> Int
forall a. String -> a
errorWithoutStackTrace String
"Error in array index"
instance Ix Char where
{-# INLINE range #-}
range :: (Char, Char) -> String
range (Char
m,Char
n) = [Char
m..Char
n]
{-# INLINE unsafeIndex #-}
unsafeIndex :: (Char, Char) -> Char -> Int
unsafeIndex (Char
m,Char
_n) Char
i = Char -> Int
forall a. Enum a => a -> Int
fromEnum Char
i Int -> Int -> Int
forall a. Num a => a -> a -> a
- Char -> Int
forall a. Enum a => a -> Int
fromEnum Char
m
{-# INLINE index #-}
index :: (Char, Char) -> Char -> Int
index (Char, Char)
b Char
i | (Char, Char) -> Char -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (Char, Char)
b Char
i = (Char, Char) -> Char -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (Char, Char)
b Char
i
| Bool
otherwise = (Char, Char) -> Char -> String -> Int
forall a b. Show a => (a, a) -> a -> String -> b
indexError (Char, Char)
b Char
i String
"Char"
inRange :: (Char, Char) -> Char -> Bool
inRange (Char
m,Char
n) Char
i = Char
m Char -> Char -> Bool
forall a. Ord a => a -> a -> Bool
<= Char
i Bool -> Bool -> Bool
&& Char
i Char -> Char -> Bool
forall a. Ord a => a -> a -> Bool
<= Char
n
instance Ix Int where
{-# INLINE range #-}
range :: (Int, Int) -> [Int]
range (Int
m,Int
n) = [Int
m..Int
n]
{-# INLINE unsafeIndex #-}
unsafeIndex :: (Int, Int) -> Int -> Int
unsafeIndex (Int
m,Int
_n) Int
i = Int
i Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
m
{-# INLINE index #-}
index :: (Int, Int) -> Int -> Int
index (Int, Int)
b Int
i | (Int, Int) -> Int -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (Int, Int)
b Int
i = (Int, Int) -> Int -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (Int, Int)
b Int
i
| Bool
otherwise = (Int, Int) -> Int -> String -> Int
forall a b. Show a => (a, a) -> a -> String -> b
indexError (Int, Int)
b Int
i String
"Int"
{-# INLINE inRange #-}
inRange :: (Int, Int) -> Int -> Bool
inRange (I# Int#
m,I# Int#
n) (I# Int#
i) = Int# -> Bool
isTrue# (Int#
m Int# -> Int# -> Int#
<=# Int#
i) Bool -> Bool -> Bool
&& Int# -> Bool
isTrue# (Int#
i Int# -> Int# -> Int#
<=# Int#
n)
instance Ix Word where
range :: (Word, Word) -> [Word]
range (Word
m,Word
n) = [Word
m..Word
n]
unsafeIndex :: (Word, Word) -> Word -> Int
unsafeIndex (Word
m,Word
_) Word
i = Word -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word
i Word -> Word -> Word
forall a. Num a => a -> a -> a
- Word
m)
inRange :: (Word, Word) -> Word -> Bool
inRange (Word
m,Word
n) Word
i = Word
m Word -> Word -> Bool
forall a. Ord a => a -> a -> Bool
<= Word
i Bool -> Bool -> Bool
&& Word
i Word -> Word -> Bool
forall a. Ord a => a -> a -> Bool
<= Word
n
instance Ix Integer where
{-# INLINE range #-}
range :: (Integer, Integer) -> [Integer]
range (Integer
m,Integer
n) = [Integer
m..Integer
n]
{-# INLINE unsafeIndex #-}
unsafeIndex :: (Integer, Integer) -> Integer -> Int
unsafeIndex (Integer
m,Integer
_n) Integer
i = Integer -> Int
forall a. Num a => Integer -> a
fromInteger (Integer
i Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
- Integer
m)
{-# INLINE index #-}
index :: (Integer, Integer) -> Integer -> Int
index (Integer, Integer)
b Integer
i | (Integer, Integer) -> Integer -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (Integer, Integer)
b Integer
i = (Integer, Integer) -> Integer -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (Integer, Integer)
b Integer
i
| Bool
otherwise = (Integer, Integer) -> Integer -> String -> Int
forall a b. Show a => (a, a) -> a -> String -> b
indexError (Integer, Integer)
b Integer
i String
"Integer"
inRange :: (Integer, Integer) -> Integer -> Bool
inRange (Integer
m,Integer
n) Integer
i = Integer
m Integer -> Integer -> Bool
forall a. Ord a => a -> a -> Bool
<= Integer
i Bool -> Bool -> Bool
&& Integer
i Integer -> Integer -> Bool
forall a. Ord a => a -> a -> Bool
<= Integer
n
instance Ix Natural where
range :: (Natural, Natural) -> [Natural]
range (Natural
m,Natural
n) = [Natural
m..Natural
n]
inRange :: (Natural, Natural) -> Natural -> Bool
inRange (Natural
m,Natural
n) Natural
i = Natural
m Natural -> Natural -> Bool
forall a. Ord a => a -> a -> Bool
<= Natural
i Bool -> Bool -> Bool
&& Natural
i Natural -> Natural -> Bool
forall a. Ord a => a -> a -> Bool
<= Natural
n
unsafeIndex :: (Natural, Natural) -> Natural -> Int
unsafeIndex (Natural
m,Natural
_) Natural
i = Natural -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Natural
iNatural -> Natural -> Natural
forall a. Num a => a -> a -> a
-Natural
m)
index :: (Natural, Natural) -> Natural -> Int
index (Natural, Natural)
b Natural
i | (Natural, Natural) -> Natural -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (Natural, Natural)
b Natural
i = (Natural, Natural) -> Natural -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (Natural, Natural)
b Natural
i
| Bool
otherwise = (Natural, Natural) -> Natural -> String -> Int
forall a b. Show a => (a, a) -> a -> String -> b
indexError (Natural, Natural)
b Natural
i String
"Natural"
instance Ix Bool where
{-# INLINE range #-}
range :: (Bool, Bool) -> [Bool]
range (Bool
m,Bool
n) = [Bool
m..Bool
n]
{-# INLINE unsafeIndex #-}
unsafeIndex :: (Bool, Bool) -> Bool -> Int
unsafeIndex (Bool
l,Bool
_) Bool
i = Bool -> Int
forall a. Enum a => a -> Int
fromEnum Bool
i Int -> Int -> Int
forall a. Num a => a -> a -> a
- Bool -> Int
forall a. Enum a => a -> Int
fromEnum Bool
l
{-# INLINE index #-}
index :: (Bool, Bool) -> Bool -> Int
index (Bool, Bool)
b Bool
i | (Bool, Bool) -> Bool -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (Bool, Bool)
b Bool
i = (Bool, Bool) -> Bool -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (Bool, Bool)
b Bool
i
| Bool
otherwise = (Bool, Bool) -> Bool -> String -> Int
forall a b. Show a => (a, a) -> a -> String -> b
indexError (Bool, Bool)
b Bool
i String
"Bool"
inRange :: (Bool, Bool) -> Bool -> Bool
inRange (Bool
l,Bool
u) Bool
i = Bool -> Int
forall a. Enum a => a -> Int
fromEnum Bool
i Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= Bool -> Int
forall a. Enum a => a -> Int
fromEnum Bool
l Bool -> Bool -> Bool
&& Bool -> Int
forall a. Enum a => a -> Int
fromEnum Bool
i Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<= Bool -> Int
forall a. Enum a => a -> Int
fromEnum Bool
u
instance Ix Ordering where
{-# INLINE range #-}
range :: (Ordering, Ordering) -> [Ordering]
range (Ordering
m,Ordering
n) = [Ordering
m..Ordering
n]
{-# INLINE unsafeIndex #-}
unsafeIndex :: (Ordering, Ordering) -> Ordering -> Int
unsafeIndex (Ordering
l,Ordering
_) Ordering
i = Ordering -> Int
forall a. Enum a => a -> Int
fromEnum Ordering
i Int -> Int -> Int
forall a. Num a => a -> a -> a
- Ordering -> Int
forall a. Enum a => a -> Int
fromEnum Ordering
l
{-# INLINE index #-}
index :: (Ordering, Ordering) -> Ordering -> Int
index (Ordering, Ordering)
b Ordering
i | (Ordering, Ordering) -> Ordering -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (Ordering, Ordering)
b Ordering
i = (Ordering, Ordering) -> Ordering -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (Ordering, Ordering)
b Ordering
i
| Bool
otherwise = (Ordering, Ordering) -> Ordering -> String -> Int
forall a b. Show a => (a, a) -> a -> String -> b
indexError (Ordering, Ordering)
b Ordering
i String
"Ordering"
inRange :: (Ordering, Ordering) -> Ordering -> Bool
inRange (Ordering
l,Ordering
u) Ordering
i = Ordering -> Int
forall a. Enum a => a -> Int
fromEnum Ordering
i Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= Ordering -> Int
forall a. Enum a => a -> Int
fromEnum Ordering
l Bool -> Bool -> Bool
&& Ordering -> Int
forall a. Enum a => a -> Int
fromEnum Ordering
i Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<= Ordering -> Int
forall a. Enum a => a -> Int
fromEnum Ordering
u
instance Ix Void where
range :: (Void, Void) -> [Void]
range (Void, Void)
_ = []
index :: (Void, Void) -> Void -> Int
index (Void, Void)
_ = Void -> Int
forall a. Void -> a
absurd
inRange :: (Void, Void) -> Void -> Bool
inRange (Void, Void)
_ = Void -> Bool
forall a. Void -> a
absurd
rangeSize :: (Void, Void) -> Int
rangeSize (Void, Void)
_ = Int
0
instance Ix () where
{-# INLINE range #-}
range :: ((), ()) -> [()]
range ((), ()) = [()]
{-# INLINE unsafeIndex #-}
unsafeIndex :: ((), ()) -> () -> Int
unsafeIndex ((), ()) () = Int
0
{-# INLINE inRange #-}
inRange :: ((), ()) -> () -> Bool
inRange ((), ()) () = Bool
True
{-# INLINE index #-}
index :: ((), ()) -> () -> Int
index ((), ())
b ()
i = ((), ()) -> () -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex ((), ())
b ()
i
instance Ix a => Ix (Solo a) where
{-# SPECIALISE instance Ix (Solo Int) #-}
{-# INLINE range #-}
range :: (Solo a, Solo a) -> [Solo a]
range (MkSolo a
l, MkSolo a
u) =
[ a -> Solo a
forall a. a -> Solo a
MkSolo a
i | a
i <- (a, a) -> [a]
forall a. Ix a => (a, a) -> [a]
range (a
l,a
u) ]
{-# INLINE unsafeIndex #-}
unsafeIndex :: (Solo a, Solo a) -> Solo a -> Int
unsafeIndex (MkSolo a
l, MkSolo a
u) (MkSolo a
i) =
(a, a) -> a -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a
l,a
u) a
i
{-# INLINE inRange #-}
inRange :: (Solo a, Solo a) -> Solo a -> Bool
inRange (MkSolo a
l, MkSolo a
u) (MkSolo a
i) =
(a, a) -> a -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a
l, a
u) a
i
instance (Ix a, Ix b) => Ix (a, b) where
{-# SPECIALISE instance Ix (Int,Int) #-}
{-# INLINE range #-}
range :: ((a, b), (a, b)) -> [(a, b)]
range ((a
l1,b
l2),(a
u1,b
u2)) =
[ (a
i1,b
i2) | a
i1 <- (a, a) -> [a]
forall a. Ix a => (a, a) -> [a]
range (a
l1,a
u1), b
i2 <- (b, b) -> [b]
forall a. Ix a => (a, a) -> [a]
range (b
l2,b
u2) ]
{-# INLINE unsafeIndex #-}
unsafeIndex :: ((a, b), (a, b)) -> (a, b) -> Int
unsafeIndex ((a
l1,b
l2),(a
u1,b
u2)) (a
i1,b
i2) =
(a, a) -> a -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a
l1,a
u1) a
i1 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (b, b) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (b
l2,b
u2) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (b, b) -> b -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (b
l2,b
u2) b
i2
{-# INLINE inRange #-}
inRange :: ((a, b), (a, b)) -> (a, b) -> Bool
inRange ((a
l1,b
l2),(a
u1,b
u2)) (a
i1,b
i2) =
(a, a) -> a -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a
l1,a
u1) a
i1 Bool -> Bool -> Bool
&& (b, b) -> b -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (b
l2,b
u2) b
i2
instance (Ix a1, Ix a2, Ix a3) => Ix (a1,a2,a3) where
{-# SPECIALISE instance Ix (Int,Int,Int) #-}
range :: ((a1, a2, a3), (a1, a2, a3)) -> [(a1, a2, a3)]
range ((a1
l1,a2
l2,a3
l3),(a1
u1,a2
u2,a3
u3)) =
[(a1
i1,a2
i2,a3
i3) | a1
i1 <- (a1, a1) -> [a1]
forall a. Ix a => (a, a) -> [a]
range (a1
l1,a1
u1),
a2
i2 <- (a2, a2) -> [a2]
forall a. Ix a => (a, a) -> [a]
range (a2
l2,a2
u2),
a3
i3 <- (a3, a3) -> [a3]
forall a. Ix a => (a, a) -> [a]
range (a3
l3,a3
u3)]
unsafeIndex :: ((a1, a2, a3), (a1, a2, a3)) -> (a1, a2, a3) -> Int
unsafeIndex ((a1
l1,a2
l2,a3
l3),(a1
u1,a2
u2,a3
u3)) (a1
i1,a2
i2,a3
i3) =
(a3, a3) -> a3 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a3
l3,a3
u3) a3
i3 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a3, a3) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a3
l3,a3
u3) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a2, a2) -> a2 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a2
l2,a2
u2) a2
i2 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a2, a2) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a2
l2,a2
u2) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a1, a1) -> a1 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a1
l1,a1
u1) a1
i1))
inRange :: ((a1, a2, a3), (a1, a2, a3)) -> (a1, a2, a3) -> Bool
inRange ((a1
l1,a2
l2,a3
l3),(a1
u1,a2
u2,a3
u3)) (a1
i1,a2
i2,a3
i3) =
(a1, a1) -> a1 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a1
l1,a1
u1) a1
i1 Bool -> Bool -> Bool
&& (a2, a2) -> a2 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a2
l2,a2
u2) a2
i2 Bool -> Bool -> Bool
&&
(a3, a3) -> a3 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a3
l3,a3
u3) a3
i3
instance (Ix a1, Ix a2, Ix a3, Ix a4) => Ix (a1,a2,a3,a4) where
range :: ((a1, a2, a3, a4), (a1, a2, a3, a4)) -> [(a1, a2, a3, a4)]
range ((a1
l1,a2
l2,a3
l3,a4
l4),(a1
u1,a2
u2,a3
u3,a4
u4)) =
[(a1
i1,a2
i2,a3
i3,a4
i4) | a1
i1 <- (a1, a1) -> [a1]
forall a. Ix a => (a, a) -> [a]
range (a1
l1,a1
u1),
a2
i2 <- (a2, a2) -> [a2]
forall a. Ix a => (a, a) -> [a]
range (a2
l2,a2
u2),
a3
i3 <- (a3, a3) -> [a3]
forall a. Ix a => (a, a) -> [a]
range (a3
l3,a3
u3),
a4
i4 <- (a4, a4) -> [a4]
forall a. Ix a => (a, a) -> [a]
range (a4
l4,a4
u4)]
unsafeIndex :: ((a1, a2, a3, a4), (a1, a2, a3, a4)) -> (a1, a2, a3, a4) -> Int
unsafeIndex ((a1
l1,a2
l2,a3
l3,a4
l4),(a1
u1,a2
u2,a3
u3,a4
u4)) (a1
i1,a2
i2,a3
i3,a4
i4) =
(a4, a4) -> a4 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a4
l4,a4
u4) a4
i4 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a4, a4) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a4
l4,a4
u4) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a3, a3) -> a3 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a3
l3,a3
u3) a3
i3 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a3, a3) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a3
l3,a3
u3) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a2, a2) -> a2 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a2
l2,a2
u2) a2
i2 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a2, a2) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a2
l2,a2
u2) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a1, a1) -> a1 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a1
l1,a1
u1) a1
i1)))
inRange :: ((a1, a2, a3, a4), (a1, a2, a3, a4)) -> (a1, a2, a3, a4) -> Bool
inRange ((a1
l1,a2
l2,a3
l3,a4
l4),(a1
u1,a2
u2,a3
u3,a4
u4)) (a1
i1,a2
i2,a3
i3,a4
i4) =
(a1, a1) -> a1 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a1
l1,a1
u1) a1
i1 Bool -> Bool -> Bool
&& (a2, a2) -> a2 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a2
l2,a2
u2) a2
i2 Bool -> Bool -> Bool
&&
(a3, a3) -> a3 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a3
l3,a3
u3) a3
i3 Bool -> Bool -> Bool
&& (a4, a4) -> a4 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a4
l4,a4
u4) a4
i4
instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5) => Ix (a1,a2,a3,a4,a5) where
range :: ((a1, a2, a3, a4, a5), (a1, a2, a3, a4, a5))
-> [(a1, a2, a3, a4, a5)]
range ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5),(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5)) =
[(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5) | a1
i1 <- (a1, a1) -> [a1]
forall a. Ix a => (a, a) -> [a]
range (a1
l1,a1
u1),
a2
i2 <- (a2, a2) -> [a2]
forall a. Ix a => (a, a) -> [a]
range (a2
l2,a2
u2),
a3
i3 <- (a3, a3) -> [a3]
forall a. Ix a => (a, a) -> [a]
range (a3
l3,a3
u3),
a4
i4 <- (a4, a4) -> [a4]
forall a. Ix a => (a, a) -> [a]
range (a4
l4,a4
u4),
a5
i5 <- (a5, a5) -> [a5]
forall a. Ix a => (a, a) -> [a]
range (a5
l5,a5
u5)]
unsafeIndex :: ((a1, a2, a3, a4, a5), (a1, a2, a3, a4, a5))
-> (a1, a2, a3, a4, a5) -> Int
unsafeIndex ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5),(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5)) (a1
i1,a2
i2,a3
i3,a4
i4,a5
i5) =
(a5, a5) -> a5 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a5
l5,a5
u5) a5
i5 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a5, a5) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a5
l5,a5
u5) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a4, a4) -> a4 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a4
l4,a4
u4) a4
i4 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a4, a4) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a4
l4,a4
u4) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a3, a3) -> a3 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a3
l3,a3
u3) a3
i3 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a3, a3) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a3
l3,a3
u3) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a2, a2) -> a2 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a2
l2,a2
u2) a2
i2 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a2, a2) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a2
l2,a2
u2) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a1, a1) -> a1 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a1
l1,a1
u1) a1
i1))))
inRange :: ((a1, a2, a3, a4, a5), (a1, a2, a3, a4, a5))
-> (a1, a2, a3, a4, a5) -> Bool
inRange ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5),(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5)) (a1
i1,a2
i2,a3
i3,a4
i4,a5
i5) =
(a1, a1) -> a1 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a1
l1,a1
u1) a1
i1 Bool -> Bool -> Bool
&& (a2, a2) -> a2 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a2
l2,a2
u2) a2
i2 Bool -> Bool -> Bool
&&
(a3, a3) -> a3 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a3
l3,a3
u3) a3
i3 Bool -> Bool -> Bool
&& (a4, a4) -> a4 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a4
l4,a4
u4) a4
i4 Bool -> Bool -> Bool
&&
(a5, a5) -> a5 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a5
l5,a5
u5) a5
i5
instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6) =>
Ix (a1,a2,a3,a4,a5,a6) where
range :: ((a1, a2, a3, a4, a5, a6), (a1, a2, a3, a4, a5, a6))
-> [(a1, a2, a3, a4, a5, a6)]
range ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6),(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6)) =
[(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6) | a1
i1 <- (a1, a1) -> [a1]
forall a. Ix a => (a, a) -> [a]
range (a1
l1,a1
u1),
a2
i2 <- (a2, a2) -> [a2]
forall a. Ix a => (a, a) -> [a]
range (a2
l2,a2
u2),
a3
i3 <- (a3, a3) -> [a3]
forall a. Ix a => (a, a) -> [a]
range (a3
l3,a3
u3),
a4
i4 <- (a4, a4) -> [a4]
forall a. Ix a => (a, a) -> [a]
range (a4
l4,a4
u4),
a5
i5 <- (a5, a5) -> [a5]
forall a. Ix a => (a, a) -> [a]
range (a5
l5,a5
u5),
a6
i6 <- (a6, a6) -> [a6]
forall a. Ix a => (a, a) -> [a]
range (a6
l6,a6
u6)]
unsafeIndex :: ((a1, a2, a3, a4, a5, a6), (a1, a2, a3, a4, a5, a6))
-> (a1, a2, a3, a4, a5, a6) -> Int
unsafeIndex ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6),(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6)) (a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6) =
(a6, a6) -> a6 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a6
l6,a6
u6) a6
i6 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a6, a6) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a6
l6,a6
u6) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a5, a5) -> a5 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a5
l5,a5
u5) a5
i5 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a5, a5) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a5
l5,a5
u5) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a4, a4) -> a4 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a4
l4,a4
u4) a4
i4 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a4, a4) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a4
l4,a4
u4) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a3, a3) -> a3 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a3
l3,a3
u3) a3
i3 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a3, a3) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a3
l3,a3
u3) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a2, a2) -> a2 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a2
l2,a2
u2) a2
i2 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a2, a2) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a2
l2,a2
u2) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a1, a1) -> a1 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a1
l1,a1
u1) a1
i1)))))
inRange :: ((a1, a2, a3, a4, a5, a6), (a1, a2, a3, a4, a5, a6))
-> (a1, a2, a3, a4, a5, a6) -> Bool
inRange ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6),(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6)) (a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6) =
(a1, a1) -> a1 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a1
l1,a1
u1) a1
i1 Bool -> Bool -> Bool
&& (a2, a2) -> a2 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a2
l2,a2
u2) a2
i2 Bool -> Bool -> Bool
&&
(a3, a3) -> a3 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a3
l3,a3
u3) a3
i3 Bool -> Bool -> Bool
&& (a4, a4) -> a4 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a4
l4,a4
u4) a4
i4 Bool -> Bool -> Bool
&&
(a5, a5) -> a5 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a5
l5,a5
u5) a5
i5 Bool -> Bool -> Bool
&& (a6, a6) -> a6 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a6
l6,a6
u6) a6
i6
instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6, Ix a7) =>
Ix (a1,a2,a3,a4,a5,a6,a7) where
range :: ((a1, a2, a3, a4, a5, a6, a7), (a1, a2, a3, a4, a5, a6, a7))
-> [(a1, a2, a3, a4, a5, a6, a7)]
range ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7),(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7)) =
[(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7) | a1
i1 <- (a1, a1) -> [a1]
forall a. Ix a => (a, a) -> [a]
range (a1
l1,a1
u1),
a2
i2 <- (a2, a2) -> [a2]
forall a. Ix a => (a, a) -> [a]
range (a2
l2,a2
u2),
a3
i3 <- (a3, a3) -> [a3]
forall a. Ix a => (a, a) -> [a]
range (a3
l3,a3
u3),
a4
i4 <- (a4, a4) -> [a4]
forall a. Ix a => (a, a) -> [a]
range (a4
l4,a4
u4),
a5
i5 <- (a5, a5) -> [a5]
forall a. Ix a => (a, a) -> [a]
range (a5
l5,a5
u5),
a6
i6 <- (a6, a6) -> [a6]
forall a. Ix a => (a, a) -> [a]
range (a6
l6,a6
u6),
a7
i7 <- (a7, a7) -> [a7]
forall a. Ix a => (a, a) -> [a]
range (a7
l7,a7
u7)]
unsafeIndex :: ((a1, a2, a3, a4, a5, a6, a7), (a1, a2, a3, a4, a5, a6, a7))
-> (a1, a2, a3, a4, a5, a6, a7) -> Int
unsafeIndex ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7),(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7))
(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7) =
(a7, a7) -> a7 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a7
l7,a7
u7) a7
i7 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a7, a7) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a7
l7,a7
u7) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a6, a6) -> a6 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a6
l6,a6
u6) a6
i6 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a6, a6) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a6
l6,a6
u6) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a5, a5) -> a5 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a5
l5,a5
u5) a5
i5 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a5, a5) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a5
l5,a5
u5) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a4, a4) -> a4 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a4
l4,a4
u4) a4
i4 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a4, a4) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a4
l4,a4
u4) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a3, a3) -> a3 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a3
l3,a3
u3) a3
i3 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a3, a3) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a3
l3,a3
u3) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a2, a2) -> a2 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a2
l2,a2
u2) a2
i2 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a2, a2) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a2
l2,a2
u2) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a1, a1) -> a1 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a1
l1,a1
u1) a1
i1))))))
inRange :: ((a1, a2, a3, a4, a5, a6, a7), (a1, a2, a3, a4, a5, a6, a7))
-> (a1, a2, a3, a4, a5, a6, a7) -> Bool
inRange ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7),(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7))
(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7) =
(a1, a1) -> a1 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a1
l1,a1
u1) a1
i1 Bool -> Bool -> Bool
&& (a2, a2) -> a2 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a2
l2,a2
u2) a2
i2 Bool -> Bool -> Bool
&&
(a3, a3) -> a3 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a3
l3,a3
u3) a3
i3 Bool -> Bool -> Bool
&& (a4, a4) -> a4 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a4
l4,a4
u4) a4
i4 Bool -> Bool -> Bool
&&
(a5, a5) -> a5 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a5
l5,a5
u5) a5
i5 Bool -> Bool -> Bool
&& (a6, a6) -> a6 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a6
l6,a6
u6) a6
i6 Bool -> Bool -> Bool
&&
(a7, a7) -> a7 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a7
l7,a7
u7) a7
i7
instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6, Ix a7, Ix a8) =>
Ix (a1,a2,a3,a4,a5,a6,a7,a8) where
range :: ((a1, a2, a3, a4, a5, a6, a7, a8),
(a1, a2, a3, a4, a5, a6, a7, a8))
-> [(a1, a2, a3, a4, a5, a6, a7, a8)]
range ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8),(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8)) =
[(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8) | a1
i1 <- (a1, a1) -> [a1]
forall a. Ix a => (a, a) -> [a]
range (a1
l1,a1
u1),
a2
i2 <- (a2, a2) -> [a2]
forall a. Ix a => (a, a) -> [a]
range (a2
l2,a2
u2),
a3
i3 <- (a3, a3) -> [a3]
forall a. Ix a => (a, a) -> [a]
range (a3
l3,a3
u3),
a4
i4 <- (a4, a4) -> [a4]
forall a. Ix a => (a, a) -> [a]
range (a4
l4,a4
u4),
a5
i5 <- (a5, a5) -> [a5]
forall a. Ix a => (a, a) -> [a]
range (a5
l5,a5
u5),
a6
i6 <- (a6, a6) -> [a6]
forall a. Ix a => (a, a) -> [a]
range (a6
l6,a6
u6),
a7
i7 <- (a7, a7) -> [a7]
forall a. Ix a => (a, a) -> [a]
range (a7
l7,a7
u7),
a8
i8 <- (a8, a8) -> [a8]
forall a. Ix a => (a, a) -> [a]
range (a8
l8,a8
u8)]
unsafeIndex :: ((a1, a2, a3, a4, a5, a6, a7, a8),
(a1, a2, a3, a4, a5, a6, a7, a8))
-> (a1, a2, a3, a4, a5, a6, a7, a8) -> Int
unsafeIndex ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8),(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8))
(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8) =
(a8, a8) -> a8 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a8
l8,a8
u8) a8
i8 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a8, a8) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a8
l8,a8
u8) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a7, a7) -> a7 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a7
l7,a7
u7) a7
i7 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a7, a7) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a7
l7,a7
u7) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a6, a6) -> a6 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a6
l6,a6
u6) a6
i6 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a6, a6) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a6
l6,a6
u6) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a5, a5) -> a5 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a5
l5,a5
u5) a5
i5 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a5, a5) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a5
l5,a5
u5) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a4, a4) -> a4 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a4
l4,a4
u4) a4
i4 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a4, a4) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a4
l4,a4
u4) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a3, a3) -> a3 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a3
l3,a3
u3) a3
i3 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a3, a3) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a3
l3,a3
u3) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a2, a2) -> a2 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a2
l2,a2
u2) a2
i2 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a2, a2) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a2
l2,a2
u2) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a1, a1) -> a1 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a1
l1,a1
u1) a1
i1)))))))
inRange :: ((a1, a2, a3, a4, a5, a6, a7, a8),
(a1, a2, a3, a4, a5, a6, a7, a8))
-> (a1, a2, a3, a4, a5, a6, a7, a8) -> Bool
inRange ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8),(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8))
(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8) =
(a1, a1) -> a1 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a1
l1,a1
u1) a1
i1 Bool -> Bool -> Bool
&& (a2, a2) -> a2 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a2
l2,a2
u2) a2
i2 Bool -> Bool -> Bool
&&
(a3, a3) -> a3 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a3
l3,a3
u3) a3
i3 Bool -> Bool -> Bool
&& (a4, a4) -> a4 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a4
l4,a4
u4) a4
i4 Bool -> Bool -> Bool
&&
(a5, a5) -> a5 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a5
l5,a5
u5) a5
i5 Bool -> Bool -> Bool
&& (a6, a6) -> a6 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a6
l6,a6
u6) a6
i6 Bool -> Bool -> Bool
&&
(a7, a7) -> a7 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a7
l7,a7
u7) a7
i7 Bool -> Bool -> Bool
&& (a8, a8) -> a8 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a8
l8,a8
u8) a8
i8
instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6, Ix a7, Ix a8, Ix a9) =>
Ix (a1,a2,a3,a4,a5,a6,a7,a8,a9) where
range :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9),
(a1, a2, a3, a4, a5, a6, a7, a8, a9))
-> [(a1, a2, a3, a4, a5, a6, a7, a8, a9)]
range ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9),(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9)) =
[(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9) | a1
i1 <- (a1, a1) -> [a1]
forall a. Ix a => (a, a) -> [a]
range (a1
l1,a1
u1),
a2
i2 <- (a2, a2) -> [a2]
forall a. Ix a => (a, a) -> [a]
range (a2
l2,a2
u2),
a3
i3 <- (a3, a3) -> [a3]
forall a. Ix a => (a, a) -> [a]
range (a3
l3,a3
u3),
a4
i4 <- (a4, a4) -> [a4]
forall a. Ix a => (a, a) -> [a]
range (a4
l4,a4
u4),
a5
i5 <- (a5, a5) -> [a5]
forall a. Ix a => (a, a) -> [a]
range (a5
l5,a5
u5),
a6
i6 <- (a6, a6) -> [a6]
forall a. Ix a => (a, a) -> [a]
range (a6
l6,a6
u6),
a7
i7 <- (a7, a7) -> [a7]
forall a. Ix a => (a, a) -> [a]
range (a7
l7,a7
u7),
a8
i8 <- (a8, a8) -> [a8]
forall a. Ix a => (a, a) -> [a]
range (a8
l8,a8
u8),
a9
i9 <- (a9, a9) -> [a9]
forall a. Ix a => (a, a) -> [a]
range (a9
l9,a9
u9)]
unsafeIndex :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9),
(a1, a2, a3, a4, a5, a6, a7, a8, a9))
-> (a1, a2, a3, a4, a5, a6, a7, a8, a9) -> Int
unsafeIndex ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9),(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9))
(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9) =
(a9, a9) -> a9 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a9
l9,a9
u9) a9
i9 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a9, a9) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a9
l9,a9
u9) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a8, a8) -> a8 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a8
l8,a8
u8) a8
i8 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a8, a8) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a8
l8,a8
u8) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a7, a7) -> a7 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a7
l7,a7
u7) a7
i7 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a7, a7) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a7
l7,a7
u7) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a6, a6) -> a6 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a6
l6,a6
u6) a6
i6 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a6, a6) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a6
l6,a6
u6) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a5, a5) -> a5 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a5
l5,a5
u5) a5
i5 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a5, a5) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a5
l5,a5
u5) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a4, a4) -> a4 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a4
l4,a4
u4) a4
i4 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a4, a4) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a4
l4,a4
u4) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a3, a3) -> a3 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a3
l3,a3
u3) a3
i3 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a3, a3) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a3
l3,a3
u3) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a2, a2) -> a2 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a2
l2,a2
u2) a2
i2 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a2, a2) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a2
l2,a2
u2) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a1, a1) -> a1 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a1
l1,a1
u1) a1
i1))))))))
inRange :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9),
(a1, a2, a3, a4, a5, a6, a7, a8, a9))
-> (a1, a2, a3, a4, a5, a6, a7, a8, a9) -> Bool
inRange ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9),(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9))
(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9) =
(a1, a1) -> a1 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a1
l1,a1
u1) a1
i1 Bool -> Bool -> Bool
&& (a2, a2) -> a2 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a2
l2,a2
u2) a2
i2 Bool -> Bool -> Bool
&&
(a3, a3) -> a3 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a3
l3,a3
u3) a3
i3 Bool -> Bool -> Bool
&& (a4, a4) -> a4 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a4
l4,a4
u4) a4
i4 Bool -> Bool -> Bool
&&
(a5, a5) -> a5 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a5
l5,a5
u5) a5
i5 Bool -> Bool -> Bool
&& (a6, a6) -> a6 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a6
l6,a6
u6) a6
i6 Bool -> Bool -> Bool
&&
(a7, a7) -> a7 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a7
l7,a7
u7) a7
i7 Bool -> Bool -> Bool
&& (a8, a8) -> a8 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a8
l8,a8
u8) a8
i8 Bool -> Bool -> Bool
&&
(a9, a9) -> a9 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a9
l9,a9
u9) a9
i9
instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6, Ix a7, Ix a8, Ix a9,
Ix aA) =>
Ix (a1,a2,a3,a4,a5,a6,a7,a8,a9,aA) where
range :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9, aA),
(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA))
-> [(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA)]
range ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9,aA
lA),(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9,aA
uA)) =
[(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9,aA
iA) | a1
i1 <- (a1, a1) -> [a1]
forall a. Ix a => (a, a) -> [a]
range (a1
l1,a1
u1),
a2
i2 <- (a2, a2) -> [a2]
forall a. Ix a => (a, a) -> [a]
range (a2
l2,a2
u2),
a3
i3 <- (a3, a3) -> [a3]
forall a. Ix a => (a, a) -> [a]
range (a3
l3,a3
u3),
a4
i4 <- (a4, a4) -> [a4]
forall a. Ix a => (a, a) -> [a]
range (a4
l4,a4
u4),
a5
i5 <- (a5, a5) -> [a5]
forall a. Ix a => (a, a) -> [a]
range (a5
l5,a5
u5),
a6
i6 <- (a6, a6) -> [a6]
forall a. Ix a => (a, a) -> [a]
range (a6
l6,a6
u6),
a7
i7 <- (a7, a7) -> [a7]
forall a. Ix a => (a, a) -> [a]
range (a7
l7,a7
u7),
a8
i8 <- (a8, a8) -> [a8]
forall a. Ix a => (a, a) -> [a]
range (a8
l8,a8
u8),
a9
i9 <- (a9, a9) -> [a9]
forall a. Ix a => (a, a) -> [a]
range (a9
l9,a9
u9),
aA
iA <- (aA, aA) -> [aA]
forall a. Ix a => (a, a) -> [a]
range (aA
lA,aA
uA)]
unsafeIndex :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9, aA),
(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA))
-> (a1, a2, a3, a4, a5, a6, a7, a8, a9, aA) -> Int
unsafeIndex ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9,aA
lA),
(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9,aA
uA))
(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9,aA
iA) =
(aA, aA) -> aA -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aA
lA,aA
uA) aA
iA Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aA, aA) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aA
lA,aA
uA) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a9, a9) -> a9 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a9
l9,a9
u9) a9
i9 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a9, a9) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a9
l9,a9
u9) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a8, a8) -> a8 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a8
l8,a8
u8) a8
i8 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a8, a8) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a8
l8,a8
u8) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a7, a7) -> a7 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a7
l7,a7
u7) a7
i7 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a7, a7) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a7
l7,a7
u7) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a6, a6) -> a6 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a6
l6,a6
u6) a6
i6 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a6, a6) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a6
l6,a6
u6) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a5, a5) -> a5 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a5
l5,a5
u5) a5
i5 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a5, a5) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a5
l5,a5
u5) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a4, a4) -> a4 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a4
l4,a4
u4) a4
i4 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a4, a4) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a4
l4,a4
u4) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a3, a3) -> a3 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a3
l3,a3
u3) a3
i3 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a3, a3) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a3
l3,a3
u3) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a2, a2) -> a2 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a2
l2,a2
u2) a2
i2 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a2, a2) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a2
l2,a2
u2) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a1, a1) -> a1 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a1
l1,a1
u1) a1
i1)))))))))
inRange :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9, aA),
(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA))
-> (a1, a2, a3, a4, a5, a6, a7, a8, a9, aA) -> Bool
inRange ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9,aA
lA),(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9,aA
uA))
(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9,aA
iA) =
(a1, a1) -> a1 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a1
l1,a1
u1) a1
i1 Bool -> Bool -> Bool
&& (a2, a2) -> a2 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a2
l2,a2
u2) a2
i2 Bool -> Bool -> Bool
&&
(a3, a3) -> a3 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a3
l3,a3
u3) a3
i3 Bool -> Bool -> Bool
&& (a4, a4) -> a4 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a4
l4,a4
u4) a4
i4 Bool -> Bool -> Bool
&&
(a5, a5) -> a5 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a5
l5,a5
u5) a5
i5 Bool -> Bool -> Bool
&& (a6, a6) -> a6 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a6
l6,a6
u6) a6
i6 Bool -> Bool -> Bool
&&
(a7, a7) -> a7 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a7
l7,a7
u7) a7
i7 Bool -> Bool -> Bool
&& (a8, a8) -> a8 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a8
l8,a8
u8) a8
i8 Bool -> Bool -> Bool
&&
(a9, a9) -> a9 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a9
l9,a9
u9) a9
i9 Bool -> Bool -> Bool
&& (aA, aA) -> aA -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aA
lA,aA
uA) aA
iA
instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6, Ix a7, Ix a8, Ix a9,
Ix aA, Ix aB) =>
Ix (a1,a2,a3,a4,a5,a6,a7,a8,a9,aA,aB) where
range :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB),
(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB))
-> [(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB)]
range ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9,aA
lA,aB
lB),
(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9,aA
uA,aB
uB)) =
[(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9,aA
iA,aB
iB) | a1
i1 <- (a1, a1) -> [a1]
forall a. Ix a => (a, a) -> [a]
range (a1
l1,a1
u1),
a2
i2 <- (a2, a2) -> [a2]
forall a. Ix a => (a, a) -> [a]
range (a2
l2,a2
u2),
a3
i3 <- (a3, a3) -> [a3]
forall a. Ix a => (a, a) -> [a]
range (a3
l3,a3
u3),
a4
i4 <- (a4, a4) -> [a4]
forall a. Ix a => (a, a) -> [a]
range (a4
l4,a4
u4),
a5
i5 <- (a5, a5) -> [a5]
forall a. Ix a => (a, a) -> [a]
range (a5
l5,a5
u5),
a6
i6 <- (a6, a6) -> [a6]
forall a. Ix a => (a, a) -> [a]
range (a6
l6,a6
u6),
a7
i7 <- (a7, a7) -> [a7]
forall a. Ix a => (a, a) -> [a]
range (a7
l7,a7
u7),
a8
i8 <- (a8, a8) -> [a8]
forall a. Ix a => (a, a) -> [a]
range (a8
l8,a8
u8),
a9
i9 <- (a9, a9) -> [a9]
forall a. Ix a => (a, a) -> [a]
range (a9
l9,a9
u9),
aA
iA <- (aA, aA) -> [aA]
forall a. Ix a => (a, a) -> [a]
range (aA
lA,aA
uA),
aB
iB <- (aB, aB) -> [aB]
forall a. Ix a => (a, a) -> [a]
range (aB
lB,aB
uB)]
unsafeIndex :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB),
(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB))
-> (a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB) -> Int
unsafeIndex ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9,aA
lA,aB
lB),
(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9,aA
uA,aB
uB))
(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9,aA
iA,aB
iB) =
(aB, aB) -> aB -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aB
lB,aB
uB) aB
iB Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aB, aB) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aB
lB,aB
uB) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(aA, aA) -> aA -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aA
lA,aA
uA) aA
iA Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aA, aA) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aA
lA,aA
uA) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a9, a9) -> a9 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a9
l9,a9
u9) a9
i9 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a9, a9) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a9
l9,a9
u9) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a8, a8) -> a8 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a8
l8,a8
u8) a8
i8 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a8, a8) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a8
l8,a8
u8) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a7, a7) -> a7 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a7
l7,a7
u7) a7
i7 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a7, a7) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a7
l7,a7
u7) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a6, a6) -> a6 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a6
l6,a6
u6) a6
i6 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a6, a6) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a6
l6,a6
u6) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a5, a5) -> a5 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a5
l5,a5
u5) a5
i5 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a5, a5) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a5
l5,a5
u5) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a4, a4) -> a4 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a4
l4,a4
u4) a4
i4 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a4, a4) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a4
l4,a4
u4) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a3, a3) -> a3 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a3
l3,a3
u3) a3
i3 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a3, a3) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a3
l3,a3
u3) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a2, a2) -> a2 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a2
l2,a2
u2) a2
i2 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a2, a2) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a2
l2,a2
u2) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a1, a1) -> a1 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a1
l1,a1
u1) a1
i1))))))))))
inRange :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB),
(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB))
-> (a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB) -> Bool
inRange ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9,aA
lA,aB
lB),
(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9,aA
uA,aB
uB))
(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9,aA
iA,aB
iB) =
(a1, a1) -> a1 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a1
l1,a1
u1) a1
i1 Bool -> Bool -> Bool
&& (a2, a2) -> a2 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a2
l2,a2
u2) a2
i2 Bool -> Bool -> Bool
&&
(a3, a3) -> a3 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a3
l3,a3
u3) a3
i3 Bool -> Bool -> Bool
&& (a4, a4) -> a4 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a4
l4,a4
u4) a4
i4 Bool -> Bool -> Bool
&&
(a5, a5) -> a5 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a5
l5,a5
u5) a5
i5 Bool -> Bool -> Bool
&& (a6, a6) -> a6 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a6
l6,a6
u6) a6
i6 Bool -> Bool -> Bool
&&
(a7, a7) -> a7 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a7
l7,a7
u7) a7
i7 Bool -> Bool -> Bool
&& (a8, a8) -> a8 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a8
l8,a8
u8) a8
i8 Bool -> Bool -> Bool
&&
(a9, a9) -> a9 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a9
l9,a9
u9) a9
i9 Bool -> Bool -> Bool
&& (aA, aA) -> aA -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aA
lA,aA
uA) aA
iA Bool -> Bool -> Bool
&&
(aB, aB) -> aB -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aB
lB,aB
uB) aB
iB
instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6, Ix a7, Ix a8, Ix a9,
Ix aA, Ix aB, Ix aC) =>
Ix (a1,a2,a3,a4,a5,a6,a7,a8,a9,aA,aB,aC) where
range :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC),
(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC))
-> [(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC)]
range ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9,aA
lA,aB
lB,aC
lC),
(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9,aA
uA,aB
uB,aC
uC)) =
[(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9,aA
iA,aB
iB,aC
iC) | a1
i1 <- (a1, a1) -> [a1]
forall a. Ix a => (a, a) -> [a]
range (a1
l1,a1
u1),
a2
i2 <- (a2, a2) -> [a2]
forall a. Ix a => (a, a) -> [a]
range (a2
l2,a2
u2),
a3
i3 <- (a3, a3) -> [a3]
forall a. Ix a => (a, a) -> [a]
range (a3
l3,a3
u3),
a4
i4 <- (a4, a4) -> [a4]
forall a. Ix a => (a, a) -> [a]
range (a4
l4,a4
u4),
a5
i5 <- (a5, a5) -> [a5]
forall a. Ix a => (a, a) -> [a]
range (a5
l5,a5
u5),
a6
i6 <- (a6, a6) -> [a6]
forall a. Ix a => (a, a) -> [a]
range (a6
l6,a6
u6),
a7
i7 <- (a7, a7) -> [a7]
forall a. Ix a => (a, a) -> [a]
range (a7
l7,a7
u7),
a8
i8 <- (a8, a8) -> [a8]
forall a. Ix a => (a, a) -> [a]
range (a8
l8,a8
u8),
a9
i9 <- (a9, a9) -> [a9]
forall a. Ix a => (a, a) -> [a]
range (a9
l9,a9
u9),
aA
iA <- (aA, aA) -> [aA]
forall a. Ix a => (a, a) -> [a]
range (aA
lA,aA
uA),
aB
iB <- (aB, aB) -> [aB]
forall a. Ix a => (a, a) -> [a]
range (aB
lB,aB
uB),
aC
iC <- (aC, aC) -> [aC]
forall a. Ix a => (a, a) -> [a]
range (aC
lC,aC
uC)]
unsafeIndex :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC),
(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC))
-> (a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC) -> Int
unsafeIndex ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9,aA
lA,aB
lB,aC
lC),
(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9,aA
uA,aB
uB,aC
uC))
(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9,aA
iA,aB
iB,aC
iC) =
(aC, aC) -> aC -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aC
lC,aC
uC) aC
iC Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aC, aC) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aC
lC,aC
uC) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(aB, aB) -> aB -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aB
lB,aB
uB) aB
iB Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aB, aB) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aB
lB,aB
uB) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(aA, aA) -> aA -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aA
lA,aA
uA) aA
iA Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aA, aA) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aA
lA,aA
uA) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a9, a9) -> a9 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a9
l9,a9
u9) a9
i9 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a9, a9) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a9
l9,a9
u9) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a8, a8) -> a8 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a8
l8,a8
u8) a8
i8 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a8, a8) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a8
l8,a8
u8) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a7, a7) -> a7 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a7
l7,a7
u7) a7
i7 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a7, a7) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a7
l7,a7
u7) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a6, a6) -> a6 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a6
l6,a6
u6) a6
i6 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a6, a6) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a6
l6,a6
u6) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a5, a5) -> a5 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a5
l5,a5
u5) a5
i5 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a5, a5) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a5
l5,a5
u5) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a4, a4) -> a4 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a4
l4,a4
u4) a4
i4 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a4, a4) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a4
l4,a4
u4) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a3, a3) -> a3 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a3
l3,a3
u3) a3
i3 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a3, a3) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a3
l3,a3
u3) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a2, a2) -> a2 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a2
l2,a2
u2) a2
i2 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a2, a2) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a2
l2,a2
u2) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a1, a1) -> a1 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a1
l1,a1
u1) a1
i1)))))))))))
inRange :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC),
(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC))
-> (a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC) -> Bool
inRange ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9,aA
lA,aB
lB,aC
lC),
(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9,aA
uA,aB
uB,aC
uC))
(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9,aA
iA,aB
iB,aC
iC) =
(a1, a1) -> a1 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a1
l1,a1
u1) a1
i1 Bool -> Bool -> Bool
&& (a2, a2) -> a2 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a2
l2,a2
u2) a2
i2 Bool -> Bool -> Bool
&&
(a3, a3) -> a3 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a3
l3,a3
u3) a3
i3 Bool -> Bool -> Bool
&& (a4, a4) -> a4 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a4
l4,a4
u4) a4
i4 Bool -> Bool -> Bool
&&
(a5, a5) -> a5 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a5
l5,a5
u5) a5
i5 Bool -> Bool -> Bool
&& (a6, a6) -> a6 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a6
l6,a6
u6) a6
i6 Bool -> Bool -> Bool
&&
(a7, a7) -> a7 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a7
l7,a7
u7) a7
i7 Bool -> Bool -> Bool
&& (a8, a8) -> a8 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a8
l8,a8
u8) a8
i8 Bool -> Bool -> Bool
&&
(a9, a9) -> a9 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a9
l9,a9
u9) a9
i9 Bool -> Bool -> Bool
&& (aA, aA) -> aA -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aA
lA,aA
uA) aA
iA Bool -> Bool -> Bool
&&
(aB, aB) -> aB -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aB
lB,aB
uB) aB
iB Bool -> Bool -> Bool
&& (aC, aC) -> aC -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aC
lC,aC
uC) aC
iC
instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6, Ix a7, Ix a8, Ix a9,
Ix aA, Ix aB, Ix aC, Ix aD) =>
Ix (a1,a2,a3,a4,a5,a6,a7,a8,a9,aA,aB,aC,aD) where
range :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD),
(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD))
-> [(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD)]
range ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9,aA
lA,aB
lB,aC
lC,aD
lD),
(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9,aA
uA,aB
uB,aC
uC,aD
uD)) =
[(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9,aA
iA,aB
iB,aC
iC,aD
iD) | a1
i1 <- (a1, a1) -> [a1]
forall a. Ix a => (a, a) -> [a]
range (a1
l1,a1
u1),
a2
i2 <- (a2, a2) -> [a2]
forall a. Ix a => (a, a) -> [a]
range (a2
l2,a2
u2),
a3
i3 <- (a3, a3) -> [a3]
forall a. Ix a => (a, a) -> [a]
range (a3
l3,a3
u3),
a4
i4 <- (a4, a4) -> [a4]
forall a. Ix a => (a, a) -> [a]
range (a4
l4,a4
u4),
a5
i5 <- (a5, a5) -> [a5]
forall a. Ix a => (a, a) -> [a]
range (a5
l5,a5
u5),
a6
i6 <- (a6, a6) -> [a6]
forall a. Ix a => (a, a) -> [a]
range (a6
l6,a6
u6),
a7
i7 <- (a7, a7) -> [a7]
forall a. Ix a => (a, a) -> [a]
range (a7
l7,a7
u7),
a8
i8 <- (a8, a8) -> [a8]
forall a. Ix a => (a, a) -> [a]
range (a8
l8,a8
u8),
a9
i9 <- (a9, a9) -> [a9]
forall a. Ix a => (a, a) -> [a]
range (a9
l9,a9
u9),
aA
iA <- (aA, aA) -> [aA]
forall a. Ix a => (a, a) -> [a]
range (aA
lA,aA
uA),
aB
iB <- (aB, aB) -> [aB]
forall a. Ix a => (a, a) -> [a]
range (aB
lB,aB
uB),
aC
iC <- (aC, aC) -> [aC]
forall a. Ix a => (a, a) -> [a]
range (aC
lC,aC
uC),
aD
iD <- (aD, aD) -> [aD]
forall a. Ix a => (a, a) -> [a]
range (aD
lD,aD
uD)]
unsafeIndex :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD),
(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD))
-> (a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD) -> Int
unsafeIndex ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9,aA
lA,aB
lB,aC
lC,aD
lD),
(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9,aA
uA,aB
uB,aC
uC,aD
uD))
(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9,aA
iA,aB
iB,aC
iC,aD
iD) =
(aD, aD) -> aD -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aD
lD,aD
uD) aD
iD Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aD, aD) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aD
lD,aD
uD) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(aC, aC) -> aC -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aC
lC,aC
uC) aC
iC Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aC, aC) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aC
lC,aC
uC) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(aB, aB) -> aB -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aB
lB,aB
uB) aB
iB Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aB, aB) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aB
lB,aB
uB) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(aA, aA) -> aA -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aA
lA,aA
uA) aA
iA Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aA, aA) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aA
lA,aA
uA) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a9, a9) -> a9 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a9
l9,a9
u9) a9
i9 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a9, a9) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a9
l9,a9
u9) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a8, a8) -> a8 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a8
l8,a8
u8) a8
i8 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a8, a8) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a8
l8,a8
u8) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a7, a7) -> a7 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a7
l7,a7
u7) a7
i7 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a7, a7) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a7
l7,a7
u7) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a6, a6) -> a6 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a6
l6,a6
u6) a6
i6 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a6, a6) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a6
l6,a6
u6) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a5, a5) -> a5 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a5
l5,a5
u5) a5
i5 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a5, a5) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a5
l5,a5
u5) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a4, a4) -> a4 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a4
l4,a4
u4) a4
i4 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a4, a4) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a4
l4,a4
u4) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a3, a3) -> a3 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a3
l3,a3
u3) a3
i3 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a3, a3) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a3
l3,a3
u3) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a2, a2) -> a2 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a2
l2,a2
u2) a2
i2 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a2, a2) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a2
l2,a2
u2) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a1, a1) -> a1 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a1
l1,a1
u1) a1
i1))))))))))))
inRange :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD),
(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD))
-> (a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD) -> Bool
inRange ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9,aA
lA,aB
lB,aC
lC,aD
lD),
(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9,aA
uA,aB
uB,aC
uC,aD
uD))
(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9,aA
iA,aB
iB,aC
iC,aD
iD) =
(a1, a1) -> a1 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a1
l1,a1
u1) a1
i1 Bool -> Bool -> Bool
&& (a2, a2) -> a2 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a2
l2,a2
u2) a2
i2 Bool -> Bool -> Bool
&&
(a3, a3) -> a3 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a3
l3,a3
u3) a3
i3 Bool -> Bool -> Bool
&& (a4, a4) -> a4 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a4
l4,a4
u4) a4
i4 Bool -> Bool -> Bool
&&
(a5, a5) -> a5 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a5
l5,a5
u5) a5
i5 Bool -> Bool -> Bool
&& (a6, a6) -> a6 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a6
l6,a6
u6) a6
i6 Bool -> Bool -> Bool
&&
(a7, a7) -> a7 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a7
l7,a7
u7) a7
i7 Bool -> Bool -> Bool
&& (a8, a8) -> a8 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a8
l8,a8
u8) a8
i8 Bool -> Bool -> Bool
&&
(a9, a9) -> a9 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a9
l9,a9
u9) a9
i9 Bool -> Bool -> Bool
&& (aA, aA) -> aA -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aA
lA,aA
uA) aA
iA Bool -> Bool -> Bool
&&
(aB, aB) -> aB -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aB
lB,aB
uB) aB
iB Bool -> Bool -> Bool
&& (aC, aC) -> aC -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aC
lC,aC
uC) aC
iC Bool -> Bool -> Bool
&&
(aD, aD) -> aD -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aD
lD,aD
uD) aD
iD
instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6, Ix a7, Ix a8, Ix a9,
Ix aA, Ix aB, Ix aC, Ix aD, Ix aE) =>
Ix (a1,a2,a3,a4,a5,a6,a7,a8,a9,aA,aB,aC,aD,aE) where
range :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE),
(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE))
-> [(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE)]
range ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9,aA
lA,aB
lB,aC
lC,aD
lD,aE
lE),
(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9,aA
uA,aB
uB,aC
uC,aD
uD,aE
uE)) =
[(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9,aA
iA,aB
iB,aC
iC,aD
iD,aE
iE) | a1
i1 <- (a1, a1) -> [a1]
forall a. Ix a => (a, a) -> [a]
range (a1
l1,a1
u1),
a2
i2 <- (a2, a2) -> [a2]
forall a. Ix a => (a, a) -> [a]
range (a2
l2,a2
u2),
a3
i3 <- (a3, a3) -> [a3]
forall a. Ix a => (a, a) -> [a]
range (a3
l3,a3
u3),
a4
i4 <- (a4, a4) -> [a4]
forall a. Ix a => (a, a) -> [a]
range (a4
l4,a4
u4),
a5
i5 <- (a5, a5) -> [a5]
forall a. Ix a => (a, a) -> [a]
range (a5
l5,a5
u5),
a6
i6 <- (a6, a6) -> [a6]
forall a. Ix a => (a, a) -> [a]
range (a6
l6,a6
u6),
a7
i7 <- (a7, a7) -> [a7]
forall a. Ix a => (a, a) -> [a]
range (a7
l7,a7
u7),
a8
i8 <- (a8, a8) -> [a8]
forall a. Ix a => (a, a) -> [a]
range (a8
l8,a8
u8),
a9
i9 <- (a9, a9) -> [a9]
forall a. Ix a => (a, a) -> [a]
range (a9
l9,a9
u9),
aA
iA <- (aA, aA) -> [aA]
forall a. Ix a => (a, a) -> [a]
range (aA
lA,aA
uA),
aB
iB <- (aB, aB) -> [aB]
forall a. Ix a => (a, a) -> [a]
range (aB
lB,aB
uB),
aC
iC <- (aC, aC) -> [aC]
forall a. Ix a => (a, a) -> [a]
range (aC
lC,aC
uC),
aD
iD <- (aD, aD) -> [aD]
forall a. Ix a => (a, a) -> [a]
range (aD
lD,aD
uD),
aE
iE <- (aE, aE) -> [aE]
forall a. Ix a => (a, a) -> [a]
range (aE
lE,aE
uE)]
unsafeIndex :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE),
(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE))
-> (a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE) -> Int
unsafeIndex ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9,aA
lA,aB
lB,aC
lC,aD
lD,aE
lE),
(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9,aA
uA,aB
uB,aC
uC,aD
uD,aE
uE))
(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9,aA
iA,aB
iB,aC
iC,aD
iD,aE
iE) =
(aE, aE) -> aE -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aE
lE,aE
uE) aE
iE Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aE, aE) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aE
lE,aE
uE) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(aD, aD) -> aD -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aD
lD,aD
uD) aD
iD Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aD, aD) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aD
lD,aD
uD) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(aC, aC) -> aC -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aC
lC,aC
uC) aC
iC Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aC, aC) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aC
lC,aC
uC) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(aB, aB) -> aB -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aB
lB,aB
uB) aB
iB Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aB, aB) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aB
lB,aB
uB) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(aA, aA) -> aA -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aA
lA,aA
uA) aA
iA Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aA, aA) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aA
lA,aA
uA) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a9, a9) -> a9 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a9
l9,a9
u9) a9
i9 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a9, a9) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a9
l9,a9
u9) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a8, a8) -> a8 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a8
l8,a8
u8) a8
i8 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a8, a8) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a8
l8,a8
u8) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a7, a7) -> a7 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a7
l7,a7
u7) a7
i7 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a7, a7) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a7
l7,a7
u7) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a6, a6) -> a6 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a6
l6,a6
u6) a6
i6 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a6, a6) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a6
l6,a6
u6) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a5, a5) -> a5 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a5
l5,a5
u5) a5
i5 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a5, a5) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a5
l5,a5
u5) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a4, a4) -> a4 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a4
l4,a4
u4) a4
i4 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a4, a4) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a4
l4,a4
u4) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a3, a3) -> a3 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a3
l3,a3
u3) a3
i3 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a3, a3) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a3
l3,a3
u3) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a2, a2) -> a2 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a2
l2,a2
u2) a2
i2 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a2, a2) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a2
l2,a2
u2) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a1, a1) -> a1 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a1
l1,a1
u1) a1
i1)))))))))))))
inRange :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE),
(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE))
-> (a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE) -> Bool
inRange ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9,aA
lA,aB
lB,aC
lC,aD
lD,aE
lE),
(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9,aA
uA,aB
uB,aC
uC,aD
uD,aE
uE))
(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9,aA
iA,aB
iB,aC
iC,aD
iD,aE
iE) =
(a1, a1) -> a1 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a1
l1,a1
u1) a1
i1 Bool -> Bool -> Bool
&& (a2, a2) -> a2 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a2
l2,a2
u2) a2
i2 Bool -> Bool -> Bool
&&
(a3, a3) -> a3 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a3
l3,a3
u3) a3
i3 Bool -> Bool -> Bool
&& (a4, a4) -> a4 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a4
l4,a4
u4) a4
i4 Bool -> Bool -> Bool
&&
(a5, a5) -> a5 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a5
l5,a5
u5) a5
i5 Bool -> Bool -> Bool
&& (a6, a6) -> a6 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a6
l6,a6
u6) a6
i6 Bool -> Bool -> Bool
&&
(a7, a7) -> a7 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a7
l7,a7
u7) a7
i7 Bool -> Bool -> Bool
&& (a8, a8) -> a8 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a8
l8,a8
u8) a8
i8 Bool -> Bool -> Bool
&&
(a9, a9) -> a9 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a9
l9,a9
u9) a9
i9 Bool -> Bool -> Bool
&& (aA, aA) -> aA -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aA
lA,aA
uA) aA
iA Bool -> Bool -> Bool
&&
(aB, aB) -> aB -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aB
lB,aB
uB) aB
iB Bool -> Bool -> Bool
&& (aC, aC) -> aC -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aC
lC,aC
uC) aC
iC Bool -> Bool -> Bool
&&
(aD, aD) -> aD -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aD
lD,aD
uD) aD
iD Bool -> Bool -> Bool
&& (aE, aE) -> aE -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aE
lE,aE
uE) aE
iE
instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5, Ix a6, Ix a7, Ix a8, Ix a9,
Ix aA, Ix aB, Ix aC, Ix aD, Ix aE, Ix aF) =>
Ix (a1,a2,a3,a4,a5,a6,a7,a8,a9,aA,aB,aC,aD,aE,aF) where
range :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE, aF),
(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE, aF))
-> [(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE, aF)]
range ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9,aA
lA,aB
lB,aC
lC,aD
lD,aE
lE,aF
lF),
(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9,aA
uA,aB
uB,aC
uC,aD
uD,aE
uE,aF
uF)) =
[(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9,aA
iA,aB
iB,aC
iC,aD
iD,aE
iE,aF
iF) | a1
i1 <- (a1, a1) -> [a1]
forall a. Ix a => (a, a) -> [a]
range (a1
l1,a1
u1),
a2
i2 <- (a2, a2) -> [a2]
forall a. Ix a => (a, a) -> [a]
range (a2
l2,a2
u2),
a3
i3 <- (a3, a3) -> [a3]
forall a. Ix a => (a, a) -> [a]
range (a3
l3,a3
u3),
a4
i4 <- (a4, a4) -> [a4]
forall a. Ix a => (a, a) -> [a]
range (a4
l4,a4
u4),
a5
i5 <- (a5, a5) -> [a5]
forall a. Ix a => (a, a) -> [a]
range (a5
l5,a5
u5),
a6
i6 <- (a6, a6) -> [a6]
forall a. Ix a => (a, a) -> [a]
range (a6
l6,a6
u6),
a7
i7 <- (a7, a7) -> [a7]
forall a. Ix a => (a, a) -> [a]
range (a7
l7,a7
u7),
a8
i8 <- (a8, a8) -> [a8]
forall a. Ix a => (a, a) -> [a]
range (a8
l8,a8
u8),
a9
i9 <- (a9, a9) -> [a9]
forall a. Ix a => (a, a) -> [a]
range (a9
l9,a9
u9),
aA
iA <- (aA, aA) -> [aA]
forall a. Ix a => (a, a) -> [a]
range (aA
lA,aA
uA),
aB
iB <- (aB, aB) -> [aB]
forall a. Ix a => (a, a) -> [a]
range (aB
lB,aB
uB),
aC
iC <- (aC, aC) -> [aC]
forall a. Ix a => (a, a) -> [a]
range (aC
lC,aC
uC),
aD
iD <- (aD, aD) -> [aD]
forall a. Ix a => (a, a) -> [a]
range (aD
lD,aD
uD),
aE
iE <- (aE, aE) -> [aE]
forall a. Ix a => (a, a) -> [a]
range (aE
lE,aE
uE),
aF
iF <- (aF, aF) -> [aF]
forall a. Ix a => (a, a) -> [a]
range (aF
lF,aF
uF)]
unsafeIndex :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE, aF),
(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE, aF))
-> (a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE, aF)
-> Int
unsafeIndex ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9,aA
lA,aB
lB,aC
lC,aD
lD,aE
lE,aF
lF),
(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9,aA
uA,aB
uB,aC
uC,aD
uD,aE
uE,aF
uF))
(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9,aA
iA,aB
iB,aC
iC,aD
iD,aE
iE,aF
iF) =
(aF, aF) -> aF -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aF
lF,aF
uF) aF
iF Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aF, aF) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aF
lF,aF
uF) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(aE, aE) -> aE -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aE
lE,aE
uE) aE
iE Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aE, aE) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aE
lE,aE
uE) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(aD, aD) -> aD -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aD
lD,aD
uD) aD
iD Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aD, aD) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aD
lD,aD
uD) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(aC, aC) -> aC -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aC
lC,aC
uC) aC
iC Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aC, aC) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aC
lC,aC
uC) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(aB, aB) -> aB -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aB
lB,aB
uB) aB
iB Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aB, aB) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aB
lB,aB
uB) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(aA, aA) -> aA -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (aA
lA,aA
uA) aA
iA Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (aA, aA) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (aA
lA,aA
uA) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a9, a9) -> a9 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a9
l9,a9
u9) a9
i9 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a9, a9) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a9
l9,a9
u9) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a8, a8) -> a8 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a8
l8,a8
u8) a8
i8 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a8, a8) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a8
l8,a8
u8) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a7, a7) -> a7 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a7
l7,a7
u7) a7
i7 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a7, a7) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a7
l7,a7
u7) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a6, a6) -> a6 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a6
l6,a6
u6) a6
i6 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a6, a6) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a6
l6,a6
u6) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a5, a5) -> a5 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a5
l5,a5
u5) a5
i5 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a5, a5) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a5
l5,a5
u5) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a4, a4) -> a4 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a4
l4,a4
u4) a4
i4 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a4, a4) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a4
l4,a4
u4) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a3, a3) -> a3 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a3
l3,a3
u3) a3
i3 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a3, a3) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a3
l3,a3
u3) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a2, a2) -> a2 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a2
l2,a2
u2) a2
i2 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (a2, a2) -> Int
forall a. Ix a => (a, a) -> Int
unsafeRangeSize (a2
l2,a2
u2) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (
(a1, a1) -> a1 -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex (a1
l1,a1
u1) a1
i1))))))))))))))
inRange :: ((a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE, aF),
(a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE, aF))
-> (a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE, aF)
-> Bool
inRange ((a1
l1,a2
l2,a3
l3,a4
l4,a5
l5,a6
l6,a7
l7,a8
l8,a9
l9,aA
lA,aB
lB,aC
lC,aD
lD,aE
lE,aF
lF),
(a1
u1,a2
u2,a3
u3,a4
u4,a5
u5,a6
u6,a7
u7,a8
u8,a9
u9,aA
uA,aB
uB,aC
uC,aD
uD,aE
uE,aF
uF))
(a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,a8
i8,a9
i9,aA
iA,aB
iB,aC
iC,aD
iD,aE
iE,aF
iF) =
(a1, a1) -> a1 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a1
l1,a1
u1) a1
i1 Bool -> Bool -> Bool
&& (a2, a2) -> a2 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a2
l2,a2
u2) a2
i2 Bool -> Bool -> Bool
&&
(a3, a3) -> a3 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a3
l3,a3
u3) a3
i3 Bool -> Bool -> Bool
&& (a4, a4) -> a4 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a4
l4,a4
u4) a4
i4 Bool -> Bool -> Bool
&&
(a5, a5) -> a5 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a5
l5,a5
u5) a5
i5 Bool -> Bool -> Bool
&& (a6, a6) -> a6 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a6
l6,a6
u6) a6
i6 Bool -> Bool -> Bool
&&
(a7, a7) -> a7 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a7
l7,a7
u7) a7
i7 Bool -> Bool -> Bool
&& (a8, a8) -> a8 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a8
l8,a8
u8) a8
i8 Bool -> Bool -> Bool
&&
(a9, a9) -> a9 -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (a9
l9,a9
u9) a9
i9 Bool -> Bool -> Bool
&& (aA, aA) -> aA -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aA
lA,aA
uA) aA
iA Bool -> Bool -> Bool
&&
(aB, aB) -> aB -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aB
lB,aB
uB) aB
iB Bool -> Bool -> Bool
&& (aC, aC) -> aC -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aC
lC,aC
uC) aC
iC Bool -> Bool -> Bool
&&
(aD, aD) -> aD -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aD
lD,aD
uD) aD
iD Bool -> Bool -> Bool
&& (aE, aE) -> aE -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aE
lE,aE
uE) aE
iE Bool -> Bool -> Bool
&&
(aF, aF) -> aF -> Bool
forall a. Ix a => (a, a) -> a -> Bool
inRange (aF
lF,aF
uF) aF
iF