Skip to content

Instantly share code, notes, and snippets.

@rylev
Created May 13, 2014 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rylev/1da4bf6aeed4ca10141d to your computer and use it in GitHub Desktop.
Save rylev/1da4bf6aeed4ca10141d to your computer and use it in GitHub Desktop.
Cargo Cult Hedis
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"
@chad
Copy link

chad commented May 13, 2014

WHEEEEEEEEE

@chad
Copy link

chad commented May 13, 2014

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.

@rylev
Copy link
Author

rylev commented May 13, 2014

This prints:

Right (Just "hello")
"Success"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment