Skip to content

Instantly share code, notes, and snippets.

@jdiez17
Created December 23, 2014 11:53
Show Gist options
  • Select an option

  • Save jdiez17/f52d2ab6be2bd5fbae2d to your computer and use it in GitHub Desktop.

Select an option

Save jdiez17/f52d2ab6be2bd5fbae2d to your computer and use it in GitHub Desktop.
queryRedis :: forall a. R.Connection -> R.Redis a -> Bot (Maybe a)
queryRedis db r = do
eitherComp <- redisComp
return $ either (const Nothing) Just eitherComp
where
redisComp :: Bot (Either SomeException a)
redisComp = io $ try $ runRedis db r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment