Before submitting your PR, check that you've:
- Documented new APIs with Haddock markup
- Added
@sincedeclarations to the Haddock
After submitting your PR:
- Update the Changelog.md file with a link to your PR
- Bumped the version number if there isn't an
(unreleased)on the Changelog - Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts)
Refactors the TH module, specifically themed around generating TH Names, or Exp values that use those names.
Now I think this module is a lot dry'er, where we have some duplication currently scattered around this module dealing with how names are generated.
For example, the Entity name when using mpsGeneric was duplicated in 3 different places, this change has DRY'd this up into a single function.
I considered moving these functions out and into their own module, and adding some HSpec tests for each name generating function, for the key name generating functions at least, such as the constructor name/field accessor names, but thought this might be over kill. I think this functionality is largely covered in persistent-test so thought best of doing that. I have grouped these functions at the bottom of the module anyway.
I think there is probably more we can do here to make this module a bit easier to follow in line with #1156 while also trying to balance out not changing too much in a single change request. Hopefully there are some values/functions in here now with some slightly clearer names too.
I took a very incremental approach to this change, so there are a lot of commits here. I've left them as they are for now, but if it is preferred that they're squashed into a single commit I can do so ๐