Haskell-OpenAPI-Client-Code-Generator icon indicating copy to clipboard operation
Haskell-OpenAPI-Client-Code-Generator copied to clipboard

add additional import alias for newer GHC versions

Open joel-bach opened this issue 2 months ago • 2 comments

Fix for https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator/issues/123

joel-bach avatar Nov 15 '25 13:11 joel-bach

The generated modules now make GHC.Internal.* available via aliases. So that the rest of the generated code can access GHC.Internal.*?

Just out of curiosity, why is this the preferred solution? Wouldn't another solution be to not access the GHC internal namespace at all and use Data.Maybe etc. instead?

schoettl avatar Nov 16 '25 08:11 schoettl

@schoettl We use template-haskell for the code generation and it seems like even if you do not access internal modules during the generation, they can still get exposed in the actually generated code. I assume this is due to the fact that template-haskell is not designed for code generation written to file but instead for ad-hoc generation during compilation where these quirks are internals of the compiler.

joel-bach avatar Nov 18 '25 12:11 joel-bach

Ah, makes sense. Thanks!

schoettl avatar Nov 18 '25 13:11 schoettl