ndmitchell / nsis

Haskell DSL for producing Windows Installer using NSIS
Other
26 stars 8 forks source link

Add reuse of code blocks #4

Open ndmitchell opened 9 years ago

ndmitchell commented 9 years ago

Currently some functions, e.g. strReplace expand to a lot of code. I should reuse that code in a function. Likely the syntax would be:

strReplace x y z = function "Development.NSIS.strReplace" [x,y,z] $ \[x,y,z] -> ...

That would generate a function which shoves the parameters into global variables, operates, and returns the result via a final global parameter (or list of them, perhaps).

One tricky detail is that uninstall and install functions live in different namespaces, so I might have to generate the function twice.