goldfirere / singletons

Fake dependent types in Haskell using singletons

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use `cabal`'s `code-generators` to reimplement `singletons-base` test suite without custom `Setup.hs`

RyanGlScott opened this issue · comments

Cabal-3.8 debuts a new code-generators feature that can be used to generate modules when preprocessing a test suite and include them as part of building the test suite. One of the intended use cases for a code generator is to fill the role that is often served today by custom Setup.hs scripts. In particular, singletons-base's custom Setup.hs script seems like a prime candidate for being implemented as a code generator, since the primary reason for using a custom Setup.hs script is to learn what -package-id arguments to pass to GHC to get the dependencies right. That is exactly the sort of information that code generators have access to.