Skip to content

Instantly share code, notes, and snippets.

@kraftdorian
Last active August 13, 2025 19:32
Show Gist options
  • Save kraftdorian/6fc4587ebfb12cd6bbc3c03e1dc8547b to your computer and use it in GitHub Desktop.
Save kraftdorian/6fc4587ebfb12cd6bbc3c03e1dc8547b to your computer and use it in GitHub Desktop.
playing around with JSON in Haskell
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