slotmap alternatives and similar packages
Based on the "Data" category.
Alternatively, view slotmap alternatives based on common mentions on social networks and blogs.
-
semantic-source
Parsing, analyzing, and comparing source code across many languages -
lens
Lenses, Folds, and Traversals - Join us on web.libera.chat #haskell-lens -
text
Haskell library for space- and time-efficient operations over Unicode text. -
code-builder
Packages for defining APIs, running them, generating client code and documentation. -
compendium-client
Mu (μ) is a purely functional framework for building micro services. -
unordered-containers
Efficient hashing-based container types -
cassava
A CSV parsing and encoding library optimized for ease of use and high performance -
holmes
A reference library for constraint-solving with propagators and CDCL. -
resource-pool
A high-performance striped resource pooling implementation for Haskell -
primitive
This package provides various primitive memory-related operations. -
discrimination
Fast linear time sorting and discrimination for a large class of data types -
reflection
Reifies arbitrary Haskell terms into types that can be reflected back into terms -
IORefCAS
A collection of different packages for CAS based data structures. -
dependent-map
Dependently-typed finite maps (partial dependent products) -
dependent-sum
Dependent sums and supporting typeclasses for comparing and displaying them -
streaming
An optimized general monad transformer for streaming applications, with a simple prelude of functions -
orgmode-parse
Attoparsec parser combinators for parsing org-mode structured text! -
text-icu
This package provides the Haskell Data.Text.ICU library, for performing complex manipulation of Unicode text. -
scientific
Arbitrary-precision floating-point numbers represented using scientific notation
Clean code begins in your IDE with SonarLint
Do you think we are missing an alternative of slotmap or a related project?
README
Haskell SlotMap
This package implements the SlotMap data structure. SlotMaps are popular in certain high performance situations. This implementation is generic over ST or IO. More information on SlotMaps can be found here.
Example Usage
module Main where
import Data.SlotMap as M
main :: IO ()
main = do
-- Create SlotMap
m <- M.empty
-- Insert Elements
a <- M.insert 3 m
b <- M.insert 7 m
c <- M.insert 9 m
-- Print Elements
M.lookup a m >>= putStrLn . show -- Just 3
M.lookup b m >>= putStrLn . show -- Just 7
M.lookup c m >>= putStrLn . show -- Just 9
-- Mutate Elements
M.delete a m
M.update m (1+) b
M.map (*2) m
-- Print Updated Elements
M.lookup a m >>= putStrLn . show -- Just Nothing
M.lookup b m >>= putStrLn . show -- Just 16
M.lookup c m >>= putStrLn . show -- Just 18
Structure Properties
Keys are a weakly owning reference to the contents of the store. On insertion a unique key is returned. There is a generational index system such that when a storage slot is reused previous keys to the same slot do not incorrectly return a value.
Operation | Complexity |
---|---|
Lookup | O(1) |
Map | O(N)*1 |
Update | O(1) |
Delete | O(1) |
Insert | O(1)*2 |
Size | O(1)*3 |
- Where N = capacity NOT size.
- May initiate allocation if the capacity is full.
- Size != capacity. Capacity may never shrink.