Skip to content

Instantly share code, notes, and snippets.

@joastbg
Created November 11, 2013 12:07
Show Gist options
  • Select an option

  • Save joastbg/7412252 to your computer and use it in GitHub Desktop.

Select an option

Save joastbg/7412252 to your computer and use it in GitHub Desktop.
Haskell - Simple example of how to use Redis, from the hedis documentation
{-# LANGUAGE OverloadedStrings #-}
import Database.Redis
import Control.Monad.Trans
main :: IO ()
main = do
conn <- connect defaultConnectInfo
runRedis conn $ do
set "foo" "123"
set "bar" "456"
foo <- get "foo"
bar <- get "bar"
liftIO $ print (foo, bar)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment