Skip to content

Instantly share code, notes, and snippets.

@tom-lpsd
Created January 7, 2010 13:53
Show Gist options
  • Save tom-lpsd/271236 to your computer and use it in GitHub Desktop.
Save tom-lpsd/271236 to your computer and use it in GitHub 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.TDB
Prelude Database.TokyoCabinet.TDB> t <- new
Loading package bytestring-0.9.1.4 ... linking ... done.
Loading package HUnit-1.2.0.3 ... linking ... done.
Loading package filepath-1.1.0.2 ... linking ... done.
Loading package old-locale-1.0.0.1 ... linking ... done.
Loading package old-time-1.0.0.2 ... linking ... done.
Loading package unix-2.3.2.0 ... linking ... done.
Loading package directory-1.0.0.3 ... linking ... done.
Loading package mtl-1.1.0.2 ... linking ... done.
Loading package tokyocabinet-haskell-0.0.5 ... linking ... done.
Prelude Database.TokyoCabinet.TDB> open t "foo.tct" [OCREAT, OWRITER]
True
Prelude Database.TokyoCabinet.TDB> put t "foo" (AssocList [("a", "100"), ("b", "200") ])
True
Prelude Database.TokyoCabinet.TDB> get t "foo" :: IO (AssocList String String)
AssocList {unAssocList = [("a","100"),("b","200")]}
Prelude Database.TokyoCabinet.TDB> close t
True
Prelude Database.TokyoCabinet.TDB> :q
Leaving GHCi.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment