Skip to content

Instantly share code, notes, and snippets.

@rylev
Created May 13, 2014 15:08
Show Gist options
  • Select an option

  • Save rylev/1da4bf6aeed4ca10141d to your computer and use it in GitHub Desktop.

Select an option

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

chad commented May 13, 2014

Copy link
Copy Markdown

WHEEEEEEEEE

@chad

chad commented May 13, 2014

Copy link
Copy Markdown

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

rylev commented May 13, 2014

Copy link
Copy Markdown
Author

This prints:

Right (Just "hello")
"Success"

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