Generating files/errors from the source Haskell

Hi!

I was wondering what options there are for performing the following actions from my Haskell source.

  1. Generating .hlsl / .glsl shader code (and other formats) from specific functions with specific type signatures: parsing the code generated by that function, before generating the destination format.
  2. Detecting if a specific language feature has been used and throwing errors/warnings (I believe hlint could be used for this?) that can be caught by another program. For example: detecting whenever a case ... of expression has been used instead of a guard.

These are fairly far field goals and not immediately necessary to anything: I would just like some pointers to some good resources or techniques for now, if any.

Thanks in advance :slight_smile:

Can you show an example input and output for point 1? In particular you say:

But do you mean parsing the Haskell source code itself or implementing a DSL in Haskell that generates code? The latter can be done with packages like GPipe.