hetero-dict: fast heterogeneous data structures

This package provide two flavor fast and easy to use heterogeneous data structures:

Dict which use boxed array, it's read-only with O(1) get. DynDict which use linked-list(see module document for details).

Features simple api, good performance and good error message, Show and From/ToJSON instances are provided.

Example

> :set -XDataKinds -XQuasiQuotes > :m + Data.Hetero.Dict > let d = mkDict . add [key|foo|] 12 . add [key|bar|] "baz" $ emptyStore > :t d d :: Num v => Dict '["foo" ':= v, "bar" ':= [Char]] > get [key|foo|] d 12 > get [key|bar|] d "baz" > get [key|qux|] d • Couldn't match type ‘'Index i1’ with ‘'NotFoundKey "qux"’ ...

> :set -XDataKinds -XQuasiQuotes > :m + Data.Hetero.DynDict > let d = add [key|foo|] 12 . add [key|bar|] "baz" $ empty > get [key|foo|] d 12 > get [key|bar|] d "baz" > let d' = set [key|foo|] 13 d > get [key|foo|] d' 13

Benchmark

We use hvect and vinyl as references.