Created
October 3, 2010 15:37
-
-
Save hvr/608671 to your computer and use it in GitHub Desktop.
NFData instance for Text.JSON intermediate parse-tree types
This file contains 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
import Text.JSON | |
import Text.JSON.Types | |
import Control.DeepSeq | |
instance NFData JSValue where | |
rnf JSNull = () | |
rnf (JSBool _) = () | |
rnf (JSRational b _) = rnf b | |
rnf (JSString s) = rnf s | |
rnf (JSArray a) = rnf a | |
rnf (JSObject obj) = rnf obj | |
instance NFData JSString where | |
rnf = rnf . fromJSString | |
instance NFData t => NFData (JSObject t) where | |
rnf = rnf . fromJSObject |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NFData instance for Text.JSON intermediate parse-tree types