Last active
August 13, 2025 19:32
-
-
Save kraftdorian/6fc4587ebfb12cd6bbc3c03e1dc8547b to your computer and use it in GitHub Desktop.
playing around with JSON in Haskell
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
import Distribution.Utils.Json | |
-- create JSON object | |
object :: Json | |
object = JSONObject ["foo" .= JsonString "bar"] -- or JsonObject [("foo", JsonString "bar")] | |
main :: IO () | |
main = putStrLn $ show $ renderJson object -- "{\"foo\":\"bar\"}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment