# \`Arbitrary\` instances for GADTs

**URL:** <https://discourse.haskell.org/t/arbitrary-instances-for-gadts/14580>\
**Category:** Learn\
**Created:** [August 18, 2026, 7:49pm UTC](https://discourse.haskell.org/t/arbitrary-instances-for-gadts/14580 "2026-08-18T19:49:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![6d03](https://avatars.discourse-cdn.com/v4/letter/6/8c91f0/32.png) [@6d03](https://discourse.haskell.org/u/6d03)\
**Post date:** [August 18, 2026, 7:49pm UTC](https://discourse.haskell.org/t/arbitrary-instances-for-gadts/14580/1 "2026-08-18T19:49:27Z")

</div>

I have a need to define QuickCheck `Arbitrary` instances for GADTs, of course `genericArbitrary` does not work, because GHC does not derive `Generic` for GADTs. But [kind-generics: Generic programming in GHC style for arbitrary kinds and GADTs.](https://hackage.haskell.org/package/kind-generics) uses Template Haskell to define a instances for a class `GenericK` , so I think the missing piece would be a function `genericKArbitrary`, analogous to `generic-random`s `genericArbitrary`.

Does that exist somewhere?

What else do people use to write property tests over GADTs?

---

<div class="post-metadata">

**Author:** ![mastarija](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/mastarija/32/5066_2.png) [@mastarija](https://discourse.haskell.org/u/mastarija)\
**Post date:** [August 20, 2026, 10:17am UTC](https://discourse.haskell.org/t/arbitrary-instances-for-gadts/14580/2 "2026-08-20T10:17:45Z")

</div>

Personally, on the rare occasion I do need to property test over GADTs I just write the instances manually. The same goes for e.g. JSON instances and similar stuff.
