Skip to content

Instantly share code, notes, and snippets.

@cmoore
Created July 15, 2009 20:36
Show Gist options
  • Save cmoore/147964 to your computer and use it in GitHub Desktop.
Save cmoore/147964 to your computer and use it in GitHub Desktop.
-- Utils
conn :: IO Server
conn = Single.connect "192.168.0.33" 1111
dconn x = Single.disconnect x
m_set :: Server -> String -> String -> IO Bool
m_set ss x y = do
Network.Memcache.set ss x y
m_get :: Server -> String -> IO (Maybe String)
m_get ss x = do
Network.Memcache.get ss x
{-
ghci> lx <- conn
ghci> m_get lx "foo"
Just "3"
ghci> m_get lx "ox"
-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment