Copyright | (c) Masahiro Sakai 2014 |
---|---|
License | BSD-style |
Maintainer | masahiro.sakai@gmail.com |
Stability | provisional |
Portability | non-portable (BangPatterns, FlexibleContexts, ScopedTypeVariables) |
Safe Haskell | None |
Language | Haskell2010 |
Simple 1-dimentional resizable array
- data GenericVec a e
- type Vec e = GenericVec IOArray e
- type UVec e = GenericVec IOUArray e
- type Index = Int
- new :: MArray a e IO => IO (GenericVec a e)
- clone :: MArray a e IO => GenericVec a e -> IO (GenericVec a e)
- getSize :: MArray a e IO => GenericVec a e -> IO Int
- read :: MArray a e IO => GenericVec a e -> Int -> IO e
- write :: MArray a e IO => GenericVec a e -> Int -> e -> IO ()
- unsafeRead :: MArray a e IO => GenericVec a e -> Int -> IO e
- unsafeWrite :: MArray a e IO => GenericVec a e -> Int -> e -> IO ()
- resize :: MArray a e IO => GenericVec a e -> Int -> IO ()
- growTo :: MArray a e IO => GenericVec a e -> Int -> IO ()
- push :: MArray a e IO => GenericVec a e -> e -> IO ()
- unsafePop :: MArray a e IO => GenericVec a e -> IO e
- clear :: MArray a e IO => GenericVec a e -> IO ()
- getElems :: MArray a e IO => GenericVec a e -> IO [e]
- getArray :: GenericVec a e -> IO (a Index e)
- getCapacity :: MArray a e IO => GenericVec a e -> IO Int
- resizeCapacity :: MArray a e IO => GenericVec a e -> Int -> IO ()
Vec type
data GenericVec a e Source
Eq (GenericVec a e) |
type Vec e = GenericVec IOArray e Source
type UVec e = GenericVec IOUArray e Source
Constructors
clone :: MArray a e IO => GenericVec a e -> IO (GenericVec a e) Source
Operators
unsafeRead :: MArray a e IO => GenericVec a e -> Int -> IO e Source
unsafeWrite :: MArray a e IO => GenericVec a e -> Int -> e -> IO () Source
Low-level operators
getArray :: GenericVec a e -> IO (a Index e) Source
Get the internal representation array
getCapacity :: MArray a e IO => GenericVec a e -> IO Int Source
Get the internal representation array
resizeCapacity :: MArray a e IO => GenericVec a e -> Int -> IO () Source
Pre-allocate internal buffer for n
elements.