A typed, persistent store for values of arbitrary types
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/Data Do the same for ‘IO.hs’ May 23, 2018
.gitignore Release on hackage. Sep 26, 2011
.travis.yml Maintenance: Bump dependency `containers` Aug 4, 2018
CHANGELOG.md
LICENSE Initial import Sep 7, 2011
README.md The `README.md` file now has its filename in uppercase. Dec 19, 2014
Setup.hs Initial import Sep 7, 2011
vault.cabal Maintenance: Bump dependency `containers` Aug 4, 2018

README.md

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.