{-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples #-}
{-# OPTIONS_HADDOCK not-home #-}

-----------------------------------------------------------------------------
-- |
-- Module      :  GHC.Ix
-- Copyright   :  (c) The University of Glasgow, 1994-2000
-- License     :  see libraries/base/LICENSE
--
-- Maintainer  :  cvs-ghc@haskell.org
-- Stability   :  internal
-- Portability :  non-portable (GHC extensions)
--
-- GHC\'s Ix typeclass implementation.
--
-----------------------------------------------------------------------------

module GHC.Ix (
        Ix(..), indexError
    ) where

import GHC.Enum
import GHC.Num
import GHC.Base
import GHC.Real( fromIntegral )
import GHC.Show

-- | The 'Ix' class is used to map a contiguous subrange of values in
-- a type onto integers.  It is used primarily for array indexing
-- (see the array package).
--
-- The first argument @(l,u)@ of each of these operations is a pair
-- specifying the lower and upper bounds of a contiguous subrange of values.
--
-- An implementation is entitled to assume the following laws about these
-- operations:
--
-- * @'inRange' (l,u) i == 'elem' i ('range' (l,u))@ @ @
--
-- * @'range' (l,u) '!!' 'index' (l,u) i == i@, when @'inRange' (l,u) i@
--
-- * @'map' ('index' (l,u)) ('range' (l,u))) == [0..'rangeSize' (l,u)-1]@ @ @
--
-- * @'rangeSize' (l,u) == 'length' ('range' (l,u))@ @ @
--
class (Ord a) => Ix a where
    {-# MINIMAL range, (index | unsafeIndex), inRange #-}

    -- | The list of values in the subrange defined by a bounding pair.
    range               :: (a,a) -> [a]
    -- | The position of a subscript in the subrange.
    index               :: (a,a) -> a -> Int
    -- | Like 'index', but without checking that the value is in range.
    unsafeIndex         :: (a,a) -> a -> Int
    -- | Returns 'True' the given subscript lies in the range defined
    -- the bounding pair.
    inRange             :: (a,a) -> a -> Bool
    -- | The size of the subrange defined by a bounding pair.
    rangeSize           :: (a,a) -> Int
    -- | like 'rangeSize', but without checking that the upper bound is
    -- in range.
    unsafeRangeSize     :: (a,a) -> Int

        -- Must specify one of index, unsafeIndex

        -- 'index' is typically over-ridden in instances, with essentially
        -- the same code, but using indexError instead of hopelessIndexError
        -- Reason: we have 'Show' at the instances
    {-# INLINE index #-}  -- See Note [Inlining 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        -- This case is only here to
                                                -- check for an empty range
        -- NB: replacing (inRange b h) by (l <= h) fails for
        --     tuples.  E.g.  (1,2) <= (2,1) but the range is empty

    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

{-
Note that the following is NOT right
        rangeSize (l,h) | l <= h    = index b h + 1
                        | otherwise = 0

Because it might be the case that l<h, but the range
is nevertheless empty.  Consider
        ((1,2),(2,1))
Here l<h, but the second index ranges from 2..1 and
hence is empty


Note [Inlining index]
~~~~~~~~~~~~~~~~~~~~~
We inline the 'index' operation,

 * Partly because it generates much faster code
   (although bigger); see #1216

 * Partly because it exposes the bounds checks to the simplifier which
   might help a big.

If you make a per-instance index method, you may consider inlining it.

Note [Double bounds-checking of index values]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When you index an array, a!x, there are two possible bounds checks we might make:

  (A) Check that (inRange (bounds a) x) holds.

      (A) is checked in the method for 'index'

  (B) Check that (index (bounds a) x) lies in the range 0..n,
      where n is the size of the underlying array

      (B) is checked in the top-level function (!), in safeIndex.

Of course it *should* be the case that (A) holds iff (B) holds, but that
is a property of the particular instances of index, bounds, and inRange,
so GHC cannot guarantee it.

 * If you do (A) and not (B), then you might get a seg-fault,
   by indexing at some bizarre location.  #1610

 * If you do (B) but not (A), you may get no complaint when you index
   an array out of its semantic bounds.  #2120

At various times we have had (A) and not (B), or (B) and not (A); both
led to complaints.  So now we implement *both* checks (#2669).

For 1-d, 2-d, and 3-d arrays of Int we have specialised instances to avoid this.

Note [Out-of-bounds error messages]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The default method for 'index' generates hoplelessIndexError, because
Ix doesn't have Show as a superclass.  For particular base types we
can do better, so we override the default method for index.
-}

-- Abstract these errors from the relevant index functions so that
-- the guts of the function will be small enough to inline.

{-# NOINLINE indexError #-}
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 -- Try to use 'indexError' instead!
hopelessIndexError :: Int
hopelessIndexError = String -> Int
forall a. String -> a
errorWithoutStackTrace String
"Error in array index"

----------------------------------------------------------------------
-- | @since 2.01
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 #-}  -- See Note [Out-of-bounds error messages]
                          -- and Note [Inlining 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

----------------------------------------------------------------------
-- | @since 2.01
instance  Ix Int  where
    {-# INLINE range #-}
        -- The INLINE stops the build in the RHS from getting inlined,
        -- so that callers can fuse with the result of 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 #-}  -- See Note [Out-of-bounds error messages]
                          -- and Note [Inlining 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)

-- | @since 4.6.0.0
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

----------------------------------------------------------------------
-- | @since 2.01
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 #-}  -- See Note [Out-of-bounds error messages]
                          -- and Note [Inlining 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

----------------------------------------------------------------------
-- | @since 4.8.0.0
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"

----------------------------------------------------------------------
-- | @since 2.01
instance Ix Bool where -- as derived
    {-# 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 #-}  -- See Note [Out-of-bounds error messages]
                          -- and Note [Inlining 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

----------------------------------------------------------------------
-- | @since 2.01
instance Ix Ordering where -- as derived
    {-# 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 #-}  -- See Note [Out-of-bounds error messages]
                          -- and Note [Inlining 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

----------------------------------------------------------------------
-- | @since 2.01
instance Ix () where
    {-# INLINE range #-}
    range :: ((), ()) -> [()]
range   ((), ())    = [()]
    {-# INLINE unsafeIndex #-}
    unsafeIndex :: ((), ()) -> () -> Int
unsafeIndex   ((), ()) () = Int
0
    {-# INLINE inRange #-}
    inRange :: ((), ()) -> () -> Bool
inRange ((), ()) () = Bool
True

    {-# INLINE index #-}  -- See Note [Inlining index]
    index :: ((), ()) -> () -> Int
index ((), ())
b ()
i = ((), ()) -> () -> Int
forall a. Ix a => (a, a) -> a -> Int
unsafeIndex ((), ())
b ()
i

----------------------------------------------------------------------
-- | @since 2.01
instance (Ix a, Ix b) => Ix (a, b) where -- as derived
    {-# 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

    -- Default method for index

----------------------------------------------------------------------
-- | @since 2.01
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

    -- Default method for index

----------------------------------------------------------------------
-- | @since 2.01
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

    -- Default method for index

----------------------------------------------------------------------
-- | @since 2.01
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

    -- Default method for index

----------------------------------------------------------------------
-- | @since 4.15.0.0
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

    -- Default method for index

----------------------------------------------------------------------
-- | @since 4.15.0.0
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

    -- Default method for index

----------------------------------------------------------------------
-- | @since 4.15.0.0
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

    -- Default method for index

----------------------------------------------------------------------
-- | @since 4.15.0.0
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

    -- Default method for index

----------------------------------------------------------------------
-- | @since 4.15.0.0
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

    -- Default method for index

----------------------------------------------------------------------
-- | @since 4.15.0.0
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

    -- Default method for index

----------------------------------------------------------------------
-- | @since 4.15.0.0
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

    -- Default method for index

----------------------------------------------------------------------
-- | @since 4.15.0.0
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

    -- Default method for index

----------------------------------------------------------------------
-- | @since 4.15.0.0
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

    -- Default method for index

----------------------------------------------------------------------
-- | @since 4.15.0.0
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

    -- Default method for index