-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | IsList instances of Array for OverloadedLists extension -- -- This package provides "orphan" IsList instances for -- Array data types with Integral indices up to 5 -- dimensions to allow initializing Arrays from [nested] lists -- using OverloadedLists GHC extension. -- -- It also includes more generic arrayNestedList and -- toNestedList functions to convert between nested lists and -- Arrays with any indices. @package array-list @version 0.2.0.0 -- | This package provides "orphan" IsList instances for -- Arrays with Integral indices up to 5 dimensions to allow -- initializing Arrays from [nested] lists using -- OverloadedLists GHC extension. -- -- It also includes more generic arrayNestedList and -- toNestedList functions to convert between nested lists and -- Arrays with any indices. -- -- Examples: -- --
-- >>> ["one","two","three"] :: Array Int String -- array (0,2) [(0,"one"),(1,"two"),(2,"three")] ---- --
-- >>> [[0,1,2], [10,11,12]] :: Array (Int, Int) Int -- array ((0,0),(1,2)) [((0,0),0),((0,1),1),((0,2),2),((1,0),10),((1,1),11),((1,2),12)] ---- -- If any of the nested lists contains smaller number of elements than -- the first nested list in the same dimension, the array creation will -- fail. -- --
-- >>> [[1,2],[3]] :: Array (Int, Int) Int -- ... Exception: (Array.!): undefined array element ---- -- Nested lists with larger number of elements will be truncated. module Data.Array.IsList -- | The IsList class and its methods are intended to be used in -- conjunction with the OverloadedLists extension. class IsList l -- | The fromList function constructs the structure l from -- the given list of Item l fromList :: IsList l => [Item l] -> l -- | The toList function extracts a list of Item l from the -- structure l. It should satisfy fromList . toList = id. toList :: IsList l => l -> [Item l] -- | ArrayNestedList class defines methods to convert between nested -- lists and multi-dimensional (up to 5) Arrays with any indices, -- not only Integral, using provided range of indices. class Ix i => ArrayNestedList i e -- | Converts nested list to multi-dimensional Array Similarly to -- arrayList function, it does not require to pass index for -- each element, only the range of indices. arrayNestedList :: ArrayNestedList i e => (i, i) -> NestedList i e -> Array i e -- | Converts multi-dimensional Array to nested list. toNestedList :: ArrayNestedList i e => Array i e -> NestedList i e instance (GHC.Real.Integral i, GHC.Real.Integral j, GHC.Arr.Ix i, GHC.Arr.Ix j) => GHC.Exts.IsList (GHC.Arr.Array (i, j) e) instance (GHC.Real.Integral i, GHC.Real.Integral j, GHC.Real.Integral k, GHC.Arr.Ix i, GHC.Arr.Ix j, GHC.Arr.Ix k) => GHC.Exts.IsList (GHC.Arr.Array (i, j, k) e) instance (GHC.Real.Integral i, GHC.Real.Integral j, GHC.Real.Integral k, GHC.Real.Integral m, GHC.Arr.Ix i, GHC.Arr.Ix j, GHC.Arr.Ix k, GHC.Arr.Ix m) => GHC.Exts.IsList (GHC.Arr.Array (i, j, k, m) e) instance (GHC.Real.Integral i, GHC.Real.Integral j, GHC.Real.Integral k, GHC.Real.Integral m, GHC.Real.Integral n, GHC.Arr.Ix i, GHC.Arr.Ix j, GHC.Arr.Ix k, GHC.Arr.Ix m, GHC.Arr.Ix n) => GHC.Exts.IsList (GHC.Arr.Array (i, j, k, m, n) e) instance (GHC.Arr.Ix i, GHC.Arr.Ix j) => Data.Array.IsList.ArrayNestedList (i, j) e instance (GHC.Arr.Ix i, GHC.Arr.Ix j, GHC.Arr.Ix k) => Data.Array.IsList.ArrayNestedList (i, j, k) e instance (GHC.Arr.Ix i, GHC.Arr.Ix j, GHC.Arr.Ix k, GHC.Arr.Ix m) => Data.Array.IsList.ArrayNestedList (i, j, k, m) e instance (GHC.Arr.Ix i, GHC.Arr.Ix j, GHC.Arr.Ix k, GHC.Arr.Ix m, GHC.Arr.Ix n) => Data.Array.IsList.ArrayNestedList (i, j, k, m, n) e instance GHC.Exts.IsList (GHC.Arr.Array GHC.Types.Int e) instance GHC.Exts.IsList (GHC.Arr.Array GHC.Int.Int8 e) instance GHC.Exts.IsList (GHC.Arr.Array GHC.Int.Int16 e) instance GHC.Exts.IsList (GHC.Arr.Array GHC.Int.Int32 e) instance GHC.Exts.IsList (GHC.Arr.Array GHC.Int.Int64 e) instance GHC.Exts.IsList (GHC.Arr.Array GHC.Integer.Type.Integer e) instance GHC.Exts.IsList (GHC.Arr.Array GHC.Natural.Natural e) instance GHC.Exts.IsList (GHC.Arr.Array GHC.Types.Word e) instance GHC.Exts.IsList (GHC.Arr.Array GHC.Word.Word8 e) instance GHC.Exts.IsList (GHC.Arr.Array GHC.Word.Word16 e) instance GHC.Exts.IsList (GHC.Arr.Array GHC.Word.Word32 e) instance GHC.Exts.IsList (GHC.Arr.Array GHC.Word.Word64 e)