on master help sign in
Expose unsafe mutable array APIs (#2375)
e697599Ranjeet Ranjan
core/src/Streamly/Data/MutArray.hs+3
@@ -51,9 +51,12 @@ module Streamly.Data.MutArray
51
51
52 -- * Inplace mutation
52 -- * Inplace mutation
53 , putIndex
53 , putIndex
54+ , putIndexUnsafe
55+ , modifyIndexUnsafe
54
56
55 -- * Random access
57 -- * Random access
56 , getIndex
58 , getIndex
59+ , getIndexUnsafe
57
60
58 -- * Conversion
61 -- * Conversion
59 , toList
62 , toList
core/src/Streamly/Internal/Data/Array/Mut/Type.hs+1−1
@@ -1647,7 +1647,7 @@ foldr f z arr = D.foldr f z $ toStreamD arr
1647
1647
1648-- XXX Keep the bound intact to not lose any free space? Perf impact?
1648-- XXX Keep the bound intact to not lose any free space? Perf impact?
1649
1649
1650−-- | @writeAppendNUnsafe n alloc@ appends up to @n@ input items to the supplied
1650+-- | @writeAppendNUnsafe n arr@ appends up to @n@ input items to the supplied
1651-- array.
1651-- array.
1652--
1652--
1653-- Unsafe: Do not drive the fold beyond @n@ elements, it will lead to memory
1653-- Unsafe: Do not drive the fold beyond @n@ elements, it will lead to memory