Haskell Core Libraries (base package)ParentContentsIndex
GHC.Arr
Portability non-portable (GHC extensions)
Stability internal
Maintainer cvs-ghc@haskell.org
Description
GHC's array implementation.
Synopsis
data Array i e = Array !i !i (Array# e)
type IPr = (Int, Int)
class (Ord a) => Ix a where
unsafeRangeSize :: (a, a) -> Int
rangeSize :: (a, a) -> Int
inRange :: (a, a) -> a -> Bool
index :: (a, a) -> a -> Int
unsafeIndex :: (a, a) -> a -> Int
range :: (a, a) -> [a]
data STArray s i e = STArray !i !i (MutableArray# s e)
data Array i e = Array !i !i (Array# e)
data STArray s i e = STArray !i !i (MutableArray# s e)
accum :: (Ix i) => (e -> a -> e) -> Array i e -> [(i, a)] -> Array i e
accumArray :: (Ix i) => (e -> a -> e) -> e -> (i, i) -> [(i, a)] -> Array i e
adjust :: (e -> a -> e) -> MutableArray# s e -> (Int, a) -> STRep s b -> STRep s b
amap :: (Ix i) => (a -> b) -> Array i a -> Array i b
arrEleBottom :: a
array :: (Ix i) => (i, i) -> [(i, e)] -> Array i e
assocs :: (Ix i) => Array i e -> [(i, e)]
bounds :: (Ix i) => Array i e -> (i, i)
boundsSTArray :: STArray s i e -> (i, i)
cmpArray :: (Ix i, Ord e) => Array i e -> Array i e -> Ordering
cmpIntArray :: (Ord e) => Array Int e -> Array Int e -> Ordering
done :: (Ix i) => i -> i -> MutableArray# s e -> STRep s (Array i e)
elems :: (Ix i) => Array i e -> [e]
eqArray :: (Ix i, Eq e) => Array i e -> Array i e -> Bool
fill :: MutableArray# s e -> (Int, e) -> STRep s a -> STRep s a
freezeSTArray :: (Ix i) => STArray s i e -> ST s (Array i e)
class (Ord a) => Ix a where
unsafeRangeSize :: (a, a) -> Int
rangeSize :: (a, a) -> Int
inRange :: (a, a) -> a -> Bool
index :: (a, a) -> a -> Int
unsafeIndex :: (a, a) -> a -> Int
range :: (a, a) -> [a]
class (Ord a) => Ix a where
unsafeRangeSize :: (a, a) -> Int
rangeSize :: (a, a) -> Int
inRange :: (a, a) -> a -> Bool
index :: (a, a) -> a -> Int
unsafeIndex :: (a, a) -> a -> Int
range :: (a, a) -> [a]
indexError :: (Show a) => (a, a) -> a -> String -> b
indices :: (Ix i) => Array i e -> [i]
ixmap :: (Ix i, Ix j) => (i, i) -> (i -> j) -> Array j e -> Array i e
listArray :: (Ix i) => (i, i) -> [e] -> Array i e
newSTArray :: (Ix i) => (i, i) -> e -> ST s (STArray s i e)
class (Ord a) => Ix a where
unsafeRangeSize :: (a, a) -> Int
rangeSize :: (a, a) -> Int
inRange :: (a, a) -> a -> Bool
index :: (a, a) -> a -> Int
unsafeIndex :: (a, a) -> a -> Int
range :: (a, a) -> [a]
class (Ord a) => Ix a where
unsafeRangeSize :: (a, a) -> Int
rangeSize :: (a, a) -> Int
inRange :: (a, a) -> a -> Bool
index :: (a, a) -> a -> Int
unsafeIndex :: (a, a) -> a -> Int
range :: (a, a) -> [a]
readSTArray :: (Ix i) => STArray s i e -> i -> ST s e
thawSTArray :: (Ix i) => Array i e -> ST s (STArray s i e)
unsafeAccum :: (Ix i) => (e -> a -> e) -> Array i e -> [(Int, a)] -> Array i e
unsafeAccumArray :: (Ix i) => (e -> a -> e) -> e -> (i, i) -> [(Int, a)] -> Array i e
unsafeArray :: (Ix i) => (i, i) -> [(Int, e)] -> Array i e
unsafeAt :: (Ix i) => Array i e -> Int -> e
unsafeFreezeSTArray :: (Ix i) => STArray s i e -> ST s (Array i e)
class (Ord a) => Ix a where
unsafeRangeSize :: (a, a) -> Int
rangeSize :: (a, a) -> Int
inRange :: (a, a) -> a -> Bool
index :: (a, a) -> a -> Int
unsafeIndex :: (a, a) -> a -> Int
range :: (a, a) -> [a]
class (Ord a) => Ix a where
unsafeRangeSize :: (a, a) -> Int
rangeSize :: (a, a) -> Int
inRange :: (a, a) -> a -> Bool
index :: (a, a) -> a -> Int
unsafeIndex :: (a, a) -> a -> Int
range :: (a, a) -> [a]
unsafeReadSTArray :: (Ix i) => STArray s i e -> Int -> ST s e
unsafeReplace :: (Ix i) => Array i e -> [(Int, e)] -> Array i e
unsafeThawSTArray :: (Ix i) => Array i e -> ST s (STArray s i e)
unsafeWriteSTArray :: (Ix i) => STArray s i e -> Int -> e -> ST s ()
writeSTArray :: (Ix i) => STArray s i e -> i -> e -> ST s ()
(!) :: (Ix i) => Array i e -> i -> e
(//) :: (Ix i) => Array i e -> [(i, e)] -> Array i e
Documentation
data Array i e
Constructors
Array !i !i (Array# e)
Instances
(Typeable a, Typeable b) => Typeable (Array a b)
HasBounds Array
IArray Array e
(Ix i) => Functor (Array i)
(Ix i, Eq e) => Eq (Array i e)
(Ix i, Ord e) => Ord (Array i e)
(Ix a, Show a, Show b) => Show (Array a b)
(Ix a, Read a, Read b) => Read (Array a b)
type IPr = (Int, Int)
class (Ord a) => Ix a where
Methods
unsafeRangeSize :: (a, a) -> Int
rangeSize :: (a, a) -> Int
inRange :: (a, a) -> a -> Bool
index :: (a, a) -> a -> Int
unsafeIndex :: (a, a) -> a -> Int
range :: (a, a) -> [a]
Instances
Ix Char
Ix Int
Ix Integer
Ix Bool
Ix Ordering
Ix ()
(Ix a, Ix b) => Ix (a, b)
(Ix a1, Ix a2, Ix a3) => Ix (a1, a2, a3)
(Ix a1, Ix a2, Ix a3, Ix a4) => Ix (a1, a2, a3, a4)
(Ix a1, Ix a2, Ix a3, Ix a4, Ix a5) => Ix (a1, a2, a3, a4, a5)
Ix Int8
Ix Int16
Ix Int32
Ix Int64
Ix Word
Ix Word8
Ix Word16
Ix Word32
Ix Word64
data STArray s i e

Mutable, boxed, non-strict arrays in the ST monad. The type arguments are as follows:

  • s: the state variable argument for the ST type

  • i: the index type of the array (should be an instance of Ix)

  • e: the element type of the array.

Constructors
STArray !i !i (MutableArray# s e)
Instances
HasBounds (STArray s)
MArray (STArray s) e (ST s)
(Typeable a, Typeable b, Typeable c) => Typeable (STArray a b c)
Eq (STArray s i e)
data Array i e
Constructors
Array !i !i (Array# e)
data STArray s i e

Mutable, boxed, non-strict arrays in the ST monad. The type arguments are as follows:

  • s: the state variable argument for the ST type

  • i: the index type of the array (should be an instance of Ix)

  • e: the element type of the array.

Constructors
STArray !i !i (MutableArray# s e)
accum :: (Ix i) => (e -> a -> e) -> Array i e -> [(i, a)] -> Array i e
accumArray :: (Ix i) => (e -> a -> e) -> e -> (i, i) -> [(i, a)] -> Array i e
adjust :: (e -> a -> e) -> MutableArray# s e -> (Int, a) -> STRep s b -> STRep s b
amap :: (Ix i) => (a -> b) -> Array i a -> Array i b
arrEleBottom :: a
array :: (Ix i) => (i, i) -> [(i, e)] -> Array i e
assocs :: (Ix i) => Array i e -> [(i, e)]
bounds :: (Ix i) => Array i e -> (i, i)
boundsSTArray :: STArray s i e -> (i, i)
cmpArray :: (Ix i, Ord e) => Array i e -> Array i e -> Ordering
cmpIntArray :: (Ord e) => Array Int e -> Array Int e -> Ordering
done :: (Ix i) => i -> i -> MutableArray# s e -> STRep s (Array i e)
elems :: (Ix i) => Array i e -> [e]
eqArray :: (Ix i, Eq e) => Array i e -> Array i e -> Bool
fill :: MutableArray# s e -> (Int, e) -> STRep s a -> STRep s a
freezeSTArray :: (Ix i) => STArray s i e -> ST s (Array i e)
class (Ord a) => Ix a where
Methods
unsafeRangeSize :: (a, a) -> Int
rangeSize :: (a, a) -> Int
inRange :: (a, a) -> a -> Bool
index :: (a, a) -> a -> Int
unsafeIndex :: (a, a) -> a -> Int
range :: (a, a) -> [a]
class (Ord a) => Ix a where
Methods
unsafeRangeSize :: (a, a) -> Int
rangeSize :: (a, a) -> Int
inRange :: (a, a) -> a -> Bool
index :: (a, a) -> a -> Int
unsafeIndex :: (a, a) -> a -> Int
range :: (a, a) -> [a]
indexError :: (Show a) => (a, a) -> a -> String -> b
indices :: (Ix i) => Array i e -> [i]
ixmap :: (Ix i, Ix j) => (i, i) -> (i -> j) -> Array j e -> Array i e
listArray :: (Ix i) => (i, i) -> [e] -> Array i e
newSTArray :: (Ix i) => (i, i) -> e -> ST s (STArray s i e)
class (Ord a) => Ix a where
Methods
unsafeRangeSize :: (a, a) -> Int
rangeSize :: (a, a) -> Int
inRange :: (a, a) -> a -> Bool
index :: (a, a) -> a -> Int
unsafeIndex :: (a, a) -> a -> Int
range :: (a, a) -> [a]
class (Ord a) => Ix a where
Methods
unsafeRangeSize :: (a, a) -> Int
rangeSize :: (a, a) -> Int
inRange :: (a, a) -> a -> Bool
index :: (a, a) -> a -> Int
unsafeIndex :: (a, a) -> a -> Int
range :: (a, a) -> [a]
readSTArray :: (Ix i) => STArray s i e -> i -> ST s e
thawSTArray :: (Ix i) => Array i e -> ST s (STArray s i e)
unsafeAccum :: (Ix i) => (e -> a -> e) -> Array i e -> [(Int, a)] -> Array i e
unsafeAccumArray :: (Ix i) => (e -> a -> e) -> e -> (i, i) -> [(Int, a)] -> Array i e
unsafeArray :: (Ix i) => (i, i) -> [(Int, e)] -> Array i e
unsafeAt :: (Ix i) => Array i e -> Int -> e
unsafeFreezeSTArray :: (Ix i) => STArray s i e -> ST s (Array i e)
class (Ord a) => Ix a where
Methods
unsafeRangeSize :: (a, a) -> Int
rangeSize :: (a, a) -> Int
inRange :: (a, a) -> a -> Bool
index :: (a, a) -> a -> Int
unsafeIndex :: (a, a) -> a -> Int
range :: (a, a) -> [a]
class (Ord a) => Ix a where
Methods
unsafeRangeSize :: (a, a) -> Int
rangeSize :: (a, a) -> Int
inRange :: (a, a) -> a -> Bool
index :: (a, a) -> a -> Int
unsafeIndex :: (a, a) -> a -> Int
range :: (a, a) -> [a]
unsafeReadSTArray :: (Ix i) => STArray s i e -> Int -> ST s e
unsafeReplace :: (Ix i) => Array i e -> [(Int, e)] -> Array i e
unsafeThawSTArray :: (Ix i) => Array i e -> ST s (STArray s i e)
unsafeWriteSTArray :: (Ix i) => STArray s i e -> Int -> e -> ST s ()
writeSTArray :: (Ix i) => STArray s i e -> i -> e -> ST s ()
(!) :: (Ix i) => Array i e -> i -> e
(//) :: (Ix i) => Array i e -> [(i, e)] -> Array i e
Produced by Haddock version 0.3