BSD-3-Clause licensed by Heinrich Apfelmus, Elliott Hird
Maintained by Heinrich Apfelmus <apfelmus at quantentunnel de>
This version can be pinned in stack with:vault-0.3.1.2@sha256:aa0869aa80026d0bfbbeee44a6381ccd2a2c960ce3ef7d484b14270e054ca79a,1912

Module documentation for 0.3.1.2

Build Status

Vault is a tiny library that provides a single data structure called vault.

A vault is a type-safe, persistent storage for values of arbitrary types. Like IORef, I want to be able to store values of any type in it, but unlike IORef, I want the storage space to behave like a persistent, first-class data structure, as appropriate for a purely functional language.

It is analogous to a bank vault, where you can access different bank boxes with different keys; hence the name.

In other words, a vault is an abstract data type with the following basic signature

data Key a
data Vault

newKey :: IO (Key a)
empty  :: Vault
lookup :: Key a -> Vault -> Maybe a
insert :: Key a -> a -> Vault -> Vault
delete :: Key a -> Vault -> Vault

A few common functions for finite maps, like adjust and union, are provided as well.

This library was created thanks to the feedback on my blog post Vault - a persistent store for values of arbitrary types.

Installation

The whole thing is available on hackage, so you just have to type

cabal update
cabal install vault

Feedback

Use the issue tracker or send an email to the maintainer.

Changes

Changelog for the vault package

0.3.1.2

  • Bump dependencies to allow containers-0.6.
  • Compatibility with GHC-8.6
    • Bump dependencies to allow base >= 4.5 && < 4.13.

0.3.1.1

  • Rename source files to allow building the package with Bazel.

0.3.1.0

  • Compatibility with GHC-8.4:
    • Bump dependencies to allow base >= 4.5 && < 4.12.
    • Add Semigroup instances.

0.3.0.7

  • Bump dependencies to allow base >= 4.5 && < 4.11.

0.3.0.6

  • Bump dependencies to allow base >= 4.5 && < 4.10.

0.3.0.5

  • Add support for GHC type roles extension, using the RoleAnnotations language pragma.

0.3.0.4

  • Bump upper version bound for the base dependency.

0.3.0.3

  • Bump upper version bound for the base dependency.

0.3.0.2

  • Fix tarball.

0.3.0.1

  • Use CPP to reduce code duplication.

0.3.0.0

  • Split modules into Lazy and Strict variants, no default choice.
  • Add Hashable instance to Data.Unique.Really for all implementations.