-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Reshape multi-dimensional arrays.
--   
--   Reshape multi-dimensional arrays.
--   
--   Provides the <a>Shapable</a> class, respresenting those instances of
--   <a>Ix</a> that provide to arrays indexing that is isomorphic to that
--   of C-style multi-dimensional arrays.
--   
--   Factored out of the <a>carray</a> library with the kind permission of
--   its author.
@package ix-shapable
@version 0.1.0

module Data.Ix.Shapable

-- | We need this type class to distinguish between different tuples of Ix.
--   There are Shapable instances for homogenous Int tuples, but may
--   Haddock doesn't see them.
class Shapable i
sRank :: Shapable i => i -> Int
sShape :: Shapable i => i -> i -> [Int]
sBounds :: Shapable i => [Int] -> (i, i)

-- | Determine the rank of an array.
rank :: (Shapable i, Ix i, IArray a e) => a i e -> Int

-- | Canonical representation of the shape. The following properties hold:
--   'length . shape = rank' 'product . shape = size'
shape :: (Shapable i, Ix i, IArray a e) => a i e -> [Int]

-- | How much the offset changes when you move one element in the given
--   direction. Since arrays are in row-major order, 'last . shapeToStride
--   = const 1'
shapeToStride :: [Int] -> [Int]

-- | Number of elements in the Array.
size :: (Ix i, IArray a e) => a i e -> Int
instance Data.Ix.Shapable.Shapable GHC.Types.Int
instance Data.Ix.Shapable.Shapable (GHC.Types.Int, GHC.Types.Int)
instance Data.Ix.Shapable.Shapable (GHC.Types.Int, GHC.Types.Int, GHC.Types.Int)
instance Data.Ix.Shapable.Shapable (GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int)
instance Data.Ix.Shapable.Shapable (GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int)
instance Data.Ix.Shapable.Shapable (GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int)
instance Data.Ix.Shapable.Shapable (GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int)
instance Data.Ix.Shapable.Shapable (GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int)
instance Data.Ix.Shapable.Shapable (GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int)
