The ‘th-utilities’ package provides a number of useful utilities for Template Haskell. In particular:
TH.Deriveprovides a convenient system for using TH to derive typeclass instances. It allows for open registration of TH derivers, and reuses instance syntax for invoking them.
TH.Derive.Storabledefines derivation of Storable for ADTs.
TH.ReifyDataTypeprovides utilities for reifying simplified datatype info. It omits details that you don’t usually want to handle, making it much more straightforward to generate code based on datatype structure.
TH.RelativePathsprovides utilities for loading files based on paths relative to the cabal file. This is particularly handy for loading code into ghci even when its current dir isn’t the package dir. Ideally, this module would be used by everyone who currently uses
TH.Utilitiesprovides a miscellaneous set of utilities that are useful within this package and elsewhere.
- Adds a lower bound for
th-abstractiondependency. Also released as a hackage revision of
0.2.4.2. See #15
- Fixes compilation with
GHC-9.0.*. See #14
- Fixes generated Storable instances to have a
sizeOfdefinition which works with
-XStrict. See #13
Compatibility with GHC-8.10
Behavior change in reification of type family instances. Instead of erroring if the instance mentions a kind variable, now just ignores it.
- Compatibility with GHC-8.8
- Improved fix to the type variable behavior with GHC <= 7.10. Uses
Anyin place of type variables instead of
(), to allow for more kinds than just
Fixes derive and instantiator mechanisms to work with ghc 7.10 and earlier. Previously, invocation was broken when type variables were used.
freeVarsT- it now looks through more constructors of
dequalifyTyVarsto dequalify every type variable.
Fixes build on 7.8
Adds TH.ReifySimple, which supports reifying most of the information TH users care about.
Adds some utilities based on SYB, which is often useful for TH.
Makes relative path stuff less noisyi with GHCi.
- First public release