vault: a persistent store for values of arbitrary types

[ bsd3, data, library ] [ Propose Tags ] [ Report a vulnerability ]

A vault is a persistent store for values of arbitrary types. It's like having first-class access to the storage space behind IORefs.

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

Also provided is a locker type, representing a store for a single element.


[Skip to Readme]

Flags

Automatic Flags
NameDescriptionDefault
useghc

Use GHC-specific packages and extensions.

Enabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.2.0.0, 0.2.0.1, 0.2.0.3, 0.2.0.4, 0.3.0.0, 0.3.0.1, 0.3.0.2, 0.3.0.3, 0.3.0.4, 0.3.0.5, 0.3.0.6, 0.3.0.7, 0.3.1.0, 0.3.1.1, 0.3.1.2, 0.3.1.3, 0.3.1.4, 0.3.1.5
Change log CHANGELOG.md
Dependencies base (>=4.5 && <4.21), containers (>=0.4 && <0.8), hashable (>=1.1.2.5 && <1.6), semigroups (>=0.1 && <1.0), unordered-containers (>=0.2.3.0 && <0.3) [details]
Tested with ghc ==8.0.2, ghc ==8.2.2, ghc ==8.4.4, ghc ==8.6.5, ghc ==8.8.4, ghc ==8.10.7, ghc ==9.0.2, ghc ==9.2.8, ghc ==9.4.8, ghc ==9.6.6, ghc ==9.8.2, ghc ==9.10.1
License BSD-3-Clause
Copyright (c) Heinrich Apfelmus 2011-2013
Author Heinrich Apfelmus, Elliott Hird
Maintainer Heinrich Apfelmus <apfelmus at quantentunnel de>
Revised Revision 8 made by HeinrichApfelmus at 2024-08-31T11:37:47Z
Category Data
Home page https://github.com/HeinrichApfelmus/vault
Source repo head: git clone https://github.com/HeinrichApfelmus/vault.git
Uploaded by sjakobi at 2021-02-19T09:53:51Z
Distributions Arch:0.3.1.5, Debian:0.3.1.4, Fedora:0.3.1.5, FreeBSD:0.3.0.4, LTSHaskell:0.3.1.5, NixOS:0.3.1.5, Stackage:0.3.1.5, openSUSE:0.3.1.5
Reverse Dependencies 61 direct, 3754 indirect [details]
Downloads 137767 total (253 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2021-02-19 [all 1 reports]

Readme for vault-0.3.1.5

[back to package description]

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.