Skip to content

Commit d9741ad

Browse files
committed
RFC: TH support for data families
This leverages the `th-abstraction` library to grant `Generics.SOP.TH` the ability to generate code for vanilla data types and data families alike. This patch looks large, but most of it is internal refactoring to use `th-abstraction`'s intermediate data types where necessary (e.g., `DatatypeInfo` instead of `Dec`, `ConstructorInfo` instead of `Con`, etc.). This does incur an extra library dependency in `th-abstraction`, but it's a very small one, as it does not depend on any non-GHC-boot libraries itself. It's also used by other libraries to enable data family support, such as `aeson` and `th-lift`. Fixes #111 along the way.
1 parent 760fabe commit d9741ad

File tree

3 files changed

+265
-178
lines changed

3 files changed

+265
-178
lines changed

generics-sop/generics-sop.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ library
6868
build-depends: base >= 4.9 && < 5,
6969
sop-core == 0.5.0.*,
7070
template-haskell >= 2.8 && < 2.16,
71+
th-abstraction >= 0.3 && < 0.4,
7172
ghc-prim >= 0.3 && < 0.6
7273
hs-source-dirs: src
7374
default-language: Haskell2010

0 commit comments

Comments
 (0)