on 4300a9f help sign in
81 lines 1.7 kB history raw
1{-# LANGUAGE CPP #-}
2-- |
3-- Module : Streamly.Data.MutArray
4-- Copyright : (c) 2022 Composewell Technologies
5--
6-- License : BSD3
7-- Maintainer : streamly@composewell.com
8-- Stability : released
9-- Portability : GHC
10--
11-- This module provides a mutable version of "Streamly.Data.Array". The
12-- contents of a mutable array can be modified in-place. For general
13-- documentation, please refer to the original module.
14--
15-- Please refer to "Streamly.Internal.Data.Array.Mut" for functions that have
16-- not yet been released.
17--
18-- For mutable arrays that work on boxed types, not requiring the 'Unbox'
19-- constraint, please refer to "Streamly.Data.MutArray.Generic".
21module Streamly.Data.MutArray
22 (
23 -- * Setup
24 -- | To execute the code examples provided in this module in ghci, please
25 -- run the following commands first.
26 --
27 -- $setup
29 -- * Mutable Array Type
30 MutArray
32 -- * Construction
34 -- Uninitialized Arrays
35 , new
36 , newPinned
38 -- From containers
39 , fromListN
40 , fromList
41 , writeN -- drop new
42 , write -- full buffer
43 -- writeLastN
45 -- * Appending elements
46 , snoc
48 -- * Appending streams
49 , writeAppendN
50 , writeAppend
52 -- * Inplace mutation
53 , putIndex
55 -- * Random access
56 , getIndex
58 -- * Conversion
59 , toList
61 -- * Unfolds
62 , reader
63 , readerRev
65 -- * Casting
66 , cast
67 , asBytes
69 -- * Size
70 , length
72 -- * Unbox Type Class
73 , Unbox (..)
74 )
75where
77import Prelude hiding (length, read)
78import Streamly.Internal.Data.Array.Mut
79import Streamly.Internal.Data.Unboxed (Unbox (..))
81#include "DocTestDataMutArray.hs"