Move Hedgehog generators out of the library
The Haskell library component currently depends on Hedgehog, even when building only the library. The only reason for this is src/Language/GraphQL/Draft/Generator.hs, which is marked in the exposed-modules of the library.
Presumably, the reason for this is that both the test suite and the benchmark use that file.
Can we avoid this dependency on Hedgehog by making src/Language/GraphQL/Draft/Generator.hs part of the test suite and benchmark directly? It might end up getting compiled twice (once for the tests, once for the benchmarks). In return, it would not get built at all for the library. This would be preferable over pulling in both Hedgehog and Language.GraphQL.Draft.Generator into the library, even though both never get used.
I would like to suggest a slightly different approach, just for the sake of maintenance:
If we can express the parsers in a final representation of a free generator type, we can guarantee that the generators stay up-to-date with the parsers (currently not guaranteed) and remove this dependency. In fact, we'd end up with some Hedgehog interpreter of this classy free generator that probably amounts to a couple dozen lines of code and achieves the same thing.
I'm happy to prototype this at some point if that would help?
I'm happy to prototype this at some point if that would help?
Yes, I would love to see what you can come up with! But this is not an urgent problem, so perhaps timebox it.
@i-am-tom I would love to be involved in this as well, assuming it makes sense to include more people.
@solomon-b let's look into it :)