Created
September 25, 2011 04:28
-
-
Save tsurushuu/1240228 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fromResult :: Result a -> Maybe a | |
fromResult (Ok k) = Just k | |
fromResult (Error e) = Nothing | |
maybeFromObj :: JSON a => String -> JSObject JSValue -> Maybe a | |
maybeFromObj k o = maybe (Nothing) (fromResult . readJSON) (lookup k (fromJSObject o)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment