fleet-array: Fleet arrays are pure, but support fast updates if used linearly
This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.
Updating a pure array in Haskell usually requires copying the whole array, which takes linear time. For constant-time array updates, you would need to use a monadic interface, manually specifying the order of evaluation. Fleet arrays strike a balance between these two extremes. In common usage patterns, where old versions of arrays not reused after they are updated, fleet arrays support constant time indexing and updates. Accessing old versions does incur performance overhead. We hope this package can form the basis of a pure and performant array library.
Fleet arrays can be more than 10x faster than IntMap
if used densly and
linearly.
The ideas behind fleet arrays are due to Baker in 1991, who called them shallow arrays. These ideas were first implemented in Haskell by Simon Marlow as part of GHC (now moved to the diffarray package). Fleet arrays provide a simpler vector-like interface and offer better performance.
Properties
Versions | 0.1.0.0 |
---|---|
Change log | None available |
Dependencies | base (>=4.18 && <4.21), fleet-array [details] |
License | BSD-3-Clause |
Author | Jaro Reinders |
Maintainer | jaro.reinders@gmail.com |
Category | Data, Data Structures, Array |
Source repo | head: git clone https://github.com/noughtmare/fleet-array |
Uploaded | by JaroReinders at 2025-03-12T20:59:23Z |
library fleet-array
library fleet-array:fleet-array-examples
Modules
[Index] [Quick Jump]
- Example
- Fleet
- Example.Fleet.Eratosthenes
- Example.Fleet.Quicksort
- MutArr
- Example.MutArr.Eratosthenes
- Example.MutArr.Quicksort
- Fleet
Downloads
- fleet-array-0.1.0.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
Package maintainers
For package maintainers and hackage trustees