Search code examples
jsondhall

Parse JSON in Dhall


Dhall is famous for generating JSON, namely from input.dhall to output.json. Is it possible to write a “JSON transformer” in Dhall, namely “input.json + rules.dhalloutput.json”? It still sounds functional (two input and one output), but I wonder whether Dhall is the right tool for this purpose. I know how to import the JSON file as bytes, but I hear that Dhall intentionally avoids supporting any text parsing.


Solution

  • Currently Dhall does not support a way to import JSON expressions at runtime. You can only conver them to Dhall using the json-to-dhall utility.