Created
July 15, 2009 20:36
-
-
Save cmoore/147964 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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