gdritter repos tansu / 24c5aea
Added type clarification to the docs Getty Ritter 8 years ago
1 changed file(s) with 17 addition(s) and 0 deletion(s). Collapse all Expand all
5151 command (or its operator synonym `=:`) and retrieved using the `get`
5252 command.
5353
54 ~~~.haskell
55 -- set a key to a value
56 set :: (Serialize k, Serialize v) => k -> v -> Tansu ()
57
58 -- infix alias for set
59 (=:) :: (Serialize k, Serialize v) => k -> v -> Tansu ()
60
61 -- get a value, failing if it does not exist
62 get :: (Serialize k, Serialize v) => k -> Tansu v
63
64 -- get a value, returning Nothing if it does not exist
65 getMb :: (Serialize k, Serialize v) => k -> Tansu (Maybe v)
66
67 -- run a Tansu computation
68 run :: TansuDb -> Tansu a -> IO (Either TansuError a)
69 ~~~
70
5471 A value of type `TansuDb` should be supplied by a _backend_, which can
5572 correspond to any storage medium capable of storing a key-value store.
5673 The `tansu` library only defines two trivial storage backends—one that