Skip to content

Instantly share code, notes, and snippets.

@jroesch
Created September 9, 2012 07:42
Show Gist options
  • Save jroesch/3683227 to your computer and use it in GitHub Desktop.
Save jroesch/3683227 to your computer and use it in GitHub Desktop.
toBool
/* Use this as our base */
(.:?) :: (FromJSON a) => Object -> Text -> Parser (Maybe a)
obj .:? key = case M.lookup key obj of
Nothing -> pure Nothing
Just v -> parseJSON v
/* I'll look into it tomorrow */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment