diff options
| author | Tom Smeding <tom@tomsmeding.com> | 2025-11-15 22:48:06 +0100 |
|---|---|---|
| committer | Tom Smeding <tom@tomsmeding.com> | 2025-11-15 22:48:06 +0100 |
| commit | e9a0873ceb5c2140dc3331aa8239d511675d55c4 (patch) | |
| tree | 4101ee16a5f0a0005376008a0956bfbca313b362 /README.md | |
| parent | 965ea2fd5aa21e1570f97957ae5613894fe8795d (diff) | |
README: Document array buffer sharing policy
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -58,6 +58,14 @@ as precisely as you want to GHC what exactly you're doing. Below the surface layer, there is a more low-level wrapper (`XArray`) around `orthotope` that defines a non-nested `Mixed`-style array type. +**Be aware**: `ox-arrays` attempts to preserve sharing as much as possible. +That is to say: if a function is able avoid copying array data and return an +array that references the original underlying `Vector`, it may do so. For +example, this means that if you convert a nested array to a list of arrays, all +returned arrays reference part of the original array without copying. This +makes `mtoList` fast, but also means that memory may be retained longer than +you might expect. + Here is a little taster of the API, to get a sense for the design: ```haskell |
