Skip to content

Instantly share code, notes, and snippets.

@LeviSchuck
Created October 1, 2013 18:17
Show Gist options
  • Save LeviSchuck/6782703 to your computer and use it in GitHub Desktop.
Save LeviSchuck/6782703 to your computer and use it in GitHub Desktop.
lookupThing t = do
?s <- someStorageConstant
context <- getContextSandbox
(res, context') <- runKV context $ do
thing <- getKV t
return $ case thing of
Nothing -> Left "Nope, nothin'"
Just kv -> Right kv
return res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment