Created
May 13, 2014 15:08
-
-
Save rylev/1da4bf6aeed4ca10141d to your computer and use it in GitHub Desktop.
Cargo Cult Hedis
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
import Database.Redis | |
import Control.Monad.IO.Class | |
import Data.ByteString.Char8 | |
main :: IO () | |
main = do | |
conn <- connect defaultConnectInfo | |
runRedis conn $ do | |
set (pack "hello") (pack "hello") | |
hello <- get $ pack "hello" | |
liftIO $ print $ hello | |
print "Success" |
it's too bad you have to do all that packing and unpacking but hopefully the web apis will also give you bytestrings so you can just pass them back and forth without conversion.
This prints:
Right (Just "hello")
"Success"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
WHEEEEEEEEE