on 46ea2aa help sign in
69 lines 1.3 kB history raw
1-- |
2-- Module : Streamly.Data.MutArray
3-- Copyright : (c) 2022 Composewell Technologies
4--
5-- License : BSD3
6-- Maintainer : streamly@composewell.com
7-- Stability : released
8-- Portability : GHC
9--
10-- Mutable version of "Streamly.Data.Array". Please refer to that module for
11-- general documentation. The contents of mutable ararys can be modified
12-- in-place.
13--
14-- See "Streamly.Data.MutArray.Generic" for mutable arrays that work for boxed
15-- types i.e. not requiring the 'Unbox' constraint.
17module Streamly.Data.MutArray
18 (
19 -- * Types
20 MutArray
22 -- * Construction
24 -- Uninitialized Arrays
25 , new
26 , newPinned
28 -- From containers
29 , fromListN
30 , fromList
31 , writeN -- drop new
32 , write -- full buffer
33 -- writeLastN
35 -- * Appending elements
36 , snoc
38 -- * Appending streams
39 , writeAppendN
40 , writeAppend
42 -- * Inplace mutation
43 , putIndex
45 -- * Random access
46 , getIndex
48 -- * Conversion
49 , toList
51 -- * Unfolds
52 , reader
53 , readerRev
55 -- * Casting
56 , cast
57 , asBytes
59 -- * Size
60 , length
62 -- * Unbox Type Class
63 , Unbox (..)
64 )
65where
67import Prelude hiding (length, read)
68import Streamly.Internal.Data.Array.Mut
69import Streamly.Internal.Data.Unboxed (Unbox (..))