Skip to content

Instantly share code, notes, and snippets.

@alexy
Forked from tom-lpsd/Using Database.TokyoCabinet
Created January 6, 2010 22:08
Show Gist options
  • Save alexy/270723 to your computer and use it in GitHub Desktop.
Save alexy/270723 to your computer and use it in GitHub Desktop.
tom-desktop% pwd [~]
/home/tom
tom-desktop% ghci [~]
GHCi, version 6.10.4: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
Prelude> :module Database.TokyoCabinet
Prelude Database.TokyoCabinet> runTCM $ do { db <- new :: TCM HDB; open db "foo.tch" [OWRITER, OCREAT]; put db "bar" "baz"; close db }
Loading package bytestring-0.9.1.4 ... linking ... done.
Loading package mtl-1.1.0.2 ... linking ... done.
Loading package tokyocabinet-haskell-0.0.5 ... linking ... done.
True
Prelude Database.TokyoCabinet> :q
Leaving GHCi.
tom-desktop% tchmgr get foo.tch bar [~]
baz
tom-desktop%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment