Skip to content

Make Template Haskell GadtC and RecGadt take non-empty lists of constructors

The GadtC and RecGadtC constructors of Template Haskell's Con datatype always use non-empty lists of constructors. I had changed them from using [Name] to NonEmpty Name in 3f374399, but this had the potential to break a lot of user code, so we decided to revert that change in 3b7bbb39. Using [Name] means we end up erroring/panicking in several situations where we could statically rule out bad cases via the type system.

This ticket tracks the task of reverting the revert 3f374399, after we establish whether the breakage is worth it (or, if as @RyanGlScott points out, we want to bundle this change to other changes to the representation of GADT constructors in Template Haskell, such as #18378).

Edited by sheaf
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information