As part of my compiler, I need alex and happy to run as part of my build process. How does Stack support this scenario?
Bonus: how can I register alex and happy as compile-time dependencies?
As part of my compiler, I need alex and happy to run as part of my build process. How does Stack support this scenario?
Bonus: how can I register alex and happy as compile-time dependencies?
cabal understand the suffixes .x for alex files and .y for happy files and will automatically use alex and happy to build the corresponding .hs files.
Steps to undertake:
.x and .y files to your extra-source-files: sectionalex and happy to your build-tools: sectionFoo.Bar.x, make sure that Foo.Bar is listed in exposed-module: or in other-modules:A good example of a package using alex and happy is the language-python package:
https://github.com/bjpop/language-python/blob/master/language-python.cabal (permalink)
Update: This is relevant to stack as well. In fact, stack will also build alex and happy for you.