haskellcode-generationinstallscript

Generating code for another language in Haskell


I want to generate code for another language in Haskell, but I'm puzzled on how to approach this problem. I'm looking for an abstract and elegant representation of the language in Haskell, which is also useful for code generation. The language in question is InstallScript (link to the language reference guide). Could someone please provide hints (maybe with examples?) on how to capture the language constructs employed in InstallScript in Haskell types, or point to similar projects for inspiration?


Solution

  • This is a classic problem to solve in Haskell.

    For bonus points:

    There are many, many examples on Hackage (e.g. this one).