| 1 |
This is a plugin for the UUAG system. |
| 2 |
|
| 3 |
To use UUAG in combination with Cabal, add a dependency on the packages: |
| 4 |
uuagc -- installs the tool: uuagc |
| 5 |
uuagc-cabal -- installs a cabal plugin that uses uuagc |
| 6 |
Note that this package does not have a dependency on uuagc. You can use |
| 7 |
this module without having uuagc installed. |
| 8 |
(whether this is useful is a different question) |
| 9 |
|
| 10 |
Then write a custom Setup.hs: |
| 11 |
|
| 12 |
-- |
| 13 |
module Main where |
| 14 |
|
| 15 |
import Distribution.Simple |
| 16 |
import Distribution.Simple.UUAGC (uuagcLibUserHook) |
| 17 |
import UU.UUAGC (uuagc) |
| 18 |
|
| 19 |
main = defaultMainWithHooks (uuagcLibUserHook uuagc) |
| 20 |
-- |
| 21 |
|
| 22 |
Add extra-source-files: uuagc_options |
| 23 |
The contents of this file are options per AG module, as specified |
| 24 |
as follows. Write for each AG file: |
| 25 |
* Two lines in a file uuagc_options in the root of the package: |
| 26 |
-- |
| 27 |
file: "src-ag/Desugar.ag" |
| 28 |
options: module, pretty, catas, semfuns, signatures, genlinepragmas |
| 29 |
-- |
| 30 |
The options depend on what you actually want to compile. |
| 31 |
* Add an extra source file to the AG file in the cabal file: |
| 32 |
extra-source-files: src/MyProgram.ag |
| 33 |
* Add the module to the modules list in the cabal file. |
| 34 |
|
| 35 |
|
| 36 |
Originally written by Juan Cardona (or one of his students). |