Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Small-array
Synopsis
- data SmallMutableArray s a = SmallMutableArray (SmallMutableArray# s a)
- data SmallArray a = SmallArray (SmallArray# a)
- newSmallArray :: Int -> a -> State# s -> (# State# s, SmallMutableArray s a #)
- writeSmallArray :: SmallMutableArray s a -> Int -> a -> State# s -> State# s
- freezeSmallArray :: SmallMutableArray s a -> Int -> Int -> State# s -> (# State# s, SmallArray a #)
- unsafeFreezeSmallArray :: SmallMutableArray s a -> State# s -> (# State# s, SmallArray a #)
- indexSmallArray :: SmallArray a -> Int -> a
- listToArray :: Int -> (e -> Int) -> (e -> a) -> [e] -> SmallArray a
Documentation
data SmallMutableArray s a Source #
data SmallArray a Source #
:: Int | size |
-> a | initial contents |
-> State# s | |
-> (# State# s, SmallMutableArray s a #) |
:: SmallMutableArray s a | array |
-> Int | index |
-> a | new element |
-> State# s | |
-> State# s |
:: SmallMutableArray s a | source |
-> Int | offset |
-> Int | length |
-> State# s | |
-> (# State# s, SmallArray a #) |
Copy and freeze a slice of a mutable array.
unsafeFreezeSmallArray :: SmallMutableArray s a -> State# s -> (# State# s, SmallArray a #) Source #
Freeze a mutable array (no copy!)
:: SmallArray a | array |
-> Int | index |
-> a |
Index a small-array (no bounds checking!)
listToArray :: Int -> (e -> Int) -> (e -> a) -> [e] -> SmallArray a Source #
Convert a list into an array.