The vault package

[Tags: bsd3, library]

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.

Changelog:


[Skip to ReadMe]

Properties

Versions0.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
Change logNone available
Dependenciesbase (>=4.5 && <4.7), containers (>=0.4 && <0.6), hashable (>=1.1.2.5 && <1.3), unordered-containers (>=0.2.3.0 && <0.3) [details]
LicenseBSD3
Copyright(c) Heinrich Apfelmus 2011-2013
AuthorHeinrich Apfelmus, Elliott Hird
MaintainerHeinrich Apfelmus <apfelmus at quantentunnel de>
CategoryData
Home pagehttps://github.com/HeinrichApfelmus/vault
Source repositoryhead: git clone git://github.com/HeinrichApfelmus/vault.git
UploadedTue Sep 10 08:02:43 UTC 2013 by HeinrichApfelmus
DistributionsDebian:0.3.0.4, Fedora:0.3.0.4, FreeBSD:0.3.0.3, LTSHaskell:0.3.0.4, NixOS:0.3.0.4, Stackage:0.3.0.4
Downloads65872 total (521 in last 30 days)
Votes
0 []
StatusDocs available [build log]
Successful builds reported [all 1 reports]

Modules

[Index]

Flags

NameDescriptionDefault
useghcUse GHC-specific packages and extensions.Enabled

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

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for vault-0.3.0.2

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.