git.iko.soy/rowtype-yoga/purescript-vault
on master help sign in
Clean up description a bit.
commitce5f6bf546d0ddf97deac61ed3328077a7baf364 authorNick Saunders <nick@saunde.rs> dateSat 18 Mar 2023, 16:20 (4 years ago) parentc68dc2c
1 file changed+3−3
unifiedsplit
README.md+3−3
README.md+3−3
@@ -5,9 +5,9 @@
55[![Pursuit](https://pursuit.purescript.org/packages/purescript-vault/badge)](https://pursuit.purescript.org/packages/purescript-vault)
66[![Maintainer: nsaunders](https://img.shields.io/badge/maintainer-nsaunders-teal.svg)](https://github.com/nsaunders)
77
8−A typed, persistent store for values of arbitrary types. This is a port of the Haskell [Vault](https://github.com/HeinrichApfelmus/vault) library by Heinrich Apfelmus.
8+A typed, persistent store for values of arbitrary types, ported from the Haskell [Vault](https://github.com/HeinrichApfelmus/vault) library by Heinrich Apfelmus.
99
10−Think of it as Map that can store for values of arbitrary types, but it's type-safe. You can store of any types by creating Key a first, this key used to parameterized the type you are going to store in vault.
10+Think of a vault like a map that can store any value in a type-safe manner. The first step is to generate a new `Key a` value using the `newKey` function. Then, use `insert`, `lookup`, `delete`, etc., just like their [Data.Map](https://pursuit.purescript.org/packages/purescript-ordered-collections/3.0.0/docs/Data.Map) analogs.
1111
1212```purescript
1313data Vault
@@ -15,8 +15,8 @@ data Key a
1515
1616newKey :: forall a. Effect (Key a)
1717empty :: Vault
18−lookup :: forall a. Key a -> Vault -> Maybe a
1918insert :: forall a. Key a -> a -> Vault -> Vault
19+lookup :: forall a. Key a -> Vault -> Maybe a
2020delete :: forall a. Key a -> Vault -> Vault
2121adjust :: forall a. (a -> a) -> Key a -> Vault -> Vault
2222```