diff --git a/CHANGES.md b/CHANGES.md
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,11 +1,109 @@
 Changelog for singletons project
 ================================
 
+2.7
+---
+* Require GHC 8.10.
+* Record selectors are now singled as top-level functions. For instance,
+  `$(singletons [d| data T = MkT { unT :: Bool } |])` will now generate this:
+
+  ```hs
+  data ST :: T -> Type where
+    SMkT :: Sing b -> Sing (MkT b)
+
+  sUnT :: Sing (t :: T) -> Sing (UnT t :: Bool)
+  sUnT (SMkT sb) = sb
+
+  ...
+  ```
+
+  Instead of this:
+
+  ```hs
+  data ST :: T -> Type where
+    SMkT :: { sUnT :: Sing b } -> Sing (MkT b)
+  ```
+
+  Note that the new type of `sUnT` is more general than the previous type
+  (`Sing (MkT b) -> Sing b`).
+
+  There are two primary reasons for this change:
+
+  1. Singling record selectors as top-level functions is consistent with how
+     promoting records works (note that `MkT` is also a top-level function). As
+  2. Embedding record selectors directly into a singleton data constructor can
+     result in surprising behavior. This can range from simple code using a
+     record selector not typechecking to the inability to define multiple
+     constructors that share the same record name.
+
+  See [this GitHub issue](https://github.com/goldfirere/singletons/issues/364)
+  for an extended discussion on the motivation behind this change.
+* The Template Haskell machinery now supports fine-grained configuration in
+  the way of an `Options` data type, which lives in the new
+  `Data.Singletons.TH.Options` module. Besides `Options`, this module also
+  contains:
+    * `Options`' record selectors. Currently, these include options to toggle
+      generating quoted declarations, toggle generating `SingKind` instances,
+      and configure how `singletons` generates the names of promoted or singled
+      types. In the future, there may be additional options.
+    * A `defaultOptions` value.
+    * An `mtl`-like `OptionsMonad` class for monads that support carrying
+      `Option`s. This includes `Q`, which uses `defaultOptions` if it is the
+      top of the monad transformer stack.
+    * An `OptionM` monad transformer that turns any `DsMonad` into an
+      `OptionsMonad`.
+    * A `withOptions` function which allows passing `Options` to TH functions
+      (e.g., `promote` or `singletons`). See the `README` for a full example
+      of how to use `withOptions`.
+  Most TH functions are now polymorphic over `OptionsMonad` instead of
+  `DsMonad`.
+* `singletons` now does a much better job of preserving the order of type
+  variables in type signatures during promotion and singling. See the
+  `Support for TypeApplications` section of the `README` for more details.
+
+  When generating type-level declarations in particular (e.g., promoted type
+  families or defunctionalization symbols), `singletons` will likely also
+  generate standalone kind signatures to preserve type variable order. As a
+  result, most `singletons` code that uses Template Haskell will require the
+  use of the `StandaloneKindSignatures` extension (and, by extension, the
+  `NoCUSKs` extension) to work.
+* `singletons` now does a more much thorough job of rejecting higher-rank types
+  during promotion or singling, as `singletons` cannot support them.
+  (Previously, `singletons` would sometimes accept them, often changing rank-2
+  types to rank-1 types incorrectly in the process.)
+* Add the `Data.Singletons.Prelude.Proxy` module.
+* Remove the promoted versions of `genericTake`, `genericDrop`,
+  `genericSplitAt`, `genericIndex`, and `genericReplicate` from
+  `Data.Singletons.Prelude.List`. These definitions were subtly wrong since
+  (1) they claim to work over any `Integral` type `i`, but in practice would
+  only work on `Nat`s, and (2) wouldn't even typecheck if they were singled.
+* Export `ApplyTyConAux1`, `ApplyTyConAux2`, as well as the record pattern
+  synonyms selector `applySing2`, `applySing3`, etc. from `Data.Singletons`.
+  These were unintentionally left out in previous releases.
+* Export promoted and singled versions of the `getDown` record selector in
+  `Data.Singletons.Prelude.Ord`.
+* Fix a slew of bugs related to fixity declarations:
+  * Fixity declarations for data types are no longer singled, as fixity
+    declarations do not serve any purpose for singled data type constructors,
+    which always have exactly one argument.
+  * `singletons` now promotes fixity declarations for class names.
+    `genPromotions`/`genSingletons` now also handle fixity declarations for
+    classes, class methods, data types, and record selectors correctly.
+  * `singletons` will no longer erroneously try to single fixity declarations
+    for type synonym or type family names.
+  * A bug that caused fixity declarations for certain defunctionalization
+    symbols not to be generated has been fixed.
+  * `promoteOnly` and `singletonsOnly` will now produce fixity declarations
+    for values with infix names.
+
 2.6
 ---
 * Require GHC 8.8.
-* `Sing` has switched from a data family to a type family. This has a number of
-  consequences:
+* `Sing` has switched from a data family to a type family. This
+  [GitHub issue comment](https://github.com/goldfirere/singletons/issues/318#issuecomment-467067257)
+  provides a detailed explanation for the motivation behind this change.
+
+  This has a number of consequences:
   * Names like `SBool`, `SMaybe`, etc. are no longer type synonyms for
     particular instantiations of `Sing` but are instead the names of the
     singleton data types themselves. In other words, previous versions of
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,14 +1,15 @@
-singletons 2.6
+singletons 2.7
 ==============
 
 [![Hackage](https://img.shields.io/hackage/v/singletons.svg)](http://hackage.haskell.org/package/singletons)
 [![Build Status](https://travis-ci.org/goldfirere/singletons.svg?branch=master)](https://travis-ci.org/goldfirere/singletons)
 
-This is the README file for the singletons library. This file contains all the
+This is the README file for the `singletons` library. This file contains all the
 documentation for the definitions and functions in the library.
 
-The singletons library was written by Richard Eisenberg, <rae@cs.brynmawr.edu>, and
-with significant contributions by Jan Stolarek, <jan.stolarek@p.lodz.pl>.  There
+The `singletons` library was written by Richard Eisenberg (<rae@cs.brynmawr.edu>) and
+with significant contributions by Jan Stolarek (<jan.stolarek@p.lodz.pl>) and
+Ryan Scott (<ryan.gl.scott@gmail.com>). There
 are two papers that describe the library. Original one, _Dependently typed
 programming with singletons_, is available
 [here](https://cs.brynmawr.edu/~rae/papers/2012/singletons/paper.pdf) and will
@@ -18,18 +19,19 @@
 and will be referenced in this documentation as the
 "promotion paper".
 
-Ryan Scott, <ryan.gl.scott@gmail.com>, is an active maintainer.
+Ryan Scott (<ryan.gl.scott@gmail.com>) is the active maintainer.
 
-Purpose of the singletons library
----------------------------------
+Purpose of the `singletons` library
+-----------------------------------
 
 The library contains a definition of _singleton types_, which allow programmers
 to use dependently typed techniques to enforce rich constraints among the types
 in their programs. See the singletons paper for a more thorough introduction.
 
 The package also allows _promotion_ of term-level functions to type-level
-equivalents. Accordingly, it exports a Prelude of promoted and singletonized
-functions, mirroring functions and datatypes found in Prelude, `Data.Bool`,
+equivalents and _singling_ functions to dependently typed equivalents.
+Accordingly, it exports a Prelude of promoted and singled
+functions, mirroring functions and datatypes found in the `Prelude`, `Data.Bool`,
 `Data.Maybe`, `Data.Either`, `Data.Tuple` and `Data.List`. See the promotion
 paper for a more thorough introduction.
 
@@ -40,7 +42,7 @@
 Compatibility
 -------------
 
-The singletons library requires GHC 8.8.1 or greater. Any code that uses the
+The `singletons` library requires GHC 8.10.1 or greater. Any code that uses the
 singleton generation primitives needs to enable a long list of GHC
 extensions. This list includes, but is not necessarily limited to, the
 following:
@@ -54,10 +56,12 @@
 * `GADTs`
 * `InstanceSigs`
 * `KindSignatures`
+* `NoCUSKs`
 * `NoStarIsType`
 * `PolyKinds`
 * `RankNTypes`
 * `ScopedTypeVariables`
+* `StandaloneKindSignatures`
 * `TemplateHaskell`
 * `TypeApplications`
 * `TypeFamilies`
@@ -68,12 +72,15 @@
 `PNum` class because with `StarIsType` enabled, GHC thinks `*` is a synonym
 for `Type`.
 
-You may also want
-
-* `-Wno-redundant-constraints`
+You may also want to consider toggling various warning flags:
 
-as the code that `singletons` generates uses redundant constraints, and there
-seems to be no way, without a large library redesign, to avoid this.
+* `-Wno-redundant-constraints`.
+  The code that `singletons` generates uses redundant constraints, and there
+  seems to be no way, without a large library redesign, to avoid this.
+* `-fenable-th-splice-warnings`.
+  By default, GHC does not run pattern-match coverage checker warnings on code
+  inside of Template Haskell quotes. This is an extremely common thing to do
+  in `singletons`, so you may consider opting in to these warnings.
 
 Modules for singleton types
 ---------------------------
@@ -86,52 +93,36 @@
 Haskell code to generate new singletons.
 
 `Data.Singletons.Prelude` re-exports `Data.Singletons` along with singleton
-definitions for various Prelude types. This module provides a singletonized
-equivalent of the real `Prelude`. Note that not all functions from original
-`Prelude` could be turned into singletons.
+definitions for various `Prelude` types. This module provides promoted and
+singled equivalents of functions from the real `Prelude`.
+Note that not all functions from original `Prelude` could be promoted or
+singled.
 
-`Data.Singletons.Prelude.*` modules provide singletonized equivalents of
-definitions found in the following `base` library modules: `Data.Bool`,
-`Data.Maybe`, `Data.Either`, `Data.List`, `Data.Tuple`, `Data.Void` and
-`GHC.Base`. We also provide singletonized `Eq`, `Ord`, `Show`, `Enum`, and
-`Bounded` typeclasses.
+`Data.Singletons.Prelude.*` modules provide promoted and singled equivalents of
+definitions found in several commonly used `base` library modules, including
+(but not limited to) `Data.Bool`, `Data.Maybe`, `Data.Either`, `Data.List`,
+`Data.Tuple`, `Data.Void` and `GHC.Base`. We also provide promoted and singled
+versions of common type classes, including (but not limited to) `Eq`, `Ord`,
+`Show`, `Enum`, and `Bounded`.
 
 `Data.Singletons.Decide` exports type classes for propositional equality.
 
 `Data.Singletons.TypeLits` exports definitions for working with `GHC.TypeLits`.
 
-Modules for function promotion
-------------------------------
-
-Modules in `Data.Promotion` namespace provide functionality required for
-function promotion. They mostly re-export a subset of definitions from
-respective `Data.Singletons` modules.
-
-`Data.Promotion.TH` exports all the definitions needed to use the Template
-Haskell code to generate promoted definitions.
-
-`Data.Promotion.Prelude` and `Data.Promotion.Prelude.*` modules re-export all
-promoted definitions from respective `Data.Singletons.Prelude`
-modules. `Data.Promotion.Prelude.List` adds a significant amount of functions
-that couldn't be singletonized but can be promoted. Some functions still don't
-promote - these are documented in the source code of the module. There is also
-`Data.Promotion.Prelude.Bounded` module that provides promoted `PBounded`
-typeclass.
-
 Functions to generate singletons
 --------------------------------
 
-The top-level functions used to generate singletons are documented in the
-`Data.Singletons.TH` module. The most common case is just calling `singletons`,
-which I'll describe here:
+The top-level functions used to generate promoted or singled definitions are
+documented in the `Data.Singletons.TH` module. The most common case is just
+calling `singletons`, which I'll describe here:
 
 ```haskell
 singletons :: Q [Dec] -> Q [Dec]
 ```
 
-Generates singletons from the definitions given. Because singleton generation
-requires promotion, this also promotes all of the definitions given to the
-type level.
+This function generates singletons from the definitions given. Because
+singleton generation requires promotion, this also promotes all of the
+definitions given to the type level.
 
 Usage example:
 
@@ -151,14 +142,15 @@
 definitions. Many of the definitions were developed in tandem with Iavor Diatchki.
 
 ```haskell
-type family Sing :: k -> Type
+type Sing :: k -> Type
+type family Sing
 ```
 
 The type family of singleton types. A new instance of this type family is
 generated for every new singleton type.
 
 ```haskell
-class SingI (a :: k) where
+class SingI a where
   sing :: Sing a
 ```
 
@@ -166,6 +158,7 @@
 an explicit singleton value.
 
 ```haskell
+type SomeSing :: Type -> Type
 data SomeSing k where
   SomeSing :: Sing (a :: k) -> SomeSing k
 ```
@@ -176,6 +169,7 @@
 it will be. `SomeSing Thing` is isomorphic to `Thing`.
 
 ```haskell
+type SingKind :: Type -> Constraint
 class SingKind k where
   type Demote k :: *
   fromSing :: Sing (a :: k) -> Demote k
@@ -190,7 +184,8 @@
 kind-indexed type family maps the kind `Nat` back to the type `Nat`.
 
 ```haskell
-data SingInstance (a :: k) where
+type SingInstance :: k -> Type
+data SingInstance a where
   SingInstance :: SingI a => SingInstance a
 singInstance :: Sing a -> SingInstance a
 ```
@@ -208,13 +203,13 @@
 There are two different notions of equality applicable to singletons: Boolean
 equality and propositional equality.
 
-* Boolean equality is implemented in the type family `(:==)` (which is actually
-a synonym for the type family `(==)` from `Data.Type.Equality`) and the class
-`SEq`. See the `Data.Singletons.Prelude.Eq` module for more information.
+* Boolean equality is implemented in the type family `(==)` (in the `PEq`
+  class) and the `(%==`) method (in the `SEq` class).
+  See the `Data.Singletons.Prelude.Eq` module for more information.
 
 * Propositional equality is implemented through the constraint `(~)`, the type
-`(:~:)`, and the class `SDecide`. See modules `Data.Type.Equality` and
-`Data.Singletons.Decide` for more information.
+  `(:~:)`, and the class `SDecide`. See modules `Data.Type.Equality` and
+  `Data.Singletons.Decide` for more information.
 
 Which one do you need? That depends on your application. Boolean equality has
 the advantage that your program can take action when two types do _not_ equal,
@@ -236,7 +231,8 @@
 `Data.Singletons.ShowSing` module:
 
 ```haskell
-type ShowSing k = (forall z. Show (Sing (z :: k))
+type ShowSing :: Type -> Constraint
+type ShowSing k = (forall z. Show (Sing (z :: k)) -- Approximately
 ```
 
 This facilitates the ability to write `Show` instances for `Sing` instances.
@@ -268,7 +264,8 @@
 * The `Error` type family, from `Data.Singletons.TypeLits`:
 
   ```haskell
-  type family Error (str :: a) :: k where {}
+  type Error :: a -> k
+  type family Error str where {}
   ```
 
   This is simply an empty, closed type family, which means that it will fail
@@ -285,8 +282,8 @@
 Pre-defined singletons
 ----------------------
 
-The singletons library defines a number of singleton types and functions
-by default:
+The `singletons` library defines a number of singleton types and functions
+by default. These include (but are not limited to):
 
 * `Bool`
 * `Maybe`
@@ -304,10 +301,10 @@
 -------------------
 
 Function promotion allows to generate type-level equivalents of term-level
-definitions. Almost all Haskell source constructs are supported -- see last
-section of this README for a full list.
+definitions. Almost all Haskell source constructs are supported -- see the
+"Supported Haskell constructs" section of this README for a full list.
 
-Promoted definitions are usually generated by calling `promote` function:
+Promoted definitions are usually generated by calling the `promote` function:
 
 ```haskell
 $(promote [d|
@@ -319,30 +316,178 @@
 ```
 
 Every promoted function and data constructor definition comes with a set of
-so-called "symbols". These are required to represent partial application at the
-type level. Each function gets N+1 symbols, where N is the arity. Symbols
-represent application of between 0 to N arguments. When calling any of the
-promoted definitions it is important refer to it using their symbol
-name. Moreover, there is new function application at the type level represented
-by `Apply` type family. Symbol representing arity X can have X arguments passed
-in using normal function application. All other parameters must be passed by
-calling `Apply`.
+so-called _defunctionalization symbols_. These are required to represent
+partial application at the type level. For more information, refer to the
+"Promotion and partial application" section below.
 
-Users also have access to `Data.Promotion.Prelude` and its submodules (`Base`,
-`Bool`, `Either`, `List`, `Maybe` and `Tuple`). These provide promoted versions
-of function found in GHC's base library.
+Users also have access to `Data.Singletons.Prelude` and its submodules (e.g.,
+`Base`, `Bool`, `Either`, `List`, `Maybe` and `Tuple`). These provide promoted
+versions of function found in GHC's `base` library.
 
 Note that GHC resolves variable names in Template Haskell quotes. You cannot
 then use an undefined identifier in a quote, making idioms like this not
 work:
+
 ```haskell
 type family Foo a where ...
 $(promote [d| ... foo x ... |])
 ```
+
 In this example, `foo` would be out of scope.
 
 Refer to the promotion paper for more details on function promotion.
 
+Promotion and partial application
+---------------------------------
+
+Promoting higher-order functions proves to be surprisingly tricky. Consider
+this example:
+
+```hs
+$(promote [d|
+  map :: (a -> b) -> [a] -> [b]
+  map _ []     = []
+  map f (x:xs) = f x : map f xs
+  |])
+```
+
+A naïve attempt to promote `map` would be:
+
+```hs
+type Map :: (a -> b) -> [a] -> [b]
+type family Map f xs where
+  Map _ '[]    = '[]
+  Map f (x:xs) = f x : Map f xs
+```
+
+While this compiles, it is much less useful than we would like. In particular,
+common idioms like `Map Id xs` will not typecheck, since GHC requires that all
+invocations of type families be fully saturated. That is, the use of `Id` in
+`Map Id xs` is rejected since it is not applied to one argument, which the
+number of arguments that `Id` was defined with. For more information on this
+point, refer to the promotion paper.
+
+Not having the ability to partially apply functions at the type level is rather
+painful, so we do the next best thing: we _defunctionalize_ all promoted
+functions so that we can emulate partial application. For example, if one were
+to promote the `id` function:
+
+```hs
+$(promote [d|
+  id :: a -> a
+  id x = x
+  |]
+```
+
+Then in addition to generating the promoted `Id` type family, two
+defunctionalization symbols will be generated:
+
+```hs
+type IdSym0 :: a ~> a
+type IdSym0 x = x
+
+type IdSym1 (x :: a) = Id a
+```
+
+In general, a function that accepts N arguments generates N+1 defunctionalization
+symbols when promoted.
+
+`IdSym1` is a _fully saturated_ defunctionalization symbol and is usually only
+needed when generating code through the Template Haskell machinery. `IdSym0`
+is more interesting: it has the kind `a ~> a`, which has a special arrow type
+`(~>)`. Defunctionalization symbols using the `(~>)` kind are type-level
+constants that can be "applied" using a special `Apply` type family:
+
+```hs
+type Apply :: (a ~> b) -> a -> b
+type family Apply f x
+```
+
+Every defunctionalization symbol comes with a corresponding `Apply` instance
+(except for fully saturated defunctionalization symbols). For instance, here
+is the `Apply` instance for `IdSym0`:
+
+```hs
+type instance Apply IdSym0 x = IdSym1 x
+```
+
+The `(~>)` kind is used when promoting higher-order functions so that partially
+applied arguments can be passed to them. For instance, here is our final attempt
+at promoting `map`:
+
+```hs
+type Map :: (a ~> b) -> [a] -> [b]
+type family Map f xs where
+  Map _ '[]    = '[]
+  Map f (x:xs) = Apply f x : Map f xs
+```
+
+Now `map id xs` can be promoted to `Map IdSym0 xs`, which typechecks without issue.
+
+## Defunctionalizing existing type families
+
+The most common way to defunctionalize functions is by promoting them with the
+Template Haskell machinery. One can also defunctionalize existing type families,
+however, by using `genDefunSymbols`. For example:
+
+```hs
+type MyTypeFamily :: Nat -> Bool
+type family MyTypeFamily n
+
+$(genDefunSymbols [''MyTypeFamily])
+```
+
+This can be especially useful if `MyTypeFamily` needs to be implemented by
+hand. Be aware of the following design limitations of `genDefunSymbols`:
+
+* `genDefunSymbols` only works for type-level declarations. Namely, it only
+  works when given the names of type classes, type families, type synonyms,
+  or data types. Attempting to pass the name of a term level function,
+  class method, data constructor, or record selector will throw an error.
+* Passing the name of a data type to `genDefunSymbols` will cause its
+  data constructors to be defunctionalized but _not_ its record selectors.
+* Passing the name of a type class to `genDefunSymbols` will cause the
+  class itself to be defunctionalized, but /not/ its associated type families
+  or methods.
+
+Note that the limitations above reflect the current design of
+`genDefunSymbols`. As a result, they are subject to change in the future.
+
+## Defunctionalization and visible dependent quantification
+
+Unlike most other parts of `singletons`, which disallow visible dependent
+quantification (VDQ), `genDefunSymbols` has limited support for VDQ.
+Consider this example:
+
+```hs
+type MyProxy :: forall (k :: Type) -> k -> Type
+type family MyProxy k (a :: k) :: Type where
+  MyProxy k (a :: k) = Proxy a
+
+$(genDefunSymbols [''MyProxy])
+```
+
+This will generate the following defunctionalization symbols:
+
+```hs
+type MyProxySym0 ::              Type  ~> k ~> Type
+type MyProxySym1 :: forall (k :: Type) -> k ~> Type
+type MyProxySym2 k (a :: k) = MyProxy k a
+```
+
+Note that `MyProxySym0` is a bit more general than it ought to be, since
+there is no dependency between the first kind (`Type`) and the second kind
+(`k`). But this would require the ability to write something like this:
+
+```hs
+type MyProxySym0 :: forall (k :: Type) ~> k ~> Type
+```
+
+This currently isn't possible. So for the time being, the kind of
+`MyProxySym0` will be slightly more general, which means that under rare
+circumstances, you may have to provide extra type signatures if you write
+code which exploits the dependency in `MyProxy`'s kind.
+
 Classes and instances
 ---------------------
 
@@ -363,8 +508,8 @@
 ```haskell
 class PEq a => POrd a where
   type Compare (x :: a) (y :: a) :: Ordering
-  type (:<)    (x :: a) (y :: a) :: Bool
-  type x :< y = ... -- promoting `case` is yucky.
+  type (<)     (x :: a) (y :: a) :: Bool
+  type x < y = ... -- promoting `case` is yucky.
 ```
 
 Note that default method definitions become default associated type family
@@ -375,15 +520,15 @@
 ```haskell
 class SEq a => SOrd a where
   sCompare :: forall (x :: a) (y :: a). Sing x -> Sing y -> Sing (Compare x y)
-  (%:<)    :: forall (x :: a) (y :: a). Sing x -> Sing y -> Sing (x :< y)
+  (%<)     :: forall (x :: a) (y :: a). Sing x -> Sing y -> Sing (x < y)
 
-  default (%:<) :: forall (x :: a) (y :: a).
-                   ((x :< y) ~ {- RHS from (:<) above -})
-		=> Sing x -> Sing y -> Sing (x :< y)
-  x %:< y = ...  -- this is a bit yucky too
+  default (%<) :: forall (x :: a) (y :: a).
+                  ((x < y) ~ {- RHS from (<) above -})
+		=> Sing x -> Sing y -> Sing (x < y)
+  x %< y = ...  -- this is a bit yucky too
 ```
 
-Note that a singletonized class needs to use `default` signatures, because
+Note that a singled class needs to use `default` signatures, because
 type-checking the default body requires that the default associated type
 family instance was used in the promoted class. The extra equality constraint
 on the default signature asserts this fact to the type checker.
@@ -419,7 +564,7 @@
 On names
 --------
 
-The singletons library has to produce new names for the new constructs it
+The `singletons` library has to produce new names for the new constructs it
 generates. Here are some examples showing how this is done:
 
 1. original datatype: `Nat`
@@ -545,9 +690,28 @@
 
    All functions that begin with leading underscores are treated similarly.
 
+If desired, you can pick your own naming conventions by using the
+`Data.Singletons.TH.Options` module. Here is an example of how this module can
+be used to prefix a singled data constructor with `MyS` instead of `S`:
+
+```hs
+import Control.Monad.Trans.Class
+import Data.Singletons.TH
+import Data.Singletons.TH.Options
+import Language.Haskell.TH (Name, mkName, nameBase)
+
+$(let myPrefix :: Name -> Name
+      myPrefix name = mkName ("MyS" ++ nameBase name) in
+
+      withOptions defaultOptions{singledDataConName = myPrefix} $
+      singletons $ lift [d| data T = MkT |])
+```
+
 Supported Haskell constructs
 ----------------------------
 
+## Full support
+
 The following constructs are fully supported:
 
 * variables
@@ -562,111 +726,271 @@
 * sections
 * undefined
 * error
-* deriving `Eq`, `Ord`, `Show`, `Bounded`, `Enum`, `Functor`, `Foldable`, and
-  `Traversable`, as well as the `stock` and `anyclass` deriving strategies
 * class constraints (though these sometimes fail with `let`, `lambda`, and `case`)
 * literals (for `Nat` and `Symbol`), including overloaded number literals
 * unboxed tuples (which are treated as normal tuples)
-* records
 * pattern guards
 * case
 * let
 * lambda expressions
 * `!` and `~` patterns (silently but successfully ignored during promotion)
 * class and instance declarations
-* scoped type variables
-* signatures (e.g., `(x :: Maybe a)`) in expressions and patterns
+* signatures (e.g., `(x :: Maybe a)`) in expressions
 * `InstanceSigs`
-* higher-kinded type variables (see below)
-* finite arithmetic sequences (see below)
-* functional dependencies (with limitations -- see below)
-* type families (with limitations -- see below)
 
-Higher-kinded type variables in `class`/`data` declarations must be annotated
-explicitly. This is due to GHC's handling of *complete
-user-specified kind signatures*, or [CUSKs](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#complete-user-supplied-kind-signatures-and-polymorphic-recursion).
-Briefly, `singletons` has a hard
-time conforming to the precise rules that GHC imposes around CUSKs and so
-needs a little help around kind inference here. See
-[this pull request](https://github.com/goldfirere/singletons/pull/171) for more
-background.
+## Partial support
 
+The following constructs are partially supported:
+
+* `deriving`
+* finite arithmetic sequences
+* records
+* signatures (e.g., `(x :: Maybe a)`) in patterns
+* functional dependencies
+* type families
+
+See the following sections for more details.
+
+### `deriving`
+
 `singletons` is slightly more conservative with respect to `deriving` than GHC is.
-The stock classes listed above (`Eq`, `Ord`, `Show`, `Bounded`, `Enum`, `Functor`,
-`Foldable`, and `Traversable`) are the only ones that `singletons` will derive
-without an explicit deriving strategy. To do anything more exotic, one must
-explicitly indicate one's intentions by using the `DerivingStrategies` extension.
+The only classes that `singletons` can derive without an explicit deriving
+strategy are the following stock classes:
 
-`singletons` fully supports the `anyclass` strategy as well as the `stock` strategy
-(at least, for the classes listed above). `singletons` does not support the
-`newtype` strategy, as there is not an equivalent of `coerce` at the type level.
+* `Eq`
+* `Ord`
+* `Show`
+* `Bounded`
+* `Enum`
+* `Functor`
+* `Foldable`
+* `Traversable`
 
+To do anything more exotic, one must explicitly indicate one's intentions by
+using the `DerivingStrategies` extension. `singletons` fully supports the
+`anyclass` strategy as well as the `stock` strategy (at least, for the classes
+listed above). `singletons` does not support the `newtype` or `via` strategies,
+as there is no equivalent of `coerce` at the type level.
+
+### Finite arithmetic sequences
+
 `singletons` has partial support for arithmetic sequences (which desugar to
 methods from the `Enum` class under the hood). _Finite_ sequences (e.g.,
 [0..42]) are fully supported. However, _infinite_ sequences (e.g., [0..]),
 which desugar to calls to `enumFromTo` or `enumFromThenTo`, are not supported,
 as these would require using infinite lists at the type level.
 
+### Records
+
+Record selectors are promoted to top-level functions, as there is no record
+syntax at the type level. Record selectors are also singled to top-level
+functions because embedding records directly into singleton data constructors
+can result in surprising behavior (see
+[this bug report](https://github.com/goldfirere/singletons/issues/364) for more
+details on this point). TH-generated code is not affected by this limitation
+since `singletons` desugars away most uses of record syntax. On the other hand,
+it is not possible to write out code like
+`SIdentity { sRunIdentity = SIdentity STrue }` by hand.
+
+### Signatures in patterns
+
+`singletons` can promote basic pattern signatures, such as in the following
+examples:
+
+```hs
+f :: forall a. a -> a
+f (x :: a) = (x :: a)
+
+g :: forall a. a -> a
+g (x :: b) = (x :: b) -- b is the same as a
+```
+
+What does /not/ work are more advanced uses of pattern signatures that take
+advantage of the fact that type variables in pattern signatures can alias other
+types. Here are some examples of functions that one cannot promote:
+
+* ```hs
+  h :: a -> a -> a
+  h (x :: a) (_ :: b) = x
+  ```
+
+  This typechecks by virtue of the fact that `b` aliases `a`. However, the same
+  trick does not work when `h` is promoted to a type family, as a type family
+  would consider `a` and `b` to be distinct type variables.
+* ```hs
+  i :: Bool -> Bool
+  i (x :: a) = x
+  ```
+
+  This typechecks by virtue of the fact that `a` aliases `Bool`. Again, this
+  would not work at the type level, as a type family would consider `a` to be
+  a separate type from `Bool`.
+
+### Functional dependencies
+
+Inference dependent on functional dependencies is unpredictably bad. The
+problem is that a use of an associated type family tied to a class with
+fundeps doesn't provoke the fundep to kick in. This is GHC's problem, in
+the end.
+
+### Type families
+
+Promoting functions with types that contain type families is likely to fail due to
+[GHC#12564](https://gitlab.haskell.org/ghc/ghc/issues/12564).
+Note that promoting type family _declarations_ is fine
+(and often desired, since that produces defunctionalization symbols for them).
+
+## Support for promotion, but not singling
+
 The following constructs are supported for promotion but not singleton generation:
 
-* datatypes with constructors which have contexts. For example, the following
-  datatype does not singletonize:
+* data constructors with contexts
+* overlapping patterns
+* `GADTs`
+* instances of poly-kinded type classes
 
-    ```haskell
-    data T a where
-      MkT :: Show a => a -> T a
-    ```
+See the following sections for more details.
 
-  Constructors like these do not interact well with the current design of the
-  `SingKind` class. But see
-  [this bug report](https://github.com/goldfirere/singletons/issues/150), which
-  proposes a redesign for `SingKind` (in a future version of GHC with certain
-  bugfixes) which could permit constructors with equality constraints.
+### Data constructors with contexts
 
-* overlapping patterns. Note that overlapping patterns are
-  sometimes not obvious. For example, the `filter` function does not
-  singletonize due
-  to overlapping patterns:
+For example, the following datatype does not single:
 
-    ```haskell
-    filter :: (a -> Bool) -> [a] -> [a]
-    filter _pred []    = []
-    filter pred (x:xs)
-      | pred x         = x : filter pred xs
-      | otherwise      = filter pred xs
-    ```
-  Overlap is caused by `otherwise` catch-all guard, which is always true and thus
+```haskell
+data T a where
+  MkT :: Show a => a -> T a
+```
+
+Constructors like these do not interact well with the current design of the
+`SingKind` class. But see
+[this bug report](https://github.com/goldfirere/singletons/issues/150), which
+proposes a redesign for `SingKind` (in a future version of GHC with certain
+bugfixes) which could permit constructors with equality constraints.
+
+### Overlapping patterns
+
+Note that overlapping patterns are sometimes not obvious. For example, the
+`filter` function does not single due to overlapping patterns:
+
+```haskell
+filter :: (a -> Bool) -> [a] -> [a]
+filter _pred []    = []
+filter pred (x:xs)
+  | pred x         = x : filter pred xs
+  | otherwise      = filter pred xs
+```
+
+Overlap is caused by `otherwise` catch-all guard, which is always true and thus
 overlaps with `pred x` guard.
 
-  Another non-obvious source of overlapping patterns comes from partial pattern
-  matches in `do`-notation. For example:
+Another non-obvious source of overlapping patterns comes from partial pattern
+matches in `do`-notation. For example:
 
-    ```haskell
-    f :: [()]
-    f = do
-      Just () <- [Nothing]
-      return ()
-    ```
+```haskell
+f :: [()]
+f = do
+  Just () <- [Nothing]
+  return ()
+```
 
-  This has overlap because the partial pattern match desugars to the following:
+This has overlap because the partial pattern match desugars to the following:
 
-    ```haskell
-    f :: [()]
-    f = case [Nothing] of
-          Just () -> return ()
-          _ -> fail "Partial pattern match in do notation"
-    ```
+```haskell
+f :: [()]
+f = case [Nothing] of
+      Just () -> return ()
+      _ -> fail "Partial pattern match in do notation"
+```
 
-  Here, it is more evident that the catch-all pattern `_` overlaps with the
-  one above it.
+Here, it is more evident that the catch-all pattern `_` overlaps with the
+one above it.
 
-The following constructs are not supported:
+### `GADTs`
 
+Singling GADTs is likely to fail due to the generated `SingKind` instances
+not typechecking. (See
+[#150](https://github.com/goldfirere/singletons/issues/150)).
+However, one can often work around the issue by suppressing the generation
+of `SingKind` instances by using custom `Options`. See the `T150` test case
+for an example.
+
+### Instances of poly-kinded type classes
+
+Singling instances of poly-kinded type classes is likely to fail due to
+[#358](https://github.com/goldfirere/singletons/issues/358).
+However, one can often work around the issue by using `InstanceSigs`. For
+instance, the following code will not single:
+
+```haskell
+class C (f :: k -> Type) where
+  method :: f a
+
+instance C [] where
+  method = []
+```
+
+Adding a type signature for `method` in the `C []` is sufficient
+to work around the issue, though:
+
+```haskell
+instance C [] where
+  method :: [a]
+  method = []
+```
+
+## Little to no support
+
+The following constructs are either unsupported or almost never work:
+
+* scoped type variables
 * datatypes that store arrows, `Nat`, or `Symbol`
-* literals (limited support)
+* rank-n types
+* promoting `TypeRep`s
+* `TypeApplications`
 
-Why are these out of reach?
+See the following sections for more details.
 
+### Scoped type variables
+
+Promoting functions that rely on the behavior of `ScopedTypeVariables` is very
+tricky—see
+[this GitHub issue](https://github.com/goldfirere/singletons/issues/433) for an
+extended discussion on the topic. This is not to say that promoting functions
+that rely on `ScopedTypeVariables` is guaranteed to fail, but it is rather
+fragile. To demonstrate how fragile this is, note that the following function
+will promote successfully:
+
+```hs
+f :: forall a. a -> a
+f x = id x :: a
+```
+
+But this one will not:
+
+```hs
+g :: forall a. a -> a
+g x = id (x :: a)
+```
+
+There are usually workarounds one can use instead of `ScopedTypeVariables`:
+
+1. Use pattern signatures:
+
+   ```hs
+   g :: forall a. a -> a
+   g (x :: a) = id (x :: a)
+   ```
+2. Use local definitions:
+
+   ```hs
+   g :: forall a. a -> a
+   g x = id' a
+     where
+       id' :: a -> a
+       id' x = x
+   ```
+
+### Arrows, `Nat`, `Symbol`, and literals
+
 As described in the promotion paper, promotion of datatypes that store arrows is
 currently impossible. So if you have a declaration such as
 
@@ -678,18 +1002,32 @@
 
 Literals are problematic because we rely on GHC's built-in support, which
 currently is limited. Functions that operate on strings will not work because
-type level strings are no longer considered lists of characters. Function
-working on integer literals can be promoted by rewriting them to use
-`Nat`. Since `Nat` does not exist at the term level it will only be possible to
+type level strings are no longer considered lists of characters. Functions
+working over integer literals can be promoted by rewriting them to use
+`Nat`. Since `Nat` does not exist at the term level, it will only be possible to
 use the promoted definition, but not the original, term-level one.
 
 This is the same line of reasoning that forbids the use of `Nat` or `Symbol`
 in datatype definitions. But, see [this bug
 report](https://github.com/goldfirere/singletons/issues/76) for a workaround.
 
-Support for `*`
----------------
+### Rank-n types
 
+`singletons` does not support type signatures that have higher-rank types.
+More precisely, the only types that can be promoted or singled are
+_vanilla_ types,  where a vanilla function type is a type that:
+
+1. Only uses a `forall` at the top level, if used at all. That is to say, it
+   does not contain any nested or higher-rank `forall`s.
+
+2. Only uses a context (e.g., `c => ...`) at the top level, if used at all,
+   and only after the top-level `forall` if one is present. That is to say,
+   it does not contain any nested or higher-rank contexts.
+
+3. Contains no visible dependent quantification.
+
+### Promoting `TypeRep`s
+
 The built-in Haskell promotion mechanism does not yet have a full story around
 the kind `*` (the kind of types that have values). Ideally, promoting some form
 of `TypeRep` would yield `*`, but the implementation of `TypeRep` would have to
@@ -712,35 +1050,116 @@
 of types with which to work. See the Haddock documentation for the function
 `singletonStar` for more info.
 
-Known bugs
-----------
+### `TypeApplications`
 
-* Record updates don't singletonize
-* Inference dependent on functional dependencies is unpredictably bad. The
-  problem is that a use of an associated type family tied to a class with
-  fundeps doesn't provoke the fundep to kick in. This is GHC's problem, in
-  the end.
-* Singled code that contains uses type families is likely to fail due to GHC
-  Trac #12564. Note that singling type family declarations themselves is fine
-  (and often desired, since that produces defunctionalization symbols for them).
-* Singling instances of poly-kinded type classes is likely to fail due to
-  [#358](https://github.com/goldfirere/singletons/issues/358).
-  However, one can often work around the issue by using `InstanceSigs`. For
-  instance, the following code will not single:
+`singletons` currently cannot handle promoting or singling code that uses
+`TypeApplications` syntax, so `singletons` will simply drop any visible type
+applications. For example, `id @Bool True` will be promoted to `Id True` and
+singled to `sId STrue`. See
+[#378](https://github.com/goldfirere/singletons/issues/378) for a discussion
+of how `singletons` may support `TypeApplications` in the future.
 
+On the other hand, `singletons` does make an effort to preserve the order of
+type variables when promoting and singling certain constructors. These include:
+
+* Kind signatures of promoted top-level functions
+* Type signatures of singled top-level functions
+* Kind signatures of singled data type declarations
+* Type signatures of singled data constructors
+* Kind signatures of singled class declarations
+* Type signatures of singled class methods
+
+For example, consider this type signature:
+
+```haskell
+const2 :: forall b a. a -> b -> a
+```
+
+The promoted version of `const` will have the following kind signature:
+
+```haskell
+type Const2 :: forall b a. a -> b -> a
+```
+
+The singled version of `const2` will have the following type signature:
+
+```haskell
+sConst2 :: forall b a (x :: a) (y :: a). Sing x -> Sing y -> Sing (Const x y)
+```
+
+Therefore, writing `const2 @T1 @T2` works just as well as writing
+`Const2 @T1 @T2` or `sConst2 @T1 @T2`, since the signatures for `const2`, `Const2`,
+and `sConst2` all begin with `forall b a.`, in that order. Again, it is worth
+emphasizing that the TH machinery does not support promoting or singling
+`const2 @T1 @T2` directly, but you can write the type applications by hand if
+you so choose.
+
+`singletons` also has limited support for preserving the order of type variables
+for the following constructs:
+
+* Kind signatures of defunctionalization symbols.
+  The order of type variables is only guaranteed to be preserved if:
+
+  1. The thing being defunctionalized has a standalone type (or kind)
+     signature.
+  2. The type (or kind) signature of the thing being defunctionalized is
+     a vanilla type. (See the "Rank-n types" section above for what "vanilla"
+     means.)
+
+  If either of these conditions do not hold, `singletons` will fall back to
+  a slightly different approach to generating defunctionalization symbols that
+  does *not* guarantee the order of type variables. As an example, consider the
+  following example:
+
   ```haskell
-  class C (f :: k -> Type) where
-    method :: f a
+  data T (x :: a) :: forall b. b -> Type
+  $(genDefunSymbols [''T])
+  ```
 
-  instance C [] where
-    method = []
+  The kind of `T` is `forall a. a -> forall b. b -> Type`, which is not
+  vanilla. Currently, `singletons` will generate the following
+  defunctionalization symbols for `T`:
+
+  ```haskell
+  data TSym0 :: a ~> b ~> Type
+  data TSym1 (x :: a) :: b ~> Type
   ```
 
-  Adding a type signature for `method` in the `C []` is sufficient
-  to work around the issue, though:
+  In both symbols, the kind starts with `forall a b.` rather than quantifying
+  the `b` after the visible argument of kind `a`. These symbols can still be
+  useful even with this flaw, so `singletons` permits generating them
+  regardless. Be aware of this drawback if you try doing something similar
+  yourself!
 
+* Kind signatures of promoted class methods.
+  The order of type variables will often "just work" by happy coincidence, but
+  there are some situations where this does not happen. Consider the following
+  class:
+
   ```haskell
-  instance C [] where
-    method :: [a]
-    method = []
+  class C (b :: Type) where
+    m :: forall a. a -> b -> a
+  ```
+
+  The full type of `m` is `forall b. C b => forall a. a -> b -> a`, which binds
+  `b` before `a`. This order is preserved when singling `m`, but *not* when
+  promoting `m`. This is because the `C` class is promoted as follows:
+
+  ```haskell
+  class PC (b :: Type) where
+    type M (x :: a) (y :: b) :: a
+  ```
+
+  Due to the way GHC kind-checks associated type families, the kind of `M` is
+  `forall a b. a -> b -> a`, which binds `b` *after* `a`. Moreover, the
+  `StandaloneKindSignatures` extension does not provide a way to explicitly
+  declare the full kind of an associated type family, so this limitation is
+  not easy to work around.
+
+  The defunctionalization symbols for `M` will also follow a similar
+  order of type variables:
+
+  ```haskell
+  type MSym0 :: forall a b. a ~> b ~> a
+  type MSym1 :: forall a b. a -> b ~> a
   ```
diff --git a/singletons.cabal b/singletons.cabal
--- a/singletons.cabal
+++ b/singletons.cabal
@@ -1,5 +1,5 @@
 name:           singletons
-version:        2.6
+version:        2.7
                 -- Remember to bump version in the Makefile as well
 cabal-version:  >= 1.10
 synopsis:       A framework for generating singleton types
@@ -9,17 +9,16 @@
 maintainer:     Ryan Scott <ryan.gl.scott@gmail.com>
 bug-reports:    https://github.com/goldfirere/singletons/issues
 stability:      experimental
-tested-with:    GHC == 8.8.1
-extra-source-files: README.md, CHANGES.md,
-                    tests/compile-and-dump/buildGoldenFiles.awk,
+tested-with:    GHC == 8.10.1
+extra-source-files: README.md, CHANGES.md, tests/README.md,
                     tests/compile-and-dump/GradingClient/*.hs,
                     tests/compile-and-dump/InsertionSort/*.hs,
                     tests/compile-and-dump/Promote/*.hs,
                     tests/compile-and-dump/Singletons/*.hs
-                    tests/compile-and-dump/GradingClient/*.ghc88.template,
-                    tests/compile-and-dump/InsertionSort/*.ghc88.template,
-                    tests/compile-and-dump/Promote/*.ghc88.template,
-                    tests/compile-and-dump/Singletons/*.ghc88.template
+                    tests/compile-and-dump/GradingClient/*.golden,
+                    tests/compile-and-dump/InsertionSort/*.golden,
+                    tests/compile-and-dump/Promote/*.golden,
+                    tests/compile-and-dump/Singletons/*.golden
 license:        BSD3
 license-file:   LICENSE
 build-type:     Custom
@@ -30,7 +29,7 @@
     presented in /Dependently Typed Programming with Singletons/, published
     at the Haskell Symposium, 2012.
     (<https://cs.brynmawr.edu/~rae/papers/2012/singletons/paper.pdf>)
-
+    .
     Version 1.0 and onwards works a lot harder to promote functions. See the
     paper published at Haskell Symposium, 2014:
     <https://cs.brynmawr.edu/~rae/papers/2014/promotion/promotion.pdf>.
@@ -38,7 +37,7 @@
 source-repository this
   type:     git
   location: https://github.com/goldfirere/singletons.git
-  tag:      v2.6
+  tag:      v2.7
 
 source-repository head
   type:     git
@@ -47,19 +46,19 @@
 
 custom-setup
   setup-depends:
-    base      >= 4.13 && < 4.14,
-    Cabal     >= 2.5 && < 3.1,
+    base      >= 4.14 && < 4.15,
+    Cabal     >= 3.2 && < 3.3,
     directory >= 1,
     filepath  >= 1.3
 
 library
   hs-source-dirs:     src
-  build-depends:      base >= 4.13 && < 4.14,
+  build-depends:      base >= 4.14 && < 4.15,
                       mtl >= 2.2.1,
                       ghc-boot-th,
                       template-haskell,
                       containers >= 0.5,
-                      th-desugar >= 1.10 && < 1.11,
+                      th-desugar >= 1.11 && < 1.12,
                       pretty,
                       syb >= 0.4,
                       text >= 1.2,
@@ -73,6 +72,7 @@
                       Data.Singletons.CustomStar
                       Data.Singletons.TypeRepTYPE
                       Data.Singletons.TH
+                      Data.Singletons.TH.Options
                       Data.Singletons.Prelude
                       Data.Singletons.Prelude.Applicative
                       Data.Singletons.Prelude.Base
@@ -95,6 +95,7 @@
                       Data.Singletons.Prelude.Monad.Zip
                       Data.Singletons.Prelude.Monoid
                       Data.Singletons.Prelude.Num
+                      Data.Singletons.Prelude.Proxy
                       Data.Singletons.Prelude.Semigroup
                       Data.Singletons.Prelude.Show
                       Data.Singletons.Prelude.Traversable
@@ -120,7 +121,9 @@
                       Data.Singletons.Prelude.List.Internal
                       Data.Singletons.Prelude.List.Internal.Disambiguation
                       Data.Singletons.Prelude.Monad.Internal
+                      Data.Singletons.Prelude.Ord.Disambiguation
                       Data.Singletons.Prelude.Semigroup.Internal
+                      Data.Singletons.Prelude.Semigroup.Internal.Disambiguation
                       Data.Singletons.Promote
                       Data.Singletons.Promote.Monad
                       Data.Singletons.Promote.Eq
@@ -152,7 +155,9 @@
                       ByHand2
                       SingletonsTestSuiteUtils
 
-  build-depends:      base >= 4.13 && < 4.14,
+  build-depends:      base >= 4.14 && < 4.15,
+                      bytestring >= 0.10.9,
+                      deepseq >= 1.4.4,
                       filepath >= 1.3,
                       process >= 1.1,
                       turtle >= 1.5,
diff --git a/src/Data/Singletons.hs b/src/Data/Singletons.hs
--- a/src/Data/Singletons.hs
+++ b/src/Data/Singletons.hs
@@ -9,6 +9,7 @@
 {-# LANGUAGE QuantifiedConstraints #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -60,7 +61,7 @@
   -- ** Defunctionalization
   TyFun, type (~>),
   TyCon1, TyCon2, TyCon3, TyCon4, TyCon5, TyCon6, TyCon7, TyCon8,
-  TyCon, Apply, type (@@),
+  TyCon, Apply, type (@@), ApplyTyCon, ApplyTyConAux1, ApplyTyConAux2,
 
   -- ** Defunctionalized singletons
   -- | When calling a higher-order singleton function, you need to use a
@@ -70,8 +71,13 @@
   unSingFun1, unSingFun2, unSingFun3, unSingFun4, unSingFun5,
   unSingFun6, unSingFun7, unSingFun8,
   -- $SLambdaPatternSynonyms
-  pattern SLambda2, pattern SLambda3, pattern SLambda4, pattern SLambda5,
-  pattern SLambda6, pattern SLambda7, pattern SLambda8,
+  pattern SLambda2, applySing2,
+  pattern SLambda3, applySing3,
+  pattern SLambda4, applySing4,
+  pattern SLambda5, applySing5,
+  pattern SLambda6, applySing6,
+  pattern SLambda7, applySing7,
+  pattern SLambda8, applySing8,
 
   -- | These type synonyms are exported only to improve error messages; users
   -- should not have to mention them.
diff --git a/src/Data/Singletons/CustomStar.hs b/src/Data/Singletons/CustomStar.hs
--- a/src/Data/Singletons/CustomStar.hs
+++ b/src/Data/Singletons/CustomStar.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE DataKinds, TypeFamilies, KindSignatures, TemplateHaskell, CPP #-}
+{-# LANGUAGE DataKinds, TypeFamilies, KindSignatures, TemplateHaskell #-}
 
 -----------------------------------------------------------------------------
 -- |
@@ -37,6 +37,7 @@
 import Data.Singletons.Syntax
 import Data.Singletons.Names
 import Data.Singletons.TH
+import Data.Singletons.TH.Options
 import Control.Monad
 import Data.Maybe
 import Language.Haskell.TH.Desugar
@@ -70,7 +71,7 @@
 -- @Bool@, and @Maybe@, not just promoted data constructors.
 --
 -- Please note that this function is /very/ experimental. Use at your own risk.
-singletonStar :: DsMonad q
+singletonStar :: OptionsMonad q
               => [Name]        -- ^ A list of Template Haskell @Name@s for types
               -> q [Dec]
 singletonStar names = do
@@ -91,9 +92,9 @@
     let dataDeclEqInst = DerivedDecl (Just dataDeclEqCxt) (DConT repName) repName dataDecl
     ordInst  <- mkOrdInstance Nothing (DConT repName) dataDecl
     showInst <- mkShowInstance ForPromotion Nothing (DConT repName) dataDecl
-    (pInsts, promDecls) <- promoteM [] $ do promoteDataDec dataDecl
+    (pInsts, promDecls) <- promoteM [] $ do _ <- promoteDataDec dataDecl
                                             promoteDerivedEqDec dataDeclEqInst
-                                            traverse (promoteInstanceDec mempty)
+                                            traverse (promoteInstanceDec mempty mempty)
                                               [ordInst, showInst]
     singletonDecls <- singDecsM [] $ do decs1 <- singDataD dataDecl
                                         decs2 <- singDerivedEqDecs dataDeclEqInst
@@ -133,7 +134,8 @@
 
         -- demote a kind back to a type, accumulating any unbound parameters
         kindToType :: DsMonad q => [DTypeArg] -> DKind -> QWithAux [Name] q DType
-        kindToType _    (DForallT _ _ _) = fail "Explicit forall encountered in kind"
+        kindToType _    (DForallT _ _ _)    = fail "Explicit forall encountered in kind"
+        kindToType _    (DConstrainedT _ _) = fail "Explicit constraint encountered in kind"
         kindToType args (DAppT f a) = do
           a' <- kindToType [] a
           kindToType (DTANormal a' : args) f
diff --git a/src/Data/Singletons/Decide.hs b/src/Data/Singletons/Decide.hs
--- a/src/Data/Singletons/Decide.hs
+++ b/src/Data/Singletons/Decide.hs
@@ -1,6 +1,6 @@
 {-# LANGUAGE RankNTypes, PolyKinds, DataKinds, TypeOperators,
              TypeFamilies, FlexibleContexts, UndecidableInstances,
-             GADTs, TypeApplications #-}
+             GADTs, TypeApplications, StandaloneKindSignatures #-}
 {-# OPTIONS_GHC -Wno-orphans #-}
 
 -----------------------------------------------------------------------------
@@ -25,6 +25,7 @@
   decideEquality, decideCoercion
   ) where
 
+import Data.Kind
 import Data.Singletons.Internal
 import Data.Type.Coercion
 import Data.Type.Equality
@@ -37,16 +38,19 @@
 -- | Because we can never create a value of type 'Void', a function that type-checks
 -- at @a -> Void@ shows that objects of type @a@ can never exist. Thus, we say that
 -- @a@ is 'Refuted'
+type Refuted :: Type -> Type
 type Refuted a = (a -> Void)
 
 -- | A 'Decision' about a type @a@ is either a proof of existence or a proof that @a@
 -- cannot exist.
+type Decision :: Type -> Type
 data Decision a = Proved a               -- ^ Witness for @a@
                 | Disproved (Refuted a)  -- ^ Proof that no @a@ exists
 
 -- | Members of the 'SDecide' "kind" class support decidable equality. Instances
 -- of this class are generated alongside singleton definitions for datatypes that
 -- derive an 'Eq' instance.
+type SDecide :: Type -> Constraint
 class SDecide k where
   -- | Compute a proof or disproof of equality, given two singletons.
   (%~) :: forall (a :: k) (b :: k). Sing a -> Sing b -> Decision (a :~: b)
diff --git a/src/Data/Singletons/Deriving/Infer.hs b/src/Data/Singletons/Deriving/Infer.hs
--- a/src/Data/Singletons/Deriving/Infer.hs
+++ b/src/Data/Singletons/Deriving/Infer.hs
@@ -19,7 +19,8 @@
 import Language.Haskell.TH.Syntax
 import Data.Singletons.Deriving.Util
 import Data.Singletons.Util
-import Data.List
+import Data.List (nub)
+import Data.Maybe (fromJust)
 
 -- @inferConstraints cls inst_ty cons@ infers the instance context for a
 -- derived type class instance of @cls@ for @inst_ty@, using the constructors
@@ -142,7 +143,7 @@
       -- we invoke this.
       let (_, res_ty_args)     = unfoldDType res_ty
           (_, last_res_ty_arg) = snocView $ filterDTANormals res_ty_args
-          Just last_tv         = getDVarTName_maybe last_res_ty_arg
+          last_tv              = fromJust $ getDVarTName_maybe last_res_ty_arg
       deep_subtypes <- concatMapM (deepSubtypesContaining last_tv) fields
       pure $ map (pr `DAppT`) deep_subtypes
 
diff --git a/src/Data/Singletons/Deriving/Show.hs b/src/Data/Singletons/Deriving/Show.hs
--- a/src/Data/Singletons/Deriving/Show.hs
+++ b/src/Data/Singletons/Deriving/Show.hs
@@ -20,6 +20,7 @@
 import Language.Haskell.TH.Syntax hiding (showName)
 import Language.Haskell.TH.Desugar
 import Data.Singletons.Names
+import Data.Singletons.TH.Options
 import Data.Singletons.Util
 import Data.Singletons.Syntax
 import Data.Singletons.Deriving.Infer
@@ -28,7 +29,7 @@
 import GHC.Lexeme (startsConSym, startsVarSym)
 import GHC.Show (appPrec, appPrec1)
 
-mkShowInstance :: DsMonad q => ShowMode -> DerivDesc q
+mkShowInstance :: OptionsMonad q => ShowMode -> DerivDesc q
 mkShowInstance mode mb_ctxt ty (DataDecl _ _ cons) = do
   clauses <- mk_showsPrec mode cons
   constraints <- inferConstraintsDef (fmap (mkShowSingContext mode) mb_ctxt)
@@ -41,7 +42,7 @@
                     , id_sigs  = mempty
                     , id_meths = [ (showsPrecName, UFunction clauses) ] }
 
-mk_showsPrec :: DsMonad q => ShowMode -> [DCon] -> q [DClause]
+mk_showsPrec :: OptionsMonad q => ShowMode -> [DCon] -> q [DClause]
 mk_showsPrec mode cons = do
     p <- newUniqueName "p" -- The precedence argument (not always used)
     if null cons
@@ -49,120 +50,124 @@
                pure [DClause [DWildP, DVarP v] (DCaseE (DVarE v) [])]
        else mapM (mk_showsPrec_clause mode p) cons
 
-mk_showsPrec_clause :: forall q. DsMonad q
+mk_showsPrec_clause :: forall q. OptionsMonad q
                     => ShowMode -> Name -> DCon
                     -> q DClause
 mk_showsPrec_clause mode p (DCon _ _ con_name con_fields _) = go con_fields
   where
-    con_name' :: Name
-    con_name' = case mode of
-                  ForPromotion  -> con_name
-                  ForShowSing{} -> singDataConName con_name
-
     go :: DConFields -> q DClause
+    go con_fields' = do
+      opts <- getOptions
 
-    -- No fields: print just the constructor name, with no parentheses
-    go (DNormalC _ []) = return $
-      DClause [DWildP, DConP con_name' []] $
-        DVarE showStringName `DAppE` dStringE (parenInfixConName con_name' "")
+      let con_name' :: Name
+          con_name' = case mode of
+                        ForPromotion  -> con_name
+                        ForShowSing{} -> singledDataConName opts con_name
 
-    -- Infix constructors have special Show treatment.
-    go (DNormalC True tys@[_, _])
-        -- Although the (:) constructor is infix, its singled counterpart SCons
-        -- is not, which matters if we're deriving a ShowSing instance.
-        -- Unless we remove this special case (see #234), we will simply
-        -- shunt it along as if we were dealing with a prefix constructor.
-      | ForShowSing{} <- mode
-      , con_name == consName
-      = go (DNormalC False tys)
+      case con_fields' of
 
-      | otherwise
-      = do argL   <- newUniqueName "argL"
-           argR   <- newUniqueName "argR"
-           argTyL <- newUniqueName "argTyL"
-           argTyR <- newUniqueName "argTyR"
-           fi <- fromMaybe defaultFixity <$> reifyFixityWithLocals con_name'
-           let con_prec = case fi of Fixity prec _ -> prec
-               op_name  = nameBase con_name'
-               infixOpE = DAppE (DVarE showStringName) . dStringE $
-                            if isInfixDataCon op_name
-                               then " "  ++ op_name ++ " "
-                               -- Make sure to handle infix data constructors
-                               -- like (Int `Foo` Int)
-                               else " `" ++ op_name ++ "` "
-           return $ DClause [ DVarP p
-                            , DConP con_name' $
-                              zipWith (mk_Show_arg_pat mode) [argL, argR] [argTyL, argTyR]
-                            ] $
-             mk_Show_rhs_sig mode [argTyL, argTyR] $
-             (DVarE showParenName `DAppE` (DVarE gtName `DAppE` DVarE p
-                                                        `DAppE` dIntegerE con_prec))
-               `DAppE` (DVarE composeName
-                          `DAppE` showsPrecE (con_prec + 1) argL
-                          `DAppE` (DVarE composeName
-                                     `DAppE` infixOpE
-                                     `DAppE` showsPrecE (con_prec + 1) argR))
+        -- No fields: print just the constructor name, with no parentheses
+        DNormalC _ [] -> return $
+          DClause [DWildP, DConP con_name' []] $
+            DVarE showStringName `DAppE` dStringE (parenInfixConName con_name' "")
 
-    go (DNormalC _ tys) = do
-      args   <- mapM (const $ newUniqueName "arg")   tys
-      argTys <- mapM (const $ newUniqueName "argTy") tys
-      let show_args     = map (showsPrecE appPrec1) args
-          composed_args = foldr1 (\v q -> DVarE composeName
-                                           `DAppE` v
-                                           `DAppE` (DVarE composeName
-                                                     `DAppE` DVarE showSpaceName
-                                                     `DAppE` q)) show_args
-          named_args = DVarE composeName
-                         `DAppE` (DVarE showStringName
-                                   `DAppE` dStringE (parenInfixConName con_name' " "))
-                         `DAppE` composed_args
-      return $ DClause [ DVarP p
-                       , DConP con_name' $
-                         zipWith (mk_Show_arg_pat mode) args argTys
-                       ] $
-        mk_Show_rhs_sig mode argTys $
-        DVarE showParenName
-          `DAppE` (DVarE gtName `DAppE` DVarE p `DAppE` dIntegerE appPrec)
-          `DAppE` named_args
+        -- Infix constructors have special Show treatment.
+        DNormalC True tys@[_, _]
+            -- Although the (:) constructor is infix, its singled counterpart SCons
+            -- is not, which matters if we're deriving a ShowSing instance.
+            -- Unless we remove this special case (see #234), we will simply
+            -- shunt it along as if we were dealing with a prefix constructor.
+          |  ForShowSing{} <- mode
+          ,  con_name == consName
+          -> go (DNormalC False tys)
 
-    -- We show a record constructor with no fields the same way we'd show a
-    -- normal constructor with no fields.
-    go (DRecC []) = go (DNormalC False [])
+          |  otherwise
+          -> do argL   <- newUniqueName "argL"
+                argR   <- newUniqueName "argR"
+                argTyL <- newUniqueName "argTyL"
+                argTyR <- newUniqueName "argTyR"
+                fi <- fromMaybe defaultFixity <$> reifyFixityWithLocals con_name'
+                let con_prec = case fi of Fixity prec _ -> prec
+                    op_name  = nameBase con_name'
+                    infixOpE = DAppE (DVarE showStringName) . dStringE $
+                                 if isInfixDataCon op_name
+                                    then " "  ++ op_name ++ " "
+                                    -- Make sure to handle infix data constructors
+                                    -- like (Int `Foo` Int)
+                                    else " `" ++ op_name ++ "` "
+                return $ DClause [ DVarP p
+                                 , DConP con_name' $
+                                   zipWith (mk_Show_arg_pat mode) [argL, argR] [argTyL, argTyR]
+                                 ] $
+                  mk_Show_rhs_sig mode [argTyL, argTyR] $
+                  (DVarE showParenName `DAppE` (DVarE gtName `DAppE` DVarE p
+                                                             `DAppE` dIntegerE con_prec))
+                    `DAppE` (DVarE composeName
+                               `DAppE` showsPrecE (con_prec + 1) argL
+                               `DAppE` (DVarE composeName
+                                          `DAppE` infixOpE
+                                          `DAppE` showsPrecE (con_prec + 1) argR))
 
-    go (DRecC tys) = do
-      args   <- mapM (const $ newUniqueName "arg")   tys
-      argTys <- mapM (const $ newUniqueName "argTy") tys
-      let show_args =
-            concatMap (\((arg_name, _, _), arg) ->
-                        let arg_name'    = case mode of
-                                             ForPromotion  -> arg_name
-                                             ForShowSing{} -> singValName arg_name
-                            arg_nameBase = nameBase arg_name'
-                            infix_rec    = showParen (isSym arg_nameBase)
-                                                     (showString arg_nameBase) ""
-                        in [ DVarE showStringName `DAppE` dStringE (infix_rec ++ " = ")
-                           , showsPrecE 0 arg
-                           , DVarE showCommaSpaceName
-                           ])
-                      (zip tys args)
-          brace_comma_args =   (DVarE showCharName `DAppE` dCharE mode '{')
-                             : take (length show_args - 1) show_args
-          composed_args = foldr (\x y -> DVarE composeName `DAppE` x `DAppE` y)
-                                (DVarE showCharName `DAppE` dCharE mode '}')
-                                brace_comma_args
-          named_args = DVarE composeName
-                         `DAppE` (DVarE showStringName
-                                   `DAppE` dStringE (parenInfixConName con_name' " "))
-                         `DAppE` composed_args
-      return $ DClause [ DVarP p
-                       , DConP con_name' $
-                         zipWith (mk_Show_arg_pat mode) args argTys
-                       ] $
-        mk_Show_rhs_sig mode argTys $
-        DVarE showParenName
-          `DAppE` (DVarE gtName `DAppE` DVarE p `DAppE` dIntegerE appPrec)
-          `DAppE` named_args
+        DNormalC _ tys -> do
+          args   <- mapM (const $ newUniqueName "arg")   tys
+          argTys <- mapM (const $ newUniqueName "argTy") tys
+          let show_args     = map (showsPrecE appPrec1) args
+              composed_args = foldr1 (\v q -> DVarE composeName
+                                               `DAppE` v
+                                               `DAppE` (DVarE composeName
+                                                         `DAppE` DVarE showSpaceName
+                                                         `DAppE` q)) show_args
+              named_args = DVarE composeName
+                             `DAppE` (DVarE showStringName
+                                       `DAppE` dStringE (parenInfixConName con_name' " "))
+                             `DAppE` composed_args
+          return $ DClause [ DVarP p
+                           , DConP con_name' $
+                             zipWith (mk_Show_arg_pat mode) args argTys
+                           ] $
+            mk_Show_rhs_sig mode argTys $
+            DVarE showParenName
+              `DAppE` (DVarE gtName `DAppE` DVarE p `DAppE` dIntegerE appPrec)
+              `DAppE` named_args
 
+        -- We show a record constructor with no fields the same way we'd show a
+        -- normal constructor with no fields.
+        DRecC [] -> go (DNormalC False [])
+
+        DRecC tys -> do
+          args   <- mapM (const $ newUniqueName "arg")   tys
+          argTys <- mapM (const $ newUniqueName "argTy") tys
+          let show_args =
+                concatMap (\((arg_name, _, _), arg) ->
+                            let arg_name'    = case mode of
+                                                 ForPromotion  -> arg_name
+                                                 ForShowSing{} -> singledValueName opts arg_name
+                                arg_nameBase = nameBase arg_name'
+                                infix_rec    = showParen (isSym arg_nameBase)
+                                                         (showString arg_nameBase) ""
+                            in [ DVarE showStringName `DAppE` dStringE (infix_rec ++ " = ")
+                               , showsPrecE 0 arg
+                               , DVarE showCommaSpaceName
+                               ])
+                          (zip tys args)
+              brace_comma_args =   (DVarE showCharName `DAppE` dCharE mode '{')
+                                 : take (length show_args - 1) show_args
+              composed_args = foldr (\x y -> DVarE composeName `DAppE` x `DAppE` y)
+                                    (DVarE showCharName `DAppE` dCharE mode '}')
+                                    brace_comma_args
+              named_args = DVarE composeName
+                             `DAppE` (DVarE showStringName
+                                       `DAppE` dStringE (parenInfixConName con_name' " "))
+                             `DAppE` composed_args
+          return $ DClause [ DVarP p
+                           , DConP con_name' $
+                             zipWith (mk_Show_arg_pat mode) args argTys
+                           ] $
+            mk_Show_rhs_sig mode argTys $
+            DVarE showParenName
+              `DAppE` (DVarE gtName `DAppE` DVarE p `DAppE` dIntegerE appPrec)
+              `DAppE` named_args
+
 -- | Parenthesize an infix constructor name if it is being applied as a prefix
 -- function (e.g., data Amp a = (:&) a a)
 parenInfixConName :: Name -> ShowS
@@ -218,14 +223,15 @@
 mk_Show_name ForPromotion  = showName
 mk_Show_name ForShowSing{} = showSingName
 
--- If we're creating a 'Show' instance for a singleon type, decorate the type
+-- If we're creating a 'Show' instance for a singleton type, decorate the type
 -- appropriately (e.g., turn @Maybe a@ into @SMaybe (z :: Maybe a)@).
 -- Otherwise, return the type (@Maybe a@) unchanged.
-mk_Show_inst_ty :: Quasi q => ShowMode -> DType -> q DType
+mk_Show_inst_ty :: OptionsMonad q => ShowMode -> DType -> q DType
 mk_Show_inst_ty ForPromotion           ty = pure ty
 mk_Show_inst_ty (ForShowSing ty_tycon) ty = do
+  opts <- getOptions
   z <- qNewName "z"
-  pure $ DConT (singTyConName ty_tycon) `DAppT` (DVarT z `DSigT` ty)
+  pure $ DConT (singledDataTypeName opts ty_tycon) `DAppT` (DVarT z `DSigT` ty)
 
 -- If we're creating a 'Show' instance for a singleton type, create a pattern
 -- of the form @(sx :: Sing x)@. Otherwise, simply return the pattern @sx@.
@@ -241,5 +247,5 @@
 mk_Show_rhs_sig :: ShowMode -> [Name] -> DExp -> DExp
 mk_Show_rhs_sig ForPromotion  _            e = e
 mk_Show_rhs_sig ForShowSing{} arg_ty_names e =
-  e `DSigE` DForallT [] (map (DAppT (DConT showSing'Name) . DVarT) arg_ty_names)
-                        (DConT showSName)
+  e `DSigE` DConstrainedT (map (DAppT (DConT showSing'Name) . DVarT) arg_ty_names)
+                          (DConT showSName)
diff --git a/src/Data/Singletons/Deriving/Util.hs b/src/Data/Singletons/Deriving/Util.hs
--- a/src/Data/Singletons/Deriving/Util.hs
+++ b/src/Data/Singletons/Deriving/Util.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE MultiWayIf #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 
 -----------------------------------------------------------------------------
@@ -15,7 +16,7 @@
 module Data.Singletons.Deriving.Util where
 
 import Control.Monad
-import Data.List
+import qualified Data.List as List
 import Data.Singletons.Names
 import Data.Singletons.Syntax
 import Data.Singletons.Util
@@ -121,34 +122,25 @@
   where
     go :: DType
        -> q (a, Bool) -- (result of type a, does type contain var)
-    go (DAppT f x) = do
-      (_, fc) <- go f
-      if fc
-         then pure (caseWrongArg, True)
-         else do (xr, xc) <- go x
-                 if xc
-                    then let tyApp :: q (a, Bool)
-                             tyApp = pure (caseTyApp f xr, True)
-
-                             inspect :: DType -> q (a, Bool)
-                             inspect (DConT n) = do
-                               itf <- isTyFamilyName n
-                               if itf -- We can't decompose type families, so
-                                      -- error if we encounter one here.
-                                  then pure (caseWrongArg, True)
-                                  else tyApp
-                             inspect (DForallT _ _ t) = inspect t
-                             inspect (DSigT t _)      = inspect t
-                             inspect (DAppT t _)      = inspect t
-                             inspect (DAppKindT t _)  = inspect t
-                             inspect (DVarT {})       = tyApp
-                             inspect DArrowT          = tyApp
-                             inspect (DLitT {})       = tyApp
-                             inspect DWildCardT       = tyApp
-
-                         in case unfoldDType f of
-                              (f_head, _) -> inspect f_head
-                    else trivial
+    go t@DAppT{} = do
+      let (f, args) = unfoldDType t
+          vis_args  = filterDTANormals args
+      (_,   fc)  <- go f
+      (xrs, xcs) <- mapAndUnzipM go vis_args
+      let wrongArg  :: q (a, Bool)
+          wrongArg = pure (caseWrongArg, True)
+      if |  not (or xcs)
+         -> trivial -- Variable does not occur
+         -- At this point we know that xrs, xcs is not empty,
+         -- and at least one xr is True
+         |  fc || or (init xcs)
+         -> wrongArg                    -- T (..var..)    ty
+         |  otherwise                   -- T (..no var..) ty
+         -> do itf <- isInTypeFamilyApp var f vis_args
+               if itf -- We can't decompose type families, so
+                      -- error if we encounter one here.
+                  then wrongArg
+                  else pure (caseTyApp (last vis_args) (last xrs), True)
     go (DAppKindT t k) = do
       (_, kc) <- go k
       if kc
@@ -162,11 +154,12 @@
     go (DVarT v)
       | v == var = pure (caseVar, True)
       | otherwise = trivial
-    go (DForallT tvbs _ t) = do
+    go (DForallT _ tvbs t) = do
       (tr, tc) <- go t
       if var `notElem` map extractTvbName tvbs && tc
          then pure (caseForAll tvbs tr, True)
          else trivial
+    go (DConstrainedT _ t) =  go t
     go (DConT {}) = trivial
     go DArrowT    = trivial
     go (DLitT {}) = trivial
@@ -175,15 +168,39 @@
     trivial :: q (a, Bool)
     trivial = pure (caseTrivial, False)
 
-isTyFamilyName :: DsMonad q => Name -> q Bool
-isTyFamilyName n = do
-  info <- dsReify n
-  pure $ case info of
-           Just (DTyConI dec _)
-             | DOpenTypeFamilyD{}   <- dec -> True
-             | DClosedTypeFamilyD{} <- dec -> True
-           _ -> False
+-- | Detect if a Name occurs as an argument to some type family. This makes an
+-- effort to exclude /oversaturated/ arguments to type families. For instance,
+-- if one declared the following type family:
+--
+-- @
+-- type family F a :: Type -> Type
+-- @
+--
+-- Then in the type @F a b@, we would consider @a@ to be an argument to @F@,
+-- but not @b@.
+isInTypeFamilyApp :: forall q. DsMonad q => Name -> DType -> [DType] -> q Bool
+isInTypeFamilyApp name tyFun tyArgs =
+  case tyFun of
+    DConT tcName -> go tcName
+    _            -> pure False
+  where
+    go :: Name -> q Bool
+    go tcName = do
+      info <- dsReify tcName
+      case info of
+        Just (DTyConI dec _)
+          |  DOpenTypeFamilyD (DTypeFamilyHead _ bndrs _ _) <- dec
+          -> withinFirstArgs bndrs
+          |  DClosedTypeFamilyD (DTypeFamilyHead _ bndrs _ _) _ <- dec
+          -> withinFirstArgs bndrs
+        _ -> pure False
 
+    withinFirstArgs :: [a] -> q Bool
+    withinFirstArgs bndrs =
+      let firstArgs = take (length bndrs) tyArgs
+          argFVs    = foldMap fvDType firstArgs
+      in pure $ name `elem` argFVs
+
 -- A crude approximation of cond_functorOK from GHC. This checks that:
 --
 -- (1) There's at least one type variable in the data type.
@@ -211,7 +228,7 @@
       , (_, last_res_ty_arg) <- snocView $ filterDTANormals res_ty_args
       , Just last_tv <- getDVarTName_maybe last_res_ty_arg
       = do ex_tvbs <- conExistentialTvbs (foldTypeTvbs (DConT n) data_tvbs) con
-           let univ_tvb_names = map extractTvbName con_tvbs \\ map extractTvbName ex_tvbs
+           let univ_tvb_names = map extractTvbName con_tvbs List.\\ map extractTvbName ex_tvbs
            if last_tv `elem` univ_tvb_names
                 && last_tv `OSet.notMember` foldMap fvDType con_theta
               then pure ()
diff --git a/src/Data/Singletons/Internal.hs b/src/Data/Singletons/Internal.hs
--- a/src/Data/Singletons/Internal.hs
+++ b/src/Data/Singletons/Internal.hs
@@ -3,7 +3,7 @@
              TypeFamilies, TypeOperators, TypeFamilyDependencies,
              UndecidableInstances, ConstraintKinds,
              ScopedTypeVariables, TypeApplications, AllowAmbiguousTypes,
-             PatternSynonyms, ViewPatterns #-}
+             PatternSynonyms, ViewPatterns, StandaloneKindSignatures #-}
 
 -----------------------------------------------------------------------------
 -- |
@@ -33,26 +33,34 @@
 
 -- | Convenient synonym to refer to the kind of a type variable:
 -- @type KindOf (a :: k) = k@
+type KindOf :: k -> Type
 type KindOf (a :: k) = k
 
 -- | Force GHC to unify the kinds of @a@ and @b@. Note that @SameKind a b@ is
 -- different from @KindOf a ~ KindOf b@ in that the former makes the kinds
 -- unify immediately, whereas the latter is a proposition that GHC considers
 -- as possibly false.
-type SameKind (a :: k) (b :: k) = (() :: Constraint)
+type SameKind :: k -> k -> Constraint
+type SameKind a b = ()
 
 ----------------------------------------------------------------------
 ---- Sing & friends --------------------------------------------------
 ----------------------------------------------------------------------
 
 -- | The singleton kind-indexed type family.
-type family Sing :: k -> Type
+type Sing :: k -> Type
+type family Sing
 
 {-
 Note [The kind of Sing]
 ~~~~~~~~~~~~~~~~~~~~~~~
 It is important to define Sing like this:
 
+  type Sing :: k -> Type
+  type family Sing
+
+Or, equivalently,
+
   type family Sing :: k -> Type
 
 There are other conceivable ways to define Sing, but they all suffer from
@@ -138,6 +146,7 @@
 -- @
 -- (\\('FromSing' sing) -> 'FromSing' sing) ≡ 'id'
 -- @
+type SingKind :: Type -> Constraint
 class SingKind k where
   -- | Get a base type from the promoted kind. For example,
   -- @Demote Bool@ will be the type @Bool@. Rarely, the type and kind do not
@@ -160,6 +169,7 @@
 -- >           SomeSing sb -> {- fancy dependently-typed code with sb -}
 --
 -- An example like the one above may be easier to write using 'withSomeSing'.
+type SomeSing :: Type -> Type
 data SomeSing k where
   SomeSing :: Sing (a :: k) -> SomeSing k
 
@@ -208,17 +218,20 @@
 -- 'WrappedSing' is a perfectly ordinary data type, which means that it is
 -- quite possible to define an
 -- @instance 'SDecide' k => 'TestEquality' ('WrappedSing' k)@.
-newtype WrappedSing :: forall k. k -> Type where
+type WrappedSing :: k -> Type
+newtype WrappedSing a where
   WrapSing :: forall k (a :: k). { unwrapSing :: Sing a } -> WrappedSing a
 
 -- | The singleton for 'WrappedSing's. Informally, this is the singleton type
 -- for other singletons.
-newtype SWrappedSing :: forall k (a :: k). WrappedSing a -> Type where
+type SWrappedSing :: forall k (a :: k). WrappedSing a -> Type
+newtype SWrappedSing ws where
   SWrapSing :: forall k (a :: k) (ws :: WrappedSing a).
                { sUnwrapSing :: Sing a } -> SWrappedSing ws
 type instance Sing = SWrappedSing
 
-type family UnwrapSing (ws :: WrappedSing a) :: Sing a where
+type UnwrapSing :: WrappedSing a -> Sing a
+type family UnwrapSing ws where
   UnwrapSing ('WrapSing s) = s
 
 instance SingKind (WrappedSing a) where
@@ -234,10 +247,12 @@
 ----------------------------------------------------------------------
 
 -- | A 'SingInstance' wraps up a 'SingI' instance for explicit handling.
-data SingInstance (a :: k) where
+type SingInstance :: k -> Type
+data SingInstance a where
   SingInstance :: SingI a => SingInstance a
 
 -- dirty implementation of explicit-to-implicit conversion
+type DI :: k -> Type
 newtype DI a = Don'tInstantiate (SingI a => SingInstance a)
 
 -- | Get an implicit singleton (a 'SingI' instance) from an explicit one.
@@ -255,17 +270,21 @@
 -- between term-level arrows and this type-level arrow is that at the term
 -- level applications can be unsaturated, whereas at the type level all
 -- applications have to be fully saturated.
-data TyFun :: Type -> Type -> Type
+type TyFun :: Type -> Type -> Type
+data TyFun a b
 
 -- | Something of kind `a ~> b` is a defunctionalized type function that is
 -- not necessarily generative or injective.
+type (~>) :: Type -> Type -> Type
 type a ~> b = TyFun a b -> Type
 infixr 0 ~>
 
 -- | Type level function application
-type family Apply (f :: k1 ~> k2) (x :: k1) :: k2
+type Apply :: (k1 ~> k2) -> k1 -> k2
+type family Apply f x
 
 -- | An infix synonym for `Apply`
+type (@@) :: (k1 ~> k2) -> k1 -> k2
 type a @@ b = Apply a b
 infixl 9 @@
 
@@ -273,7 +292,8 @@
 -- in place of any of the @TyConN@ types, but it will work only with
 -- /monomorphic/ types. When GHC#14645 is fixed, this should fully supersede
 -- the @TyConN@ types.
-data family TyCon :: (k1 -> k2) -> unmatchable_fun
+type TyCon :: (k1 -> k2) -> unmatchable_fun
+data family TyCon
 -- That unmatchable_fun should really be a function of k1 and k2,
 -- but GHC 8.4 doesn't support type family calls in the result kind
 -- of a data family. It should. See GHC#14645.
@@ -287,7 +307,8 @@
 -- here because dealing with inequality like this is hard, and
 -- I (Richard) wasn't sure what concrete value the ticket would
 -- have, given that we don't know how to begin fixing it.
-type family ApplyTyCon :: (k1 -> k2) -> (k1 ~> unmatchable_fun) where
+type ApplyTyCon :: (k1 -> k2) -> (k1 ~> unmatchable_fun)
+type family ApplyTyCon where
   ApplyTyCon @k1 @(k2 -> k3) @unmatchable_fun = ApplyTyConAux2
   ApplyTyCon @k1 @k2         @k2              = ApplyTyConAux1
 -- Upon first glance, the definition of ApplyTyCon (as well as the
@@ -314,10 +335,12 @@
 -- | An \"internal\" defunctionalization symbol used primarily in the
 -- definition of 'ApplyTyCon', as well as the 'SingI' instances for 'TyCon1',
 -- 'TyCon2', etc.
-data ApplyTyConAux1 :: (k1 -> k2) -> (k1 ~> k2)
+type ApplyTyConAux1 :: (k1 -> k2) -> (k1 ~> k2)
+data ApplyTyConAux1 f z
 -- | An \"internal\" defunctionalization symbol used primarily in the
 -- definition of 'ApplyTyCon'.
-data ApplyTyConAux2 :: (k1 -> k2 -> k3) -> (k1 ~> unmatchable_fun)
+type ApplyTyConAux2 :: (k1 -> k2 -> k3) -> (k1 ~> unmatchable_fun)
+data ApplyTyConAux2 f z
 type instance Apply (ApplyTyConAux1 f) x = f x
 type instance Apply (ApplyTyConAux2 f) x = TyCon (f x)
 
@@ -332,26 +355,41 @@
 -- We can write:
 --
 -- > Map (TyCon1 Succ) [Zero, Succ Zero]
-type TyCon1 = (TyCon :: (k1 -> k2) -> (k1 ~> k2))
+type TyCon1 :: (k1 -> k2) -> (k1 ~> k2)
+type TyCon1 = TyCon
 
 -- | Similar to 'TyCon1', but for two-parameter type constructors.
-type TyCon2 = (TyCon :: (k1 -> k2 -> k3) -> (k1 ~> k2 ~> k3))
-type TyCon3 = (TyCon :: (k1 -> k2 -> k3 -> k4) -> (k1 ~> k2 ~> k3 ~> k4))
-type TyCon4 = (TyCon :: (k1 -> k2 -> k3 -> k4 -> k5) -> (k1 ~> k2 ~> k3 ~> k4 ~> k5))
-type TyCon5 = (TyCon :: (k1 -> k2 -> k3 -> k4 -> k5 -> k6)
-                     -> (k1 ~> k2 ~> k3 ~> k4 ~> k5 ~> k6))
-type TyCon6 = (TyCon :: (k1 -> k2 -> k3 -> k4 -> k5 -> k6 -> k7)
-                     -> (k1 ~> k2 ~> k3 ~> k4 ~> k5 ~> k6 ~> k7))
-type TyCon7 = (TyCon :: (k1 -> k2 -> k3 -> k4 -> k5 -> k6 -> k7 -> k8)
-                     -> (k1 ~> k2 ~> k3 ~> k4 ~> k5 ~> k6 ~> k7 ~> k8))
-type TyCon8 = (TyCon :: (k1 -> k2 -> k3 -> k4 -> k5 -> k6 -> k7 -> k8 -> k9)
-                     -> (k1 ~> k2 ~> k3 ~> k4 ~> k5 ~> k6 ~> k7 ~> k8 ~> k9))
+type TyCon2 :: (k1 -> k2 -> k3) -> (k1 ~> k2 ~> k3)
+type TyCon2 = TyCon
 
+type TyCon3 :: (k1 -> k2 -> k3 -> k4) -> (k1 ~> k2 ~> k3 ~> k4)
+type TyCon3 = TyCon
+
+type TyCon4 :: (k1 -> k2 -> k3 -> k4 -> k5) -> (k1 ~> k2 ~> k3 ~> k4 ~> k5)
+type TyCon4 = TyCon
+
+type TyCon5 :: (k1 -> k2 -> k3 -> k4 -> k5 -> k6)
+            -> (k1 ~> k2 ~> k3 ~> k4 ~> k5 ~> k6)
+type TyCon5 = TyCon
+
+type TyCon6 :: (k1 -> k2 -> k3 -> k4 -> k5 -> k6 -> k7)
+            -> (k1 ~> k2 ~> k3 ~> k4 ~> k5 ~> k6 ~> k7)
+type TyCon6 = TyCon
+
+type TyCon7 :: (k1 -> k2 -> k3 -> k4 -> k5 -> k6 -> k7 -> k8)
+            -> (k1 ~> k2 ~> k3 ~> k4 ~> k5 ~> k6 ~> k7 ~> k8)
+type TyCon7 = TyCon
+
+type TyCon8 :: (k1 -> k2 -> k3 -> k4 -> k5 -> k6 -> k7 -> k8 -> k9)
+            -> (k1 ~> k2 ~> k3 ~> k4 ~> k5 ~> k6 ~> k7 ~> k8 ~> k9)
+type TyCon8 = TyCon
+
 ----------------------------------------------------------------------
 ---- Defunctionalized Sing instance and utilities --------------------
 ----------------------------------------------------------------------
 
-newtype SLambda (f :: k1 ~> k2) =
+type SLambda :: (k1 ~> k2) -> Type
+newtype SLambda f =
   SLambda { applySing :: forall t. Sing t -> Sing (f @@ t) }
 type instance Sing = SLambda
 
@@ -382,6 +420,7 @@
           lam :: forall (t :: k1). Sing t -> Sing (f @@ t)
           lam x = withSomeSing (f (fromSing x)) (\(r :: Sing res) -> unsafeCoerce r)
 
+type SingFunction1 :: (a1 ~> b) -> Type
 type SingFunction1 f = forall t. Sing t -> Sing (f @@ t)
 
 -- | Use this function when passing a function on singletons as
@@ -396,31 +435,50 @@
 singFun1 :: forall f. SingFunction1 f -> Sing f
 singFun1 f = SLambda f
 
-type SingFunction2 f = forall t. Sing t -> SingFunction1 (f @@ t)
+type SingFunction2 :: (a1 ~> a2 ~> b) -> Type
+type SingFunction2 f = forall t1 t2. Sing t1 -> Sing t2 -> Sing (f @@ t1 @@ t2)
 singFun2 :: forall f. SingFunction2 f -> Sing f
 singFun2 f = SLambda (\x -> singFun1 (f x))
 
-type SingFunction3 f = forall t. Sing t -> SingFunction2 (f @@ t)
+type SingFunction3 :: (a1 ~> a2 ~> a3 ~> b) -> Type
+type SingFunction3 f = forall t1 t2 t3.
+                       Sing t1 -> Sing t2 -> Sing t3
+                    -> Sing (f @@ t1 @@ t2 @@ t3)
 singFun3 :: forall f. SingFunction3 f -> Sing f
 singFun3 f = SLambda (\x -> singFun2 (f x))
 
-type SingFunction4 f = forall t. Sing t -> SingFunction3 (f @@ t)
+type SingFunction4 :: (a1 ~> a2 ~> a3 ~> a4 ~> b) -> Type
+type SingFunction4 f = forall t1 t2 t3 t4.
+                       Sing t1 -> Sing t2 -> Sing t3 -> Sing t4
+                    -> Sing (f @@ t1 @@ t2 @@ t3 @@ t4)
 singFun4 :: forall f. SingFunction4 f -> Sing f
 singFun4 f = SLambda (\x -> singFun3 (f x))
 
-type SingFunction5 f = forall t. Sing t -> SingFunction4 (f @@ t)
+type SingFunction5 :: (a1 ~> a2 ~> a3 ~> a4 ~> a5 ~> b) -> Type
+type SingFunction5 f = forall t1 t2 t3 t4 t5.
+                       Sing t1 -> Sing t2 -> Sing t3 -> Sing t4 -> Sing t5
+                    -> Sing (f @@ t1 @@ t2 @@ t3 @@ t4 @@ t5)
 singFun5 :: forall f. SingFunction5 f -> Sing f
 singFun5 f = SLambda (\x -> singFun4 (f x))
 
-type SingFunction6 f = forall t. Sing t -> SingFunction5 (f @@ t)
+type SingFunction6 :: (a1 ~> a2 ~> a3 ~> a4 ~> a5 ~> a6 ~> b) -> Type
+type SingFunction6 f = forall t1 t2 t3 t4 t5 t6.
+                       Sing t1 -> Sing t2 -> Sing t3 -> Sing t4 -> Sing t5 -> Sing t6
+                    -> Sing (f @@ t1 @@ t2 @@ t3 @@ t4 @@ t5 @@ t6)
 singFun6 :: forall f. SingFunction6 f -> Sing f
 singFun6 f = SLambda (\x -> singFun5 (f x))
 
-type SingFunction7 f = forall t. Sing t -> SingFunction6 (f @@ t)
+type SingFunction7 :: (a1 ~> a2 ~> a3 ~> a4 ~> a5 ~> a6 ~> a7 ~> b) -> Type
+type SingFunction7 f = forall t1 t2 t3 t4 t5 t6 t7.
+                       Sing t1 -> Sing t2 -> Sing t3 -> Sing t4 -> Sing t5 -> Sing t6 -> Sing t7
+                    -> Sing (f @@ t1 @@ t2 @@ t3 @@ t4 @@ t5 @@ t6 @@ t7)
 singFun7 :: forall f. SingFunction7 f -> Sing f
 singFun7 f = SLambda (\x -> singFun6 (f x))
 
-type SingFunction8 f = forall t. Sing t -> SingFunction7 (f @@ t)
+type SingFunction8 :: (a1 ~> a2 ~> a3 ~> a4 ~> a5 ~> a6 ~> a7 ~> a8 ~> b) -> Type
+type SingFunction8 f = forall t1 t2 t3 t4 t5 t6 t7 t8.
+                       Sing t1 -> Sing t2 -> Sing t3 -> Sing t4 -> Sing t5 -> Sing t6 -> Sing t7 -> Sing t8
+                    -> Sing (f @@ t1 @@ t2 @@ t3 @@ t4 @@ t5 @@ t6 @@ t7 @@ t8)
 singFun8 :: forall f. SingFunction8 f -> Sing f
 singFun8 f = SLambda (\x -> singFun7 (f x))
 
diff --git a/src/Data/Singletons/Names.hs b/src/Data/Singletons/Names.hs
--- a/src/Data/Singletons/Names.hs
+++ b/src/Data/Singletons/Names.hs
@@ -170,68 +170,6 @@
 mkTupleDataName n = mk_name_d "Data.Singletons.Prelude.Instances" $
                     "STuple" ++ (show n)
 
--- used when a value name appears in a pattern context
--- works only for proper variables (lower-case names)
-promoteValNameLhs :: Name -> Name
-promoteValNameLhs = promoteValNameLhsPrefix noPrefix
-
--- like promoteValNameLhs, but adds a prefix to the promoted name
-promoteValNameLhsPrefix :: (String, String) -> Name -> Name
-promoteValNameLhsPrefix pres@(alpha, _) n
-    -- We can't promote promote idenitifers beginning with underscores to
-    -- type names, so we work around the issue by prepending "US" at the
-    -- front of the name (#229).
-  | Just (us, rest) <- splitUnderscores (nameBase n)
-  = mkName $ alpha ++ "US" ++ us ++ rest
-
-  | otherwise
-  = mkName $ toUpcaseStr pres n
-
--- used when a value name appears in an expression context
--- works for both variables and datacons
-promoteValRhs :: Name -> DType
-promoteValRhs name
-  | name == nilName
-  = DConT nilName   -- workaround for #21
-
-  | otherwise
-  = DConT $ promoteTySym name 0
-
--- generates type-level symbol for a given name. Int parameter represents
--- saturation: 0 - no parameters passed to the symbol, 1 - one parameter
--- passed to the symbol, and so on. Works on both promoted and unpromoted
--- names.
-promoteTySym :: Name -> Int -> Name
-promoteTySym name sat
-      -- We can't promote promote idenitifers beginning with underscores to
-      -- type names, so we work around the issue by prepending "US" at the
-      -- front of the name (#229).
-    | Just (us, rest) <- splitUnderscores (nameBase name)
-    = default_case (mkName $ "US" ++ us ++ rest)
-
-    | name == nilName
-    = mkName $ "NilSym" ++ (show sat)
-
-       -- treat unboxed tuples like tuples
-    | Just degree <- tupleNameDegree_maybe name `mplus`
-                     unboxedTupleNameDegree_maybe name
-    = mk_name_tc "Data.Singletons.Prelude.Instances" $
-                 "Tuple" ++ show degree ++ "Sym" ++ (show sat)
-
-    | otherwise
-    = default_case name
-  where
-    default_case :: Name -> Name
-    default_case name' =
-      let capped = toUpcaseStr noPrefix name' in
-      if isHsLetter (head capped)
-      then mkName (capped ++ "Sym" ++ (show sat))
-      else mkName (capped ++ "@#@" -- See Note [Defunctionalization symbol suffixes]
-                          ++ (replicate (sat + 1) '$'))
-
-promoteClassName :: Name -> Name
-promoteClassName = prefixName "P" "#"
-
 mkTyName :: Quasi q => Name -> q Name
 mkTyName tmName = do
   let nameStr  = nameBase tmName
@@ -241,47 +179,9 @@
 mkTyConName :: Int -> Name
 mkTyConName i = mk_name_tc "Data.Singletons.Internal" $ "TyCon" ++ show i
 
-falseTySym :: DType
-falseTySym = promoteValRhs falseName
-
-trueTySym :: DType
-trueTySym = promoteValRhs trueName
-
 boolKi :: DKind
 boolKi = DConT boolName
 
-andTySym :: DType
-andTySym = promoteValRhs andName
-
--- Singletons
-
-singDataConName :: Name -> Name
-singDataConName nm
-  | nm == nilName                                  = snilName
-  | nm == consName                                 = sconsName
-  | Just degree <- tupleNameDegree_maybe nm        = mkTupleDataName degree
-  | Just degree <- unboxedTupleNameDegree_maybe nm = mkTupleDataName degree
-  | otherwise                                      = prefixConName "S" "%" nm
-
-singTyConName :: Name -> Name
-singTyConName name
-  | name == listName                                 = sListName
-  | Just degree <- tupleNameDegree_maybe name        = mkTupleTypeName degree
-  | Just degree <- unboxedTupleNameDegree_maybe name = mkTupleTypeName degree
-  | otherwise                                        = prefixName "S" "%" name
-
-singClassName :: Name -> Name
-singClassName = singTyConName
-
-singValName :: Name -> Name
-singValName n
-     -- Push the 's' past the underscores, as this lets us avoid some unused
-     -- variable warnings (#229).
-  | Just (us, rest) <- splitUnderscores (nameBase n)
-  = prefixName (us ++ "s") "%" $ mkName rest
-  | otherwise
-  = prefixName "s" "%" $ upcase n
-
 singFamily :: DType
 singFamily = DConT singFamilyName
 
@@ -320,7 +220,9 @@
 modifyConNameDType :: (Name -> Name) -> DType -> DType
 modifyConNameDType mod_con_name = go
   where
-    go (DForallT tvbs cxt p) = DForallT tvbs (map go cxt) (go p)
+    go :: DType -> DType
+    go (DForallT fvf tvbs p) = DForallT fvf tvbs (go p)
+    go (DConstrainedT cxt p) = DConstrainedT (map go cxt) (go p)
     go (DAppT     p t)       = DAppT     (go p) t
     go (DAppKindT p k)       = DAppKindT (go p) k
     go (DSigT     p k)       = DSigT     (go p) k
diff --git a/src/Data/Singletons/Partition.hs b/src/Data/Singletons/Partition.hs
--- a/src/Data/Singletons/Partition.hs
+++ b/src/Data/Singletons/Partition.hs
@@ -27,6 +27,7 @@
 import Data.Singletons.Deriving.Traversable
 import Data.Singletons.Deriving.Util
 import Data.Singletons.Names
+import Data.Singletons.TH.Options
 import Language.Haskell.TH.Syntax hiding (showName)
 import Language.Haskell.TH.Ppr
 import Language.Haskell.TH.Desugar
@@ -54,19 +55,19 @@
 
 instance Semigroup PartitionedDecs where
   PDecs a1 b1 c1 d1 e1 f1 g1 h1 i1 <> PDecs a2 b2 c2 d2 e2 f2 g2 h2 i2 =
-    PDecs (a1 <> a2) (b1 <> b2) (c1 <> c2) (d1 <> d2) (e1 <> e2) (f1 <> f2)
-          (g1 <> g2) (h1 <> h2) (i1 <> i2)
+    PDecs (a1 <> a2) (b1 <> b2) (c1 <> c2) (d1 <> d2) (e1 <> e2)
+          (f1 <> f2) (g1 <> g2) (h1 <> h2) (i1 <> i2)
 
 instance Monoid PartitionedDecs where
-  mempty = PDecs [] [] [] [] [] [] [] [] []
-  mappend = (<>)
+  mempty = PDecs mempty mempty mempty mempty mempty
+                 mempty mempty mempty mempty
 
 -- | Split up a @[DDec]@ into its pieces, extracting 'Ord' instances
 -- from deriving clauses
-partitionDecs :: DsMonad m => [DDec] -> m PartitionedDecs
+partitionDecs :: OptionsMonad m => [DDec] -> m PartitionedDecs
 partitionDecs = concatMapM partitionDec
 
-partitionDec :: DsMonad m => DDec -> m PartitionedDecs
+partitionDec :: OptionsMonad m => DDec -> m PartitionedDecs
 partitionDec (DLetDec (DPragmaD {})) = return mempty
 partitionDec (DLetDec letdec) = return $ mempty { pd_let_decs = [letdec] }
 
@@ -99,8 +100,8 @@
                                                , cd_name      = name
                                                , cd_tvbs      = tvbs
                                                , cd_fds       = fds
-                                               , cd_lde       = lde }]
-                  , pd_open_type_family_decs = otfs }
+                                               , cd_lde       = lde
+                                               , cd_atfs      = otfs}] }
 partitionDec (DInstanceD _ _ cxt ty decs) = do
   (defns, sigs) <- liftM (bimap catMaybes mconcat) $
                    mapAndUnzipM partitionInstanceDec decs
@@ -128,6 +129,9 @@
 partitionDec (DTySynInstD {}) = pure mempty
   -- There's no need to track type family instances, since
   -- we already record the type family itself separately.
+partitionDec (DKiSigD {}) = pure mempty
+  -- There's no need to track standalone kind signatures, since we use
+  -- dsReifyType to look them up.
 partitionDec (DStandaloneDerivD mb_strat _ ctxt ty) =
   case unfoldDType ty of
     (cls_pred_ty, cls_tys)
@@ -194,7 +198,7 @@
   fail "Only method bodies can be promoted within an instance."
 
 partitionDeriving
-  :: forall m. DsMonad m
+  :: forall m. OptionsMonad m
   => Maybe DDerivStrategy
                 -- ^ The deriving strategy, if present.
   -> DPred      -- ^ The class being derived (e.g., 'Eq'), possibly applied to
@@ -312,4 +316,9 @@
 1. Other uses of type synonyms in singled code will be expanded away.
 2. Other uses of type families in singled code are unlikely to work at present
    due to Trac #12564.
+3. We track open type families, closed type families, and associated type
+   families separately, as each form of type family has different kind
+   inference behavior. See defunTopLevelTypeDecls and
+   defunAssociatedTypeFamilies in D.S.Promote.Defun for how these differences
+   manifest.
 -}
diff --git a/src/Data/Singletons/Prelude/Applicative.hs b/src/Data/Singletons/Prelude/Applicative.hs
--- a/src/Data/Singletons/Prelude/Applicative.hs
+++ b/src/Data/Singletons/Prelude/Applicative.hs
@@ -5,6 +5,7 @@
 {-# LANGUAGE InstanceSigs #-}
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -28,7 +29,7 @@
 module Data.Singletons.Prelude.Applicative (
   PApplicative(..), SApplicative(..),
   PAlternative(..), SAlternative(..),
-  Sing, SConst(..), Const, GetConst,
+  Sing, SConst(..), Const, GetConst, sGetConst,
   type (<$>), (%<$>), type (<$), (%<$), type (<**>), (%<**>),
   LiftA, sLiftA, LiftA3, sLiftA3, Optional, sOptional,
 
diff --git a/src/Data/Singletons/Prelude/Base.hs b/src/Data/Singletons/Prelude/Base.hs
--- a/src/Data/Singletons/Prelude/Base.hs
+++ b/src/Data/Singletons/Prelude/Base.hs
@@ -1,6 +1,7 @@
 {-# LANGUAGE TemplateHaskell, TypeOperators, DataKinds, PolyKinds,
              ScopedTypeVariables, TypeFamilies, GADTs,
-             UndecidableInstances, BangPatterns, TypeApplications #-}
+             UndecidableInstances, BangPatterns, TypeApplications,
+             StandaloneKindSignatures #-}
 
 -----------------------------------------------------------------------------
 -- |
@@ -108,9 +109,3 @@
   seq _ x = x
   infixr 0 `seq`
  |])
-
--- Workaround for #326
-infixr 5 ++
-infixr 9 .
-infixr 0 $
-infixr 0 $!
diff --git a/src/Data/Singletons/Prelude/Bool.hs b/src/Data/Singletons/Prelude/Bool.hs
--- a/src/Data/Singletons/Prelude/Bool.hs
+++ b/src/Data/Singletons/Prelude/Bool.hs
@@ -1,6 +1,6 @@
 {-# LANGUAGE TemplateHaskell, TypeApplications, TypeFamilies, TypeOperators,
              GADTs, ScopedTypeVariables, DeriveDataTypeable, UndecidableInstances,
-             DataKinds, PolyKinds #-}
+             DataKinds, PolyKinds, StandaloneKindSignatures #-}
 
 -----------------------------------------------------------------------------
 -- |
diff --git a/src/Data/Singletons/Prelude/Const.hs b/src/Data/Singletons/Prelude/Const.hs
--- a/src/Data/Singletons/Prelude/Const.hs
+++ b/src/Data/Singletons/Prelude/Const.hs
@@ -4,6 +4,7 @@
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -26,7 +27,7 @@
 
 module Data.Singletons.Prelude.Const (
   -- * The 'Const' singleton
-  Sing, SConst(..), GetConst,
+  Sing, SConst(..), GetConst, sGetConst,
 
   -- * Defunctionalization symbols
   ConstSym0, ConstSym1,
@@ -54,10 +55,10 @@
 
 {-
 Const's argument `b` is poly-kinded, and as a result, we have a choice as to
-what Sing instance to give it. We could use either
+what singleton type to give it. We could use either
 
-1. data instance Sing :: forall (k :: Type) (a :: Type) (b :: k).    Const a b -> Type
-2. data instance Sing :: forall             (a :: Type) (b :: Type). Const a b -> Type
+1. type SConst :: forall {k :: Type} (a :: Type) (b :: k).    Const a b -> Type
+2. type SConst :: forall             (a :: Type) (b :: Type). Const a b -> Type
 
 Option (1) is the more permissive one, so we opt for that. However, singletons'
 TH machinery does not jive with this option, since the SingKind instance it
@@ -67,11 +68,12 @@
     type Demote (Const a b) = Const (Demote a) (Demote b)
 
 Assumes that `b` is of kind Type. Until we get a more reliable story for
-poly-kinded Sing instances (see #150), we simply write the Sing instance by
+poly-kinded Sing instances (see #150), we simply write the singleton type by
 hand.
 -}
-data SConst :: forall (k :: Type) (a :: Type) (b :: k). Const a b -> Type where
-  SConst :: { sGetConst :: Sing a } -> SConst ('Const a)
+type SConst :: Const a b -> Type
+data SConst c where
+  SConst :: Sing a -> SConst ('Const a)
 type instance Sing = SConst
 instance SingKind a => SingKind (Const a b) where
   type Demote (Const a b) = Const (Demote a) b
@@ -84,12 +86,10 @@
 instance SingI ConstSym0 where
   sing = singFun1 SConst
 
-$(singletons [d|
-  type family GetConst (x :: Const a b) :: a where
-    GetConst ('Const x) = x
-  |])
-
 $(singletonsOnly [d|
+  getConst :: Const a b -> a
+  getConst (Const x) = x
+
   deriving instance Bounded a => Bounded (Const a b)
   deriving instance Eq      a => Eq      (Const a b)
   deriving instance Ord     a => Ord     (Const a b)
diff --git a/src/Data/Singletons/Prelude/Either.hs b/src/Data/Singletons/Prelude/Either.hs
--- a/src/Data/Singletons/Prelude/Either.hs
+++ b/src/Data/Singletons/Prelude/Either.hs
@@ -1,6 +1,6 @@
 {-# LANGUAGE TemplateHaskell, ScopedTypeVariables, TypeFamilies, GADTs,
              RankNTypes, UndecidableInstances, DataKinds, PolyKinds,
-             TypeApplications #-}
+             TypeApplications, StandaloneKindSignatures #-}
 
 -----------------------------------------------------------------------------
 -- |
diff --git a/src/Data/Singletons/Prelude/Enum.hs b/src/Data/Singletons/Prelude/Enum.hs
--- a/src/Data/Singletons/Prelude/Enum.hs
+++ b/src/Data/Singletons/Prelude/Enum.hs
@@ -1,7 +1,7 @@
 {-# LANGUAGE TemplateHaskell, DataKinds, PolyKinds, ScopedTypeVariables,
              TypeFamilies, TypeOperators, GADTs, UndecidableInstances,
              FlexibleContexts, DefaultSignatures, BangPatterns,
-             InstanceSigs, TypeApplications #-}
+             InstanceSigs, TypeApplications, StandaloneKindSignatures #-}
 
 -----------------------------------------------------------------------------
 -- |
diff --git a/src/Data/Singletons/Prelude/Eq.hs b/src/Data/Singletons/Prelude/Eq.hs
--- a/src/Data/Singletons/Prelude/Eq.hs
+++ b/src/Data/Singletons/Prelude/Eq.hs
@@ -1,7 +1,7 @@
 {-# LANGUAGE TypeOperators, DataKinds, PolyKinds, TypeFamilies,
              RankNTypes, FlexibleContexts, TemplateHaskell,
              UndecidableInstances, GADTs, DefaultSignatures,
-             ScopedTypeVariables, TypeApplications #-}
+             ScopedTypeVariables, TypeApplications, StandaloneKindSignatures #-}
 
 -----------------------------------------------------------------------------
 -- |
@@ -26,6 +26,7 @@
   DefaultEqSym0, DefaultEqSym1, DefaultEqSym2
   ) where
 
+import Data.Kind
 import Data.Singletons.Internal
 import Data.Singletons.Prelude.Bool
 import Data.Singletons.Single
@@ -39,6 +40,7 @@
 
 -- | The promoted analogue of 'Eq'. If you supply no definition for '(==)',
 -- then it defaults to a use of 'DefaultEq'.
+type PEq :: Type -> Constraint
 class PEq a where
   type (==) (x :: a) (y :: a) :: Bool
   type (/=) (x :: a) (y :: a) :: Bool
@@ -56,7 +58,8 @@
 -- @a == a@ does not reduce to 'True' for every @a@, but @'DefaultEq' a a@
 -- /does/ reduce to 'True' for every @a@. The latter behavior is more desirable
 -- for @singletons@' purposes, so we use it instead of '(DTE.==)'.
-type family DefaultEq (a :: k) (b :: k) :: Bool where
+type DefaultEq :: k -> k -> Bool
+type family DefaultEq a b where
   DefaultEq a a = 'True
   DefaultEq a b = 'False
 
@@ -64,6 +67,7 @@
 
 -- | The singleton analogue of 'Eq'. Unlike the definition for 'Eq', it is required
 -- that instances define a body for '(%==)'. You may also supply a body for '(%/=)'.
+type SEq :: Type -> Constraint
 class SEq k where
   -- | Boolean equality on singletons
   (%==) :: forall (a :: k) (b :: k). Sing a -> Sing b -> Sing (a == b)
diff --git a/src/Data/Singletons/Prelude/Foldable.hs b/src/Data/Singletons/Prelude/Foldable.hs
--- a/src/Data/Singletons/Prelude/Foldable.hs
+++ b/src/Data/Singletons/Prelude/Foldable.hs
@@ -6,6 +6,7 @@
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -101,7 +102,7 @@
 import Data.Kind
 import Data.List.NonEmpty (NonEmpty(..))
 import Data.Monoid hiding (All(..), Any(..), Endo(..), Product(..), Sum(..))
-import qualified Data.Monoid as Monoid (All(..), Any(..), Product(..), Sum(..))
+import qualified Data.Monoid as Monoid (Product(..), Sum(..))
 import Data.Singletons.Internal
 import Data.Singletons.Prelude.Base
   hiding (Foldr, FoldrSym0, FoldrSym1, FoldrSym2, FoldrSym3, sFoldr)
@@ -126,21 +127,28 @@
   hiding ( AllSym0(..),     AllSym1,     SAll
          , AnySym0(..),     AnySym1,     SAny
          , FirstSym0,       FirstSym1,   SFirst
+         , GetFirstSym0,    sGetFirst
          , LastSym0,        LastSym1,    SLast
          , ProductSym0(..), ProductSym1, SProduct
          , SumSym0(..),     SumSym1,     SSum )
-import Data.Singletons.Promote
+import Data.Singletons.Prelude.Semigroup.Internal.Disambiguation
 import Data.Singletons.Single
 import Data.Singletons.TypeLits.Internal
 
+type Endo :: Type -> Type
 newtype Endo a = Endo (a ~> a)
-data SEndo :: forall a. Endo a -> Type where
+type SEndo :: Endo a -> Type
+data SEndo e where
   SEndo :: Sing x -> SEndo ('Endo x)
 type instance Sing = SEndo
-data EndoSym0 :: forall a. (a ~> a) ~> Endo a
+type EndoSym0 :: (a ~> a) ~> Endo a
+data EndoSym0 tf
 type instance Apply EndoSym0 x = 'Endo x
 
 $(singletonsOnly [d|
+  appEndo :: Endo a -> (a -> a)
+  appEndo (Endo x) = x
+
   instance Semigroup (Endo a) where
           Endo x <> Endo y = Endo (x . y)
 
@@ -148,17 +156,10 @@
           mempty = Endo id
   |])
 
-newtype MaxInternal a = MaxInternal (Maybe a)
-data SMaxInternal :: forall a. MaxInternal a -> Type where
-  SMaxInternal :: Sing x -> SMaxInternal ('MaxInternal x)
-type instance Sing = SMaxInternal
-$(genDefunSymbols [''MaxInternal])
-
-newtype MinInternal a = MinInternal (Maybe a)
-data SMinInternal :: forall a. MinInternal a -> Type where
-  SMinInternal :: Sing x -> SMinInternal ('MinInternal x)
-type instance Sing = SMinInternal
-$(genDefunSymbols [''MinInternal])
+$(singletons [d|
+  newtype MaxInternal a = MaxInternal { getMaxInternal :: Maybe a }
+  newtype MinInternal a = MinInternal { getMinInternal :: Maybe a }
+  |])
 
 $(singletonsOnly [d|
   instance Ord a => Semigroup (MaxInternal a) where
@@ -227,7 +228,7 @@
   --
   -- > foldMap f . fmap g = foldMap (f . g)
 
-  class Foldable (t :: Type -> Type) where
+  class Foldable t where
       -- {-# MINIMAL foldMap | foldr #-}
 
       -- -| Combine the elements of a structure using a monoid.
@@ -257,8 +258,7 @@
       -- @foldr f z = 'List.foldr' f z . 'toList'@
       --
       foldr :: (a -> b -> b) -> b -> t a -> b
-      foldr f z t = case foldMap (Endo . f) t of
-                      Endo g -> g z
+      foldr f z t = appEndo (foldMap (Endo . f) t) z
 
       -- -| Right-associative fold of a structure, but with strict application of
       -- the operator.
@@ -293,8 +293,7 @@
       -- @foldl f z = 'List.foldl' f z . 'toList'@
       --
       foldl :: (b -> a -> b) -> b -> t a -> b
-      foldl f z t = case foldMap (Dual . Endo . flip f) t of
-                      Dual (Endo g) -> g z
+      foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z
       -- There's no point mucking around with coercions here,
       -- because flip forces us to build a new function anyway.
 
@@ -361,26 +360,28 @@
 
       -- -| The largest element of a non-empty structure.
       maximum :: forall a . Ord a => t a -> a
-      maximum x =
-        case foldMap (MaxInternal . Just) x of
-          MaxInternal y -> fromMaybe (errorWithoutStackTrace "maximum: empty structure") y
+      maximum = fromMaybe (errorWithoutStackTrace "maximum: empty structure") .
+       getMaxInternal . foldMap (MaxInternal . mkJust)
+        where
+          mkJust :: a -> Maybe a
+          mkJust = Just
 
       -- -| The least element of a non-empty structure.
       minimum :: forall a . Ord a => t a -> a
-      minimum x =
-        case foldMap (MinInternal . Just) x of
-          MinInternal y -> fromMaybe (errorWithoutStackTrace "minimum: empty structure") y
+      minimum = fromMaybe (errorWithoutStackTrace "minimum: empty structure") .
+       getMinInternal . foldMap (MinInternal . mkJust)
+        where
+          mkJust :: a -> Maybe a
+          mkJust = Just
 
       -- -| The 'sum' function computes the sum of the numbers of a structure.
       sum :: Num a => t a -> a
-      sum x = case foldMap sum_ x of
-                Monoid.Sum y -> y
+      sum = getSum . foldMap sum_
 
       -- -| The 'product' function computes the product of the numbers of a
       -- structure.
       product :: Num a => t a -> a
-      product x = case foldMap product_ x of
-                    Monoid.Product y -> y
+      product = getProduct . foldMap product_
 
   -- instances for Prelude types
 
@@ -445,58 +446,88 @@
 
       null             = isLeft
 
+  instance Foldable Proxy where
+      foldMap _ _ = mempty
+      fold _ = mempty
+      foldr _ z _ = z
+      foldl _ z _ = z
+      foldl1 _ _ = errorWithoutStackTrace "foldl1: Proxy"
+      foldr1 _ _ = errorWithoutStackTrace "foldr1: Proxy"
+
+      -- Why do we give length (and null) an instance signature here? If we
+      -- didn't, singletons would generate one for us when singling it:
+      --
+      --    instance SFoldable Proxy where
+      --      sLength :: forall a (x :: Proxy a). Sing x -> Sing (Length x)
+      --      sLength = ...
+      --
+      -- If you squint, you'll notice that that instance signature is actually
+      -- /too/ general. This is because GHC will infer that `a` should be
+      -- kind-polymorphic, but Length is only defined when `a` is of kind
+      -- `Type`! Ugh. To force GHC to come to its senses, we explicitly inform
+      -- it that `a :: Type` through our own instance signature.
+      length :: forall (a :: Type). Proxy a -> Nat
+      length _   = 0
+
+      null :: forall (a :: Type). Proxy a -> Bool
+      null _     = True
+
+      elem _ _   = False
+      sum _      = 0
+      product _  = 1
+
   instance Foldable Dual where
       foldMap f (Dual x)  = f x
 
-      elem x (Dual y)     = x == y
+      elem                = (. getDual) . (==)
       foldl f z (Dual x)  = f z x
       foldl' f z (Dual x) = f z x
-      foldl1 _ (Dual x)   = x
+      foldl1 _            = getDual
       foldr f z (Dual x)  = f x z
       foldr'              = foldr
-      foldr1 _ (Dual x)   = x
+      foldr1 _            = getDual
       length _            = 1
-      maximum (Dual x)    = x
-      minimum (Dual x)    = x
+      maximum             = getDual
+      minimum             = getDual
       null _              = False
-      product (Dual x)    = x
-      sum (Dual x)        = x
+      product             = getDual
+      sum                 = getDual
       toList (Dual x)     = [x]
 
   instance Foldable Monoid.Sum where
       foldMap f (Monoid.Sum x)  = f x
 
-      elem x (Monoid.Sum y)     = x == y
+      elem                      = (. getSum) . (==)
       foldl f z (Monoid.Sum x)  = f z x
       foldl' f z (Monoid.Sum x) = f z x
-      foldl1 _ (Monoid.Sum x)   = x
+      foldl1 _                  = getSum
       foldr f z (Monoid.Sum x)  = f x z
       foldr'                    = foldr
-      foldr1 _ (Monoid.Sum x)   = x
+      foldr1 _                  = getSum
       length _                  = 1
-      maximum (Monoid.Sum x)    = x
-      minimum (Monoid.Sum x)    = x
+      maximum                   = getSum
+      minimum                   = getSum
       null _                    = False
-      product (Monoid.Sum x)    = x
-      sum (Monoid.Sum x)        = x
+      product                   = getSum
+      sum                       = getSum
       toList (Monoid.Sum x)     = [x]
 
   instance Foldable Monoid.Product where
       foldMap f (Monoid.Product x)  = f x
 
-      elem x (Monoid.Product y)     = x == y
+      elem                          = (. getProduct) . (==)
       foldl f z (Monoid.Product x)  = f z x
       foldl' f z (Monoid.Product x) = f z x
-      foldl1 _ (Monoid.Product x)   = x
+      foldl1 _                      = getProduct
       foldr f z (Monoid.Product x)  = f x z
-      foldr'              = foldr
-      foldr1 _ (Monoid.Product x)   = x
-      length _            = 1
-      maximum (Monoid.Product x)    = x
-      minimum (Monoid.Product x)    = x
-      null _              = False
-      product (Monoid.Product x)    = x
-      sum (Monoid.Product x)        = x
+      foldr'                        = foldr
+      foldr1 _                      = getProduct
+      length _                      = 1
+      maximum                       = getProduct
+      minimum                       = getProduct
+      null _                        = False
+      product                       = getProduct
+      sum                           = getProduct
       toList (Monoid.Product x)     = [x]
 
   -- -| Monadic fold over the elements of a structure,
@@ -587,25 +618,21 @@
   -- result to be 'True', the container must be finite; 'False', however,
   -- results from a 'False' value finitely far from the left end.
   and :: Foldable t => t Bool -> Bool
-  and x = case foldMap all_ x of
-            Monoid.All y -> y
+  and = getAll . foldMap all_
 
   -- -| 'or' returns the disjunction of a container of Bools.  For the
   -- result to be 'False', the container must be finite; 'True', however,
   -- results from a 'True' value finitely far from the left end.
   or :: Foldable t => t Bool -> Bool
-  or x = case foldMap any_ x of
-           Monoid.Any y -> y
+  or = getAny . foldMap any_
 
   -- -| Determines whether any element of the structure satisfies the predicate.
   any :: Foldable t => (a -> Bool) -> t a -> Bool
-  any p x = case foldMap (any_ . p) x of
-              Monoid.Any y -> y
+  any p = getAny . foldMap (any_ . p)
 
   -- -| Determines whether all elements of the structure satisfy the predicate.
   all :: Foldable t => (a -> Bool) -> t a -> Bool
-  all p x = case foldMap (all_ . p) x of
-              Monoid.All y -> y
+  all p = getAll . foldMap (all_ . p)
 
   -- -| The largest element of a non-empty structure with respect to the
   -- given comparison function.
@@ -637,8 +664,7 @@
   -- the leftmost element of the structure matching the predicate, or
   -- 'Nothing' if there is no such element.
   find :: Foldable t => (a -> Bool) -> t a -> Maybe a
-  find p y = case foldMap (\ x -> First (if p x then Just x else Nothing)) y of
-               First z -> z
+  find p = getFirst . foldMap (\ x -> First (if p x then Just x else Nothing))
   |])
 
 $(singletonsOnly [d|
diff --git a/src/Data/Singletons/Prelude/Function.hs b/src/Data/Singletons/Prelude/Function.hs
--- a/src/Data/Singletons/Prelude/Function.hs
+++ b/src/Data/Singletons/Prelude/Function.hs
@@ -19,7 +19,8 @@
 
 {-# LANGUAGE TemplateHaskell, ScopedTypeVariables, TypeFamilies,
              TypeOperators, UndecidableInstances, GADTs,
-             DataKinds, PolyKinds, TypeApplications #-}
+             DataKinds, PolyKinds, TypeApplications,
+             StandaloneKindSignatures #-}
 
 module Data.Singletons.Prelude.Function (
     -- * "Prelude" re-exports
@@ -114,6 +115,3 @@
   x & f = f x
   infixl 1 &
   |])
-
--- Workaround for #326
-infixl 1 &
diff --git a/src/Data/Singletons/Prelude/Functor.hs b/src/Data/Singletons/Prelude/Functor.hs
--- a/src/Data/Singletons/Prelude/Functor.hs
+++ b/src/Data/Singletons/Prelude/Functor.hs
@@ -6,6 +6,7 @@
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -200,8 +201,3 @@
   deriving instance Functor ((,) a)
   deriving instance Functor Down
   |])
-
--- Workaround for #326
-infixl 4 <$>
-infixl 4 $>
-infixl 1 <&>
diff --git a/src/Data/Singletons/Prelude/Identity.hs b/src/Data/Singletons/Prelude/Identity.hs
--- a/src/Data/Singletons/Prelude/Identity.hs
+++ b/src/Data/Singletons/Prelude/Identity.hs
@@ -5,6 +5,7 @@
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -26,7 +27,7 @@
 
 module Data.Singletons.Prelude.Identity (
   -- * The 'Identity' singleton
-  Sing, SIdentity(..), RunIdentity,
+  Sing, SIdentity(..), RunIdentity, sRunIdentity,
 
   -- * Defunctionalization symbols
   IdentitySym0, IdentitySym1,
diff --git a/src/Data/Singletons/Prelude/Instances.hs b/src/Data/Singletons/Prelude/Instances.hs
--- a/src/Data/Singletons/Prelude/Instances.hs
+++ b/src/Data/Singletons/Prelude/Instances.hs
@@ -11,7 +11,7 @@
 {-# LANGUAGE DataKinds, PolyKinds, RankNTypes, GADTs, TypeFamilies, EmptyCase,
              FlexibleContexts, TemplateHaskell, ScopedTypeVariables,
              UndecidableInstances, TypeOperators, FlexibleInstances,
-             TypeApplications #-}
+             TypeApplications, StandaloneKindSignatures #-}
 {-# OPTIONS_GHC -Wno-orphans #-}
 
 module Data.Singletons.Prelude.Instances (
diff --git a/src/Data/Singletons/Prelude/IsString.hs b/src/Data/Singletons/Prelude/IsString.hs
--- a/src/Data/Singletons/Prelude/IsString.hs
+++ b/src/Data/Singletons/Prelude/IsString.hs
@@ -3,6 +3,7 @@
 {-# LANGUAGE InstanceSigs #-}
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
diff --git a/src/Data/Singletons/Prelude/List.hs b/src/Data/Singletons/Prelude/List.hs
--- a/src/Data/Singletons/Prelude/List.hs
+++ b/src/Data/Singletons/Prelude/List.hs
@@ -124,8 +124,6 @@
   -- | The prefix \`@generic@\' indicates an overloaded function that
   -- is a generalized version of a "Prelude" function.
   GenericLength, sGenericLength,
-  GenericTake, GenericDrop,
-  GenericSplitAt, GenericIndex, GenericReplicate,
 
   -- * Defunctionalization symbols
   NilSym0,
@@ -245,12 +243,7 @@
   MaximumBySym0, MaximumBySym1, MaximumBySym2,
   MinimumBySym0, MinimumBySym1, MinimumBySym2,
 
-  GenericLengthSym0, GenericLengthSym1,
-  GenericTakeSym0, GenericTakeSym1, GenericTakeSym2,
-  GenericDropSym0, GenericDropSym1, GenericDropSym2,
-  GenericSplitAtSym0, GenericSplitAtSym1, GenericSplitAtSym2,
-  GenericIndexSym0, GenericIndexSym1, GenericIndexSym2,
-  GenericReplicateSym0, GenericReplicateSym1, GenericReplicateSym2,
+  GenericLengthSym0, GenericLengthSym1
   ) where
 
 import Data.Singletons.Prelude.Base
diff --git a/src/Data/Singletons/Prelude/List/Internal.hs b/src/Data/Singletons/Prelude/List/Internal.hs
--- a/src/Data/Singletons/Prelude/List/Internal.hs
+++ b/src/Data/Singletons/Prelude/List/Internal.hs
@@ -1,7 +1,7 @@
 {-# LANGUAGE TypeOperators, DataKinds, PolyKinds, TypeFamilies,
              TemplateHaskell, GADTs, UndecidableInstances, RankNTypes,
              ScopedTypeVariables, FlexibleContexts,
-             TypeApplications #-}
+             TypeApplications, StandaloneKindSignatures #-}
 {-# OPTIONS_GHC -O0 #-}
 
 -----------------------------------------------------------------------------
@@ -588,10 +588,6 @@
 
   |])
 
--- Workaround for #326
-infix 5 \\      -- This comment is necessary so CPP doesn't treat the
-infixl 9 !!
-
 -- The following functions are supported for promotion only.
 $(promoteOnly [d|
 
@@ -641,26 +637,4 @@
   zipWith7 z (a:as) (b:bs) (c:cs) (d:ds) (e:es) (f:fs) (g:gs)
                      =  z a b c d e f g : zipWith7 z as bs cs ds es fs gs
   zipWith7 _ _ _ _ _ _ _ _ = []
-
--- These functions use Integral or Num typeclass instead of Int.
---
---  genericLength, genericTake, genericDrop, genericSplitAt, genericIndex
---  genericReplicate
---
--- We provide aliases below to improve compatibility
-
-  genericTake :: (Integral i) => i -> [a] -> [a]
-  genericTake = take
-
-  genericDrop :: (Integral i) => i -> [a] -> [a]
-  genericDrop = drop
-
-  genericSplitAt :: (Integral i) => i -> [a] -> ([a], [a])
-  genericSplitAt = splitAt
-
-  genericIndex :: (Integral i) => [a] -> i -> a
-  genericIndex = (!!)
-
-  genericReplicate :: (Integral i) => i -> a -> [a]
-  genericReplicate = replicate
  |])
diff --git a/src/Data/Singletons/Prelude/List/Internal/Disambiguation.hs b/src/Data/Singletons/Prelude/List/Internal/Disambiguation.hs
--- a/src/Data/Singletons/Prelude/List/Internal/Disambiguation.hs
+++ b/src/Data/Singletons/Prelude/List/Internal/Disambiguation.hs
@@ -14,8 +14,7 @@
 
 {-# LANGUAGE TemplateHaskell, ScopedTypeVariables, TypeFamilies,
              UndecidableInstances, GADTs, DataKinds, PolyKinds,
-             TypeApplications #-}
-{-# OPTIONS_GHC -Wno-missing-signatures #-}
+             TypeApplications, StandaloneKindSignatures #-}
 
 module Data.Singletons.Prelude.List.Internal.Disambiguation where
 
@@ -26,7 +25,8 @@
 import Data.Singletons.Prelude.Num
 import Data.Singletons.Prelude.Ord
 import Data.Singletons.Prelude.Eq
-import Data.List
+import Data.List ( foldl', inits, insert, intersperse, isPrefixOf
+                 , nubBy, partition, sort, sortBy, tails, transpose )
 import GHC.TypeLits
 
 -- singletons doesn't support qualified names :(
diff --git a/src/Data/Singletons/Prelude/List/NonEmpty.hs b/src/Data/Singletons/Prelude/List/NonEmpty.hs
--- a/src/Data/Singletons/Prelude/List/NonEmpty.hs
+++ b/src/Data/Singletons/Prelude/List/NonEmpty.hs
@@ -1,6 +1,7 @@
 {-# LANGUAGE TemplateHaskell, ScopedTypeVariables, TypeOperators,
              TypeFamilies, GADTs, UndecidableInstances, InstanceSigs,
-             DataKinds, PolyKinds, TypeApplications #-}
+             DataKinds, PolyKinds, TypeApplications,
+             StandaloneKindSignatures #-}
 {-# OPTIONS_GHC -Wno-orphans #-}
 
 -----------------------------------------------------------------------------
diff --git a/src/Data/Singletons/Prelude/Maybe.hs b/src/Data/Singletons/Prelude/Maybe.hs
--- a/src/Data/Singletons/Prelude/Maybe.hs
+++ b/src/Data/Singletons/Prelude/Maybe.hs
@@ -1,6 +1,6 @@
 {-# LANGUAGE TemplateHaskell, ScopedTypeVariables, TypeFamilies,
              DataKinds, PolyKinds, UndecidableInstances, GADTs, RankNTypes,
-             TypeApplications #-}
+             TypeApplications, StandaloneKindSignatures #-}
 
 -----------------------------------------------------------------------------
 -- |
diff --git a/src/Data/Singletons/Prelude/Monad.hs b/src/Data/Singletons/Prelude/Monad.hs
--- a/src/Data/Singletons/Prelude/Monad.hs
+++ b/src/Data/Singletons/Prelude/Monad.hs
@@ -5,6 +5,7 @@
 {-# LANGUAGE InstanceSigs #-}
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -292,7 +293,3 @@
   instance Monad Down where
     Down a >>= k = k a
   |])
-
--- Workaround for #326
-infixr 1 <=<, >=>
-infixl 4 <$!>
diff --git a/src/Data/Singletons/Prelude/Monad/Fail.hs b/src/Data/Singletons/Prelude/Monad/Fail.hs
--- a/src/Data/Singletons/Prelude/Monad/Fail.hs
+++ b/src/Data/Singletons/Prelude/Monad/Fail.hs
@@ -2,6 +2,7 @@
 {-# LANGUAGE GADTs #-}
 {-# LANGUAGE InstanceSigs #-}
 {-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -27,7 +28,6 @@
   FailSym0, FailSym1
   ) where
 
-import Data.Kind
 import Data.Singletons.Prelude.Instances
 import Data.Singletons.Prelude.Monad.Internal
 import Data.Singletons.Single
@@ -53,7 +53,7 @@
   -- @
   -- fail _ = mzero
   -- @
-  class Monad m => MonadFail (m :: Type -> Type) where
+  class Monad m => MonadFail m where
       fail :: String -> m a
 
   instance MonadFail Maybe where
diff --git a/src/Data/Singletons/Prelude/Monad/Internal.hs b/src/Data/Singletons/Prelude/Monad/Internal.hs
--- a/src/Data/Singletons/Prelude/Monad/Internal.hs
+++ b/src/Data/Singletons/Prelude/Monad/Internal.hs
@@ -6,6 +6,7 @@
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -39,22 +40,11 @@
 
 import Control.Applicative
 import Control.Monad
-import Data.Kind
 import Data.List.NonEmpty (NonEmpty(..))
 import Data.Singletons.Prelude.Base
 import Data.Singletons.Prelude.Instances
 import Data.Singletons.Single
 
-{-
-Note [How to get the right kinds when promoting Functor and friends]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-To avoid running afoul of a CUSK validity check (see Note [CUSKification]),
-classes with type parameters that lack explicit kind signatures will be
-defaulted to be of kind Type. This is not what you want for Functor, however,
-since its argument is of kind (Type -> Type), so we must explicitly use this
-kind when declaring the Functor class (and other classes in this module).
--}
-
 $(singletonsOnly [d|
   infixl 4  <$
 
@@ -68,7 +58,7 @@
   satisfy these laws.
   -}
 
-  class  Functor (f :: Type -> Type)  where
+  class  Functor f  where
       fmap        :: (a -> b) -> f a -> f b
 
       -- -| Replace all locations in the input with the same value.
@@ -143,7 +133,7 @@
   --
   -- (which implies that 'pure' and '<*>' satisfy the applicative functor laws).
 
-  class Functor f => Applicative (f :: Type -> Type) where
+  class Functor f => Applicative f where
       -- {-# MINIMAL pure, ((<*>) | liftA2) #-}
       -- -| Lift a value.
       pure :: a -> f a
@@ -260,7 +250,7 @@
   The instances of 'Monad' for lists, 'Data.Maybe.Maybe' and 'System.IO.IO'
   defined in the "Prelude" satisfy these laws.
   -}
-  class Applicative m => Monad (m :: Type -> Type) where
+  class Applicative m => Monad m where
       -- -| Sequentially compose two actions, passing any value produced
       -- by the first as an argument to the second.
       (>>=)       :: forall a b. m a -> (a -> m b) -> m b
@@ -369,7 +359,7 @@
   -- -* @'some' v = (:) '<$>' v '<*>' 'many' v@
   --
   -- -* @'many' v = 'some' v '<|>' 'pure' []@
-  class Applicative f => Alternative (f :: Type -> Type) where
+  class Applicative f => Alternative f where
       -- -| The identity of '<|>'
       empty :: f a
       -- -| An associative binary operation
@@ -403,7 +393,7 @@
   -- The MonadPlus class definition
 
   -- -| Monads that also support choice and failure.
-  class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type) where
+  class (Alternative m, Monad m) => MonadPlus m where
      -- -| The identity of 'mplus'.  It should also satisfy the equations
      --
      -- > mzero >>= f  =  mzero
@@ -425,13 +415,6 @@
      mplus :: m a -> m a -> m a
      mplus = (<|>)
   |])
-
--- Workaround for #326
-infixl 4 <$
-infixl 4 <*>, <*, *>, <**>
-infixl 1 >>, >>=
-infixr 1 =<<
-infixl 3 <|>
 
 $(singletonsOnly [d|
   -------------------------------------------------------------------------------
diff --git a/src/Data/Singletons/Prelude/Monad/Zip.hs b/src/Data/Singletons/Prelude/Monad/Zip.hs
--- a/src/Data/Singletons/Prelude/Monad/Zip.hs
+++ b/src/Data/Singletons/Prelude/Monad/Zip.hs
@@ -5,6 +5,7 @@
 {-# LANGUAGE InstanceSigs #-}
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -33,10 +34,9 @@
   MunzipSym0, MunzipSym1,
   ) where
 
-import Control.Monad.Zip
 import Data.Functor.Identity
-import Data.Kind
 import Data.Monoid
+import Data.Proxy
 import Data.Singletons.Prelude.Identity
 import Data.Singletons.Prelude.Instances
 import Data.Singletons.Prelude.List
@@ -44,6 +44,7 @@
        , sZip,    sZipWith,    sUnzip )
 import Data.Singletons.Prelude.Monad.Internal
 import Data.Singletons.Prelude.Monoid ()
+import Data.Singletons.Prelude.Proxy
 import Data.Singletons.Prelude.Tuple
 import Data.Singletons.Single
 
@@ -62,7 +63,7 @@
   --   > ==>
   --   > munzip (mzip ma mb) = (ma, mb)
   --
-  class Monad m => MonadZip (m :: Type -> Type) where
+  class Monad m => MonadZip m where
       -- {-# MINIMAL mzip | mzipWith #-}
 
       mzip :: m a -> m b -> m (a,b)
@@ -104,4 +105,7 @@
 
   instance MonadZip Last where
       mzipWith = liftM2
+
+  instance MonadZip Proxy where
+      mzipWith _ _ _ = Proxy
   |])
diff --git a/src/Data/Singletons/Prelude/Monoid.hs b/src/Data/Singletons/Prelude/Monoid.hs
--- a/src/Data/Singletons/Prelude/Monoid.hs
+++ b/src/Data/Singletons/Prelude/Monoid.hs
@@ -6,6 +6,7 @@
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -33,6 +34,7 @@
   Sing, SDual(..), SAll(..), SAny(..),
   SSum(..), SProduct(..), SFirst(..), SLast(..),
   GetDual, GetAll, GetAny, GetSum, GetProduct, GetFirst, GetLast,
+  sGetDual, sGetAll, sGetAny, sGetSum, sGetProduct, sGetFirst, sGetLast,
 
   -- ** Defunctionalization symbols
   MemptySym0,
@@ -60,8 +62,8 @@
        (SFirst, SLast,
         FirstSym0, FirstSym1, FirstSym0KindInference,
         LastSym0,  LastSym1,  LastSym0KindInference,
-        GetFirst,  GetFirstSym0, GetFirstSym1, GetFirstSym0KindInference,
-        GetLast,   GetLastSym0,  GetLastSym1, GetLastSym0KindInference)
+        GetFirst, sGetFirst, GetFirstSym0, GetFirstSym1, GetFirstSym0KindInference,
+        GetLast,  sGetLast,  GetLastSym0,  GetLastSym1, GetLastSym0KindInference)
 import Data.Singletons.Prelude.Show
 import Data.Singletons.Single
 import Data.Singletons.Util
diff --git a/src/Data/Singletons/Prelude/Num.hs b/src/Data/Singletons/Prelude/Num.hs
--- a/src/Data/Singletons/Prelude/Num.hs
+++ b/src/Data/Singletons/Prelude/Num.hs
@@ -1,7 +1,7 @@
 {-# LANGUAGE TemplateHaskell, PolyKinds, DataKinds, TypeFamilies,
              TypeOperators, GADTs, ScopedTypeVariables, UndecidableInstances,
              DefaultSignatures, FlexibleContexts, InstanceSigs, NoStarIsType,
-             TypeApplications
+             TypeApplications, StandaloneKindSignatures
   #-}
 
 -----------------------------------------------------------------------------
@@ -73,6 +73,9 @@
 
       negate x            = 0 - x
 
+  subtract :: Num a => a -> a -> a
+  subtract x y = y - x
+
   -- deriving newtype instance Num a => Num (Down a)
   instance Num a => Num (Down a) where
       Down a + Down b = Down (a + b)
@@ -84,13 +87,9 @@
       fromInteger n   = Down (fromInteger n)
   |])
 
--- Workaround for #326
-infixl 6 +
-infixl 6 -
-infixl 7 *
-
 -- PNum instance
-type family SignumNat (a :: Nat) :: Nat where
+type SignumNat :: Nat -> Nat
+type family SignumNat a where
   SignumNat 0 = 0
   SignumNat x = 1
 
@@ -139,8 +138,3 @@
       Disproved _ -> unsafeCoerce (sing :: Sing 1)
 
   sFromInteger x = x
-
-$(singletonsOnly [d|
-  subtract :: Num a => a -> a -> a
-  subtract x y = y - x
-  |])
diff --git a/src/Data/Singletons/Prelude/Ord.hs b/src/Data/Singletons/Prelude/Ord.hs
--- a/src/Data/Singletons/Prelude/Ord.hs
+++ b/src/Data/Singletons/Prelude/Ord.hs
@@ -1,7 +1,8 @@
 {-# LANGUAGE TemplateHaskell, DataKinds, PolyKinds, ScopedTypeVariables,
              TypeFamilies, TypeOperators, GADTs, UndecidableInstances,
              FlexibleContexts, DefaultSignatures, InstanceSigs,
-             StandaloneDeriving, FlexibleInstances, TypeApplications #-}
+             StandaloneDeriving, FlexibleInstances, TypeApplications,
+             StandaloneKindSignatures #-}
 {-# OPTIONS_GHC -Wno-orphans #-}
 
 -----------------------------------------------------------------------------
@@ -27,7 +28,7 @@
   -- it returns its first argument.
   thenCmp, ThenCmp, sThenCmp,
 
-  Sing, SOrdering(..), SDown(..),
+  Sing, SOrdering(..), SDown(..), GetDown, sGetDown,
 
   -- ** Defunctionalization symbols
   ThenCmpSym0, ThenCmpSym1, ThenCmpSym2,
@@ -40,7 +41,8 @@
   MaxSym0, MaxSym1, MaxSym2,
   MinSym0, MinSym1, MinSym2,
   ComparingSym0, ComparingSym1, ComparingSym2, ComparingSym3,
-  DownSym0, DownSym1
+  DownSym0, DownSym1,
+  GetDownSym0, GetDownSym1
   ) where
 
 import Data.Ord (Down(..))
@@ -87,12 +89,6 @@
   comparing :: (Ord a) => (b -> a) -> b -> b -> Ordering
   comparing p x y = compare (p x) (p y)
   |])
-
--- Workaround for #326
-infix 4 <=
-infix 4 <
-infix 4 >
-infix 4 >=
 
 $(genSingletons [''Down])
 
diff --git a/src/Data/Singletons/Prelude/Ord/Disambiguation.hs b/src/Data/Singletons/Prelude/Ord/Disambiguation.hs
new file mode 100644
--- /dev/null
+++ b/src/Data/Singletons/Prelude/Ord/Disambiguation.hs
@@ -0,0 +1,38 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TypeApplications #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE UndecidableInstances #-}
+
+-----------------------------------------------------------------------------
+-- |
+-- Module      :  Data.Singletons.Prelude.Ord.Disambiguation
+-- Copyright   :  (C) 2019 Ryan Scott
+-- License     :  BSD-style (see LICENSE)
+-- Maintainer  :  Ryan Scott
+-- Stability   :  experimental
+-- Portability :  non-portable
+--
+-- Provides aliases for 'Min' and 'Max' that do not clash with the data
+-- types of the same names in Data.Singletons.Prelude.Semigroup.
+--
+----------------------------------------------------------------------------
+
+module Data.Singletons.Prelude.Ord.Disambiguation where
+
+import Data.Singletons.Prelude.Ord
+import Data.Singletons.Single
+
+-- We need these in Data.Singletons.Prelude.Semigroup, as we need to promote
+-- code that simultaneously uses the Min/Max constructors and the min/max
+-- functions, which have clashing defunctionalization symbol names. Our
+-- workaround is to simply define synonyms for min/max and use those instead.
+$(singletons [d|
+  min_, max_ :: Ord a => a -> a -> a
+  min_ = min
+  max_ = max
+  |])
diff --git a/src/Data/Singletons/Prelude/Proxy.hs b/src/Data/Singletons/Prelude/Proxy.hs
new file mode 100644
--- /dev/null
+++ b/src/Data/Singletons/Prelude/Proxy.hs
@@ -0,0 +1,162 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE InstanceSigs #-}
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TypeApplications #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE UndecidableInstances #-}
+{-# OPTIONS_GHC -Wno-orphans #-}
+
+-----------------------------------------------------------------------------
+-- |
+-- Module      :  Data.Singletons.Prelude.Proxy
+-- Copyright   :  (C) 2020 Ryan Scott
+-- License     :  BSD-style (see LICENSE)
+-- Maintainer  :  Richard Eisenberg (rae@cs.brynmawr.edu)
+-- Stability   :  experimental
+-- Portability :  non-portable
+--
+-- Exports promoted and singled versions of the definitions in "Data.Proxy".
+--
+-----------------------------------------------------------------------------
+
+module Data.Singletons.Prelude.Proxy (
+    -- * The 'Proxy' singleton
+    Sing, SProxy(..)
+  , AsProxyTypeOf, sAsProxyTypeOf
+
+    -- * Defunctionalization symbols
+  , ProxySym0
+  , AsProxyTypeOfSym0, AsProxyTypeOfSym1, AsProxyTypeOfSym2
+  ) where
+
+import Control.Applicative
+import Control.Monad
+import Data.Kind
+import Data.Proxy
+import Data.Semigroup (Semigroup(..))
+import Data.Singletons.Decide
+import Data.Singletons.Internal
+import Data.Singletons.Prelude.Base
+import Data.Singletons.Prelude.Enum
+import Data.Singletons.Prelude.Eq
+import Data.Singletons.Prelude.Instances
+import Data.Singletons.Prelude.Monad.Internal
+import Data.Singletons.Prelude.Monoid
+import Data.Singletons.Prelude.Ord
+import Data.Singletons.Prelude.Semigroup.Internal
+import Data.Singletons.Prelude.Show
+import Data.Singletons.Promote
+import Data.Singletons.Single
+import Data.Singletons.TypeLits.Internal
+import Data.Type.Coercion
+import Data.Type.Equality hiding (type (==))
+
+{-
+In order to keep the type argument to Proxy poly-kinded, we define the
+singleton version of Proxy by hand. This is very much in the spirit of the
+code in D.S.Prelude.Const. (See the comments above SConst in that module
+for more details on this choice.)
+-}
+data SProxy :: forall t. Proxy t -> Type where
+  SProxy :: forall t. SProxy ('Proxy @t)
+type instance Sing = SProxy
+instance SingKind (Proxy t) where
+  type Demote (Proxy t) = Proxy t
+  fromSing SProxy = Proxy
+  toSing Proxy = SomeSing SProxy
+instance SingI 'Proxy where
+  sing = SProxy
+
+$(genDefunSymbols [''Proxy])
+
+instance SDecide (Proxy t) where
+  SProxy %~ SProxy = Proved Refl
+
+instance TestEquality SProxy where
+  testEquality = decideEquality
+
+instance TestCoercion SProxy where
+  testCoercion = decideCoercion
+
+instance Show (SProxy z) where
+  showsPrec _ _ = showString "SProxy"
+
+$(singletonsOnly [d|
+  deriving instance Bounded (Proxy s)
+
+  -- It's common to use (undefined :: Proxy t) and (Proxy :: Proxy t)
+  -- interchangeably, so all of these instances are hand-written to be
+  -- lazy in Proxy arguments.
+
+  instance Eq (Proxy s) where
+    _ == _ = True
+
+  instance Ord (Proxy s) where
+    compare _ _ = EQ
+
+  instance Show (Proxy s) where
+    showsPrec _ _ = showString "Proxy"
+
+  instance Enum (Proxy s) where
+      succ _               = errorWithoutStackTrace "Proxy.succ"
+      pred _               = errorWithoutStackTrace "Proxy.pred"
+      fromEnum _           = 0
+      -- toEnum 0             = Proxy
+      -- toEnum _             = errorWithoutStackTrace "Proxy.toEnum: 0 expected"
+      toEnum n             = if n == 0
+                             then Proxy
+                             else errorWithoutStackTrace "Proxy.toEnum: 0 expected"
+      -- enumFrom _           = [Proxy]
+      -- enumFromThen _ _     = [Proxy]
+      enumFromThenTo _ _ _ = [Proxy]
+      enumFromTo _ _       = [Proxy]
+
+  instance Semigroup (Proxy s) where
+      _ <> _ = Proxy
+      sconcat _ = Proxy
+      -- stimes _ _ = Proxy
+
+  instance Monoid (Proxy s) where
+      mempty = Proxy
+      mconcat _ = Proxy
+
+  instance Functor Proxy where
+      fmap _ _ = Proxy
+
+  instance Applicative Proxy where
+      pure _ = Proxy
+      _ <*> _ = Proxy
+
+  instance Alternative Proxy where
+      empty = Proxy
+      _ <|> _ = Proxy
+
+  instance Monad Proxy where
+      _ >>= _ = Proxy
+
+  instance MonadPlus Proxy
+
+  -- -| 'asProxyTypeOf' is a type-restricted version of 'const'.
+  -- It is usually used as an infix operator, and its typing forces its first
+  -- argument (which is usually overloaded) to have the same type as the tag
+  -- of the second.
+  --
+  -- >>> import Data.Word
+  -- >>> :type asProxyTypeOf 123 (Proxy :: Proxy Word8)
+  -- asProxyTypeOf 123 (Proxy :: Proxy Word8) :: Word8
+  --
+  -- Note the lower-case @proxy@ in the definition. This allows any type
+  -- constructor with just one argument to be passed to the function, for example
+  -- we could also write
+  --
+  -- >>> import Data.Word
+  -- >>> :type asProxyTypeOf 123 (Just (undefined :: Word8))
+  -- asProxyTypeOf 123 (Just (undefined :: Word8)) :: Word8
+  asProxyTypeOf :: a -> proxy a -> a
+  asProxyTypeOf = const
+  |])
diff --git a/src/Data/Singletons/Prelude/Semigroup.hs b/src/Data/Singletons/Prelude/Semigroup.hs
--- a/src/Data/Singletons/Prelude/Semigroup.hs
+++ b/src/Data/Singletons/Prelude/Semigroup.hs
@@ -6,6 +6,7 @@
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -35,6 +36,8 @@
   SSum(..), SProduct(..), SOption(..), SArg(..),
   GetMin, GetMax, GetFirst, GetLast, UnwrapMonoid, GetDual,
   GetAll, GetAny, GetSum, GetProduct, GetOption,
+  sGetMin, sGetMax, sGetFirst, sGetLast, sUnwrapMonoid, sGetDual,
+  sGetAll, sGetAny, sGetSum, sGetProduct, sGetOption,
 
   option_, sOption_, Option_,
 
@@ -75,11 +78,12 @@
 import Data.Singletons.Prelude.Monoid hiding
        (SFirst(..), SLast(..),
         FirstSym0, FirstSym1, LastSym0, LastSym1,
-        GetFirst,  GetFirstSym0, GetFirstSym1,
-        GetLast,   GetLastSym0,  GetLastSym1)
+        GetFirst, sGetFirst, GetFirstSym0, GetFirstSym1,
+        GetLast,  sGetLast,  GetLastSym0,  GetLastSym1)
 import Data.Singletons.Prelude.Num
 import Data.Singletons.Prelude.Ord hiding
        (MinSym0, MinSym1, MaxSym0, MaxSym1)
+import Data.Singletons.Prelude.Ord.Disambiguation
 import Data.Singletons.Prelude.Semigroup.Internal
 import Data.Singletons.Prelude.Show
 import Data.Singletons.Prelude.Traversable
diff --git a/src/Data/Singletons/Prelude/Semigroup/Internal.hs b/src/Data/Singletons/Prelude/Semigroup/Internal.hs
--- a/src/Data/Singletons/Prelude/Semigroup/Internal.hs
+++ b/src/Data/Singletons/Prelude/Semigroup/Internal.hs
@@ -6,6 +6,7 @@
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -47,7 +48,6 @@
 import Data.Singletons.Prelude.Monad.Internal
 import Data.Singletons.Prelude.Num
 import Data.Singletons.Prelude.Ord hiding (MinSym0, MinSym1, MaxSym0, MaxSym1)
-import Data.Singletons.Promote
 import Data.Singletons.Single
 import Data.Singletons.TypeLits.Internal
 import Data.Singletons.Util
@@ -148,9 +148,6 @@
     Down a <> Down b = Down (a <> b)
   |])
 
--- Workaround for #326
-infixr 6 <>
-
 $(genSingletons       $ ''Option : semigroupBasicTypes)
 $(singBoundedInstances             semigroupBasicTypes)
 $(singEqInstances     $ ''Option : semigroupBasicTypes)
@@ -231,52 +228,3 @@
         ex = someSymbolVal $ T.unpack $ a <> b
     in case ex of
          SomeSymbol (_ :: Proxy ab) -> unsafeCoerce (SSym :: Sing ab)
-
--- We need these in Data.Singletons.Prelude.Semigroup, as we need to promote
--- code that simultaneously uses the Min/Max constructors and the min/max
--- functions, which have clashing defunctionalization symbol names. Our
--- workaround is to simply define synonyms for min/max and use those instead.
-min_, max_ :: Ord a => a -> a -> a
-min_ = min
-max_ = max
-
-type Min_ x y = Min x y
-type Max_ x y = Max x y
-$(genDefunSymbols [''Min_, ''Max_])
-
-sMin_ :: forall a (x :: a) (y :: a). SOrd a => Sing x -> Sing y -> Sing (x `Min_` y)
-sMin_ = sMin
-
-sMax_ :: forall a (x :: a) (y :: a). SOrd a => Sing x -> Sing y -> Sing (x `Max_` y)
-sMax_ = sMax
-
--- We need these in Data.Singletons.Prelude.Foldable.
-all_ :: Bool -> All
-all_ = All
-
-any_ :: Bool -> Any
-any_ = Any
-
-sum_ :: a -> Sum a
-sum_ = Sum
-
-product_ :: a -> Product a
-product_ = Product
-
-type All_     a = 'All a
-type Any_     a = 'Any a
-type Sum_     a = 'Sum a
-type Product_ a = 'Product a
-$(genDefunSymbols [''All_, ''Any_, ''Sum_, ''Product_])
-
-sAll_ :: forall (x :: Bool). Sing x -> Sing (All_ x)
-sAll_ = SAll
-
-sAny_ :: forall (x :: Bool). Sing x -> Sing (Any_ x)
-sAny_ = SAny
-
-sSum_ :: forall a (x :: a). Sing x -> Sing (Sum_ x)
-sSum_ = SSum
-
-sProduct_ :: forall a (x :: a). Sing x -> Sing (Product_ x)
-sProduct_ = SProduct
diff --git a/src/Data/Singletons/Prelude/Semigroup/Internal/Disambiguation.hs b/src/Data/Singletons/Prelude/Semigroup/Internal/Disambiguation.hs
new file mode 100644
--- /dev/null
+++ b/src/Data/Singletons/Prelude/Semigroup/Internal/Disambiguation.hs
@@ -0,0 +1,49 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TypeApplications #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE UndecidableInstances #-}
+
+-----------------------------------------------------------------------------
+-- |
+-- Module      :  Data.Singletons.Prelude.Semigroup.Internal.Disambiguation
+-- Copyright   :  (C) 2019 Ryan Scott
+-- License     :  BSD-style (see LICENSE)
+-- Maintainer  :  Ryan Scott
+-- Stability   :  experimental
+-- Portability :  non-portable
+--
+-- Provides aliases for 'All', 'Any', 'Sum', and 'Product' that do not clash
+-- with the promoted functions of the same names in
+-- Data.Singletons.Prelude.Foldable.
+--
+----------------------------------------------------------------------------
+
+module Data.Singletons.Prelude.Semigroup.Internal.Disambiguation where
+
+import Data.Semigroup
+import Data.Singletons.Prelude.Semigroup.Internal
+import Data.Singletons.Single
+
+-- We need these in Data.Singletons.Prelude.Foldable, as we need to promote
+-- code that simultaneously uses the All/Any/Sum/Product constructors and the
+-- all/any/sum/product functions, which have clashing defunctionalization
+-- symbol names. Our workaround is to simply define synonyms for
+-- all/any/sum/product and use those instead.
+$(singletons [d|
+  all_ :: Bool -> All
+  all_ = All
+
+  any_ :: Bool -> Any
+  any_ = Any
+
+  sum_ :: a -> Sum a
+  sum_ = Sum
+
+  product_ :: a -> Product a
+  product_ = Product
+  |])
diff --git a/src/Data/Singletons/Prelude/Show.hs b/src/Data/Singletons/Prelude/Show.hs
--- a/src/Data/Singletons/Prelude/Show.hs
+++ b/src/Data/Singletons/Prelude/Show.hs
@@ -6,6 +6,7 @@
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -51,6 +52,7 @@
   AppPrecSym0, AppPrec1Sym0
   ) where
 
+import           Data.Kind
 import           Data.List.NonEmpty (NonEmpty)
 import           Data.Ord (Down)
 import           Data.Proxy
@@ -76,10 +78,12 @@
 -- | The @shows@ functions return a function that prepends the
 -- output 'Symbol' to an existing 'Symbol'.  This allows constant-time
 -- concatenation of results using function composition.
+type SymbolS :: Type
 type SymbolS = Symbol -> Symbol
 
 -- | GHC currently has no notion of type-level 'Char's, so we fake them with
 -- single-character 'Symbol's.
+type SChar :: Type
 type SChar = Symbol
 
 $(singletonsOnly [d|
diff --git a/src/Data/Singletons/Prelude/Traversable.hs b/src/Data/Singletons/Prelude/Traversable.hs
--- a/src/Data/Singletons/Prelude/Traversable.hs
+++ b/src/Data/Singletons/Prelude/Traversable.hs
@@ -6,6 +6,7 @@
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -61,23 +62,38 @@
 import Data.Singletons.Prelude.Instances
 import Data.Singletons.Prelude.Monad.Internal
 import Data.Singletons.Prelude.Monoid
+import Data.Singletons.Prelude.Proxy
 import Data.Singletons.Single
 
+type StateL :: Type -> Type -> Type
 newtype StateL s a = StateL (s ~> (s, a))
-data SStateL :: forall s a. StateL s a -> Type where
+type SStateL :: forall s a. StateL s a -> Type
+data SStateL state where
   SStateL :: Sing x -> SStateL ('StateL x)
 type instance Sing = SStateL
-data StateLSym0 :: forall s a. (s ~> (s, a)) ~> StateL s a
+type StateLSym0 :: forall s a. (s ~> (s, a)) ~> StateL s a
+data StateLSym0 z
 type instance Apply StateLSym0 x = 'StateL x
 
+type StateR :: Type -> Type -> Type
 newtype StateR s a = StateR (s ~> (s, a))
-data SStateR :: forall s a. StateR s a -> Type where
+type SStateR :: forall s a. StateR s a -> Type
+data SStateR state where
   SStateR :: Sing x -> SStateR ('StateR x)
 type instance Sing = SStateR
-data StateRSym0 :: forall s a. (s ~> (s, a)) ~> StateR s a
+type StateRSym0 :: forall s a. (s ~> (s, a)) ~> StateR s a
+data StateRSym0 z
 type instance Apply StateRSym0 x = 'StateR x
 
 $(singletonsOnly [d|
+  runStateL :: StateL s a -> (s -> (s, a))
+  runStateL (StateL x) = x
+
+  runStateR :: StateR s a -> (s -> (s, a))
+  runStateR (StateR x) = x
+  |])
+
+$(singletonsOnly [d|
   -- -| Functors representing data structures that can be traversed from
   -- left to right.
   --
@@ -161,7 +177,7 @@
   --    equivalent to traversal with a constant applicative functor
   --    ('foldMapDefault').
   --
-  class (Functor t, Foldable t) => Traversable (t :: Type -> Type) where
+  class (Functor t, Foldable t) => Traversable t where
       -- {-# MINIMAL traverse | sequenceA #-}
 
       -- -| Map each element of a structure to an action, evaluate these actions
@@ -197,6 +213,13 @@
   deriving instance Traversable NonEmpty
   deriving instance Traversable (Either a)
   deriving instance Traversable ((,) a)
+
+  instance Traversable Proxy where
+      traverse _ _ = pure Proxy
+      sequenceA _ = pure Proxy
+      mapM _ _ = pure Proxy
+      sequence _ = pure Proxy
+
   deriving instance Traversable (Const m)
   deriving instance Traversable Dual
   deriving instance Traversable Sum
@@ -251,16 +274,14 @@
   -- a final value of this accumulator together with the new structure.
   mapAccumL :: forall t a b c. Traversable t
             => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
-  mapAccumL f s t = case traverse (StateL . flip f) t of
-                      StateL g -> g s
+  mapAccumL f s t = runStateL (traverse (StateL . flip f) t) s
 
   -- -|The 'mapAccumR' function behaves like a combination of 'fmap'
   -- and 'foldr'; it applies a function to each element of a structure,
   -- passing an accumulating parameter from right to left, and returning
   -- a final value of this accumulator together with the new structure.
   mapAccumR :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
-  mapAccumR f s t = case traverse (StateR . flip f) t of
-                      StateR g -> g s
+  mapAccumR f s t = runStateR (traverse (StateR . flip f) t) s
 
   -- -| This function may be used as a value for `fmap` in a `Functor`
   --   instance, provided that 'traverse' is defined. (Using
diff --git a/src/Data/Singletons/Prelude/Tuple.hs b/src/Data/Singletons/Prelude/Tuple.hs
--- a/src/Data/Singletons/Prelude/Tuple.hs
+++ b/src/Data/Singletons/Prelude/Tuple.hs
@@ -1,6 +1,6 @@
 {-# LANGUAGE TemplateHaskell, ScopedTypeVariables, DataKinds, PolyKinds,
              RankNTypes, TypeFamilies, GADTs, UndecidableInstances,
-             TypeApplications #-}
+             TypeApplications, StandaloneKindSignatures #-}
 
 -----------------------------------------------------------------------------
 -- |
diff --git a/src/Data/Singletons/Prelude/Void.hs b/src/Data/Singletons/Prelude/Void.hs
--- a/src/Data/Singletons/Prelude/Void.hs
+++ b/src/Data/Singletons/Prelude/Void.hs
@@ -3,6 +3,7 @@
 {-# LANGUAGE GADTs #-}
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
diff --git a/src/Data/Singletons/Promote.hs b/src/Data/Singletons/Promote.hs
--- a/src/Data/Singletons/Promote.hs
+++ b/src/Data/Singletons/Promote.hs
@@ -7,12 +7,13 @@
 type level. It is an internal module to the singletons package.
 -}
 
-{-# LANGUAGE TemplateHaskell, MultiWayIf, LambdaCase, TupleSections #-}
+{-# LANGUAGE TemplateHaskell, MultiWayIf, LambdaCase, TupleSections,
+             ScopedTypeVariables #-}
 
 module Data.Singletons.Promote where
 
 import Language.Haskell.TH hiding ( Q, cxt )
-import Language.Haskell.TH.Syntax ( Quasi(..) )
+import Language.Haskell.TH.Syntax ( NameSpace(..), Quasi(..), Uniq )
 import Language.Haskell.TH.Desugar
 import qualified Language.Haskell.TH.Desugar.OMap.Strict as OMap
 import Language.Haskell.TH.Desugar.OMap.Strict (OMap)
@@ -29,6 +30,7 @@
 import Data.Singletons.Deriving.Show
 import Data.Singletons.Deriving.Util
 import Data.Singletons.Partition
+import Data.Singletons.TH.Options
 import Data.Singletons.Util
 import Data.Singletons.Syntax
 import Prelude hiding (exp)
@@ -37,71 +39,80 @@
 import Control.Monad
 import Control.Monad.Trans.Maybe
 import Control.Monad.Writer
+import Data.List (nub)
 import qualified Data.Map.Strict as Map
 import Data.Map.Strict ( Map )
 import Data.Maybe
 import qualified GHC.LanguageExtensions.Type as LangExt
 
--- | Generate promoted definitions from a type that is already defined.
--- This is generally only useful with classes.
-genPromotions :: DsMonad q => [Name] -> q [Dec]
+{-
+Note [Disable genQuotedDecs in genPromotions and genSingletons]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Somewhat curiously, the genPromotions and genSingletons functions set the
+genQuotedDecs option to False, despite neither function accepting quoted
+declarations as arguments in the first place. There is a good reason for doing
+this, however. Imagine this code:
+
+  class C a where
+    infixl 9 <%%>
+    (<%%>) :: a -> a -> a
+  $(genPromotions [''C])
+
+If genQuotedDecs is set to True, then the (<%%>) type family will not receive
+a fixity declaration (see
+Note [singletons and fixity declarations] in D.S.Single.Fixity, wrinkle 1 for
+more details on this point). Therefore, we set genQuotedDecs to False to avoid
+this problem.
+-}
+
+-- | Generate promoted definitions for each of the provided type-level
+-- declaration 'Name's. This is generally only useful with classes.
+genPromotions :: OptionsMonad q => [Name] -> q [Dec]
 genPromotions names = do
-  checkForRep names
-  infos <- mapM reifyWithLocals names
-  dinfos <- mapM dsInfo infos
-  ddecs <- promoteM_ [] $ mapM_ promoteInfo dinfos
-  return $ decsToTH ddecs
+  opts <- getOptions
+  -- See Note [Disable genQuotedDecs in genPromotions and genSingletons]
+  withOptions opts{genQuotedDecs = False} $ do
+    checkForRep names
+    infos <- mapM reifyWithLocals names
+    dinfos <- mapM dsInfo infos
+    ddecs <- promoteM_ [] $ mapM_ promoteInfo dinfos
+    return $ decsToTH ddecs
 
 -- | Promote every declaration given to the type level, retaining the originals.
-promote :: DsMonad q => q [Dec] -> q [Dec]
-promote qdec = do
-  decls <- qdec
-  ddecls <- withLocalDeclarations decls $ dsDecs decls
-  promDecls <- promoteM_ decls $ promoteDecs ddecls
-  return $ decls ++ decsToTH promDecls
+-- See the
+-- @<https://github.com/goldfirere/singletons/blob/master/README.md README>@
+-- for further explanation.
+promote :: OptionsMonad q => q [Dec] -> q [Dec]
+promote qdecs = do
+  opts <- getOptions
+  withOptions opts{genQuotedDecs = True} $ promote' $ lift qdecs
 
 -- | Promote each declaration, discarding the originals. Note that a promoted
 -- datatype uses the same definition as an original datatype, so this will
 -- not work with datatypes. Classes, instances, and functions are all fine.
-promoteOnly :: DsMonad q => q [Dec] -> q [Dec]
-promoteOnly qdec = do
-  decls  <- qdec
-  ddecls <- dsDecs decls
-  promDecls <- promoteM_ decls $ promoteDecs ddecls
-  return $ decsToTH promDecls
+promoteOnly :: OptionsMonad q => q [Dec] -> q [Dec]
+promoteOnly qdecs = do
+  opts <- getOptions
+  withOptions opts{genQuotedDecs = False} $ promote' $ lift qdecs
 
--- | Generate defunctionalization symbols for existing type families.
---
--- 'genDefunSymbols' has reasonable support for type families that use
--- dependent quantification. For instance, this:
---
--- @
--- type family MyProxy k (a :: k) :: Type where
---   MyProxy k (a :: k) = Proxy a
---
--- $('genDefunSymbols' [''MyProxy])
--- @
---
--- Will generate the following defunctionalization symbols:
---
--- @
--- data MyProxySym0     :: Type  ~> k ~> Type
--- data MyProxySym1 (k  :: Type) :: k ~> Type
--- @
---
--- Note that @MyProxySym0@ is a bit more general than it ought to be, since
--- there is no dependency between the first kind (@Type@) and the second kind
--- (@k@). But this would require the ability to write something like:
---
--- @
--- data MyProxySym0 :: forall (k :: Type) ~> k ~> Type
--- @
---
--- Which currently isn't possible. So for the time being, the kind of
--- @MyProxySym0@ will be slightly more general, which means that under rare
--- circumstances, you may have to provide extra type signatures if you write
--- code which exploits the dependency in @MyProxy@'s kind.
-genDefunSymbols :: DsMonad q => [Name] -> q [Dec]
+-- The workhorse for 'promote' and 'promoteOnly'. The difference between the
+-- two functions is whether 'genQuotedDecs' is set to 'True' or 'False'.
+promote' :: OptionsMonad q => q [Dec] -> q [Dec]
+promote' qdecs = do
+  opts     <- getOptions
+  decs     <- qdecs
+  ddecs    <- withLocalDeclarations decs $ dsDecs decs
+  promDecs <- promoteM_ decs $ promoteDecs ddecs
+  let origDecs | genQuotedDecs opts = decs
+               | otherwise          = []
+  return $ origDecs ++ decsToTH promDecs
+
+-- | Generate defunctionalization symbols for each of the provided type-level
+-- declaration 'Name's. See the "Promotion and partial application" section of
+-- the @singletons@
+-- @<https://github.com/goldfirere/singletons/blob/master/README.md README>@
+-- for further explanation.
+genDefunSymbols :: OptionsMonad q => [Name] -> q [Dec]
 genDefunSymbols names = do
   checkForRep names
   infos <- mapM (dsInfo <=< reifyWithLocals) names
@@ -109,43 +120,43 @@
   return $ decsToTH decs
 
 -- | Produce instances for @(==)@ (type-level equality) from the given types
-promoteEqInstances :: DsMonad q => [Name] -> q [Dec]
+promoteEqInstances :: OptionsMonad q => [Name] -> q [Dec]
 promoteEqInstances = concatMapM promoteEqInstance
 
 -- | Produce instances for 'POrd' from the given types
-promoteOrdInstances :: DsMonad q => [Name] -> q [Dec]
+promoteOrdInstances :: OptionsMonad q => [Name] -> q [Dec]
 promoteOrdInstances = concatMapM promoteOrdInstance
 
 -- | Produce an instance for 'POrd' from the given type
-promoteOrdInstance :: DsMonad q => Name -> q [Dec]
+promoteOrdInstance :: OptionsMonad q => Name -> q [Dec]
 promoteOrdInstance = promoteInstance mkOrdInstance "Ord"
 
 -- | Produce instances for 'PBounded' from the given types
-promoteBoundedInstances :: DsMonad q => [Name] -> q [Dec]
+promoteBoundedInstances :: OptionsMonad q => [Name] -> q [Dec]
 promoteBoundedInstances = concatMapM promoteBoundedInstance
 
 -- | Produce an instance for 'PBounded' from the given type
-promoteBoundedInstance :: DsMonad q => Name -> q [Dec]
+promoteBoundedInstance :: OptionsMonad q => Name -> q [Dec]
 promoteBoundedInstance = promoteInstance mkBoundedInstance "Bounded"
 
 -- | Produce instances for 'PEnum' from the given types
-promoteEnumInstances :: DsMonad q => [Name] -> q [Dec]
+promoteEnumInstances :: OptionsMonad q => [Name] -> q [Dec]
 promoteEnumInstances = concatMapM promoteEnumInstance
 
 -- | Produce an instance for 'PEnum' from the given type
-promoteEnumInstance :: DsMonad q => Name -> q [Dec]
+promoteEnumInstance :: OptionsMonad q => Name -> q [Dec]
 promoteEnumInstance = promoteInstance mkEnumInstance "Enum"
 
 -- | Produce instances for 'PShow' from the given types
-promoteShowInstances :: DsMonad q => [Name] -> q [Dec]
+promoteShowInstances :: OptionsMonad q => [Name] -> q [Dec]
 promoteShowInstances = concatMapM promoteShowInstance
 
 -- | Produce an instance for 'PShow' from the given type
-promoteShowInstance :: DsMonad q => Name -> q [Dec]
+promoteShowInstance :: OptionsMonad q => Name -> q [Dec]
 promoteShowInstance = promoteInstance (mkShowInstance ForPromotion) "Show"
 
 -- | Produce an instance for @(==)@ (type-level equality) from the given type
-promoteEqInstance :: DsMonad q => Name -> q [Dec]
+promoteEqInstance :: OptionsMonad q => Name -> q [Dec]
 promoteEqInstance name = do
   (tvbs, cons) <- getDataD "I cannot make an instance of (==) for it." name
   tvbs' <- mapM dsTvb tvbs
@@ -155,7 +166,7 @@
   inst_decs <- mkEqTypeInstance kind cons'
   return $ decsToTH inst_decs
 
-promoteInstance :: DsMonad q => DerivDesc q -> String -> Name -> q [Dec]
+promoteInstance :: OptionsMonad q => DerivDesc q -> String -> Name -> q [Dec]
 promoteInstance mk_inst class_name name = do
   (tvbs, cons) <- getDataD ("I cannot make an instance of " ++ class_name
                             ++ " for it.") name
@@ -164,7 +175,8 @@
   cons' <- concatMapM (dsCon tvbs' data_ty) cons
   let data_decl = DataDecl name tvbs' cons'
   raw_inst <- mk_inst Nothing data_ty data_decl
-  decs <- promoteM_ [] $ void $ promoteInstanceDec OMap.empty raw_inst
+  decs <- promoteM_ [] $ void $
+          promoteInstanceDec OMap.empty Map.empty raw_inst
   return $ decsToTH decs
 
 promoteInfo :: DInfo -> PrM ()
@@ -228,100 +240,95 @@
         , pd_closed_type_family_decs = c_tyfams
         , pd_derived_eq_decs         = derived_eq_decs } <- partitionDecs decls
 
-  defunTypeDecls ty_syns c_tyfams o_tyfams
+  defunTopLevelTypeDecls ty_syns c_tyfams o_tyfams
+  rec_sel_let_decs <- promoteDataDecs datas
     -- promoteLetDecs returns LetBinds, which we don't need at top level
-  _ <- promoteLetDecs noPrefix let_decs
+  _ <- promoteLetDecs Nothing $ rec_sel_let_decs ++ let_decs
   mapM_ promoteClassDec classes
   let orig_meth_sigs = foldMap (lde_types . cd_lde) classes
-  mapM_ (promoteInstanceDec orig_meth_sigs) insts
+      cls_tvbs_map   = Map.fromList $ map (\cd -> (cd_name cd, cd_tvbs cd)) classes
+  mapM_ (promoteInstanceDec orig_meth_sigs cls_tvbs_map) insts
   mapM_ promoteDerivedEqDec   derived_eq_decs
-  promoteDataDecs datas
 
-promoteDataDecs :: [DataDecl] -> PrM ()
-promoteDataDecs data_decs = do
-  rec_selectors <- concatMapM extract_rec_selectors data_decs
-  _ <- promoteLetDecs noPrefix rec_selectors
-  mapM_ promoteDataDec data_decs
-  where
-    extract_rec_selectors :: DataDecl -> PrM [DLetDec]
-    extract_rec_selectors (DataDecl data_name tvbs cons) =
-      let arg_ty = foldTypeTvbs (DConT data_name) tvbs
-      in
-      getRecordSelectors arg_ty cons
-
 -- curious about ALetDecEnv? See the LetDecEnv module for an explanation.
-promoteLetDecs :: (String, String) -- (alpha, symb) prefixes to use
+promoteLetDecs :: Maybe Uniq -- let-binding unique (if locally bound)
                -> [DLetDec] -> PrM ([LetBind], ALetDecEnv)
   -- See Note [Promoting declarations in two stages]
-promoteLetDecs prefixes decls = do
+promoteLetDecs mb_let_uniq decls = do
+  opts <- getOptions
   let_dec_env <- buildLetDecEnv decls
   all_locals <- allLocals
   let binds = [ (name, foldType (DConT sym) (map DVarT all_locals))
               | (name, _) <- OMap.assocs $ lde_defns let_dec_env
-              , let proName = promoteValNameLhsPrefix prefixes name
-                    sym = promoteTySym proName (length all_locals) ]
-  (decs, let_dec_env') <- letBind binds $ promoteLetDecEnv prefixes let_dec_env
+              , let proName = promotedValueName opts name mb_let_uniq
+                    sym = defunctionalizedName opts proName (length all_locals) ]
+  (decs, let_dec_env') <- letBind binds $ promoteLetDecEnv mb_let_uniq let_dec_env
   emitDecs decs
   return (binds, let_dec_env' { lde_proms = OMap.fromList binds })
 
--- Promotion of data types to kinds is automatic (see "Giving Haskell a
--- Promotion" paper for more details). Here we "plug into" the promotion
--- mechanism to add some extra stuff to the promotion:
---
---  * if data type derives Eq we generate a type family that implements the
---    equality test for the data type.
---
---  * for each data constructor with arity greater than 0 we generate type level
---    symbols for use with Apply type family. In this way promoted data
---    constructors and promoted functions can be used in a uniform way at the
---    type level in the same way they can be used uniformly at the type level.
---
---  * for each nullary data constructor we generate a type synonym
-promoteDataDec :: DataDecl -> PrM ()
-promoteDataDec (DataDecl _name _tvbs ctors) = do
-  ctorSyms <- buildDefunSymsDataD ctors
-  emitDecs ctorSyms
+promoteDataDecs :: [DataDecl] -> PrM [DLetDec]
+promoteDataDecs = concatMapM promoteDataDec
 
--- Note [CUSKification]
--- ~~~~~~~~~~~~~~~~~~~~
--- GHC #12928 means that sometimes, this TH code will produce a declaration
--- that has a kind signature even when we want kind inference to work. There
--- seems to be no way to avoid this, so we embrace it:
+-- "Promotes" a data type, much like D.S.Single.Data.singDataD singles a data
+-- type. Promoting a data type is much easier than singling it, however, since
+-- DataKinds automatically promotes data types and kinds and data constructors
+-- to types. That means that promoteDataDec only has to do three things:
 --
---   * If a class type variable has no explicit kind, we make no effort to
---     guess it and default to *. This is OK because before GHC 8.0, we were
---     limited by KProxy anyway.
+-- 1. Emit defunctionalization symbols for each data constructor,
 --
---   * If a class type variable has an explicit kind, it is preserved.
+-- 2. Emit promoted fixity declarations for each data constructor and promoted
+--    record selector (assuming the originals have fixity declarations), and
 --
--- This way, we always get proper CUSKs where we need them.
+-- 3. Assemble a top-level function that mimics the behavior of its record
+--    selectors. Note that promoteDataDec does not actually promote this record
+--    selector function—it merely returns its DLetDecs. Later, the promoteDecs
+--    function takes these DLetDecs and promotes them (using promoteLetDecs).
+--    This greatly simplifies the plumbing, since this allows all DLetDecs to
+--    be promoted in a single location.
+--    See Note [singletons and record selectors] in D.S.Single.Data.
+promoteDataDec :: DataDecl -> PrM [DLetDec]
+promoteDataDec (DataDecl data_name tvbs ctors) = do
+  let arg_ty        = foldTypeTvbs (DConT data_name) tvbs
+      rec_sel_names = nub $ concatMap extractRecSelNames ctors
+                      -- Note the use of nub: the same record selector name can
+                      -- be used in multiple constructors!
+  rec_sel_let_decs <- getRecordSelectors arg_ty ctors
+  ctorSyms         <- buildDefunSymsDataD ctors
+  infix_decs       <- promoteReifiedInfixDecls rec_sel_names
+  emitDecs $ ctorSyms ++ infix_decs
+  pure rec_sel_let_decs
 
-promoteClassDec :: UClassDecl
-                -> PrM AClassDecl
+promoteClassDec :: UClassDecl -> PrM AClassDecl
 promoteClassDec decl@(ClassDecl { cd_name = cls_name
-                                , cd_tvbs = tvbs'
+                                , cd_tvbs = tvbs
                                 , cd_fds  = fundeps
+                                , cd_atfs = atfs
                                 , cd_lde  = lde@LetDecEnv
                                     { lde_defns = defaults
                                     , lde_types = meth_sigs
                                     , lde_infix = infix_decls } }) = do
-  let
-    -- a workaround for GHC Trac #12928; see Note [CUSKification]
-    tvbs = map cuskify tvbs'
-  let pClsName = promoteClassName cls_name
+  opts <- getOptions
+  let pClsName = promotedClassName opts cls_name
   forallBind cls_kvs_to_bind $ do
-    sig_decs <- mapM (uncurry promote_sig) (OMap.assocs meth_sigs)
-    let defaults_list  = OMap.assocs defaults
+    let meth_sigs_list = OMap.assocs meth_sigs
+        meth_names     = map fst meth_sigs_list
+        defaults_list  = OMap.assocs defaults
         defaults_names = map fst defaults_list
+    mb_cls_sak <- dsReifyType cls_name
+    sig_decs <- mapM (uncurry promote_sig) meth_sigs_list
     (default_decs, ann_rhss, prom_rhss)
-      <- mapAndUnzip3M (promoteMethod OMap.empty Nothing meth_sigs) defaults_list
+      <- mapAndUnzip3M (promoteMethod DefaultMethods meth_sigs) defaults_list
+    defunAssociatedTypeFamilies tvbs atfs
 
-    let infix_decls' = catMaybes $ map (uncurry promoteInfixDecl)
-                                 $ OMap.assocs infix_decls
+    infix_decls' <- mapMaybeM (uncurry (promoteInfixDecl Nothing)) $
+                    OMap.assocs infix_decls
+    cls_infix_decls <- promoteReifiedInfixDecls $ cls_name:meth_names
 
     -- no need to do anything to the fundeps. They work as is!
-    emitDecs [DClassD [] pClsName tvbs fundeps
-                      (sig_decs ++ default_decs ++ infix_decls')]
+    let pro_cls_dec = DClassD [] pClsName tvbs fundeps
+                              (sig_decs ++ default_decs ++ infix_decls')
+        mb_pro_cls_sak = fmap (DKiSigD pClsName) mb_cls_sak
+    emitDecs $ maybeToList mb_pro_cls_sak ++ pro_cls_dec:cls_infix_decls
     let defaults_list'   = zip defaults_names ann_rhss
         proms            = zip defaults_names prom_rhss
         cls_kvs_to_bind' = cls_kvs_to_bind <$ meth_sigs
@@ -330,59 +337,134 @@
                                 , lde_bound_kvs = cls_kvs_to_bind' } })
   where
     cls_kvb_names, cls_tvb_names, cls_kvs_to_bind :: OSet Name
-    cls_kvb_names   = foldMap (foldMap fvDType . extractTvbKind) tvbs'
-    cls_tvb_names   = OSet.fromList $ map extractTvbName tvbs'
+    cls_kvb_names   = foldMap (foldMap fvDType . extractTvbKind) tvbs
+    cls_tvb_names   = OSet.fromList $ map extractTvbName tvbs
     cls_kvs_to_bind = cls_kvb_names `OSet.union` cls_tvb_names
 
     promote_sig :: Name -> DType -> PrM DDec
     promote_sig name ty = do
-      let proName = promoteValNameLhs name
-      (argKs, resK) <- promoteUnraveled ty
+      opts <- getOptions
+      let proName = promotedTopLevelValueName opts name
+      -- When computing the kind to use for the defunctionalization symbols,
+      -- /don't/ use the type variable binders from the method's type...
+      (_, argKs, resK) <- promoteUnraveled ty
       args <- mapM (const $ qNewName "arg") argKs
-      let tvbs = zipWith DKindedTV args argKs
-      emitDecsM $ defunReifyFixity proName tvbs (Just resK)
+      let proTvbs = zipWith DKindedTV args argKs
+      -- ...instead, compute the type variable binders in a left-to-right order,
+      -- since that is the same order that the promoted method's kind will use.
+      -- See Note [Promoted class methods and kind variable ordering]
+          meth_sak_tvbs = toposortTyVarsOf $ argKs ++ [resK]
+          meth_sak      = ravelVanillaDType meth_sak_tvbs [] argKs resK
+      m_fixity <- reifyFixityWithLocals name
+      emitDecsM $ defunctionalize proName m_fixity $ DefunSAK meth_sak
 
       return $ DOpenTypeFamilyD (DTypeFamilyHead proName
-                                                 tvbs
+                                                 proTvbs
                                                  (DKindSig resK)
                                                  Nothing)
 
+{-
+Note [Promoted class methods and kind variable ordering]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+In general, we make an effort to preserve the order of type variables when
+promoting type signatures, but there is an annoying corner case where this is
+difficult: class methods. When promoting class methods, the order of kind
+variables in their kinds will often "just work" by happy coincidence, but
+there are some situations where this does not happen. Consider the following
+class:
+
+  class C (b :: Type) where
+    m :: forall a. a -> b -> a
+
+The full type of `m` is `forall b. C b => forall a. a -> b -> a`, which binds
+`b` before `a`. This order is preserved when singling `m`, but *not* when
+promoting `m`. This is because the `C` class is promoted as follows:
+
+  class PC (b :: Type) where
+    type M (x :: a) (y :: b) :: a
+
+Due to the way GHC kind-checks associated type families, the kind of `M` is
+`forall a b. a -> b -> a`, which binds `b` *after* `a`. Moreover, the
+`StandaloneKindSignatures` extension does not provide a way to explicitly
+declare the full kind of an associated type family, so this limitation is
+not easy to work around.
+
+The defunctionalization symbols for `M` will also follow a similar
+order of type variables:
+
+  type MSym0 :: forall a b. a ~> b ~> a
+  type MSym1 :: forall a b. a -> b ~> a
+
+There is one potential hack we could use to rectify this:
+
+  type FlipConst x y = y
+  class PC (b :: Type) where
+    type M (x :: FlipConst '(b, a) a) (y :: b) :: a
+
+Using `FlipConst` would cause `b` to be mentioned before `a`, which would give
+`M` the kind `forall b a. FlipConst '(b, a) a -> b -> a`. While the order of
+type variables would be preserved, the downside is that the ugly `FlipConst`
+type synonym leaks into the kind. I'm not particularly fond of this, so I have
+decided not to use this hack unless someone specifically requests it.
+-}
+
 -- returns (unpromoted method name, ALetDecRHS) pairs
-promoteInstanceDec :: OMap Name DType -> UInstDecl -> PrM AInstDecl
-promoteInstanceDec orig_meth_sigs
+promoteInstanceDec :: OMap Name DType
+                      -- Class method type signatures
+                   -> Map Name [DTyVarBndr]
+                      -- Class header type variable (e.g., if `class C a b` is
+                      -- quoted, then this will have an entry for {C |-> [a, b]})
+                   -> UInstDecl -> PrM AInstDecl
+promoteInstanceDec orig_meth_sigs cls_tvbs_map
                    decl@(InstDecl { id_name     = cls_name
                                   , id_arg_tys  = inst_tys
                                   , id_sigs     = inst_sigs
                                   , id_meths    = meths }) = do
-  cls_tvb_names <- lookup_cls_tvb_names
+  opts <- getOptions
+  cls_tvbs <- lookup_cls_tvbs
   inst_kis <- mapM promoteType inst_tys
-  let kvs_to_bind = foldMap fvDType inst_kis
+  let pClsName      = promotedClassName opts cls_name
+      cls_tvb_names = map extractTvbName cls_tvbs
+      kvs_to_bind   = foldMap fvDType inst_kis
   forallBind kvs_to_bind $ do
-    let subst = Map.fromList $ zip cls_tvb_names inst_kis
-    (meths', ann_rhss, _) <- mapAndUnzip3M (promoteMethod inst_sigs (Just subst) orig_meth_sigs) meths
+    let subst     = Map.fromList $ zip cls_tvb_names inst_kis
+        meth_impl = InstanceMethods inst_sigs subst
+    (meths', ann_rhss, _)
+      <- mapAndUnzip3M (promoteMethod meth_impl orig_meth_sigs) meths
     emitDecs [DInstanceD Nothing Nothing [] (foldType (DConT pClsName)
                                               inst_kis) meths']
     return (decl { id_meths = zip (map fst meths) ann_rhss })
   where
-    pClsName = promoteClassName cls_name
+    lookup_cls_tvbs :: PrM [DTyVarBndr]
+    lookup_cls_tvbs =
+      -- First, try consulting the map of class names to their type variables.
+      -- It is important to do this first to ensure that we consider locally
+      -- declared classes before imported ones. See #410 for what happens if
+      -- you don't.
+      case Map.lookup cls_name cls_tvbs_map of
+        Just tvbs -> pure tvbs
+        Nothing   -> reify_cls_tvbs
+          -- If the class isn't present in this map, we try reifying the class
+          -- as a last resort.
 
-    lookup_cls_tvb_names :: PrM [Name]
-    lookup_cls_tvb_names = do
-      let mk_tvb_names = extract_tvb_names (dsReifyTypeNameInfo pClsName)
-                     <|> extract_tvb_names (dsReifyTypeNameInfo cls_name)
+    reify_cls_tvbs :: PrM [DTyVarBndr]
+    reify_cls_tvbs = do
+      opts <- getOptions
+      let pClsName = promotedClassName opts cls_name
+          mk_tvbs  = extract_tvbs (dsReifyTypeNameInfo pClsName)
+                 <|> extract_tvbs (dsReifyTypeNameInfo cls_name)
                       -- See Note [Using dsReifyTypeNameInfo when promoting instances]
-      mb_tvb_names <- runMaybeT mk_tvb_names
-      case mb_tvb_names of
-        Just tvb_names -> pure tvb_names
+      mb_tvbs <- runMaybeT mk_tvbs
+      case mb_tvbs of
+        Just tvbs -> pure tvbs
         Nothing -> fail $ "Cannot find class declaration annotation for " ++ show cls_name
 
-    extract_tvb_names :: PrM (Maybe DInfo) -> MaybeT PrM [Name]
-    extract_tvb_names reify_info = do
+    extract_tvbs :: PrM (Maybe DInfo) -> MaybeT PrM [DTyVarBndr]
+    extract_tvbs reify_info = do
       mb_info <- lift reify_info
       case mb_info of
-        Just (DTyConI (DClassD _ _ tvbs _ _) _)
-          -> pure $ map extractTvbName tvbs
-        _ -> empty
+        Just (DTyConI (DClassD _ _ tvbs _ _) _) -> pure tvbs
+        _                                       -> empty
 
 {-
 Note [Using dsReifyTypeNameInfo when promoting instances]
@@ -418,18 +500,27 @@
 that's in the type namespace) and _then_ reifies it.
 -}
 
-promoteMethod :: OMap Name DType -- InstanceSigs for methods
-              -> Maybe (Map Name DKind)
-                    -- ^ instantiations for class tyvars (Nothing for default decls)
-                    --   See Note [Promoted class method kinds]
+-- Which sort of class methods are being promoted?
+data MethodSort
+    -- The method defaults in class declarations.
+  = DefaultMethods
+    -- The methods in instance declarations.
+  | InstanceMethods (OMap Name DType) -- ^ InstanceSigs
+                    (Map Name DKind)  -- ^ Instantiations for class tyvars
+                                      --   See Note [Promoted class method kinds]
+  deriving Show
+
+promoteMethod :: MethodSort
               -> OMap Name DType    -- method types
               -> (Name, ULetDecRHS)
               -> PrM (DDec, ALetDecRHS, DType)
                  -- returns (type instance, ALetDecRHS, promoted RHS)
-promoteMethod inst_sigs_map m_subst orig_sigs_map (meth_name, meth_rhs) = do
-  (meth_arg_kis, meth_res_ki) <- lookup_meth_ty
-  meth_arg_tvs <- mapM (const $ qNewName "a") meth_arg_kis
-  let helperNameBase = case nameBase proName of
+promoteMethod meth_sort orig_sigs_map (meth_name, meth_rhs) = do
+  opts <- getOptions
+  (meth_tvbs, meth_arg_kis, meth_res_ki) <- promote_meth_ty
+  meth_arg_tvs <- replicateM (length meth_arg_kis) (qNewName "a")
+  let proName = promotedTopLevelValueName opts meth_name
+      helperNameBase = case nameBase proName of
                          first:_ | not (isHsLetter first) -> "TFHelper"
                          alpha                            -> alpha
 
@@ -447,61 +538,80 @@
       -- strictly necessary, as kind inference can figure them out just as well.
       family_args = map DVarT meth_arg_tvs
   helperName <- newUniqueName helperNameBase
-  let proHelperName = promoteValNameLhs helperName
-  ((_, _, _, eqns), _defuns, ann_rhs)
-    <- promoteLetDecRHS (Just (meth_arg_kis, meth_res_ki)) OMap.empty OMap.empty
-                        noPrefix helperName meth_rhs
-  let tvbs = zipWith DKindedTV meth_arg_tvs meth_arg_kis
-  emitDecs [DClosedTypeFamilyD (DTypeFamilyHead
-                                  proHelperName
-                                  tvbs
-                                  (DKindSig meth_res_ki)
-                                  Nothing)
-                               eqns]
-  emitDecsM (defunctionalize proHelperName Nothing tvbs (Just meth_res_ki))
+  let helperDefunName = defunctionalizedName0 opts helperName
+  (pro_decs, defun_decs, ann_rhs)
+    <- promoteLetDecRHS (ClassMethodRHS meth_tvbs meth_arg_kis meth_res_ki)
+                        OMap.empty OMap.empty
+                        Nothing helperName meth_rhs
+  emitDecs (pro_decs ++ defun_decs)
   return ( DTySynInstD
              (DTySynEqn Nothing
                         (foldType (DConT proName) family_args)
-                        (foldApply (promoteValRhs helperName) (map DVarT meth_arg_tvs)))
+                        (foldApply (DConT helperDefunName) (map DVarT meth_arg_tvs)))
          , ann_rhs
-         , DConT (promoteTySym helperName 0) )
+         , DConT helperDefunName )
   where
-    proName = promoteValNameLhs meth_name
+    -- Promote the type of a class method. For a default method, "the type" is
+    -- simply the type of the original method. For an instance method,
+    -- "the type" is like the type of the original method, but substituted for
+    -- the types in the instance head. (e.g., if you have `class C a` and
+    -- `instance C T`, then the substitution [a |-> T] must be applied to the
+    -- original method's type.)
+    promote_meth_ty :: PrM ([DTyVarBndr], [DKind], DKind)
+    promote_meth_ty =
+      case meth_sort of
+        DefaultMethods ->
+          -- No substitution for class variables is required for default
+          -- method type signatures, as they share type variables with the
+          -- class they inhabit.
+          lookup_meth_ty
+        InstanceMethods inst_sigs_map cls_subst ->
+          case OMap.lookup meth_name inst_sigs_map of
+            Just ty -> do
+              -- We have an InstanceSig. These are easy: we can just use the
+              -- instance signature's type directly, and no substitution for
+              -- class variables is required.
+              promoteUnraveled ty
+            Nothing -> do
+              -- We don't have an InstanceSig, so we must compute the kind to use
+              -- ourselves.
+              (_, arg_kis, res_ki) <- lookup_meth_ty
+              -- Substitute for the class variables in the method's type.
+              -- See Note [Promoted class method kinds]
+              let arg_kis' = map (substKind cls_subst) arg_kis
+                  res_ki'  = substKind cls_subst res_ki
+                  -- Compute the type variable binders in a left-to-right
+                  -- order, since that is the same order that the promoted
+                  -- method's kind will use.
+                  -- See Note [Promoted class methods and kind variable ordering]
+                  tvbs'    = toposortTyVarsOf (arg_kis' ++ [res_ki'])
+              pure (tvbs', arg_kis', res_ki')
 
-    lookup_meth_ty :: PrM ([DKind], DKind)
-    lookup_meth_ty =
-      case OMap.lookup meth_name inst_sigs_map of
-        Just ty ->
-          -- We have an InstanceSig. These are easy: no substitution for clas
-          -- variables is required at all!
+    -- Attempt to look up a class method's original type.
+    lookup_meth_ty :: PrM ([DTyVarBndr], [DKind], DKind)
+    lookup_meth_ty = do
+      opts <- getOptions
+      let proName = promotedTopLevelValueName opts meth_name
+      case OMap.lookup meth_name orig_sigs_map of
+        Just ty -> do
+          -- The type of the method is in scope, so promote that.
           promoteUnraveled ty
         Nothing -> do
-          -- We don't have an InstanceSig, so we must compute the kind to use
-          -- ourselves (possibly substituting for class variables below).
-          (arg_kis, res_ki) <-
-            case OMap.lookup meth_name orig_sigs_map of
-              Nothing -> do
-                mb_info <- dsReifyTypeNameInfo proName
-                           -- See Note [Using dsReifyTypeNameInfo when promoting instances]
-                case mb_info of
-                  Just (DTyConI (DOpenTypeFamilyD (DTypeFamilyHead _ tvbs mb_res_ki _)) _)
-                    -> let arg_kis = map (default_to_star . extractTvbKind) tvbs
-                           res_ki  = default_to_star (resultSigToMaybeKind mb_res_ki)
-                        in return (arg_kis, res_ki)
-                  _ -> fail $ "Cannot find type annotation for " ++ show proName
-              Just ty -> promoteUnraveled ty
-          let -- If we're dealing with an associated type family instance, substitute
-              -- in the kind of the instance for better kind information in the RHS
-              -- helper function. If we're dealing with a default family implementation
-              -- (m_subst = Nothing), there's no need for a substitution.
-              -- See Note [Promoted class method kinds]
-              do_subst      = maybe id substKind m_subst
-              meth_arg_kis' = map do_subst arg_kis
-              meth_res_ki'  = do_subst res_ki
-          pure (meth_arg_kis', meth_res_ki')
-
-    default_to_star Nothing  = DConT typeKindName
-    default_to_star (Just k) = k
+          -- If the type of the method is not in scope, the only other option
+          -- is to try reifying the promoted method name.
+          mb_info <- dsReifyTypeNameInfo proName
+                     -- See Note [Using dsReifyTypeNameInfo when promoting instances]
+          case mb_info of
+            Just (DTyConI (DOpenTypeFamilyD (DTypeFamilyHead _ tvbs mb_res_ki _)) _)
+              -> let arg_kis = map (defaultMaybeToTypeKind . extractTvbKind) tvbs
+                     res_ki  = defaultMaybeToTypeKind (resultSigToMaybeKind mb_res_ki)
+                     -- Compute the type variable binders in a left-to-right
+                     -- order, since that is the same order that the promoted
+                     -- method's kind will use.
+                     -- See Note [Promoted class methods and kind variable ordering]
+                     tvbs'   = toposortTyVarsOf (arg_kis ++ [res_ki])
+                  in pure (tvbs', arg_kis, res_ki)
+            _ -> fail $ "Cannot find type annotation for " ++ show proName
 
 {-
 Note [Promoted class method kinds]
@@ -518,15 +628,18 @@
 The promoted version of these declarations would be:
 
   class PC a where
-    type M (x :: a) (y :: Bool) (z :: Bool)
-    type M x y z = MHelper1 x y z
+    type M (x :: a) (y :: Bool) :: Bool
+    type M x y = MHelper1 x y
 
   instance PC [a] where
-    type M x y z = MHelper2 x y z
+    type M x y = MHelper2 x y
 
-  type family MHelper1 (x :: a)   (y :: Bool) (z :: Bool) where ...
-  type family MHelper2 (x :: [a]) (y :: Bool) (z :: Bool) where ...
+  type MHelper1 :: a -> Bool -> Bool
+  type family MHelper1 x y where ...
 
+  type MHelper2 :: [a] -> Bool -> Bool
+  type family MHelper2 x y where ...
+
 Getting the kind signature for MHelper1 (the promoted default implementation of
 M) is quite simple, as it corresponds exactly to the kind of M. We might even
 choose to make that the kind of MHelper2, but then it would be overly general
@@ -535,21 +648,23 @@
 promoted method implementations like MHelper2.
 -}
 
-promoteLetDecEnv :: (String, String) -> ULetDecEnv -> PrM ([DDec], ALetDecEnv)
-promoteLetDecEnv prefixes (LetDecEnv { lde_defns = value_env
-                                     , lde_types = type_env
-                                     , lde_infix = fix_env }) = do
-  let infix_decls = catMaybes $ map (uncurry promoteInfixDecl)
-                              $ OMap.assocs fix_env
+promoteLetDecEnv :: Maybe Uniq -> ULetDecEnv -> PrM ([DDec], ALetDecEnv)
+promoteLetDecEnv mb_let_uniq (LetDecEnv { lde_defns = value_env
+                                        , lde_types = type_env
+                                        , lde_infix = fix_env }) = do
+  infix_decls <- mapMaybeM (uncurry (promoteInfixDecl mb_let_uniq)) $
+                 OMap.assocs fix_env
 
     -- promote all the declarations, producing annotated declarations
   let (names, rhss) = unzip $ OMap.assocs value_env
-  (payloads, defun_decss, ann_rhss)
-    <- fmap unzip3 $ zipWithM (promoteLetDecRHS Nothing type_env fix_env prefixes) names rhss
+  (pro_decs, defun_decss, ann_rhss)
+    <- fmap unzip3 $
+       zipWithM (promoteLetDecRHS LetBindingRHS type_env fix_env mb_let_uniq)
+                names rhss
 
   emitDecs $ concat defun_decss
   bound_kvs <- allBoundKindVars
-  let decs = map payload_to_dec payloads ++ infix_decls
+  let decs = concat pro_decs ++ infix_decls
 
     -- build the ALetDecEnv
   let let_dec_env' = LetDecEnv { lde_defns     = OMap.fromList $ zip names ann_rhss
@@ -559,104 +674,239 @@
                                , lde_bound_kvs = OMap.fromList $ map (, bound_kvs) names }
 
   return (decs, let_dec_env')
+
+-- Promote a fixity declaration.
+promoteInfixDecl :: forall q. OptionsMonad q
+                 => Maybe Uniq -> Name -> Fixity -> q (Maybe DDec)
+promoteInfixDecl mb_let_uniq name fixity = do
+  opts  <- getOptions
+  mb_ns <- reifyNameSpace name
+  case mb_ns of
+    -- If we can't find the Name for some odd reason, fall back to promote_val
+    Nothing        -> promote_val
+    Just VarName   -> promote_val
+    Just DataName  -> never_mind
+    Just TcClsName -> do
+      mb_info <- dsReify name
+      case mb_info of
+        Just (DTyConI DClassD{} _)
+          -> finish $ promotedClassName opts name
+        _ -> never_mind
   where
-    payload_to_dec (name, tvbs, m_ki, eqns) = DClosedTypeFamilyD
-                                                (DTypeFamilyHead name tvbs sig Nothing)
-                                                eqns
-      where
-        sig = maybe DNoSig DKindSig m_ki
+    -- Produce the fixity declaration.
+    finish :: Name -> q (Maybe DDec)
+    finish = pure . Just . DLetDec . DInfixD fixity
 
-promoteInfixDecl :: Name -> Fixity -> Maybe DDec
-promoteInfixDecl name fixity
- | nameBase name == nameBase promoted_name
-   -- If a name and its promoted counterpart are the same (modulo module
-   -- prefixes), then there's no need to promote a fixity declaration for
-   -- that name, since the existing fixity declaration will cover both
-   -- the term- and type-level versions of that name. Names that fall into this
-   -- category include data constructor names and infix names.
- = Nothing
- | otherwise
- = Just $ DLetDec $ DInfixD fixity promoted_name
- where
-  promoted_name = promoteValNameLhs name
+    -- Don't produce a fixity declaration at all. This happens when promoting a
+    -- fixity declaration for a name whose promoted counterpart is the same as
+    -- the original name.
+    -- See Note [singletons and fixity declarations] in D.S.Single.Fixity, wrinkle 1.
+    never_mind :: q (Maybe DDec)
+    never_mind = pure Nothing
 
+    -- Certain value names do not change when promoted (e.g., infix names).
+    -- Therefore, don't bother promoting their fixity declarations if
+    -- 'genQuotedDecs' is set to 'True', since that will run the risk of
+    -- generating duplicate fixity declarations.
+    -- See Note [singletons and fixity declarations] in D.S.Single.Fixity, wrinkle 1.
+    promote_val :: q (Maybe DDec)
+    promote_val = do
+      opts <- getOptions
+      let promoted_name :: Name
+          promoted_name = promotedValueName opts name mb_let_uniq
+      if nameBase name == nameBase promoted_name && genQuotedDecs opts
+         then never_mind
+         else finish promoted_name
+
+-- Try producing promoted fixity declarations for Names by reifying them
+-- /without/ consulting quoted declarations. If reification fails, recover and
+-- return the empty list.
+-- See [singletons and fixity declarations] in D.S.Single.Fixity, wrinkle 2.
+promoteReifiedInfixDecls :: forall q. OptionsMonad q => [Name] -> q [DDec]
+promoteReifiedInfixDecls = mapMaybeM tryPromoteFixityDeclaration
+  where
+    tryPromoteFixityDeclaration :: Name -> q (Maybe DDec)
+    tryPromoteFixityDeclaration name =
+      qRecover (return Nothing) $ do
+        mFixity <- qReifyFixity name
+        case mFixity of
+          Nothing     -> pure Nothing
+          Just fixity -> promoteInfixDecl Nothing name fixity
+
+-- Which sort of let-bound declaration's right-hand side is being promoted?
+data LetDecRHSSort
+    -- An ordinary (i.e., non-class-related) let-bound declaration.
+  = LetBindingRHS
+    -- The right-hand side of a class method (either a default method or a
+    -- method in an instance declaration).
+  | ClassMethodRHS
+      [DTyVarBndr] [DKind] DKind
+      -- The RHS's promoted type variable binders, argument types, and
+      -- result type. Needed to fix #136.
+  deriving Show
+
 -- This function is used both to promote class method defaults and normal
 -- let bindings. Thus, it can't quite do all the work locally and returns
 -- an intermediate structure. Perhaps a better design is available.
-promoteLetDecRHS :: Maybe ([DKind], DKind)  -- the promoted type of the RHS (if known)
-                                            -- needed to fix #136
+promoteLetDecRHS :: LetDecRHSSort
                  -> OMap Name DType      -- local type env't
                  -> OMap Name Fixity     -- local fixity env't
-                 -> (String, String)     -- let-binding prefixes
+                 -> Maybe Uniq           -- let-binding unique (if locally bound)
                  -> Name                 -- name of the thing being promoted
                  -> ULetDecRHS           -- body of the thing
-                 -> PrM ( (Name, [DTyVarBndr], Maybe DKind, [DTySynEqn]) -- "type family"
+                 -> PrM ( [DDec]        -- promoted type family dec, plus the
+                                        -- SAK dec (if one exists)
                         , [DDec]        -- defunctionalization
                         , ALetDecRHS )  -- annotated RHS
-promoteLetDecRHS m_rhs_ki type_env fix_env prefixes name (UValue exp) = do
-  (res_kind, num_arrows)
-    <- case m_rhs_ki of
-         Just (arg_kis, res_ki) -> return ( Just (ravelTyFun (arg_kis ++ [res_ki]))
-                                          , length arg_kis )
-         _ |  Just ty <- OMap.lookup name type_env
-           -> do ki <- promoteType ty
-                 return (Just ki, countArgs ty)
-           |  otherwise
-           -> return (Nothing, 0)
-  case num_arrows of
-    0 -> do
-      all_locals <- allLocals
-      let lde_kvs_to_bind = foldMap fvDType res_kind
-      (exp', ann_exp) <- forallBind lde_kvs_to_bind $ promoteExp exp
-      let proName = promoteValNameLhsPrefix prefixes name
-          m_fixity = OMap.lookup name fix_env
-          tvbs = map DPlainTV all_locals
-      defuns <- defunctionalize proName m_fixity tvbs res_kind
-      return ( ( proName, tvbs, res_kind
-               , [DTySynEqn Nothing (foldType (DConT proName) $ map DVarT all_locals) exp'] )
-             , defuns
-             , AValue (foldType (DConT proName) (map DVarT all_locals))
-                      num_arrows ann_exp )
-    _ -> do
-      names <- replicateM num_arrows (newUniqueName "a")
-      let pats    = map DVarP names
-          newArgs = map DVarE names
-      promoteLetDecRHS m_rhs_ki type_env fix_env prefixes name
-                       (UFunction [DClause pats (foldExp exp newArgs)])
+promoteLetDecRHS rhs_sort type_env fix_env mb_let_uniq name let_dec_rhs = do
+  opts <- getOptions
+  all_locals <- allLocals
+  case let_dec_rhs of
+    UValue exp -> do
+      (m_ldrki, ty_num_args) <- promote_let_dec_ty all_locals 0
+      if ty_num_args == 0
+      then
+        let proName = promotedValueName opts name mb_let_uniq
+            prom_fun_lhs = foldType (DConT proName) $ map DVarT all_locals in
+        promote_let_dec_rhs all_locals m_ldrki 0 (promoteExp exp)
+                            (\exp' -> [DTySynEqn Nothing prom_fun_lhs exp'])
+                            AValue
+      else
+        -- If we have a UValue with a function type, process it as though it
+        -- were a UFunction. promote_function_rhs will take care of
+        -- eta-expanding arguments as necessary.
+        promote_function_rhs all_locals [DClause [] exp]
+    UFunction clauses -> promote_function_rhs all_locals clauses
+  where
+    -- Promote the RHS of a UFunction (or a UValue with a function type).
+    promote_function_rhs :: [Name]
+                         -> [DClause] -> PrM ([DDec], [DDec], ALetDecRHS)
+    promote_function_rhs all_locals clauses = do
+      opts <- getOptions
+      numArgs <- count_args clauses
+      let proName = promotedValueName opts name mb_let_uniq
+          prom_fun_lhs = foldType (DConT proName) $ map DVarT all_locals
+      (m_ldrki, ty_num_args) <- promote_let_dec_ty all_locals numArgs
+      expClauses <- mapM (etaContractOrExpand ty_num_args numArgs) clauses
+      promote_let_dec_rhs all_locals m_ldrki ty_num_args
+                          (mapAndUnzipM (promoteClause prom_fun_lhs) expClauses)
+                          id AFunction
 
-promoteLetDecRHS m_rhs_ki type_env fix_env prefixes name (UFunction clauses) = do
-  numArgs <- count_args clauses
-  (m_argKs, m_resK, ty_num_args) <- case m_rhs_ki of
-    Just (arg_kis, res_ki) -> return (map Just arg_kis, Just res_ki, length arg_kis)
-    _ |  Just ty <- OMap.lookup name type_env
-      -> do
-      -- promoteType turns arrows into TyFun. So, we unravel first to
-      -- avoid this behavior. Note the use of ravelTyFun in resultK
-      -- to make the return kind work out
-      (argKs, resultK) <- promoteUnraveled ty
-      -- invariant: countArgs ty == length argKs
-      return (map Just argKs, Just resultK, length argKs)
+    -- Promote a UValue or a UFunction.
+    -- Notes about type variables:
+    --
+    -- * For UValues, `prom_a` is DType and `a` is Exp.
+    --
+    -- * For UFunctions, `prom_a` is [DTySynEqn] and `a` is [DClause].
+    promote_let_dec_rhs
+      :: [Name]                            -- Local variables bound in this scope
+      -> Maybe LetDecRHSKindInfo           -- Information about the promoted kind (if present)
+      -> Int                               -- The number of promoted function arguments
+      -> PrM (prom_a, a)                   -- Promote the RHS
+      -> (prom_a -> [DTySynEqn])           -- Turn the promoted RHS into type family equations
+      -> (DType -> Int -> a -> ALetDecRHS) -- Build an ALetDecRHS
+      -> PrM ([DDec], [DDec], ALetDecRHS)
+    promote_let_dec_rhs all_locals m_ldrki ty_num_args
+                        promote_thing mk_prom_eqns mk_alet_dec_rhs = do
+      opts <- getOptions
+      tyvarNames <- replicateM ty_num_args (qNewName "a")
+      let proName    = promotedValueName opts name mb_let_uniq
+          local_tvbs = map DPlainTV all_locals
+          m_fixity   = OMap.lookup name fix_env
 
-      |  otherwise
-      -> return (replicate numArgs Nothing, Nothing, numArgs)
-  let proName  = promoteValNameLhsPrefix prefixes name
-      m_fixity = OMap.lookup name fix_env
-  all_locals <- allLocals
-  let local_tvbs = map DPlainTV all_locals
-  tyvarNames <- mapM (const $ qNewName "a") m_argKs
-  let args     = zipWith inferMaybeKindTV tyvarNames m_argKs
-      all_args = local_tvbs ++ args
-  defun_decs <- defunctionalize proName m_fixity all_args m_resK
-  expClauses <- mapM (etaContractOrExpand ty_num_args numArgs) clauses
-  let lde_kvs_to_bind = foldMap (foldMap fvDType) m_argKs <> foldMap fvDType m_resK
-  (eqns, ann_clauses) <- forallBind lde_kvs_to_bind $
-                         mapAndUnzipM (promoteClause proName) expClauses
-  prom_fun <- lookupVarE name
-  return ( (proName, all_args, m_resK, eqns)
-         , defun_decs
-         , AFunction prom_fun ty_num_args ann_clauses )
+          mk_tf_head :: [DTyVarBndr] -> DFamilyResultSig -> DTypeFamilyHead
+          mk_tf_head tvbs res_sig = DTypeFamilyHead proName tvbs res_sig Nothing
 
-  where
+          (lde_kvs_to_bind, m_sak_dec, defun_ki, tf_head) =
+              -- There are three possible cases:
+            case m_ldrki of
+              -- 1. We have no kind information whatsoever.
+              Nothing ->
+                let all_args = local_tvbs ++ map DPlainTV tyvarNames in
+                ( OSet.empty
+                , Nothing
+                , DefunNoSAK all_args Nothing
+                , mk_tf_head all_args DNoSig
+                )
+              -- 2. We have some kind information in the form of a LetDecRHSKindInfo.
+              Just (LDRKI m_sak tvbs argKs resK) ->
+                let all_args         = local_tvbs ++ zipWith DKindedTV tyvarNames argKs
+                    lde_kvs_to_bind' = OSet.fromList (map extractTvbName tvbs) in
+                case m_sak of
+                  -- 2(a). We do not have a standalone kind signature.
+                  Nothing ->
+                    ( lde_kvs_to_bind'
+                    , Nothing
+                    , DefunNoSAK all_args (Just resK)
+                    , mk_tf_head all_args (DKindSig resK)
+                    )
+                  -- 2(b). We have a standalone kind signature.
+                  Just sak ->
+                    ( lde_kvs_to_bind'
+                    , Just $ DKiSigD proName sak
+                    , DefunSAK sak
+                      -- If the promoted type family has a standalone kind
+                      -- signature, then there is no need to annotate the arguments
+                      -- or result with explicit kinds. A standalone kind signature
+                      -- accomplishes the same thing, but better.
+                    , mk_tf_head (map dropTvbKind all_args) DNoSig
+                    )
+
+      defun_decs <- defunctionalize proName m_fixity defun_ki
+      (prom_thing, thing) <- forallBind lde_kvs_to_bind promote_thing
+      prom_fun_rhs <- lookupVarE name
+      return ( catMaybes [ m_sak_dec
+                         , Just $ DClosedTypeFamilyD tf_head (mk_prom_eqns prom_thing)
+                         ]
+             , defun_decs
+             , mk_alet_dec_rhs prom_fun_rhs ty_num_args thing )
+
+    promote_let_dec_ty :: [Name] -- The local variables that the let-dec closes
+                                 -- over. If this is non-empty, we cannot
+                                 -- produce a standalone kind signature.
+                                 -- See Note [No SAKs for let-decs with local variables]
+                       -> Int    -- The number of arguments to default to if the
+                                 -- type cannot be inferred. This is 0 for UValues
+                                 -- and the number of arguments in a single clause
+                                 -- for UFunctions.
+                       -> PrM (Maybe LetDecRHSKindInfo, Int)
+                                 -- Returns two things in a pair:
+                                 --
+                                 -- 1. Information about the promoted kind,
+                                 --    if available.
+                                 --
+                                 -- 2. The number of arguments the let-dec has.
+                                 --    If no kind information is available from
+                                 --    which to infer this number, then this
+                                 --    will default to the earlier Int argument.
+    promote_let_dec_ty all_locals default_num_args =
+      case rhs_sort of
+        ClassMethodRHS tvbs arg_kis res_ki
+          -> -- For class method RHS helper functions, don't bother quantifying
+             -- any type variables in their SAKS. We could certainly try, but
+             -- given that these functions are only used internally, there's no
+             -- point in trying to get the order of type variables correct,
+             -- since we don't apply these functions with visible kind
+             -- applications.
+             let sak = ravelVanillaDType [] [] arg_kis res_ki in
+             return (Just (LDRKI (Just sak) tvbs arg_kis res_ki), length arg_kis)
+        LetBindingRHS
+          |  Just ty <- OMap.lookup name type_env
+          -> do
+          -- promoteType turns rank-1 uses of (->) into (~>). So, we unravel
+          -- first to avoid this behavior, and then ravel back.
+          (tvbs, argKs, resultK) <- promoteUnraveled ty
+          let m_sak | null all_locals = Just $ ravelVanillaDType tvbs [] argKs resultK
+                      -- If this let-dec closes over local variables, then
+                      -- don't give it a SAK.
+                      -- See Note [No SAKs for let-decs with local variables]
+                    | otherwise       = Nothing
+          -- invariant: count_args ty == length argKs
+          return (Just (LDRKI m_sak tvbs argKs resultK), length argKs)
+
+          |  otherwise
+          -> return (Nothing, default_num_args)
+
     etaContractOrExpand :: Int -> Int -> DClause -> PrM DClause
     etaContractOrExpand ty_num_args clause_num_args (DClause pats exp)
       | n >= 0 = do -- Eta-expand
@@ -671,11 +921,79 @@
       where
         n = ty_num_args - clause_num_args
 
+    count_args :: [DClause] -> PrM Int
     count_args (DClause pats _ : _) = return $ length pats
     count_args _ = fail $ "Impossible! A function without clauses."
 
-promoteClause :: Name -> DClause -> PrM (DTySynEqn, ADClause)
-promoteClause proName (DClause pats exp) = do
+-- An auxiliary data type used in promoteLetDecRHS that describes information
+-- related to the promoted kind of a class method default or normal
+-- let binding.
+data LetDecRHSKindInfo =
+  LDRKI (Maybe DKind) -- The standalone kind signature, if applicable.
+                      -- This will be Nothing if the let-dec RHS has local
+                      -- variables that it closes over.
+                      -- See Note [No SAKs for let-decs with local variables]
+        [DTyVarBndr]  -- The type variable binders of the kind.
+        [DKind]       -- The argument kinds.
+        DKind         -- The result kind.
+
+{-
+Note [No SAKs for let-decs with local variables]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Consider promoting this:
+
+  f :: Bool
+  f = let x = True
+          g :: () -> Bool
+          g _ = x
+      in g ()
+
+Clearly, the promoted `F` type family will have the following SAK:
+
+  type F :: ()
+
+What about `G`? At a passing glance, it appears that you could get away with
+this:
+
+  type G :: Bool -> ()
+
+But this isn't quite right, since `g` closes over `x = True`. The body of `G`,
+therefore, has to lift `x` to be an explicit argument:
+
+  type family G x (u :: ()) :: Bool where
+    G x _ = x
+
+At present, we don't keep track of the types of local variables like `x`, which
+makes it difficult to create a SAK for things like `G`. Here are some possible
+ideas, each followed by explanations for why they are infeasible:
+
+* Use wildcards:
+
+    type G :: _ -> () -> Bool
+
+  Alas, GHC currently does not allow wildcards in SAKs. See GHC#17432.
+
+* Use visible dependent quantification to avoid having to say what the kind
+  of `x` is:
+
+    type G :: forall x -> () -> Bool
+
+  A clever trick to be sure, but it doesn't quite do what we want, since
+  GHC will generalize that kind to become `forall (x :: k) -> () -> Bool`,
+  which is more general than we want.
+
+In any case, it's probably not worth bothering with SAKs for local definitions
+like `g` in the first place, so we avoid generating SAKs for anything that
+closes over at least one local variable for now. If someone yells about this,
+we'll reconsider this design.
+-}
+
+promoteClause :: DType -- What to use as the LHS of the promoted type family
+                       -- equation. This should consist of the promoted name of
+                       -- the function to which the clause belongs, applied to
+                       -- any local arguments (e.g., `Go x y z`).
+              -> DClause -> PrM (DTySynEqn, ADClause)
+promoteClause pro_clause_fun (DClause pats exp) = do
   -- promoting the patterns creates variable bindings. These are passed
   -- to the function promoted the RHS
   ((types, pats'), prom_pat_infos) <- evalForPair $ mapAndUnzipM promotePat pats
@@ -684,12 +1002,15 @@
   (ty, ann_exp) <- forallBind sig_kvs $
                    lambdaBind new_vars $
                    promoteExp exp
-  all_locals <- allLocals   -- these are bound *outside* of this clause
-  return ( DTySynEqn Nothing (foldType (DConT proName) $ map DVarT all_locals ++ types) ty
+  return ( DTySynEqn Nothing (foldType pro_clause_fun types) ty
          , ADClause new_vars pats' ann_exp )
 
-promoteMatch :: Name -> DMatch -> PrM (DTySynEqn, ADMatch)
-promoteMatch caseTFName (DMatch pat exp) = do
+promoteMatch :: DType -- What to use as the LHS of the promoted type family
+                      -- equation. This should consist of the promoted name of
+                      -- the case expression to which the match belongs, applied
+                      -- to any local arguments (e.g., `Case x y z`).
+             -> DMatch -> PrM (DTySynEqn, ADMatch)
+promoteMatch pro_case_fun (DMatch pat exp) = do
   -- promoting the patterns creates variable bindings. These are passed
   -- to the function promoted the RHS
   ((ty, pat'), prom_pat_infos) <- evalForPair $ promotePat pat
@@ -698,10 +1019,7 @@
   (rhs, ann_exp) <- forallBind sig_kvs $
                     lambdaBind new_vars $
                     promoteExp exp
-  all_locals <- allLocals
-  return $ ( DTySynEqn Nothing
-                       (foldType (DConT caseTFName) $ map DVarT all_locals ++ [ty])
-                       rhs
+  return $ ( DTySynEqn Nothing (pro_case_fun `DAppT` ty) rhs
            , ADMatch new_vars pat' ann_exp)
 
 -- promotes a term pattern into a type pattern, accumulating bound variable names
@@ -739,7 +1057,9 @@
 
 promoteExp :: DExp -> PrM (DType, ADExp)
 promoteExp (DVarE name) = fmap (, ADVarE name) $ lookupVarE name
-promoteExp (DConE name) = return $ (promoteValRhs name, ADConE name)
+promoteExp (DConE name) = do
+  opts <- getOptions
+  return (DConT $ defunctionalizedName0 opts name, ADConE name)
 promoteExp (DLitE lit)  = fmap (, ADLitE lit) $ promoteLitExp lit
 promoteExp (DAppE exp1 exp2) = do
   (exp1', ann_exp1) <- promoteExp exp1
@@ -750,13 +1070,13 @@
   qReportWarning "Visible type applications are ignored by `singletons`."
   promoteExp exp
 promoteExp (DLamE names exp) = do
+  opts <- getOptions
   lambdaName <- newUniqueName "Lambda"
   tyNames <- mapM mkTyName names
   let var_proms = zip names tyNames
   (rhs, ann_exp) <- lambdaBind var_proms $ promoteExp exp
-  tyFamLamTypes <- mapM (const $ qNewName "t") names
   all_locals <- allLocals
-  let all_args = all_locals ++ tyFamLamTypes
+  let all_args = all_locals ++ tyNames
       tvbs     = map DPlainTV all_args
   emitDecs [DClosedTypeFamilyD (DTypeFamilyHead
                                  lambdaName
@@ -765,10 +1085,10 @@
                                  Nothing)
                                [DTySynEqn Nothing
                                           (foldType (DConT lambdaName) $
-                                           map DVarT (all_locals ++ tyNames))
+                                           map DVarT all_args)
                                           rhs]]
-  emitDecsM $ defunctionalize lambdaName Nothing tvbs Nothing
-  let promLambda = foldl apply (DConT (promoteTySym lambdaName 0))
+  emitDecsM $ defunctionalize lambdaName Nothing $ DefunNoSAK tvbs Nothing
+  let promLambda = foldl apply (DConT (defunctionalizedName opts lambdaName 0))
                                (map DVarT all_locals)
   return (promLambda, ADLamE tyNames promLambda names ann_exp)
 promoteExp (DCaseE exp matches) = do
@@ -776,7 +1096,7 @@
   all_locals <- allLocals
   let prom_case = foldType (DConT caseTFName) (map DVarT all_locals)
   (exp', ann_exp)     <- promoteExp exp
-  (eqns, ann_matches) <- mapAndUnzipM (promoteMatch caseTFName) matches
+  (eqns, ann_matches) <- mapAndUnzipM (promoteMatch prom_case) matches
   tyvarName  <- qNewName "t"
   let all_args = all_locals ++ [tyvarName]
       tvbs     = map DPlainTV all_args
@@ -787,8 +1107,7 @@
          , ADCaseE ann_exp ann_matches applied_case )
 promoteExp (DLetE decs exp) = do
   unique <- qNewUnique
-  let letPrefixes = uniquePrefixes "Let" "<<<" unique
-  (binds, ann_env) <- promoteLetDecs letPrefixes decs
+  (binds, ann_env) <- promoteLetDecs (Just unique) decs
   (exp', ann_exp) <- letBind binds $ promoteExp exp
   return (exp', ADLetE ann_env ann_exp)
 promoteExp (DSigE exp ty) = do
diff --git a/src/Data/Singletons/Promote/Defun.hs b/src/Data/Singletons/Promote/Defun.hs
--- a/src/Data/Singletons/Promote/Defun.hs
+++ b/src/Data/Singletons/Promote/Defun.hs
@@ -11,513 +11,870 @@
 module Data.Singletons.Promote.Defun where
 
 import Language.Haskell.TH.Desugar
-import qualified Language.Haskell.TH.Desugar.OSet as OSet
-import Data.Singletons.Promote.Monad
-import Data.Singletons.Promote.Type
-import Data.Singletons.Names
-import Language.Haskell.TH.Syntax
-import Data.Singletons.Syntax
-import Data.Singletons.Util
-import Control.Monad
-import Data.Foldable
-import qualified Data.Map.Strict as Map
-import Data.Map.Strict (Map)
-import Data.Maybe
-
-defunInfo :: DInfo -> PrM [DDec]
-defunInfo (DTyConI dec _instances) = buildDefunSyms dec
-defunInfo (DPrimTyConI _name _numArgs _unlifted) =
-  fail $ "Building defunctionalization symbols of primitive " ++
-         "type constructors not supported"
-defunInfo (DVarI _name _ty _mdec) =
-  fail "Building defunctionalization symbols of values not supported"
-defunInfo (DTyVarI _name _ty) =
-  fail "Building defunctionalization symbols of type variables not supported"
-defunInfo (DPatSynI {}) =
-  fail "Building defunctionalization symbols of pattern synonyms not supported"
-
-defunTypeDecls :: [TySynDecl]
-               -> [ClosedTypeFamilyDecl]
-               -> [OpenTypeFamilyDecl]
-               -> PrM ()
-defunTypeDecls ty_syns c_tyfams o_tyfams = do
-  defun_ty_syns <-
-    concatMapM (\(TySynDecl name tvbs rhs) -> buildDefunSymsTySynD name tvbs rhs) ty_syns
-  defun_c_tyfams <-
-    concatMapM (buildDefunSymsClosedTypeFamilyD . getTypeFamilyDecl) c_tyfams
-  defun_o_tyfams <-
-    concatMapM (buildDefunSymsOpenTypeFamilyD . getTypeFamilyDecl) o_tyfams
-  emitDecs $ defun_ty_syns ++ defun_c_tyfams ++ defun_o_tyfams
-
-buildDefunSyms :: DDec -> PrM [DDec]
-buildDefunSyms (DDataD _new_or_data _cxt _tyName _tvbs _k ctors _derivings) =
-  buildDefunSymsDataD ctors
-buildDefunSyms (DClosedTypeFamilyD tf_head _) =
-  buildDefunSymsClosedTypeFamilyD tf_head
-buildDefunSyms (DOpenTypeFamilyD tf_head) =
-  buildDefunSymsOpenTypeFamilyD tf_head
-buildDefunSyms (DTySynD name tvbs rhs) =
-  buildDefunSymsTySynD name tvbs rhs
-buildDefunSyms (DClassD _cxt name tvbs _fundeps _members) = do
-  defunReifyFixity name tvbs (Just (DConT constraintName))
-buildDefunSyms _ = fail $ "Defunctionalization symbols can only be built for " ++
-                          "type families and data declarations"
-
-buildDefunSymsClosedTypeFamilyD :: DTypeFamilyHead -> PrM [DDec]
-buildDefunSymsClosedTypeFamilyD = buildDefunSymsTypeFamilyHead id id
-
-buildDefunSymsOpenTypeFamilyD :: DTypeFamilyHead -> PrM [DDec]
-buildDefunSymsOpenTypeFamilyD = buildDefunSymsTypeFamilyHead cuskify default_to_star
-  where
-    default_to_star :: Maybe DKind -> Maybe DKind
-    default_to_star Nothing  = Just $ DConT typeKindName
-    default_to_star (Just k) = Just k
-
-buildDefunSymsTypeFamilyHead
-  :: (DTyVarBndr -> DTyVarBndr)
-  -> (Maybe DKind -> Maybe DKind)
-  -> DTypeFamilyHead -> PrM [DDec]
-buildDefunSymsTypeFamilyHead default_tvb default_kind
-    (DTypeFamilyHead name tvbs result_sig _) = do
-  let arg_tvbs = map default_tvb tvbs
-      res_kind = default_kind (resultSigToMaybeKind result_sig)
-  defunReifyFixity name arg_tvbs res_kind
-
-buildDefunSymsTySynD :: Name -> [DTyVarBndr] -> DType -> PrM [DDec]
-buildDefunSymsTySynD name tvbs rhs =
-  defunReifyFixity name tvbs mb_res_kind
-  where
-    -- In order to have a CUSK, a type synonym must annotate its right-hand
-    -- side with an explicit kind signature, so we can make use of this
-    -- property to determine the result kind when defunctionalizing the
-    -- type synonym.
-    mb_res_kind :: Maybe DKind
-    mb_res_kind = case rhs of
-                    DSigT _ k -> Just k
-                    _         -> Nothing
-
-buildDefunSymsDataD :: [DCon] -> PrM [DDec]
-buildDefunSymsDataD ctors =
-  concatMapM promoteCtor ctors
-  where
-    promoteCtor :: DCon -> PrM [DDec]
-    promoteCtor ctor@(DCon _ _ _ _ res_ty) = do
-      let (name, arg_tys) = extractNameTypes ctor
-      tvb_names <- replicateM (length arg_tys) $ qNewName "t"
-      arg_kis <- mapM promoteType arg_tys
-      let arg_tvbs = zipWith DKindedTV tvb_names arg_kis
-      res_ki <- promoteType res_ty
-      defunReifyFixity name arg_tvbs (Just res_ki)
-
--- Generate defunctionalization symbols for a name, using reifyFixityWithLocals
--- to determine what the fixity of each symbol should be.
--- See Note [Fixity declarations for defunctionalization symbols]
-defunReifyFixity :: Name -> [DTyVarBndr] -> Maybe DKind -> PrM [DDec]
-defunReifyFixity name tvbs m_res_kind = do
-  m_fixity <- reifyFixityWithLocals name
-  defunctionalize name m_fixity tvbs m_res_kind
-
--- Generate data declarations and apply instances
--- required for defunctionalization.
--- For a type family:
---
--- type family Foo (m :: Nat) (n :: Nat) (l :: Nat) :: Nat
---
--- we generate data declarations that allow us to talk about partial
--- application at the type level:
---
--- type FooSym3 a b c = Foo a b c
--- data FooSym2 a b f where
---   FooSym2KindInference :: SameKind (Apply (FooSym2 a b) arg) (FooSym3 a b arg)
---                        => FooSym2 a b f
--- type instance Apply (FooSym2 a b) c = FooSym3 a b c
--- data FooSym1 a f where
---   FooSym1KindInference :: SameKind (Apply (FooSym1 a) arg) (FooSym2 a arg)
---                        => FooSym1 a f
--- type instance Apply (FooSym1 a) b = FooSym2 a b
--- data FooSym0 f where
---  FooSym0KindInference :: SameKind (Apply FooSym0 arg) (FooSym1 arg)
---                       => FooSym0 f
--- type instance Apply FooSym0 a = FooSym1 a
---
--- What's up with all the "KindInference" stuff? In some scenarios, we don't
--- know the kinds that we should be using in these symbols. But, GHC can figure
--- it out using the types of the "KindInference" dummy data constructors. A
--- bit of a hack, but it works quite nicely. The only problem is that GHC will
--- warn about an unused data constructor. So, we use the data constructor in
--- an instance of a dummy class. (See Data.Singletons.SuppressUnusedWarnings
--- for the class, which should never be seen by anyone, ever.)
---
--- The defunctionalize function takes Maybe DKinds so that the caller can
--- indicate which kinds are known and which need to be inferred.
---
--- See also Note [Defunctionalization and dependent quantification]
-defunctionalize :: Name
-                -> Maybe Fixity -- The name's fixity, if one was declared.
-                -> [DTyVarBndr] -> Maybe DKind -> PrM [DDec]
-defunctionalize name m_fixity m_arg_tvbs' m_res_kind' = do
-  (m_arg_tvbs, m_res_kind) <- eta_expand (noExactTyVars m_arg_tvbs')
-                                         (noExactTyVars m_res_kind')
-
-  let -- Implements part (2)(i) from Note [Defunctionalization and dependent quantification]
-      tvb_to_type_map :: Map Name DType
-      tvb_to_type_map = Map.fromList $                   -- (2)(i)(c)
-                        map (\tvb -> (extractTvbName tvb, dTyVarBndrToDType tvb)) $
-                        toposortTyVarsOf $               -- (2)(i)(b)
-                        map dTyVarBndrToDType m_arg_tvbs
-                          ++ maybeToList m_res_kind      -- (2)(i)(a)
-
-      go :: Int -> [DTyVarBndr] -> Maybe DKind
-         -> ([DTyVarBndr] -> DType)  -- given the argument tyvar binders,
-                                     -- produce the RHS of the Apply instance
-         -> PrM [DDec]
-      go _ [] _ _ = return []
-      go n (m_arg : m_args) m_result mk_rhs = do
-        extra_name <- qNewName "arg"
-        let tyfun_name  = extractTvbName m_arg
-            data_name   = promoteTySym name n
-            next_name   = promoteTySym name (n+1)
-            con_name    = prefixName "" ":" $ suffixName "KindInference" "###" data_name
-            m_tyfun     = buildTyFunArrow_maybe (extractTvbKind m_arg) m_result
-            arg_params  = -- Implements part (2)(ii) from
-                          -- Note [Defunctionalization and dependent quantification]
-                          map (map_tvb_kind (substType tvb_to_type_map)) $
-                          reverse m_args
-            arg_names   = map extractTvbName arg_params
-            params      = arg_params ++ [DPlainTV tyfun_name]
-            con_eq_ct   = DConT sameKindName `DAppT` lhs `DAppT` rhs
-              where
-                lhs = foldType (DConT data_name) (map DVarT arg_names) `apply` (DVarT extra_name)
-                rhs = foldType (DConT next_name) (map DVarT (arg_names ++ [extra_name]))
-            con_decl    = DCon (map dropTvbKind params ++ [DPlainTV extra_name])
-                               [con_eq_ct]
-                               con_name
-                               (DNormalC False [])
-                               (foldTypeTvbs (DConT data_name) params)
-            data_decl   = DDataD Data [] data_name args res_ki [con_decl] []
-              where
-                (args, res_ki)
-                  = case m_tyfun of
-                      Nothing    -> (params, Nothing)
-                                    -- If we cannot infer the return type, don't bother
-                                    -- trying to construct an explicit return kind.
-                      Just tyfun ->
-                        let bound_tvs = OSet.fromList (map extractTvbName arg_params)
-                                        `OSet.union` foldMap (foldMap fvDType)
-                                                             (map extractTvbKind arg_params)
-                            not_bound tvb = not (extractTvbName tvb `OSet.member` bound_tvs)
-                            tvb_to_type tvb_name = fromMaybe (DVarT tvb_name) $
-                                                   Map.lookup tvb_name tvb_to_type_map
-                            -- Implements part (2)(iii) from
-                            -- Note [Defunctionalization and dependent quantification]
-                            tyfun_tvbs = filter not_bound $     -- (2)(iii)(d)
-                                         toposortTyVarsOf $     -- (2)(iii)(c)
-                                         map tvb_to_type $      -- (2)(iii)(b)
-                                         toList $ fvDType tyfun -- (2)(iii)(a)
-                        in (arg_params, Just (DForallT tyfun_tvbs [] tyfun))
-            app_data_ty = foldTypeTvbs (DConT data_name) m_args
-            app_eqn     = DTySynEqn Nothing
-                                    (DConT applyName `DAppT` app_data_ty
-                                                     `DAppT` DVarT tyfun_name)
-                                    (mk_rhs (m_args ++ [DPlainTV tyfun_name]))
-            app_decl    = DTySynInstD app_eqn
-            suppress    = DInstanceD Nothing Nothing []
-                            (DConT suppressClassName `DAppT` app_data_ty)
-                            [DLetDec $ DFunD suppressMethodName
-                                             [DClause []
-                                                      ((DVarE 'snd) `DAppE`
-                                                       mkTupleDExp [DConE con_name,
-                                                                    mkTupleDExp []])]]
-
-            mk_rhs'     = foldTypeTvbs (DConT data_name)
-
-            -- See Note [Fixity declarations for defunctionalization symbols]
-            mk_fix_decl f = DLetDec $ DInfixD f data_name
-            fixity_decl   = maybeToList $ fmap mk_fix_decl m_fixity
-
-        decls <- go (n - 1) m_args m_tyfun mk_rhs'
-        return $ suppress : data_decl : app_decl : fixity_decl ++ decls
-
-  let num_args = length m_arg_tvbs
-      sat_name = promoteTySym name num_args
-      mk_rhs   = foldTypeTvbs (DConT name)
-      sat_dec  = DTySynD sat_name m_arg_tvbs (mk_rhs m_arg_tvbs)
-
-  other_decs <- go (num_args - 1) (reverse m_arg_tvbs) m_res_kind mk_rhs
-  return $ sat_dec : other_decs
-  where
-    eta_expand :: [DTyVarBndr] -> Maybe DKind -> PrM ([DTyVarBndr], Maybe DKind)
-    eta_expand m_arg_tvbs Nothing = pure (m_arg_tvbs, Nothing)
-    eta_expand m_arg_tvbs (Just res_kind) = do
-        let (_, _, argKs, resultK) = unravel res_kind
-        tvb_names <- replicateM (length argKs) $ qNewName "e"
-        let res_kind_arg_tvbs = zipWith DKindedTV tvb_names argKs
-        pure (m_arg_tvbs ++ res_kind_arg_tvbs, Just resultK)
-
-    map_tvb_kind :: (DKind -> DKind) -> DTyVarBndr -> DTyVarBndr
-    map_tvb_kind _ tvb@DPlainTV{}  = tvb
-    map_tvb_kind f (DKindedTV n k) = DKindedTV n (f k)
-
-{-
-Note [Defunctionalization and dependent quantification]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-The machinery in this module supports defunctionalizing types that use
-dependent quantification, such as in the following example:
-
-  type family Symmetry (a :: Proxy t) (y :: Proxy t)
-                       (e :: (a :: Proxy (t :: k)) :~: (y :: Proxy (t :: k))) :: Type where
-    Symmetry a y _ = y :~: a
-
-Here is what is involved in making this happen:
-
-1. When defunctionalizing, we must not only know the argument kinds, but rather
-   the argument *kind variable binders*. This is essential since, for instance,
-   Symmetry dependently quantifies `a` and `y` and uses them in the kind of
-   `e`. If we did not track the original kind variable names, then instead of
-   generating this defunctionalization symbol for Symmetry:
-
-     data SymmetrySym2 (a :: Proxy t) (y :: Proxy t) :: (a :~: y) ~> Type
-
-   We would generate something more general, like this:
-
-     data SymmetrySym2 (abc1 :: Proxy t) (abc2 :: Proxy t) :: (a :~: y) ~> Type
-
-   Alas, there are times where will have no choice but to write a slightly
-   more general kind than we should. For instance, consider this:
-
-     data SymmetrySym0 :: Proxy t ~> Proxy t ~> (a :~: y) ~> Type
-
-   This defunctionalization symbol doesn't capture the dependent quantification
-   in the first and second argument kinds. But in order to do that properly,
-   you'd need the ability to write something like:
-
-     data SymmetrySym0 :: forall (a :: Proxy t) ~> forall (y :: Proxy t)
-                       ~> (a :~: y) ~> Type
-
-   It is my (RGS's) belief that it is not possible to achieve something like
-   this in today's GHC (see #304), so we'll just have to live with SymmetrySym0
-   being slightly more general than it ought to be. In practice, this is
-   unlikely to bite unless you're writing code that specifically exploits this
-   dependency in just the right way.
-
-2. I pulled a fast one earlier by writing:
-
-     data SymmetrySym0 :: Proxy t ~> Proxy t ~> (a :~: y) ~> Type
-
-   GHC will actually reject this, because it does not have a CUSK. There are
-   two glaring problems here:
-
-   (a) The kind of `t` is underdetermined.
-   (b) `a` and `y` should have kind `Proxy t`, but this is not currently the case.
-
-   Ultimately, the fix is to use explicit kind signatures. A naïve attempt
-   would be something like this:
-
-     data SymmetrySym0 :: Proxy (t :: (k :: Type)) ~> Proxy (t :: (k :: Type))
-                       ~> ((a :: Proxy (t :: (k :: Type))) :~: (y :: Proxy (t :: (k :: Type))))
-                       ~> Type
-
-   While that works, it adds a nontrivial amount of clutter. Plus, it requires
-   figuring out (in Template Haskell) which variables have underdetermined
-   kinds and substituting for them. Blegh. A much cleaner approach is:
-
-     data SymmetrySym0 :: forall (k :: Type) (t :: k) (a :: Proxy t) (y :: Proxy t).
-                          Proxy t ~> Proxy t ~> (a :~: y) ~> Type
-
-   This time, all we have to do is put an explicit `forall` in front, and we
-   achieve a CUSK without having to muck up the body of return kind. It also
-   has the benefit of looking much nicer in generated code.
-
-   Let's talk about how to achieve this feat, using SymmetrySym1 as the
-   guiding example:
-
-   (i) Before we begin defunctionalizing a type, we construct a mapping from
-       variable names to their corresponding types, complete with kinds.
-       For instance, in Symmetry, we would have the following map:
-
-         { k :-> DVarT k                                         -- k
-         , t :-> DSigT (DVarT t) (DVarT k)                       -- (t :: k)
-         , a :-> DSigT (DVarT a) (DConT ''Proxy `DAppT` DVarT t) -- (a :: Proxy t)
-         , y :-> DSigT (DVarT y) (DConT ''Proxy `DAppT` DVarT y) -- (y :: Proxy t)
-         , e :-> DSigT (DVarT e) (DConT ''(:~:)
-                                  `DAppT` DSigT (DVarT a) (DConT ''Proxy `DAppT` DSigT (DVarT t) (DVarT k))
-                                  `DAppT` DSigT (DVarT y) (DConT ''Proxy `DAppT` DSigT (DVarT t) (DVarT k)))
-                                                                 -- (e :: (a :: Proxy (t :: k)) :~: (y :: Proxy (t :: k)))
-         }
-
-       Why do this? Because when constructing the `forall` in the return kind
-       of a defunctionalization symbol, it's convenient to be able to know
-       the kinds of everything being bound at a glance. It's not always
-       possible to recover the kinds of every variable (for instance, if
-       we're just given `Proxy t ~> Proxy t ~> (a :~: y) ~> Type`), so having
-       this information is handy.
-
-       To construct this map, we:
-
-       (a) Grab the list of type variable binders (this is given as an input
-           to defunctionalize, as discussed in part (1)) and turn it into a list
-           of types. Also include the return kind (if there is one) in this
-           list, as it may also mention type variables with explicit kinds.
-       (b) Construct a flat list of all type variables mentioned in this list.
-           This may involve looking in the kinds of type variables binders.
-           (Note that this part is crucial—the the Singletons/PolyKinds test
-           will fail to compile without it!)
-       (c) Take the flat list and insert each variable into the map by
-           mapping its name to its type (as demonstrated above).
-
-       To continue the Symmetry example:
-
-       (a) We grab the list of type variable binders
-
-             [ (a :: Proxy t)
-             , (y :: Proxy t)
-             , (e :: (a :: Proxy (t :: k)) :~: (y :: Proxy (t :: k)))
-             ]
-
-           from the Symmetry declaration. Including the return kind (Type),
-           we get:
-
-             [ (a :: Proxy t)
-             , (y :: Proxy t)
-             , (e :: (a :: Proxy (t :: k)) :~: (y :: Proxy (t :: k)))
-             , Type
-             ]
-
-       (b) We flatten this into a list of well scoped type variables:
-
-             [ k
-             , (t :: k)
-             , (a :: Proxy t)
-             , (y :: Proxy t)
-             , (e :: (a :: Proxy (t :: k)) :~: (y :~: Proxy (t :: k)))
-             ]
-
-       (c) From this, we construct the map shown at the beginning of (i).
-
-   (ii) Using the map, we will annotate any kind variables in the LHS of the
-        declaration with their respective kinds. In this example, the LHS is:
-
-          data SymmetrySym1 (a :: Proxy t) :: ...
-
-        Since `t` maps to simply `(t :: k)` in the map, the LHS becomes:
-
-          data SymmetrySym1 (a :: Proxy (t :: k)) :: ...
-
-        Why do this? Because we need to make it apparent that `k` is bound on
-        the LHS. If we don't, we might end up trying to quantify `k` in the
-        return kind (see #353 for an example of what goes wrong if you try to
-        do this).
-
-        Having to explicitly annotate each occurrence of every kind variable on
-        the LHS like this is a bit tiresome, especially since we don't have to
-        do this in the return kind. If GHC had syntax for visible dependent
-        quantification, we could avoid this step entirely and simply write:
-
-          data SymmetrySym1 :: forall k (t :: k). forall (a :: Proxy t) -> ...
-
-        Until GHC gains this syntax, this is the best alternative.
-
-   (iii) When constructing each defunctionalization symbol, we will end up with
-         some remaining type variable binders and a return kind. For instance:
-
-           data SymmetrySym1 (a :: Proxy (t :: k))
-             :: forall ???. Proxy t
-                         ~> ((a :: Proxy (t :: k)) :~: (y :: Proxy (t :: k)))
-                         ~> Type
-
-         We must fill in the ??? part. Here is how we do so:
-
-         (a) Collect all of the type variables mentioned in the return kind.
-         (b) Look up each type variable's corresponding type in the map (from
-             part (i)) to learn as much kind information as possible.
-         (c) Perform a reverse topological sort on these types to put the
-             types (and kind) variables in proper dependency order.
-         (d) Filter out any variables that are already bound by the type
-             variable binders that precede the return kind.
-
-         After doing these steps, what remains goes in place of ???. Let's
-         explain this with the example above:
-
-           data SymmetrySym1 (a :: Proxy (t :: k))
-             :: forall ???. Proxy t
-                         ~> ((a :: Proxy (t :: k)) :~: (y :: Proxy (t :: k)))
-                         ~> Type
-
-         (a) [t, a, k, y]
-         (b) [(t :: k), (a :: Proxy t), k, (y :: Proxy t)]
-         (c) [k, (t :: k), (a :: Proxy t), (y :: Proxy t)]
-         (d) [(y :: Proxy t)] (`k`, `t` and `a` were already bound)
-
-         Therefore, we end up with:
-
-           data SymmetrySym1 (a :: Proxy (t :: k))
-             :: forall (y :: Proxy t).
-                            Proxy t
-                         ~> ((a :: Proxy (t :: k)) :~: (y :: Proxy (t :: k)))
-                         ~> Type
--}
-
--- This is a small function with large importance. When generating
--- defunctionalization data types, we often need to fill in the blank in the
--- sort of code exemplified below:
---
--- @
--- data FooSym2 a (b :: x) (c :: TyFun y z) where
---   FooSym2KindInference :: _
--- @
---
--- Where the kind of @a@ is not known. It's extremely tempting to just
--- copy-and-paste the type variable binders from the data type itself to the
--- constructor, like so:
---
--- @
--- data FooSym2 a (b :: x) (c :: TyFun y z) where
---   FooSym2KindInference :: forall a (b :: x) (c :: TyFun y z).
---                           SameKind (...) (...).
---                           FooSym2KindInference a b c
--- @
---
--- But this ends up being an untenable approach. Because @a@ lacks a kind
--- signature, @FooSym2@ does not have a complete, user-specified kind signature
--- (or CUSK), so GHC will fail to typecheck @FooSym2KindInference@.
---
--- Thankfully, there's a workaround—just don't give any of the constructor's
--- type variable binders any kinds:
---
--- @
--- data FooSym2 a (b :: x) (c :: TyFun y z) where
---   FooSym2KindInference :: forall a b c
---                           SameKind (...) (...).
---                           FooSym2KindInference a b c
--- @
---
--- GHC may be moody when it comes to CUSKs, but it's at least understanding
--- enough to typecheck this without issue. The 'dropTvbKind' function is
--- what removes the kinds used in the kind inference constructor.
-dropTvbKind :: DTyVarBndr -> DTyVarBndr
-dropTvbKind tvb@(DPlainTV {}) = tvb
-dropTvbKind (DKindedTV n _)   = DPlainTV n
-
--- Shorthand for building (k1 ~> k2)
-buildTyFunArrow :: DKind -> DKind -> DKind
-buildTyFunArrow k1 k2 = DConT tyFunArrowName `DAppT` k1 `DAppT` k2
-
-buildTyFunArrow_maybe :: Maybe DKind -> Maybe DKind -> Maybe DKind
-buildTyFunArrow_maybe m_k1 m_k2 = do
-  k1 <- m_k1
-  k2 <- m_k2
-  return $ DConT tyFunArrowName `DAppT` k1 `DAppT` k2
-
--- Build (~>) kind from the list of kinds
-ravelTyFun :: [DKind] -> DKind
-ravelTyFun []    = error "Internal error: TyFun raveling nil"
-ravelTyFun [k]   = k
-ravelTyFun kinds = go tailK (buildTyFunArrow k2 k1)
-    where (k1 : k2 : tailK) = reverse kinds
-          go []     acc = acc
-          go (k:ks) acc = go ks (buildTyFunArrow k acc)
-
-{-
+import Data.Singletons.Promote.Monad
+import Data.Singletons.Promote.Type
+import Data.Singletons.Names
+import Language.Haskell.TH.Syntax
+import Data.Singletons.Syntax
+import Data.Singletons.TH.Options
+import Data.Singletons.Util
+import Control.Monad
+import qualified Data.Map.Strict as Map
+import Data.Map.Strict (Map)
+import Data.Maybe
+
+defunInfo :: DInfo -> PrM [DDec]
+defunInfo (DTyConI dec _instances) = buildDefunSyms dec
+defunInfo (DPrimTyConI _name _numArgs _unlifted) =
+  fail $ "Building defunctionalization symbols of primitive " ++
+         "type constructors not supported"
+defunInfo (DVarI _name _ty _mdec) =
+  fail "Building defunctionalization symbols of values not supported"
+defunInfo (DTyVarI _name _ty) =
+  fail "Building defunctionalization symbols of type variables not supported"
+defunInfo (DPatSynI {}) =
+  fail "Building defunctionalization symbols of pattern synonyms not supported"
+
+-- Defunctionalize type families defined at the top level (i.e., not associated
+-- with a type class).
+defunTopLevelTypeDecls ::
+     [TySynDecl]
+  -> [ClosedTypeFamilyDecl]
+  -> [OpenTypeFamilyDecl]
+  -> PrM ()
+defunTopLevelTypeDecls ty_syns c_tyfams o_tyfams = do
+  defun_ty_syns <-
+    concatMapM (\(TySynDecl name tvbs rhs) -> buildDefunSymsTySynD name tvbs rhs) ty_syns
+  defun_c_tyfams <-
+    concatMapM (buildDefunSymsClosedTypeFamilyD . getTypeFamilyDecl) c_tyfams
+  defun_o_tyfams <-
+    concatMapM (buildDefunSymsOpenTypeFamilyD . getTypeFamilyDecl) o_tyfams
+  emitDecs $ defun_ty_syns ++ defun_c_tyfams ++ defun_o_tyfams
+
+-- Defunctionalize all the type families associated with a type class.
+defunAssociatedTypeFamilies ::
+     [DTyVarBndr]         -- The type variables bound by the parent class
+  -> [OpenTypeFamilyDecl] -- The type families associated with the parent class
+  -> PrM ()
+defunAssociatedTypeFamilies cls_tvbs atfs = do
+  defun_atfs <- concatMapM defun atfs
+  emitDecs defun_atfs
+  where
+    defun :: OpenTypeFamilyDecl -> PrM [DDec]
+    defun (TypeFamilyDecl tf_head) =
+      buildDefunSymsTypeFamilyHead ascribe_tf_tvb_kind id tf_head
+
+    -- Maps class-bound type variables to their kind annotations (if supplied).
+    -- For example, `class C (a :: Bool) b (c :: Type)` will produce
+    -- {a |-> Bool, c |-> Type}.
+    cls_tvb_kind_map :: Map Name DKind
+    cls_tvb_kind_map = Map.fromList [ (extractTvbName tvb, tvb_kind)
+                                    | tvb <- cls_tvbs
+                                    , Just tvb_kind <- [extractTvbKind tvb]
+                                    ]
+
+    -- If the parent class lacks a SAK, we cannot safely default kinds to
+    -- Type. All we can do is make use of whatever kind information that parent
+    -- class provides and let kind inference do the rest.
+    --
+    -- We can sometimes learn more specific information about unannotated type
+    -- family binders from the parent class, as in the following example:
+    --
+    --   class C (a :: Bool) where
+    --     type T a :: Type
+    --
+    -- Here, we know that `T :: Bool -> Type` because we can infer that the `a`
+    -- in `type T a` should be of kind `Bool` from the class SAK.
+    ascribe_tf_tvb_kind :: DTyVarBndr -> DTyVarBndr
+    ascribe_tf_tvb_kind tvb =
+      case tvb of
+        DKindedTV{} -> tvb
+        DPlainTV n  -> maybe tvb (DKindedTV n) $ Map.lookup n cls_tvb_kind_map
+
+buildDefunSyms :: DDec -> PrM [DDec]
+buildDefunSyms dec =
+  case dec of
+    DDataD _new_or_data _cxt _tyName _tvbs _k ctors _derivings ->
+      buildDefunSymsDataD ctors
+    DClosedTypeFamilyD tf_head _ ->
+      buildDefunSymsClosedTypeFamilyD tf_head
+    DOpenTypeFamilyD tf_head ->
+      buildDefunSymsOpenTypeFamilyD tf_head
+    DTySynD name tvbs rhs ->
+      buildDefunSymsTySynD name tvbs rhs
+    DClassD _cxt name tvbs _fundeps _members ->
+      defunReify name tvbs (Just (DConT constraintName))
+    _ -> fail $ "Defunctionalization symbols can only be built for " ++
+                "type families and data declarations"
+
+-- Unlike open type families, closed type families that lack SAKS do not
+-- default anything to Type, instead relying on kind inference to figure out
+-- unspecified kinds.
+buildDefunSymsClosedTypeFamilyD :: DTypeFamilyHead -> PrM [DDec]
+buildDefunSymsClosedTypeFamilyD = buildDefunSymsTypeFamilyHead id id
+
+-- If an open type family lacks a SAK and has type variable binders or a result
+-- without explicit kinds, then they default to Type (hence the uses of
+-- default{Tvb,Maybe}ToTypeKind).
+buildDefunSymsOpenTypeFamilyD :: DTypeFamilyHead -> PrM [DDec]
+buildDefunSymsOpenTypeFamilyD =
+  buildDefunSymsTypeFamilyHead defaultTvbToTypeKind (Just . defaultMaybeToTypeKind)
+
+buildDefunSymsTypeFamilyHead
+  :: (DTyVarBndr -> DTyVarBndr)   -- How to default each type variable binder
+  -> (Maybe DKind -> Maybe DKind) -- How to default the result kind
+  -> DTypeFamilyHead -> PrM [DDec]
+buildDefunSymsTypeFamilyHead default_tvb default_kind
+    (DTypeFamilyHead name tvbs result_sig _) = do
+  let arg_tvbs = map default_tvb tvbs
+      res_kind = default_kind (resultSigToMaybeKind result_sig)
+  defunReify name arg_tvbs res_kind
+
+buildDefunSymsTySynD :: Name -> [DTyVarBndr] -> DType -> PrM [DDec]
+buildDefunSymsTySynD name tvbs rhs = defunReify name tvbs mb_res_kind
+  where
+    -- If a type synonym lacks a SAK, we can "infer" its result kind by
+    -- checking for an explicit kind annotation on the right-hand side.
+    mb_res_kind :: Maybe DKind
+    mb_res_kind = case rhs of
+                    DSigT _ k -> Just k
+                    _         -> Nothing
+
+buildDefunSymsDataD :: [DCon] -> PrM [DDec]
+buildDefunSymsDataD ctors =
+  concatMapM promoteCtor ctors
+  where
+    promoteCtor :: DCon -> PrM [DDec]
+    promoteCtor (DCon tvbs _ name fields res_ty) = do
+      let arg_tys = tysOfConFields fields
+      arg_kis <- traverse promoteType_NC arg_tys
+      res_ki  <- promoteType_NC res_ty
+      let con_ki = ravelVanillaDType tvbs [] arg_kis res_ki
+      m_fixity <- reifyFixityWithLocals name
+      defunctionalize name m_fixity $ DefunSAK con_ki
+
+-- Generate defunctionalization symbols for a name, using reifyFixityWithLocals
+-- to determine what the fixity of each symbol should be
+-- (see Note [Fixity declarations for defunctionalization symbols])
+-- and dsReifyType to determine whether defunctionalization should make use
+-- of SAKs or not (see Note [Defunctionalization game plan]).
+defunReify :: Name           -- Name of the declaration to be defunctionalized
+           -> [DTyVarBndr]   -- The declaration's type variable binders
+                             -- (only used if the declaration lacks a SAK)
+           -> Maybe DKind    -- The declaration's return kind, if it has one
+                             -- (only used if the declaration lacks a SAK)
+           -> PrM [DDec]
+defunReify name tvbs m_res_kind = do
+  m_fixity <- reifyFixityWithLocals name
+  m_sak    <- dsReifyType name
+  let defun = defunctionalize name m_fixity
+  case m_sak of
+    Just sak -> defun $ DefunSAK sak
+    Nothing  -> defun $ DefunNoSAK tvbs m_res_kind
+
+-- Generate symbol data types, Apply instances, and other declarations required
+-- for defunctionalization.
+-- See Note [Defunctionalization game plan] for an overview of the design
+-- considerations involved.
+defunctionalize :: Name
+                -> Maybe Fixity
+                -> DefunKindInfo
+                -> PrM [DDec]
+defunctionalize name m_fixity defun_ki = do
+  case defun_ki of
+    DefunSAK sak ->
+      -- Even if a declaration has a SAK, its kind may not be vanilla.
+      case unravelVanillaDType_either sak of
+        -- If the kind isn't vanilla, use the fallback approach.
+        -- See Note [Defunctionalization game plan],
+        -- Wrinkle 2: Non-vanilla kinds.
+        Left _ -> defun_fallback [] (Just sak)
+        -- Otherwise, proceed with defun_vanilla_sak.
+        Right (sak_tvbs, _sak_cxt, sak_arg_kis, sak_res_ki)
+               -> defun_vanilla_sak sak_tvbs sak_arg_kis sak_res_ki
+    -- If a declaration lacks a SAK, it likely has a partial kind.
+    -- See Note [Defunctionalization game plan], Wrinkle 1: Partial kinds.
+    DefunNoSAK tvbs m_res -> defun_fallback tvbs m_res
+  where
+    -- Generate defunctionalization symbols for things with vanilla SAKs.
+    -- The symbols themselves will also be given SAKs.
+    defun_vanilla_sak :: [DTyVarBndr] -> [DKind] -> DKind -> PrM [DDec]
+    defun_vanilla_sak sak_tvbs sak_arg_kis sak_res_ki = do
+      opts <- getOptions
+      extra_name <- qNewName "arg"
+      -- Use noExactName below to avoid #17537.
+      arg_names <- replicateM (length sak_arg_kis) (noExactName <$> qNewName "a")
+
+      let -- The inner loop. @go n arg_nks res_nks@ returns @(res_k, decls)@.
+          -- Using one particular example:
+          --
+          -- @
+          -- type ExampleSym2 :: a -> b -> c ~> d ~> Type
+          -- data ExampleSym2 x y where ...
+          -- type instance Apply (ExampleSym2 x y) z = ExampleSym3 x y z
+          -- ...
+          -- @
+          --
+          -- We have:
+          --
+          -- * @n@ is 2. This is incremented in each iteration of `go`.
+          --
+          -- * @arg_nks@ is [(x, a), (y, b)]. Each element in this list is a
+          -- (type variable name, type variable kind) pair. The kinds appear in
+          -- the SAK, separated by matchable arrows (->).
+          --
+          -- * @res_tvbs@ is [(z, c), (w, d)]. Each element in this list is a
+          -- (type variable name, type variable kind) pair. The kinds appear in
+          -- @res_k@, separated by unmatchable arrows (~>).
+          --
+          -- * @res_k@ is `c ~> d ~> Type`. @res_k@ is returned so that earlier
+          --   defunctionalization symbols can build on the result kinds of
+          --   later symbols. For instance, ExampleSym1 would get the result
+          --   kind `b ~> c ~> d ~> Type` by prepending `b` to ExampleSym2's
+          --   result kind `c ~> d ~> Type`.
+          --
+          -- * @decls@ are all of the declarations corresponding to ExampleSym2
+          --   and later defunctionalization symbols. This is the main payload of
+          --   the function.
+          --
+          -- This function is quadratic because it appends a variable at the end of
+          -- the @arg_nks@ list at each iteration. In practice, this is unlikely
+          -- to be a performance bottleneck since the number of arguments rarely
+          -- gets to be that large.
+          go :: Int -> [(Name, DKind)] -> [(Name, DKind)] -> (DKind, [DDec])
+          go n arg_nks res_nkss =
+            case res_nkss of
+              [] ->
+                let -- Somewhat surprisingly, we do *not* generate SAKs for
+                    -- fully saturated defunctionalization symbols.
+                    -- See Note [No SAKs for fully saturated defunctionalization symbols]
+                    sat_decs = mk_sat_decs opts n (map (uncurry DKindedTV) arg_nks)
+                                           (Just sak_res_ki)
+                in (sak_res_ki, sat_decs)
+              res_nk:res_nks ->
+                let (res_ki, decs)   = go (n+1) (arg_nks ++ [res_nk]) res_nks
+                    tyfun            = buildTyFunArrow (snd res_nk) res_ki
+                    defun_sak_dec    = DKiSigD (defunctionalizedName opts name n) $
+                                       ravelVanillaDType sak_tvbs [] (map snd arg_nks) tyfun
+                    defun_other_decs = mk_defun_decs opts n (map (DPlainTV . fst) arg_nks)
+                                                     (fst res_nk) extra_name Nothing
+                in (tyfun, defun_sak_dec:defun_other_decs ++ decs)
+
+      pure $ snd $ go 0 [] $ zip arg_names sak_arg_kis
+
+    -- If defun_sak can't be used to defunctionalize something, this fallback
+    -- approach is used. This is used when defunctionalizing something with a
+    -- partial kind
+    -- (see Note [Defunctionalization game plan], Wrinkle 1: Partial kinds)
+    -- or a non-vanilla kind
+    -- (see Note [Defunctionalization game plan], Wrinkle 2: Non-vanilla kinds).
+    defun_fallback :: [DTyVarBndr] -> Maybe DKind -> PrM [DDec]
+    defun_fallback tvbs' m_res' = do
+      opts <- getOptions
+      extra_name <- qNewName "arg"
+      -- Use noExactTyVars below to avoid #11812.
+      (tvbs, m_res) <- eta_expand (noExactTyVars tvbs') (noExactTyVars m_res')
+
+      let -- The inner loop. @go n arg_tvbs res_tvbs@ returns @(m_res_k, decls)@.
+          -- Using one particular example:
+          --
+          -- @
+          -- data ExampleSym2 (x :: a) y :: c ~> d ~> Type where ...
+          -- type instance Apply (ExampleSym2 x y) z = ExampleSym3 x y z
+          -- ...
+          -- @
+          --
+          -- This works very similarly to the `go` function in
+          -- `defun_vanilla_sak`. The main differences are:
+          --
+          -- * This function does not produce any SAKs for defunctionalization
+          --   symbols.
+          --
+          -- * Instead of [(Name, DKind)], this function uses [DTyVarBndr] as
+          --   the types of @arg_tvbs@ and @res_tvbs@. This is because the
+          --   kinds are not always known. By a similar token, this function
+          --   uses Maybe DKind, not DKind, as the type of @m_res_k@, since
+          --   the result kind is not always fully known.
+          go :: Int -> [DTyVarBndr] -> [DTyVarBndr] -> (Maybe DKind, [DDec])
+          go n arg_tvbs res_tvbss =
+            case res_tvbss of
+              [] ->
+                let sat_decs = mk_sat_decs opts n arg_tvbs m_res
+                in (m_res, sat_decs)
+              res_tvb:res_tvbs ->
+                let (m_res_ki, decs) = go (n+1) (arg_tvbs ++ [res_tvb]) res_tvbs
+                    m_tyfun          = buildTyFunArrow_maybe (extractTvbKind res_tvb)
+                                                             m_res_ki
+                    defun_decs'      = mk_defun_decs opts n arg_tvbs
+                                                     (extractTvbName res_tvb)
+                                                     extra_name m_tyfun
+                in (m_tyfun, defun_decs' ++ decs)
+
+      pure $ snd $ go 0 [] tvbs
+
+    mk_defun_decs :: Options
+                  -> Int
+                  -> [DTyVarBndr]
+                  -> Name
+                  -> Name
+                  -> Maybe DKind
+                  -> [DDec]
+    mk_defun_decs opts n arg_tvbs tyfun_name extra_name m_tyfun =
+      let data_name   = defunctionalizedName opts name n
+          next_name   = defunctionalizedName opts name (n+1)
+          con_name    = prefixName "" ":" $ suffixName "KindInference" "###" data_name
+          arg_names   = map extractTvbName arg_tvbs
+          params      = arg_tvbs ++ [DPlainTV tyfun_name]
+          con_eq_ct   = DConT sameKindName `DAppT` lhs `DAppT` rhs
+            where
+              lhs = foldType (DConT data_name) (map DVarT arg_names) `apply` (DVarT extra_name)
+              rhs = foldType (DConT next_name) (map DVarT (arg_names ++ [extra_name]))
+          con_decl    = DCon [] [con_eq_ct] con_name (DNormalC False [])
+                             (foldTypeTvbs (DConT data_name) params)
+          data_decl   = DDataD Data [] data_name args m_tyfun [con_decl] []
+            where
+              args | isJust m_tyfun = arg_tvbs
+                   | otherwise      = params
+          app_data_ty = foldTypeTvbs (DConT data_name) arg_tvbs
+          app_eqn     = DTySynEqn Nothing
+                                  (DConT applyName `DAppT` app_data_ty
+                                                   `DAppT` DVarT tyfun_name)
+                                  (foldTypeTvbs (DConT next_name)
+                                                (arg_tvbs ++ [DPlainTV tyfun_name]))
+          app_decl    = DTySynInstD app_eqn
+          suppress    = DInstanceD Nothing Nothing []
+                          (DConT suppressClassName `DAppT` app_data_ty)
+                          [DLetDec $ DFunD suppressMethodName
+                                           [DClause []
+                                                    ((DVarE 'snd) `DAppE`
+                                                     mkTupleDExp [DConE con_name,
+                                                                  mkTupleDExp []])]]
+
+          -- See Note [Fixity declarations for defunctionalization symbols]
+          fixity_decl = maybeToList $ fmap (mk_fix_decl data_name) m_fixity
+      in data_decl : app_decl : suppress : fixity_decl
+
+    -- Generate a "fully saturated" defunction symbol, along with a fixity
+    -- declaration (if needed).
+    mk_sat_decs :: Options -> Int -> [DTyVarBndr] -> Maybe DKind -> [DDec]
+    mk_sat_decs opts n sat_tvbs m_sat_res =
+      let sat_name = defunctionalizedName opts name n
+          sat_dec  = DTySynD sat_name sat_tvbs $
+                     foldTypeTvbs (DConT name) sat_tvbs `maybeSigT` m_sat_res
+          sat_fixity_dec = maybeToList $ fmap (mk_fix_decl sat_name) m_fixity
+      in sat_dec : sat_fixity_dec
+
+    -- Generate extra kind variable binders corresponding to the number of
+    -- arrows in the return kind (if provided). Examples:
+    --
+    -- >>> eta_expand [(x :: a), (y :: b)] (Just (c -> Type))
+    -- ([(x :: a), (y :: b), (e :: c)], Just Type)
+    --
+    -- >>> eta_expand [(x :: a), (y :: b)] Nothing
+    -- ([(x :: a), (y :: b)], Nothing)
+    eta_expand :: [DTyVarBndr] -> Maybe DKind -> PrM ([DTyVarBndr], Maybe DKind)
+    eta_expand m_arg_tvbs Nothing = pure (m_arg_tvbs, Nothing)
+    eta_expand m_arg_tvbs (Just res_kind) = do
+        let (arg_ks, result_k) = unravelDType res_kind
+            vis_arg_ks = filterDVisFunArgs arg_ks
+        extra_arg_tvbs <- traverse mk_extra_tvb vis_arg_ks
+        pure (m_arg_tvbs ++ extra_arg_tvbs, Just result_k)
+
+    -- Convert a DVisFunArg to a DTyVarBndr, generating a fresh type variable
+    -- name if the DVisFunArg is an anonymous argument.
+    mk_extra_tvb :: DVisFunArg -> PrM DTyVarBndr
+    mk_extra_tvb vfa =
+      case vfa of
+        DVisFADep tvb -> pure tvb
+        DVisFAAnon k  -> DKindedTV <$> qNewName "e" <*> pure k
+
+    mk_fix_decl :: Name -> Fixity -> DDec
+    mk_fix_decl n f = DLetDec $ DInfixD f n
+
+-- Indicates whether the type being defunctionalized has a standalone kind
+-- signature. If it does, DefunSAK contains the kind. If not, DefunNoSAK
+-- contains whatever information is known about its type variable binders
+-- and result kind.
+-- See Note [Defunctionalization game plan] for details on how this
+-- information is used.
+data DefunKindInfo
+  = DefunSAK DKind
+  | DefunNoSAK [DTyVarBndr] (Maybe DKind)
+
+-- Shorthand for building (k1 ~> k2)
+buildTyFunArrow :: DKind -> DKind -> DKind
+buildTyFunArrow k1 k2 = DConT tyFunArrowName `DAppT` k1 `DAppT` k2
+
+buildTyFunArrow_maybe :: Maybe DKind -> Maybe DKind -> Maybe DKind
+buildTyFunArrow_maybe m_k1 m_k2 = buildTyFunArrow <$> m_k1 <*> m_k2
+
+{-
+Note [Defunctionalization game plan]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Generating defunctionalization symbols involves a surprising amount of
+complexity. This Note gives a broad overview of what happens during
+defunctionalization and highlights various design considerations.
+As a working example, we will use the following type family:
+
+  type Foo :: forall c a b. a -> b -> c -> c
+  type family Foo x y z where ...
+
+We must generate a defunctionalization symbol for every number of arguments
+to which Foo can be partially applied. We do so by generating the following
+declarations:
+
+  type FooSym0 :: forall c a b. a ~> b ~> c ~> c
+  data FooSym0 f where
+   FooSym0KindInference :: SameKind (Apply FooSym0 arg) (FooSym1 arg)
+                        => FooSym0 f
+  type instance Apply FooSym0 x = FooSym1 x
+
+  type FooSym1 :: forall c a b. a -> b ~> c ~> c
+  data FooSym1 x f where
+    FooSym1KindInference :: SameKind (Apply (FooSym1 a) arg) (FooSym2 a arg)
+                         => FooSym1 a f
+  type instance Apply (FooSym1 x) y = FooSym2 x y
+
+  type FooSym2 :: forall c a b. a -> b -> c ~> c
+  data FooSym2 x y f where
+    FooSym2KindInference :: SameKind (Apply (FooSym2 x y) arg) (FooSym3 x y arg)
+                         => FooSym2 x y f
+  type instance Apply (FooSym2 x y) z = FooSym3 x y z
+
+  type FooSym3 (x :: a) (y :: b) (z :: c) = Foo x y z :: c
+
+Some things to note:
+
+* Each defunctionalization symbol has its own standalone kind signature. The
+  number after `Sym` in each symbol indicates the number of leading -> arrows
+  in its kind—that is, the number of arguments to which it can be applied
+  directly to without the use of the Apply type family.
+
+  See "Wrinkle 1: Partial kinds" below for what happens if the declaration
+  being defunctionalized does *not* have a standalone kind signature.
+
+* Each data declaration has a constructor with the suffix `-KindInference`
+  in its name. These are redundant in the particular case of Foo, where the
+  kind is already known. They play a more vital role when the kind of the
+  declaration being defunctionalized is only partially known.
+  See "Wrinkle 1: Partial kinds" below for more information.
+
+* FooSym3, the last defunctionalization symbol, is somewhat special in that
+  it is a type synonym, not a data type. These sorts of symbols are referred
+  to as "fully saturated" defunctionalization symbols. Furthermore, these
+  symbols are intentionally *not* given SAKs. See
+  Note [No SAKs for fully saturated defunctionalization symbols].
+
+* If Foo had a fixity declaration (e.g., infixl 4 `Foo`), then we would also
+  generate fixity declarations for each defunctionalization symbol (e.g.,
+  infixl 4 `FooSym0`).
+  See Note [Fixity declarations for defunctionalization symbols].
+
+* Foo has a vanilla kind signature. (See
+  Note [Vanilla-type validity checking during promotion] in D.S.Promote.Type
+  for what "vanilla" means in this context.) Having a vanilla type signature is
+  important, as it is a property that makes it much simpler to preserve the
+  order of type variables (`forall c a b.`) in each of the defunctionalization
+  symbols.
+
+  That being said, it is not strictly required that the kind be vanilla. There
+  is another approach that can be used to defunctionalize things with
+  non-vanilla types, at the possible expense of having different type variable
+  orders between different defunctionalization symbols.
+  See "Wrinkle 2: Non-vanilla kinds" below for more information.
+
+-----
+-- Wrinkle 1: Partial kinds
+-----
+
+The Foo example above has a standalone kind signature, but not everything has
+this much kind information. For example, consider this:
+
+  $(singletons [d|
+    type family Not x where
+      Not False = True
+      Not True  = False
+    |])
+
+The inferred kind for Not is `Bool -> Bool`, but since Not was declared in TH
+quotes, `singletons` has no knowledge of this. Instead, we must rely on kind
+inference to give Not's defunctionalization symbols the appropriate kinds.
+Here is a naïve first attempt:
+
+  data NotSym0 f
+  type instance Apply NotSym0 x = NotSym1 x
+
+  type NotSym1 x = Not x
+
+NotSym1 will have the inferred kind `Bool -> Bool`, but poor NotSym0 will have
+the inferred kind `forall k. k -> Type`, which is far more general than we
+would like. We can do slightly better by supplying additional kind information
+in a data constructor, like so:
+
+  type SameKind :: k -> k -> Constraint
+  class SameKind x y = ()
+
+  data NotSym0 f where
+    NotSym0KindInference :: SameKind (Apply NotSym0 arg) (NotSym1 arg)
+                         => NotSym0 f
+
+NotSym0KindInference is not intended to ever be seen by the user. Its only
+reason for existing is its existential
+`SameKind (Apply NotSym0 arg) (NotSym1 arg)` context, which allows GHC to
+figure out that NotSym0 has kind `Bool ~> Bool`. This is a bit of a hack, but
+it works quite nicely. The only problem is that GHC is likely to warn that
+NotSym0KindInference is unused, which is annoying. To work around this, we
+mention the data constructor in an instance of a dummy class:
+
+  instance SuppressUnusedWarnings NotSym0 where
+    suppressUnusedWarnings = snd (NotSym0KindInference, ())
+
+Similarly, this SuppressUnusedWarnings class is not intended to ever be seen
+by the user. As its name suggests, it only exists to help suppress "unused
+data constructor" warnings.
+
+Some declarations have a mixture of known kinds and unknown kinds, such as in
+this example:
+
+  $(singletons [d|
+    type family Bar x (y :: Nat) (z :: Nat) :: Nat where ...
+    |])
+
+We can use the known kinds to guide kind inference. In this particular example
+of Bar, here are the defunctionalization symbols that would be generated:
+
+  data BarSym0 f where ...
+  data BarSym1 x :: Nat ~> Nat ~> Nat where ...
+  data BarSym2 x (y :: Nat) :: Nat ~> Nat where ...
+  type BarSym3 x (y :: Nat) (z :: Nat) = Bar x y z :: Nat
+
+-----
+-- Wrinkle 2: Non-vanilla kinds
+-----
+
+There is only limited support for defunctionalizing declarations with
+non-vanilla kinds. One example of something with a non-vanilla kind is the
+following, which uses a nested forall:
+
+  $(singletons [d|
+    type Baz :: forall a. a -> forall b. b -> Type
+    data Baz x y
+    |])
+
+One might envision generating the following defunctionalization symbols for
+Baz:
+
+  type BazSym0 :: forall a. a ~> forall b. b ~> Type
+  data BazSym0 f where ...
+
+  type BarSym1 :: forall a. a -> forall b. b ~> Type
+  data BazSym1 x f where ...
+
+  type family BazSym2 (x :: a) (y :: b) = Baz x y :: Type
+
+Unfortunately, doing so would require impredicativity, since we would have:
+
+    forall a. a ~> forall b. b ~> Type
+  = forall a. (~>) a (forall b. b ~> Type)
+  = forall a. TyFun a (forall b. b ~> Type) -> Type
+
+Note that TyFun is an ordinary data type, so having its second argument be
+(forall b. b ~> Type) is truly impredicative. As a result, trying to preserve
+nested or higher-rank foralls is a non-starter.
+
+We need not reject Baz entirely, however. We can still generate perfectly
+usable defunctionalization symbols if we are willing to sacrifice the exact
+order of foralls. When we encounter a non-vanilla kind such as Baz's, we simply
+fall back to the algorithm used when we encounter a partial kind (as described
+in "Wrinkle 1: Partial kinds" above.) In other words, we generate the
+following symbols:
+
+  data BazSym0 :: a ~> b ~> Type where ...
+  data BazSym1 (x :: a) :: b ~> Type where ...
+  type BazSym2 (x :: a) (y :: b) = Baz x y :: Type
+
+The kinds of BazSym0 and BazSym1 both start with `forall a b.`,
+whereas the `b` is quantified later in Baz itself. For most use cases, however,
+this is not a huge concern.
+
+Another way kinds can be non-vanilla is if they contain visible dependent
+quantification, like so:
+
+  $(singletons [d|
+    type Quux :: forall (k :: Type) -> k -> Type
+    data Quux x y
+    |])
+
+What should the kind of QuuxSym0 be? Intuitively, it should be this:
+
+  type QuuxSym0 :: forall (k :: Type) ~> k ~> Type
+
+Alas, `forall (k :: Type) ~>` simply doesn't work. See #304. But there is an
+acceptable compromise we can make that can give us defunctionalization symbols
+for Quux. Once again, we fall back to the partial kind algorithm:
+
+  data QuuxSym0 :: Type ~> k ~> Type where ...
+  data QuuxSym1 (k :: Type) :: k ~> Type where ...
+  type QuuxSym2 (k :: Type) (x :: k) = Quux k x :: Type
+
+The catch is that the kind of QuuxSym0, `forall k. Type ~> k ~> Type`, is
+slightly more general than it ought to be. In practice, however, this is
+unlikely to be a problem as long as you apply QuuxSym0 to arguments of the
+right kinds.
+
+Note [No SAKs for fully saturated defunctionalization symbols]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+When generating defunctionalization symbols, most of the symbols are data
+types. The last one, however, is a type synonym. For example, this code:
+
+  $(singletons [d|
+    type Const :: a -> b -> a
+    type Const x y = x
+    |])
+
+Will generate the following symbols:
+
+  type ConstSym0 :: a ~> b ~> a
+  data ConstSym0 f where ...
+
+  type ConstSym1 :: a -> b ~> a
+  data ConstSym1 x f where ...
+
+  type ConstSym2 (x :: a) (y :: b) = Const x y :: a
+
+ConstSym2, the sole type synonym of the bunch, is what is referred to as a
+"fully saturated" defunctionaliztion symbol.
+
+At first glance, ConstSym2 may not seem terribly useful, since it is
+effectively a thin wrapper around the original Const type. Indeed, fully
+saturated symbols are never appear directly in user-written code. Instead,
+they are most valuable in TH-generated code, as singletons often generates code
+that directly applies a defunctionalization symbol to some number of arguments
+(see, for instance, D.S.Names.promoteTySym). In theory, such code could carve
+out a special case for fully saturated applications and apply the original
+type instead of a defunctionalization symbol, but determining when an
+application is fully saturated is often difficult in practice. As a result, it
+is more convenient to just generate code that always applies FuncSymN to N
+arguments, and to let fully saturated defunctionalization symbols handle the
+case where N equals the number of arguments needed to fully saturate Func.
+
+Another curious thing about fully saturated defunctionalization symbols do
+*not* get assigned SAKs, unlike their data type brethren. Why not just give
+ConstSym2 a SAK like this?
+
+  type ConstSym2 :: a -> b -> a
+  type ConstSym2 x y = Const x y
+
+This would in fact work for most use cases, but there are a handful of corner
+cases where this approach would break down. Here is one such corner case:
+
+  $(promote [d|
+    class Applicative f where
+      pure :: a -> f a
+      ...
+      (*>) :: f a -> f b -> f b
+    |])
+
+  ==>
+
+  class PApplicative f where
+    type Pure (x :: a) :: f a
+    type (*>) (x :: f a) (y :: f b) :: f b
+
+What would happen if we were to defunctionalize the promoted version of (*>)?
+We'd end up with the following defunctionalization symbols:
+
+  type (*>@#@$)   :: f a ~> f b ~> f b
+  data (*>@#@$) f where ...
+
+  type (*>@#@$$)  :: f a -> f b ~> f b
+  data (*>@#@$$) x f where ...
+
+  type (*>@#@$$$) :: f a -> f b -> f b
+  type (*>@#@$$$) x y = (*>) x y
+
+It turns out, however, that (*>@#@$$$) will not kind-check. Because (*>@#@$$$)
+has a standalone kind signature, it is kind-generalized *before* kind-checking
+the actual definition itself. Therefore, the full kind is:
+
+  type (*>@#@$$$) :: forall {k} (f :: k -> Type) (a :: k) (b :: k).
+                     f a -> f b -> f b
+  type (*>@#@$$$) x y = (*>) x y
+
+However, the kind of (*>) is
+`forall (f :: Type -> Type) (a :: Type) (b :: Type). f a -> f b -> f b`.
+This is not general enough for (*>@#@$$$), which expects kind-polymorphic `f`,
+`a`, and `b`, leading to a kind error. You might think that we could somehow
+infer this information, but note the quoted definition of Applicative (and
+PApplicative, as a consequence) omits the kinds of `f`, `a`, and `b` entirely.
+Unless we were to implement full-blown kind inference inside of Template
+Haskell (which is a tall order), the kind `f a -> f b -> f b` is about as good
+as we can get.
+
+Note that (*>@#@$) and (*>@#@$$) are implemented as GADTs, not type synonyms.
+This allows them to have kind-polymorphic `f`, `a`, and `b` in their kinds
+while equating `k` to be `Type` in their data constructors, which neatly avoids
+the issue that (*>@#@$$$) faces.
+
+-----
+
+In one last attempt to salvage the idea of giving SAKs to fully saturated
+defunctionalization symbols, I explored an idea where we would add
+"dummy constraints" to get the kinds exactly right. The idea was to first
+define a type synonym for dummy contexts:
+
+  type Dummy :: Constraint -> Constraint
+  type Dummy x = () ~ ()
+
+Dummy simply ignores its argument and returns `() ~ ()`. `() ~ ()` was chosen
+because it's one of the few Constraints that can currently be used at the kind
+level. Dummy could, in theory, be used like this:
+
+  type (*>@#@$)   :: Dummy (PApplicative f) => f a ~> f b ~> f b
+  type (*>@#@$$)  :: Dummy (PApplicative f) => f a -> f b ~> f b
+  type (*>@#@$$$) :: Dummy (PApplicative f) => f a -> f b -> f b
+
+The advantage to using `Dummy (PApplicative f)` is that it would constraint `f`
+to be of kind `Type -> Type`, which would get the kinds exactly the way we want
+them. Sounds great, right? Unfortunately, it doesn't work in practice. Consider
+this example:
+
+  $(promoteOnly [d|
+    class C a where
+      m1 :: a -> a
+      m1 = m2
+
+      m2 :: a -> a
+      m2 = m1
+    |])
+
+  ==>
+
+  class PC a where
+    type M1 (x :: a) :: a
+    type M1 x = Apply M2Sym1 x
+
+    type M2 (x :: a) :: a
+    type M2 x = Apply M1Sym1 x
+
+The generated code would fail to compile, instead throwing this error:
+
+  error:
+      • Class ‘PC’ cannot be used here
+          (it is defined and used in the same recursive group)
+      • In the first argument of ‘Dummy’, namely ‘(PC a)’
+        In a standalone kind signature for ‘M2Sym1’:
+          forall a. Dummy (PC a) => a -> a
+     |
+     | type M2Sym1 :: forall a. Dummy (PC a) => a -> a
+     |                                 ^^^^
+
+Ugh. I suspect this is a GHC bug (see
+https://gitlab.haskell.org/ghc/ghc/issues/15942#note_242075), but it's one
+that's unlikely to be fixed any time soon.
+
+A slight variations on idea is to use the original class instead of the
+promoted class in `Dummy` contexts, e.g.,
+
+  type M2Sym1 :: forall a. Dummy (C a) => a -> a
+
+This would avoid the recursive group issues, but it would introduce a new
+problem: the original class is not guaranteed to exist if
+`promoteOnly` or `singletonsOnly` are used to create the promoted class.
+(Indeed, this is precisely the case in the `PC` example.)
+
+-----
+
+As an alternative to type synonyms, we might consider using type families to
+define fully saturated defunctionalization symbols. For instance, we could try
+this:
+
+  type (*>@#@$$$) :: f a -> f b -> f b
+  type family (*>@#@$$$) x y where
+    (*>@#@$$$) x y = (*>) x y
+
+Like before, the full kind of (*>@#@$$$) is generalized to be
+`forall {k} (f :: k -> Type) (a :: k) (b :: k)`. The difference is that the
+type family equation *matches* on `k` such that the equation will only trigger
+if `k` is equal to `Type`. (This is similar to the trick that (*>@#@$) and
+(*>@#@$$) employ, as being GADTs allows them to constrain `k` to be `Type` in
+their data constructors.)
+
+Alas, the type family approach is strictly less powerful than the type synonym
+approach. Consider the following code:
+
+  $(singletons [d|
+    data Nat = Z | S Nat
+
+    natMinus :: Nat -> Nat -> Nat
+    natMinus Z     _     = Z
+    natMinus (S a) (S b) = natMinus a b
+    natMinus a     Z     = a
+    |])
+
+Among other things, this will generate the following declarations:
+
+  type ZSym0 :: Nat
+
+  type NatMinus :: Nat -> Nat -> Nat
+  type family NatMinus x y where
+    NatMinus Z     _     = ZSym0
+    NatMinus (S a) (S b) = NatMinus a b
+    NatMinus a     Z     = a
+
+  sNatMinus :: SNat x -> SNat y -> SNat (NatMinus x y)
+  sNatMinus SZ      _       = SZ
+  sNatMinus (SS sA) (SS sB) = sNatMinus sA sB
+  sNatMinus sA      SZ      = sA
+
+Shockingly, this will either succeed or fail to compile depending on whether
+ZSym0 is a type synonym or a type family. If ZSym0 is a type synonym, then
+the first and third equations of NatMinus will be compatible (since GHC will
+be able to infer that Z ~ ZSym0), which is what allows the third equation of
+sNatMinus to typecheck. If ZSym0 is a type family, however, then the third
+equation of NatMinus will be incompatible with the first, which will cause
+the third equation of sNatMinus to fail to typecheck:
+
+  error:
+      • Could not deduce: NatMinus x 'Z ~ x
+        from the context: y ~ 'Z
+          bound by a pattern with constructor: SZ :: SNat 'Z,
+                   in an equation for ‘sNatMinus’
+        ‘x’ is a rigid type variable bound by
+          the type signature for:
+            sNatMinus :: forall (x :: Nat) (y :: Nat).
+                         SNat x -> SNat y -> SNat (NatMinus x y)
+        Expected type: SNat (NatMinus x y)
+          Actual type: SNat x
+      • In the expression: sA
+        In an equation for ‘sNatMinus’: sNatMinus sA SZ = sA
+      • Relevant bindings include
+          sA :: SNat x
+          sNatMinus :: SNat x -> SNat y -> SNat (NatMinus x y)
+
+One could work around the issue by tweaking the third equation of natMinus
+slightly:
+
+  $(singletons [d|
+    ...
+
+    natMinus :: Nat -> Nat -> Nat
+    natMinus Z       _     = Z
+    natMinus (S a)   (S b) = natMinus a b
+    natMinus a@(S _) Z     = a
+    |])
+
+But I would generally prefer to avoid having the user add extraneous pattern
+matches when possible. Given the choice between expressiveness and SAKs, I give
+the edge to expressiveness.
+
+Bottom line: don't give fully saturated defunctionalization symbols SAKs. This
+is admittedly not ideal, but it's unlikely to be a sticking point in practice,
+given that these symbols are almost exclusively used in autogenerated code
+in the first place. If we want to support promoting code that uses visible
+type application (see #378), we will need to figure out how to resolve this
+issue.
+
 Note [Fixity declarations for defunctionalization symbols]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Just like we promote fixity declarations, we should also generate fixity
diff --git a/src/Data/Singletons/Promote/Eq.hs b/src/Data/Singletons/Promote/Eq.hs
--- a/src/Data/Singletons/Promote/Eq.hs
+++ b/src/Data/Singletons/Promote/Eq.hs
@@ -12,42 +12,43 @@
 import Language.Haskell.TH.Syntax
 import Language.Haskell.TH.Desugar
 import Data.Singletons.Names
+import Data.Singletons.TH.Options
 import Data.Singletons.Util
 import Control.Monad
 
 -- produce a closed type family helper and the instance
 -- for (==) over the given list of ctors
-mkEqTypeInstance :: Quasi q => DKind -> [DCon] -> q [DDec]
+mkEqTypeInstance :: OptionsMonad q => DKind -> [DCon] -> q [DDec]
 mkEqTypeInstance kind cons = do
+  opts <- getOptions
   helperName <- newUniqueName "Equals"
   aName <- qNewName "a"
   bName <- qNewName "b"
   true_branches <- mapM (mk_branch helperName) cons
-  let null_branch  = catch_all_case helperName trueName
-      false_branch = catch_all_case helperName falseName
+  let null_branch  = catch_all_case opts helperName trueName
+      false_branch = catch_all_case opts helperName falseName
       branches | null cons = [null_branch]
                | otherwise = true_branches ++ [false_branch]
+      -- We opt to give an explicit kind signature for the helper type family.
+      -- See Note [Promoted class method kinds] in Data.Singletons.Promote.
+      sakDec    = DKiSigD helperName $ ravelVanillaDType [] [] [kind, kind] boolKi
       closedFam = DClosedTypeFamilyD (DTypeFamilyHead helperName
-                                                        -- We opt to give explicit kinds for the tyvars
-                                                        -- in the helper type family.
-                                                        -- See Note [Promoted class method kinds]
-                                                        -- in Data.Singletons.Promote.
-                                                      [ DKindedTV aName kind
-                                                      , DKindedTV bName kind ]
-                                                      (DKindSig boolKi)
+                                                      [DPlainTV aName, DPlainTV bName]
+                                                      DNoSig
                                                       Nothing)
                                      branches
       eqInst = DTySynInstD $
                DTySynEqn Nothing
                          (DConT tyEqName `DAppT` DVarT aName `DAppT` DVarT bName)
                          (foldType (DConT helperName) [DVarT aName, DVarT bName])
-      inst = DInstanceD Nothing Nothing [] ((DConT $ promoteClassName eqName) `DAppT`
+      inst = DInstanceD Nothing Nothing [] ((DConT $ promotedClassName opts eqName) `DAppT`
                                             kind) [eqInst]
 
-  return [closedFam, inst]
+  return [sakDec, closedFam, inst]
 
-  where mk_branch :: Quasi q => Name -> DCon -> q DTySynEqn
+  where mk_branch :: OptionsMonad q => Name -> DCon -> q DTySynEqn
         mk_branch helper_name con = do
+          opts <- getOptions
           let (name, numArgs) = extractNameArgs con
           lnames <- replicateM numArgs (qNewName "a")
           rnames <- replicateM numArgs (qNewName "b")
@@ -56,21 +57,24 @@
               ltype = foldType (DConT name) lvars
               rtype = foldType (DConT name) rvars
               results = zipWith (\l r -> foldType (DConT tyEqName) [l, r]) lvars rvars
-              result = tyAll results
+              result = tyAll opts results
           return $ DTySynEqn Nothing
                              (DConT helper_name `DAppT` ltype `DAppT` rtype)
                              result
 
-        catch_all_case :: Name -> Name -> DTySynEqn
-        catch_all_case helper_name returned_val_name =
+        catch_all_case :: Options -> Name -> Name -> DTySynEqn
+        catch_all_case opts helper_name returned_val_name =
           DTySynEqn Nothing
                     (DConT helper_name
                        `DAppT` DSigT DWildCardT kind
                        `DAppT` DSigT DWildCardT kind)
-                    (promoteValRhs returned_val_name)
+                    (DConT $ defunctionalizedName0 opts returned_val_name)
 
-        tyAll :: [DType] -> DType -- "all" at the type level
-        tyAll [] = (promoteValRhs trueName)
-        tyAll [one] = one
-        tyAll (h:t) = foldType (DConT $ promoteValNameLhs andName) [h, (tyAll t)]
+        tyAll :: Options -> [DType] -> DType -- "all" at the type level
+        tyAll opts = go
+          where
+            go []    = DConT $ defunctionalizedName0 opts trueName
+            go [one] = one
+            go (h:t) = foldType (DConT $ promotedTopLevelValueName opts andName)
+                                [h, (go t)]
            -- I could use the Apply nonsense here, but there's no reason to
diff --git a/src/Data/Singletons/Promote/Monad.hs b/src/Data/Singletons/Promote/Monad.hs
--- a/src/Data/Singletons/Promote/Monad.hs
+++ b/src/Data/Singletons/Promote/Monad.hs
@@ -26,21 +26,23 @@
 import Language.Haskell.TH.Desugar.OMap.Strict (OMap)
 import qualified Language.Haskell.TH.Desugar.OSet as OSet
 import Language.Haskell.TH.Desugar.OSet (OSet)
-import Data.Singletons.Names
 import Data.Singletons.Syntax
+import Data.Singletons.TH.Options
 
 type LetExpansions = OMap Name DType  -- from **term-level** name
 
 -- environment during promotion
 data PrEnv =
-  PrEnv { pr_lambda_bound :: OMap Name Name
+  PrEnv { pr_options      :: Options
+        , pr_lambda_bound :: OMap Name Name
         , pr_let_bound    :: LetExpansions
-        , pr_forall_bound :: OSet Name -- See Note [Explicitly quantifying kinds variables]
+        , pr_forall_bound :: OSet Name -- See Note [Explicitly binding kind variables]
         , pr_local_decls  :: [Dec]
         }
 
 emptyPrEnv :: PrEnv
-emptyPrEnv = PrEnv { pr_lambda_bound = OMap.empty
+emptyPrEnv = PrEnv { pr_options      = defaultOptions
+                   , pr_lambda_bound = OMap.empty
                    , pr_let_bound    = OMap.empty
                    , pr_forall_bound = OSet.empty
                    , pr_local_decls  = [] }
@@ -54,6 +56,9 @@
 instance DsMonad PrM where
   localDeclarations = asks pr_local_decls
 
+instance OptionsMonad PrM where
+  getOptions = asks pr_options
+
 -- return *type-level* names
 allLocals :: MonadReader PrEnv m => m [Name]
 allLocals = do
@@ -92,10 +97,11 @@
 
 lookupVarE :: Name -> PrM DType
 lookupVarE n = do
+  opts <- getOptions
   lets <- asks pr_let_bound
   case OMap.lookup n lets of
     Just ty -> return ty
-    Nothing -> return $ promoteValRhs n
+    Nothing -> return $ DConT $ defunctionalizedName0 opts n
 
 -- Add to the set of bound kind variables currently in scope.
 -- See Note [Explicitly binding kind variables]
@@ -109,37 +115,39 @@
 allBoundKindVars :: PrM (OSet Name)
 allBoundKindVars = asks pr_forall_bound
 
-promoteM :: DsMonad q => [Dec] -> PrM a -> q (a, [DDec])
+promoteM :: OptionsMonad q => [Dec] -> PrM a -> q (a, [DDec])
 promoteM locals (PrM rdr) = do
+  opts         <- getOptions
   other_locals <- localDeclarations
-  let wr = runReaderT rdr (emptyPrEnv { pr_local_decls = other_locals ++ locals })
+  let wr = runReaderT rdr (emptyPrEnv { pr_options     = opts
+                                      , pr_local_decls = other_locals ++ locals })
       q  = runWriterT wr
   runQ q
 
-promoteM_ :: DsMonad q => [Dec] -> PrM () -> q [DDec]
+promoteM_ :: OptionsMonad q => [Dec] -> PrM () -> q [DDec]
 promoteM_ locals thing = do
   ((), decs) <- promoteM locals thing
   return decs
 
 -- promoteM specialized to [DDec]
-promoteMDecs :: DsMonad q => [Dec] -> PrM [DDec] -> q [DDec]
+promoteMDecs :: OptionsMonad q => [Dec] -> PrM [DDec] -> q [DDec]
 promoteMDecs locals thing = do
   (decs1, decs2) <- promoteM locals thing
   return $ decs1 ++ decs2
 
 {-
 Note [Explicitly binding kind variables]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-We want to ensure that when we single type signatures for functions, we should
-explicitly quantify every kind variable bound by a forall. For example, if we
-were to single the identity function:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+We want to ensure that when we single type signatures for functions and data
+constructors, we should explicitly quantify every kind variable bound by a
+forall. For example, if we were to single the identity function:
 
   identity :: forall a. a -> a
   identity x = x
 
 We want the final result to be:
 
-  sIdentity :: forall a (x :: a). Sing x -> Sing (Identity x)
+  sIdentity :: forall a (x :: a). Sing x -> Sing (Identity x :: a)
   sIdentity sX = sX
 
 Accomplishing this takes a bit of care during promotion. When promoting a
@@ -160,7 +168,7 @@
 
 When singling, we would eventually end up in this spot:
 
-  sF :: forall a (x :: a). Sing a -> Sing (F a)
+  sF :: forall a (x :: a). Sing a -> Sing (F a :: a)
   sF = sG
     where
       sG :: _
@@ -168,10 +176,10 @@
 
 We must make sure /not/ to fill in the following type for _:
 
-  sF :: forall a (x :: a). Sing a -> Sing (F a)
+  sF :: forall a (x :: a). Sing a -> Sing (F a :: a)
   sF = sG
     where
-      sG :: forall a (y :: a). Sing a -> Sing (G a)
+      sG :: forall a (y :: a). Sing a -> Sing (G a :: a)
       sG x = x
 
 This would be incorrect, as the `a` bound by sF /must/ be the same one used in
@@ -179,9 +187,9 @@
 bound variables from `f` are put into lde_bound_kvs when promoting `g` so
 that we subtract out `a` and are left with the correct result:
 
-  sF :: forall a (x :: a). Sing a -> Sing (F a)
+  sF :: forall a (x :: a). Sing a -> Sing (F a :: a)
   sF = sG
     where
-      sG :: forall (y :: a). Sing a -> Sing (G a)
+      sG :: forall (y :: a). Sing a -> Sing (G a :: a)
       sG x = x
 -}
diff --git a/src/Data/Singletons/Promote/Type.hs b/src/Data/Singletons/Promote/Type.hs
--- a/src/Data/Singletons/Promote/Type.hs
+++ b/src/Data/Singletons/Promote/Type.hs
@@ -7,26 +7,39 @@
 -}
 
 module Data.Singletons.Promote.Type
-  ( promoteType, promoteTypeArg, promoteUnraveled
+  ( promoteType, promoteType_NC
+  , promoteTypeArg_NC, promoteUnraveled
   ) where
 
 import Language.Haskell.TH.Desugar
 import Data.Singletons.Names
+import Data.Singletons.Util
 import Language.Haskell.TH
 
--- the only monadic thing we do here is fail. This allows the function
--- to be used from the Singletons module
+-- Promote a DType to the kind level.
+--
+-- NB: the only monadic thing we do here is fail. This allows the function
+-- to be used from the Singletons module.
 promoteType :: MonadFail m => DType -> m DKind
-promoteType = go []
+promoteType ty = do
+  checkVanillaDType ty
+  promoteType_NC ty
+
+-- Promote a DType to the kind level. This is suffixed with "_NC" because
+-- we do not invoke checkVanillaDType here.
+-- See [Vanilla-type validity checking during promotion].
+promoteType_NC :: MonadFail m => DType -> m DKind
+promoteType_NC = go []
   where
     go :: MonadFail m => [DTypeArg] -> DType -> m DKind
+    go []       (DForallT fvf tvbs ty) = do
+      ty' <- go [] ty
+      pure $ DForallT fvf tvbs ty'
     -- We don't need to worry about constraints: they are used to express
     -- static guarantees at runtime. But, because we don't need to do
     -- anything special to keep static guarantees at compile time, we don't
     -- need to promote them.
-    go []       (DForallT _tvbs _cxt ty) = go [] ty
-    go []       (DAppT (DAppT DArrowT (DForallT (_:_) _ _)) _) =
-      fail "Cannot promote types of rank above 1."
+    go []       (DConstrainedT _cxt ty) = go [] ty
     go args     (DAppT t1 t2) = do
       k2 <- go [] t2
       go (DTANormal k2 : args) t1
@@ -60,14 +73,48 @@
                             "headed by: " ++ show hd ++ "\n" ++
                             "applied to: " ++ show args
 
-promoteTypeArg :: MonadFail m => DTypeArg -> m DTypeArg
-promoteTypeArg (DTANormal t) = DTANormal <$> promoteType t
-promoteTypeArg ta@(DTyArg _) = pure ta -- Kinds are already promoted
+-- | Promote a DTypeArg to the kind level. This is suffixed with "_NC" because
+-- we do not invoke checkVanillaDType here.
+-- See [Vanilla-type validity checking during promotion].
+promoteTypeArg_NC :: MonadFail m => DTypeArg -> m DTypeArg
+promoteTypeArg_NC (DTANormal t) = DTANormal <$> promoteType_NC t
+promoteTypeArg_NC ta@(DTyArg _) = pure ta -- Kinds are already promoted
 
-promoteUnraveled :: MonadFail m => DType -> m ([DKind], DKind)
+-- | Promote a DType to the kind level, splitting it into its type variable
+-- binders, argument types, and result type in the process.
+promoteUnraveled :: MonadFail m
+                 => DType -> m ([DTyVarBndr], [DKind], DKind)
 promoteUnraveled ty = do
-  arg_kis <- mapM promoteType arg_tys
-  res_ki  <- promoteType res_ty
-  return (arg_kis, res_ki)
-  where
-    (_, _, arg_tys, res_ty) = unravel ty
+  (tvbs, _, arg_tys, res_ty) <- unravelVanillaDType ty
+  arg_kis <- mapM promoteType_NC arg_tys
+  res_ki  <- promoteType_NC res_ty
+  return (tvbs, arg_kis, res_ki)
+
+{-
+Note [Vanilla-type validity checking during promotion]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+We only support promoting (and singling) vanilla types, where a vanilla
+function type is a type that:
+
+1. Only uses a @forall@ at the top level, if used at all. That is to say, it
+   does not contain any nested or higher-rank @forall@s.
+
+2. Only uses a context (e.g., @c => ...@) at the top level, if used at all,
+   and only after the top-level @forall@ if one is present. That is to say,
+   it does not contain any nested or higher-rank contexts.
+
+3. Contains no visible dependent quantification.
+
+The checkVanillaDType function checks if a type is vanilla. Note that it is
+crucial to call checkVanillaDType on the /entire/ type. For instance, it would
+be incorrect to call unravelVanillaDType and then check each argument type
+individually, since that loses information about which @forall@s/constraints
+are higher-rank.
+
+We make an effort to avoiding calling checkVanillaDType on the same type twice,
+since checkVanillaDType must traverse the entire type. (It would not be
+incorrect to do so, just wasteful.) For this certain, certain functions are
+suffixed with "_NC" (short for "no checking") to indicate that they do not
+invoke checkVanillaDType. These functions are used on types that have already
+been validity-checked.
+-}
diff --git a/src/Data/Singletons/ShowSing.hs b/src/Data/Singletons/ShowSing.hs
--- a/src/Data/Singletons/ShowSing.hs
+++ b/src/Data/Singletons/ShowSing.hs
@@ -7,6 +7,7 @@
 {-# LANGUAGE QuantifiedConstraints #-}
 {-# LANGUAGE RankNTypes #-}
 {-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE UndecidableInstances #-}
 {-# OPTIONS_GHC -Wno-orphans #-}
@@ -33,6 +34,7 @@
   ShowSing'
   ) where
 
+import Data.Kind
 import Data.Singletons.Internal
 import Data.Singletons.Prelude.Instances
 import Data.Singletons.Single
@@ -110,6 +112,7 @@
 -- @type ShowSing k = (forall (z :: k). ShowSing' z)@ instead of going the
 -- extra mile to define it as a class.
 -- See Note [Define ShowSing as a class, not a type synonym] for an explanation.
+type ShowSing :: Type -> Constraint
 class    (forall (z :: k). ShowSing' z) => ShowSing k
 instance (forall (z :: k). ShowSing' z) => ShowSing k
 
@@ -192,6 +195,7 @@
 -- of—you guessed it—<https://gitlab.haskell.org/ghc/ghc/issues/16502 another GHC bug>.
 -- Bummer. Unless that bug were to be fixed, the current definition of
 -- `ShowSing'` is the best that we can do.
+type ShowSing' :: k -> Constraint
 class    Show (Sing z) => ShowSing' z
 instance Show (Sing z) => ShowSing' z
 
diff --git a/src/Data/Singletons/Sigma.hs b/src/Data/Singletons/Sigma.hs
--- a/src/Data/Singletons/Sigma.hs
+++ b/src/Data/Singletons/Sigma.hs
@@ -3,12 +3,12 @@
 {-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE GADTs #-}
-{-# LANGUAGE ImpredicativeTypes #-} -- See Note [Impredicative Σ?]
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE QuantifiedConstraints #-}
 {-# LANGUAGE RankNTypes #-}
 {-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
 {-# LANGUAGE TypeOperators #-}
@@ -44,12 +44,13 @@
     , ShowApply', ShowSingApply'
     ) where
 
-import Data.Kind (Type)
+import Data.Kind
 import Data.Singletons.Internal
 import Data.Singletons.ShowSing
 
 -- | A dependent pair.
-data Sigma (s :: Type) :: (s ~> Type) -> Type where
+type Sigma :: forall s -> (s ~> Type) -> Type
+data Sigma s t where
   (:&:) :: forall s t fst. Sing (fst :: s) -> t @@ fst -> Sigma s t
 infixr 4 :&:
 instance (ShowSing s, ShowApply t) => Show (Sigma s t) where
@@ -58,20 +59,12 @@
       :: (ShowSing' fst, ShowApply' t fst) => ShowS
 
 -- | Unicode shorthand for 'Sigma'.
+type Σ :: forall s -> (s ~> Type) -> Type
 type Σ = Sigma
 
-{-
-Note [Impredicative Σ?]
-~~~~~~~~~~~~~~~~~~~~~~~
-The definition of Σ currently will not typecheck without the use of
-ImpredicativeTypes. There isn't a fundamental reason that this should be the
-case, and the only reason that GHC currently requires this is due to Trac
-#13408. If someone ever fixes that bug, we could remove the use of
-ImpredicativeTypes.
--}
-
 -- | The singleton type for 'Sigma'.
-data SSigma :: forall s (t :: s ~> Type). Sigma s t -> Type where
+type SSigma :: Sigma s t -> Type
+data SSigma sig where
   (:%&:) :: forall s t (fst :: s) (sfst :: Sing fst) (snd :: t @@ fst).
             Sing ('WrapSing sfst) -> Sing snd -> SSigma (sfst ':&: snd :: Sigma s t)
 infixr 4 :%&:
@@ -91,6 +84,7 @@
   sing = sing :%&: sing
 
 -- | Unicode shorthand for 'SSigma'.
+type SΣ :: Sigma s t -> Type
 type SΣ = SSigma
 
 -- | Project the first element out of a dependent pair.
@@ -98,7 +92,8 @@
 fstSigma (a :&: _) = fromSing a
 
 -- | Project the first element out of a dependent pair.
-type family FstSigma (sig :: Sigma s t) :: s where
+type FstSigma :: Sigma s t -> s
+type family FstSigma sig where
   FstSigma ((_ :: Sing fst) ':&: _) = fst
 
 -- | Project the second element out of a dependent pair.
@@ -108,7 +103,8 @@
 sndSigma (_ :%&: b) = fromSing b
 
 -- | Project the second element out of a dependent pair.
-type family SndSigma (sig :: Sigma s t) :: t @@ FstSigma sig where
+type SndSigma :: forall s t. forall (sig :: Sigma s t) -> t @@ FstSigma sig
+type family SndSigma sig where
   SndSigma (_ ':&: b) = b
 
 -- | Project the first element out of a dependent pair using
@@ -176,14 +172,18 @@
 classes exist.
 -}
 
+type ShowApply :: (a ~> Type) -> Constraint
 class    (forall (x :: a). ShowApply' f x) => ShowApply (f :: a ~> Type)
 instance (forall (x :: a). ShowApply' f x) => ShowApply (f :: a ~> Type)
 
+type ShowApply' :: (a ~> Type) -> a -> Constraint
 class    Show (Apply f x) => ShowApply' (f :: a ~> Type) (x :: a)
 instance Show (Apply f x) => ShowApply' (f :: a ~> Type) (x :: a)
 
+type ShowSingApply :: (a ~> Type) -> Constraint
 class    (forall (x :: a) (z :: Apply f x). ShowSingApply' f x z) => ShowSingApply (f :: a ~> Type)
 instance (forall (x :: a) (z :: Apply f x). ShowSingApply' f x z) => ShowSingApply (f :: a ~> Type)
 
+type ShowSingApply' :: forall a. forall (f :: a ~> Type) (x :: a) -> Apply f x -> Constraint
 class    Show (Sing z) => ShowSingApply' (f :: a ~> Type) (x :: a) (z :: Apply f x)
 instance Show (Sing z) => ShowSingApply' (f :: a ~> Type) (x :: a) (z :: Apply f x)
diff --git a/src/Data/Singletons/Single.hs b/src/Data/Singletons/Single.hs
--- a/src/Data/Singletons/Single.hs
+++ b/src/Data/Singletons/Single.hs
@@ -6,7 +6,7 @@
 This file contains functions to refine constructs to work with singleton
 types. It is an internal module to the singletons package.
 -}
-{-# LANGUAGE TemplateHaskell, TupleSections, ParallelListComp, CPP #-}
+{-# LANGUAGE TemplateHaskell, TupleSections, ParallelListComp #-}
 
 module Data.Singletons.Single where
 
@@ -31,6 +31,7 @@
 import Data.Singletons.Single.Fixity
 import Data.Singletons.Single.Eq
 import Data.Singletons.Syntax
+import Data.Singletons.TH.Options
 import Data.Singletons.Partition
 import Language.Haskell.TH.Desugar
 import qualified Language.Haskell.TH.Desugar.OMap.Strict as OMap
@@ -42,7 +43,8 @@
 import Data.Maybe
 import qualified Data.Set as Set
 import Control.Monad
-import Data.List
+import Control.Monad.Trans.Class
+import Data.List (unzip6, zipWith4)
 import qualified GHC.LanguageExtensions.Type as LangExt
 
 {-
@@ -79,42 +81,58 @@
 contract constructors. This is the point of buildDataLets.
 -}
 
--- | Generate singleton definitions from a type that is already defined.
--- For example, the singletons package itself uses
+-- | Generate singled definitions for each of the provided type-level
+-- declaration 'Name's. For example, the singletons package itself uses
 --
 -- > $(genSingletons [''Bool, ''Maybe, ''Either, ''[]])
 --
 -- to generate singletons for Prelude types.
-genSingletons :: DsMonad q => [Name] -> q [Dec]
+genSingletons :: OptionsMonad q => [Name] -> q [Dec]
 genSingletons names = do
-  checkForRep names
-  ddecs <- concatMapM (singInfo <=< dsInfo <=< reifyWithLocals) names
-  return $ decsToTH ddecs
+  opts <- getOptions
+  -- See Note [Disable genQuotedDecs in genPromotions and genSingletons]
+  -- in D.S.Promote
+  withOptions opts{genQuotedDecs = False} $ do
+    checkForRep names
+    ddecs <- concatMapM (singInfo <=< dsInfo <=< reifyWithLocals) names
+    return $ decsToTH ddecs
 
--- | Make promoted and singleton versions of all declarations given, retaining
--- the original declarations.
--- See <https://github.com/goldfirere/singletons/blob/master/README.md> for
--- further explanation.
-singletons :: DsMonad q => q [Dec] -> q [Dec]
+-- | Make promoted and singled versions of all declarations given, retaining
+-- the original declarations. See the
+-- @<https://github.com/goldfirere/singletons/blob/master/README.md README>@
+-- for further explanation.
+singletons :: OptionsMonad q => q [Dec] -> q [Dec]
 singletons qdecs = do
-  decs <- qdecs
-  ddecs <- withLocalDeclarations decs $ dsDecs decs
-  singDecs <- singTopLevelDecs decs ddecs
-  return (decs ++ decsToTH singDecs)
+  opts <- getOptions
+  withOptions opts{genQuotedDecs = True} $ singletons' $ lift qdecs
 
--- | Make promoted and singleton versions of all declarations given, discarding
+-- | Make promoted and singled versions of all declarations given, discarding
 -- the original declarations. Note that a singleton based on a datatype needs
 -- the original datatype, so this will fail if it sees any datatype declarations.
 -- Classes, instances, and functions are all fine.
-singletonsOnly :: DsMonad q => q [Dec] -> q [Dec]
-singletonsOnly = (>>= wrapDesugar singTopLevelDecs)
+singletonsOnly :: OptionsMonad q => q [Dec] -> q [Dec]
+singletonsOnly qdecs = do
+  opts <- getOptions
+  withOptions opts{genQuotedDecs = False} $ singletons' $ lift qdecs
 
+-- The workhorse for 'singletons' and 'singletonsOnly'. The difference between
+-- the two functions is whether 'genQuotedDecs' is set to 'True' or 'False'.
+singletons' :: OptionsMonad q => q [Dec] -> q [Dec]
+singletons' qdecs = do
+  opts     <- getOptions
+  decs     <- qdecs
+  ddecs    <- withLocalDeclarations decs $ dsDecs decs
+  singDecs <- singTopLevelDecs decs ddecs
+  let origDecs | genQuotedDecs opts = decs
+               | otherwise          = []
+  return $ origDecs ++ decsToTH singDecs
+
 -- | Create instances of 'SEq' and type-level @(==)@ for each type in the list
-singEqInstances :: DsMonad q => [Name] -> q [Dec]
+singEqInstances :: OptionsMonad q => [Name] -> q [Dec]
 singEqInstances = concatMapM singEqInstance
 
 -- | Create instance of 'SEq' and type-level @(==)@ for the given type
-singEqInstance :: DsMonad q => Name -> q [Dec]
+singEqInstance :: OptionsMonad q => Name -> q [Dec]
 singEqInstance name = do
   promotion <- promoteEqInstance name
   dec <- singEqualityInstance sEqClassDesc name
@@ -122,26 +140,26 @@
 
 -- | Create instances of 'SEq' (only -- no instance for @(==)@, which 'SEq' generally
 -- relies on) for each type in the list
-singEqInstancesOnly :: DsMonad q => [Name] -> q [Dec]
+singEqInstancesOnly :: OptionsMonad q => [Name] -> q [Dec]
 singEqInstancesOnly = concatMapM singEqInstanceOnly
 
 -- | Create instances of 'SEq' (only -- no instance for @(==)@, which 'SEq' generally
 -- relies on) for the given type
-singEqInstanceOnly :: DsMonad q => Name -> q [Dec]
+singEqInstanceOnly :: OptionsMonad q => Name -> q [Dec]
 singEqInstanceOnly name = singEqualityInstance sEqClassDesc name
 
 -- | Create instances of 'SDecide', 'TestEquality', and 'TestCoercion' for each
 -- type in the list.
-singDecideInstances :: DsMonad q => [Name] -> q [Dec]
+singDecideInstances :: OptionsMonad q => [Name] -> q [Dec]
 singDecideInstances = concatMapM singDecideInstance
 
 -- | Create instance of 'SDecide', 'TestEquality', and 'TestCoercion' for the
 -- given type.
-singDecideInstance :: DsMonad q => Name -> q [Dec]
+singDecideInstance :: OptionsMonad q => Name -> q [Dec]
 singDecideInstance name = singEqualityInstance sDecideClassDesc name
 
 -- generalized function for creating equality instances
-singEqualityInstance :: DsMonad q => EqualityClassDesc q -> Name -> q [Dec]
+singEqualityInstance :: OptionsMonad q => EqualityClassDesc q -> Name -> q [Dec]
 singEqualityInstance desc@(_, _, className, _) name = do
   (tvbs, cons) <- getDataD ("I cannot make an instance of " ++
                             show className ++ " for it.") name
@@ -160,45 +178,45 @@
   return $ decsToTH (eqInstance:testInstances)
 
 -- | Create instances of 'SOrd' for the given types
-singOrdInstances :: DsMonad q => [Name] -> q [Dec]
+singOrdInstances :: OptionsMonad q => [Name] -> q [Dec]
 singOrdInstances = concatMapM singOrdInstance
 
 -- | Create instance of 'SOrd' for the given type
-singOrdInstance :: DsMonad q => Name -> q [Dec]
+singOrdInstance :: OptionsMonad q => Name -> q [Dec]
 singOrdInstance = singInstance mkOrdInstance "Ord"
 
 -- | Create instances of 'SBounded' for the given types
-singBoundedInstances :: DsMonad q => [Name] -> q [Dec]
+singBoundedInstances :: OptionsMonad q => [Name] -> q [Dec]
 singBoundedInstances = concatMapM singBoundedInstance
 
 -- | Create instance of 'SBounded' for the given type
-singBoundedInstance :: DsMonad q => Name -> q [Dec]
+singBoundedInstance :: OptionsMonad q => Name -> q [Dec]
 singBoundedInstance = singInstance mkBoundedInstance "Bounded"
 
 -- | Create instances of 'SEnum' for the given types
-singEnumInstances :: DsMonad q => [Name] -> q [Dec]
+singEnumInstances :: OptionsMonad q => [Name] -> q [Dec]
 singEnumInstances = concatMapM singEnumInstance
 
 -- | Create instance of 'SEnum' for the given type
-singEnumInstance :: DsMonad q => Name -> q [Dec]
+singEnumInstance :: OptionsMonad q => Name -> q [Dec]
 singEnumInstance = singInstance mkEnumInstance "Enum"
 
 -- | Create instance of 'SShow' for the given type
 --
 -- (Not to be confused with 'showShowInstance'.)
-singShowInstance :: DsMonad q => Name -> q [Dec]
+singShowInstance :: OptionsMonad q => Name -> q [Dec]
 singShowInstance = singInstance (mkShowInstance ForPromotion) "Show"
 
 -- | Create instances of 'SShow' for the given types
 --
 -- (Not to be confused with 'showSingInstances'.)
-singShowInstances :: DsMonad q => [Name] -> q [Dec]
+singShowInstances :: OptionsMonad q => [Name] -> q [Dec]
 singShowInstances = concatMapM singShowInstance
 
 -- | Create instance of 'Show' for the given singleton type
 --
 -- (Not to be confused with 'singShowInstance'.)
-showSingInstance :: DsMonad q => Name -> q [Dec]
+showSingInstance :: OptionsMonad q => Name -> q [Dec]
 showSingInstance name = do
   (tvbs, cons) <- getDataD ("I cannot make an instance of Show for it.") name
   dtvbs <- mapM dsTvb tvbs
@@ -217,7 +235,7 @@
 -- | Create instances of 'Show' for the given singleton types
 --
 -- (Not to be confused with 'singShowInstances'.)
-showSingInstances :: DsMonad q => [Name] -> q [Dec]
+showSingInstances :: OptionsMonad q => [Name] -> q [Dec]
 showSingInstances = concatMapM showSingInstance
 
 -- | Create an instance for @'SingI' TyCon{N}@, where @N@ is the positive
@@ -244,15 +262,15 @@
        f      <- qNewName "f"
        x      <- qNewName "x"
        let k_penult = last ks
-           k_fun = ravel (map DVarT ks) (DVarT k_last)
+           k_fun = ravelVanillaDType [] [] (map DVarT ks) (DVarT k_last)
            f_ty  = DVarT f
            a_tys = map DVarT as
            mk_fun arrow t1 t2 = arrow `DAppT` t1 `DAppT` t2
            matchable_apply_fun   = mk_fun DArrowT                (DVarT k_penult) (DVarT k_last)
            unmatchable_apply_fun = mk_fun (DConT tyFunArrowName) (DVarT k_penult) (DVarT k_last)
-           ctxt = [ DForallT (map DPlainTV as)
-                             (map (DAppT (DConT singIName)) a_tys)
-                             (DConT singIName `DAppT` foldType f_ty a_tys)
+           ctxt = [ DForallT ForallInvis (map DPlainTV as) $
+                    DConstrainedT (map (DAppT (DConT singIName)) a_tys)
+                                  (DConT singIName `DAppT` foldType f_ty a_tys)
                   , DConT equalityName
                       `DAppT` (DConT applyTyConName `DSigT`
                                 mk_fun DArrowT matchable_apply_fun unmatchable_apply_fun)
@@ -269,7 +287,7 @@
                             DVarE withSingIName `DAppE` DVarE x
                                                 `DAppE` DVarE singMethName]]
 
-singInstance :: DsMonad q => DerivDesc q -> String -> Name -> q [Dec]
+singInstance :: OptionsMonad q => DerivDesc q -> String -> Name -> q [Dec]
 singInstance mk_inst inst_name name = do
   (tvbs, cons) <- getDataD ("I cannot make an instance of " ++ inst_name
                             ++ " for it.") name
@@ -279,11 +297,11 @@
   let data_decl = DataDecl name dtvbs dcons
   raw_inst <- mk_inst Nothing data_ty data_decl
   (a_inst, decs) <- promoteM [] $
-                    promoteInstanceDec OMap.empty raw_inst
+                    promoteInstanceDec OMap.empty Map.empty raw_inst
   decs' <- singDecsM [] $ (:[]) <$> singInstD a_inst
   return $ decsToTH (decs ++ decs')
 
-singInfo :: DsMonad q => DInfo -> q [DDec]
+singInfo :: OptionsMonad q => DInfo -> q [DDec]
 singInfo (DTyConI dec _) =
   singTopLevelDecs [] [dec]
 singInfo (DPrimTyConI _name _numArgs _unlifted) =
@@ -295,7 +313,7 @@
 singInfo (DPatSynI {}) =
   fail "Singling of pattern synonym info not supported"
 
-singTopLevelDecs :: DsMonad q => [Dec] -> [DDec] -> q [DDec]
+singTopLevelDecs :: OptionsMonad q => [Dec] -> [DDec] -> q [DDec]
 singTopLevelDecs locals raw_decls = withLocalDeclarations locals $ do
   decls <- expand raw_decls     -- expand type synonyms
   PDecs { pd_let_decs                = letDecls
@@ -309,18 +327,20 @@
         , pd_derived_show_decs       = derivedShowDecs } <- partitionDecs decls
 
   ((letDecEnv, classes', insts'), promDecls) <- promoteM locals $ do
-    defunTypeDecls ty_syns c_tyfams o_tyfams
-    promoteDataDecs datas
-    (_, letDecEnv) <- promoteLetDecs noPrefix letDecls
+    defunTopLevelTypeDecls ty_syns c_tyfams o_tyfams
+    recSelLetDecls <- promoteDataDecs datas
+    (_, letDecEnv) <- promoteLetDecs Nothing $ recSelLetDecls ++ letDecls
     classes' <- mapM promoteClassDec classes
-    let meth_sigs = foldMap (lde_types . cd_lde) classes
-    insts' <- mapM (promoteInstanceDec meth_sigs) insts
+    let meth_sigs    = foldMap (lde_types . cd_lde) classes
+        cls_tvbs_map = Map.fromList $ map (\cd -> (cd_name cd, cd_tvbs cd)) classes
+    insts' <- mapM (promoteInstanceDec meth_sigs cls_tvbs_map) insts
     mapM_ promoteDerivedEqDec derivedEqDecs
     return (letDecEnv, classes', insts')
 
   singDecsM locals $ do
-    let letBinds = concatMap buildDataLets datas
-                ++ concatMap buildMethLets classes
+    dataLetBinds <- concatMapM buildDataLets datas
+    methLetBinds <- concatMapM buildMethLets classes
+    let letBinds = dataLetBinds ++ methLetBinds
     (newLetDecls, singIDefunDecls, newDecls)
                             <- bindLets letBinds $
                                singLetDecEnv letDecEnv $ do
@@ -336,32 +356,36 @@
     return $ promDecls ++ (map DLetDec newLetDecls) ++ singIDefunDecls ++ newDecls
 
 -- see comment at top of file
-buildDataLets :: DataDecl -> [(Name, DExp)]
-buildDataLets (DataDecl _name _tvbs cons) =
-  concatMap con_num_args cons
+buildDataLets :: OptionsMonad q => DataDecl -> q [(Name, DExp)]
+buildDataLets (DataDecl _name _tvbs cons) = do
+  opts <- getOptions
+  pure $ concatMap (con_num_args opts) cons
   where
-    con_num_args :: DCon -> [(Name, DExp)]
-    con_num_args (DCon _tvbs _cxt name fields _rty) =
+    con_num_args :: Options -> DCon -> [(Name, DExp)]
+    con_num_args opts (DCon _tvbs _cxt name fields _rty) =
       (name, wrapSingFun (length (tysOfConFields fields))
-                         (promoteValRhs name) (DConE $ singDataConName name))
-      : rec_selectors fields
+                         (DConT $ defunctionalizedName0 opts name)
+                         (DConE $ singledDataConName opts name))
+      : rec_selectors opts fields
 
-    rec_selectors :: DConFields -> [(Name, DExp)]
-    rec_selectors (DNormalC {}) = []
-    rec_selectors (DRecC fields) =
+    rec_selectors :: Options -> DConFields -> [(Name, DExp)]
+    rec_selectors _    (DNormalC {}) = []
+    rec_selectors opts (DRecC fields) =
       let names = map fstOf3 fields in
-      [ (name, wrapSingFun 1 (promoteValRhs name) (DVarE $ singValName name))
+      [ (name, wrapSingFun 1 (DConT $ defunctionalizedName0 opts name)
+                             (DVarE $ singledValueName opts name))
       | name <- names ]
 
 -- see comment at top of file
-buildMethLets :: UClassDecl -> [(Name, DExp)]
-buildMethLets (ClassDecl { cd_lde = LetDecEnv { lde_types = meth_sigs } }) =
-  map mk_bind (OMap.assocs meth_sigs)
+buildMethLets :: OptionsMonad q => UClassDecl -> q [(Name, DExp)]
+buildMethLets (ClassDecl { cd_lde = LetDecEnv { lde_types = meth_sigs } }) = do
+  opts <- getOptions
+  pure $ map (mk_bind opts) (OMap.assocs meth_sigs)
   where
-    mk_bind (meth_name, meth_ty) =
+    mk_bind opts (meth_name, meth_ty) =
       ( meth_name
-      , wrapSingFun (countArgs meth_ty) (promoteValRhs meth_name)
-                                        (DVarE $ singValName meth_name) )
+      , wrapSingFun (countArgs meth_ty) (DConT $ defunctionalizedName0 opts meth_name)
+                                        (DVarE $ singledValueName opts meth_name) )
 
 singClassD :: AClassDecl -> SgM DDec
 singClassD (ClassDecl { cd_cxt  = cls_cxt
@@ -374,22 +398,29 @@
                                             , lde_proms     = promoted_defaults
                                             , lde_bound_kvs = meth_bound_kvs } }) =
   bindContext [foldTypeTvbs (DConT cls_name) cls_tvbs] $ do
+    opts <- getOptions
+    mb_cls_sak <- dsReifyType cls_name
+    let sing_cls_name   = singledClassName opts cls_name
+        mb_sing_cls_sak = fmap (DKiSigD sing_cls_name) mb_cls_sak
+    cls_infix_decls <- singReifiedInfixDecls $ cls_name:meth_names
     (sing_sigs, _, tyvar_names, cxts, res_kis, singIDefunss)
       <- unzip6 <$> zipWithM (singTySig no_meth_defns meth_sigs meth_bound_kvs)
-                             meth_names (map promoteValRhs meth_names)
-    emitDecs $ concat singIDefunss
+                             meth_names
+                             (map (DConT . defunctionalizedName0 opts) meth_names)
+    emitDecs $ maybeToList mb_sing_cls_sak ++ cls_infix_decls ++ concat singIDefunss
     let default_sigs = catMaybes $
-                       zipWith4 mk_default_sig meth_names sing_sigs tyvar_names res_kis
+                       zipWith4 (mk_default_sig opts) meth_names sing_sigs
+                                                      tyvar_names res_kis
         res_ki_map   = Map.fromList (zip meth_names
                                          (map (fromMaybe always_sig) res_kis))
     sing_meths <- mapM (uncurry (singLetDecRHS (Map.fromList tyvar_names)
                                                (Map.fromList cxts)
                                                res_ki_map))
                        (OMap.assocs default_defns)
-    fixities' <- traverse (uncurry singInfixDecl) $ OMap.assocs fixities
+    fixities' <- mapMaybeM (uncurry singInfixDecl) $ OMap.assocs fixities
     cls_cxt' <- mapM singPred cls_cxt
     return $ DClassD cls_cxt'
-                     (singClassName cls_name)
+                     sing_cls_name
                      cls_tvbs
                      cls_fundeps   -- they are fine without modification
                      (map DLetDec (sing_sigs ++ sing_meths ++ fixities') ++ default_sigs)
@@ -398,44 +429,47 @@
     always_sig    = error "Internal error: no signature for default method"
     meth_names    = map fst $ OMap.assocs meth_sigs
 
-    mk_default_sig meth_name (DSigD s_name sty) bound_kvs (Just res_ki) =
-      DDefaultSigD s_name <$> add_constraints meth_name sty bound_kvs res_ki
-    mk_default_sig _ _ _ _ = error "Internal error: a singled signature isn't a signature."
+    mk_default_sig opts meth_name (DSigD s_name sty) bound_kvs (Just res_ki) =
+      DDefaultSigD s_name <$> add_constraints opts meth_name sty bound_kvs res_ki
+    mk_default_sig _ _ _ _ _ = error "Internal error: a singled signature isn't a signature."
 
-    add_constraints meth_name sty (_, bound_kvs) res_ki = do  -- Maybe monad
+    add_constraints opts meth_name sty (_, bound_kvs) res_ki = do  -- Maybe monad
+      (tvbs, cxt, args, res) <- unravelVanillaDType sty
       prom_dflt <- OMap.lookup meth_name promoted_defaults
-      let default_pred = foldType (DConT equalityName)
+
+      -- Filter out explicitly bound kind variables. Otherwise, if you had
+      -- the following class (#312):
+      --
+      --  class Foo a where
+      --    bar :: a -> b -> b
+      --    bar _ x = x
+      --
+      -- Then it would be singled to:
+      --
+      --  class SFoo a where
+      --    sBar :: forall b (x :: a) (y :: b). Sing x -> Sing y -> Sing (sBar x y)
+      --    default :: forall b (x :: a) (y :: b).
+      --               (Bar b x y) ~ (BarDefault b x y) => ...
+      --
+      -- Which applies Bar/BarDefault to b, which shouldn't happen.
+      let tvs = map tvbToType $
+                filter (\tvb -> extractTvbName tvb `Set.member` bound_kv_set) tvbs
+          prom_meth =  DConT $ defunctionalizedName0 opts meth_name
+          default_pred = foldType (DConT equalityName)
                                 -- NB: Need the res_ki here to prevent ambiguous
                                 -- kinds in result-inferred default methods.
                                 -- See #175
-                               [ foldApply (promoteValRhs meth_name) tvs `DSigT` res_ki
+                               [ foldApply prom_meth tvs `DSigT` res_ki
                                , foldApply prom_dflt tvs ]
-      return $ DForallT tvbs (default_pred : cxt) (ravel args res)
+      return $ ravelVanillaDType tvbs (default_pred : cxt) args res
       where
-        (tvbs, cxt, args, res) = unravel sty
         bound_kv_set = Set.fromList bound_kvs
-        -- Filter out explicitly bound kind variables. Otherwise, if you had
-        -- the following class (#312):
-        --
-        --  class Foo a where
-        --    bar :: a -> b -> b
-        --    bar _ x = x
-        --
-        -- Then it would be singled to:
-        --
-        --  class SFoo a where
-        --    sBar :: forall b (x :: a) (y :: b). Sing x -> Sing y -> Sing (sBar x y)
-        --    default :: forall b (x :: a) (y :: b).
-        --               (Bar b x y) ~ (BarDefault b x y) => ...
-        --
-        -- Which applies Bar/BarDefault to b, which shouldn't happen.
-        tvs = map tvbToType $
-              filter (\tvb -> extractTvbName tvb `Set.member` bound_kv_set) tvbs
 
-
 singInstD :: AInstDecl -> SgM DDec
 singInstD (InstDecl { id_cxt = cxt, id_name = inst_name, id_arg_tys = inst_tys
                     , id_sigs = inst_sigs, id_meths = ann_meths }) = do
+  opts <- getOptions
+  let s_inst_name = singledClassName opts inst_name
   bindContext cxt $ do
     cxt' <- mapM singPred cxt
     inst_kis <- mapM promoteType inst_tys
@@ -447,11 +481,10 @@
                        meths)
 
   where
-    s_inst_name = singClassName inst_name
-
     sing_meth :: Name -> ALetDecRHS -> SgM [DDec]
     sing_meth name rhs = do
-      mb_s_info <- dsReify (singValName name)
+      opts <- getOptions
+      mb_s_info <- dsReify (singledValueName opts name)
       inst_kis <- mapM promoteType inst_tys
       let mk_subst cls_tvbs = Map.fromList $ zip (map extractTvbName vis_cls_tvbs) inst_kis
             where
@@ -473,7 +506,7 @@
             -- resulted in #167.
             raw_ty <- expand inner_ty
             (s_ty, _num_args, tyvar_names, ctxt, _arg_kis, res_ki)
-              <- singType bound_kvs (promoteValRhs name) raw_ty
+              <- singType bound_kvs (DConT $ defunctionalizedName0 opts name) raw_ty
             pure (s_ty, tyvar_names, ctxt, res_ki)
 
       (s_ty, tyvar_names, ctxt, m_res_ki) <- case OMap.lookup name inst_sigs of
@@ -486,9 +519,9 @@
         Nothing -> case mb_s_info of
           -- We don't have an InstanceSig, so we must compute the type to use
           -- in the singled instance ourselves through reification.
-          Just (DVarI _ (DForallT cls_tvbs _cls_pred s_ty) _) -> do
+          Just (DVarI _ (DForallT _ cls_tvbs (DConstrainedT _cls_pred s_ty)) _) -> do
+            (sing_tvbs, ctxt, _args, res_ty) <- unravelVanillaDType s_ty
             let subst = mk_subst cls_tvbs
-                (sing_tvbs, ctxt, _args, res_ty) = unravel s_ty
                 m_res_ki = case res_ty of
                   _sing `DAppT` (_prom_func `DSigT` res_ki) -> Just (substKind subst res_ki)
                   _                                         -> Nothing
@@ -500,7 +533,8 @@
           _ -> do
             mb_info <- dsReify name
             case mb_info of
-              Just (DVarI _ (DForallT cls_tvbs _cls_pred inner_ty) _) -> do
+              Just (DVarI _ (DForallT _ cls_tvbs
+                                      (DConstrainedT _cls_pred inner_ty)) _) -> do
                 let subst = mk_subst cls_tvbs
                     cls_kvb_names = foldMap (foldMap fvDType . extractTvbKind) cls_tvbs
                     cls_tvb_names = OSet.fromList $ map extractTvbName cls_tvbs
@@ -516,7 +550,7 @@
       meth' <- singLetDecRHS (Map.singleton name tyvar_names)
                              (Map.singleton name ctxt)
                              kind_map name rhs
-      return $ map DLetDec [DSigD (singValName name) s_ty, meth']
+      return $ map DLetDec [DSigD (singledValueName opts name) s_ty, meth']
 
 singLetDecEnv :: ALetDecEnv
               -> SgM a
@@ -536,7 +570,7 @@
   let prom_list = OMap.assocs proms
   (typeSigs, letBinds, tyvarNames, cxts, res_kis, singIDefunss)
     <- unzip6 <$> mapM (uncurry (singTySig defns types bound_kvs)) prom_list
-  infix_decls' <- traverse (uncurry singInfixDecl) $ OMap.assocs infix_decls
+  infix_decls' <- mapMaybeM (uncurry singInfixDecl) $ OMap.assocs infix_decls
   let res_ki_map = Map.fromList [ (name, res_ki) | ((name, _), Just res_ki)
                                                      <- zip prom_list res_kis ]
   bindLets letBinds $ do
@@ -558,8 +592,9 @@
                  , Maybe DKind           -- the result kind in the tysig
                  , [DDec]                -- SingI instances for defun symbols
                  )
-singTySig defns types bound_kvs name prom_ty =
-  let sName = singValName name in
+singTySig defns types bound_kvs name prom_ty = do
+  opts <- getOptions
+  let sName = singledValueName opts name
   case OMap.lookup name types of
     Nothing -> do
       num_args <- guess_num_args
@@ -604,22 +639,124 @@
     mk_sing_ty :: Int -> SgM (DType, [Name])
     mk_sing_ty n = do
       arg_names <- replicateM n (qNewName "arg")
-      return ( DForallT (map DPlainTV arg_names) []
-                        (ravel (map (\nm -> singFamily `DAppT` DVarT nm) arg_names)
-                               (singFamily `DAppT`
-                                    (foldl apply prom_ty (map DVarT arg_names))))
+      -- If there are no arguments, use `Sing @_` instead of `Sing`.
+      -- See Note [Disable kind generalization for local functions if possible]
+      let sing_w_wildcard | n == 0    = singFamily `DAppKindT` DWildCardT
+                          | otherwise = singFamily
+      return ( ravelVanillaDType
+                 (map DPlainTV arg_names)
+                 []
+                 (map (\nm -> singFamily `DAppT` DVarT nm) arg_names)
+                 (sing_w_wildcard `DAppT`
+                      (foldl apply prom_ty (map DVarT arg_names)))
              , arg_names )
 
+{-
+Note [Disable kind generalization for local functions if possible]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Consider this example (from #296):
+
+  f :: forall a. MyProxy a -> MyProxy a
+  f MyProxy =
+    let x = let z :: MyProxy a
+                z = MyProxy in z
+    in x
+
+A naïve attempt at singling `f` is as follows:
+
+  type LetZ :: MyProxy a
+  type family LetZ where
+    LetZ = 'MyProxy
+
+  type family LetX where
+    LetX = LetZ
+
+  type F :: forall a. MyProxy a -> MyProxy a
+  type family F x where
+    F 'MyProxy = LetX
+
+  sF :: forall a (t :: MyProxy a). Sing t -> Sing (F t :: MyProxy a)
+  sF SMyProxy =
+    let sX :: Sing LetX
+        sX = let sZ :: Sing (LetZ :: MyProxy a)
+                 sZ = SMyProxy in sZ
+    in sX
+
+This will not typecheck, however. The is because the return kind of
+`LetX` (in `let sX :: Sing LetX`) will get generalized by virtue of `sX`
+having a type signature. It's as if one had written this:
+
+  sF :: forall a (t :: MyProxy a). Sing t -> Sing (F t :: MyProxy a)
+  sF SMyProxy =
+    let sX :: forall a1. Sing (LetX :: MyProxy a1)
+        sX = ...
+
+This is too general, since `sX` will only typecheck if the return kind of
+`LetX` is `MyProxy a`, not `MyProxy a1`. In order to avoid this problem,
+we need to avoid kind generalization when kind-checking the type of `sX`.
+To accomplish this, we borrow a trick from
+Note [The id hack; or, how singletons learned to stop worrying and avoid kind generalization]
+and use TypeApplications plus a wildcard type. That is, we generate this code
+for `sF`:
+
+  sF :: forall a (t :: MyProxy a). Sing t -> Sing (F t :: MyProxy a)
+  sF SMyProxy =
+    let sX :: Sing @_ LetX
+        sX = ...
+
+The presence of the wildcard type disables kind generalization, which allows
+GHC's kind inference to deduce that the return kind of `LetX` should be `a`.
+Now `sF` typechecks, and since we only use wildcards within visible kind
+applications, we don't even have to force users to enable
+PartialTypeSignatures. Hooray!
+
+Question: where should we put wildcard types when singling? One possible answer
+is: put a wildcard in any type signature that gets generated when singling a
+function that lacks a type signature. Unfortunately, this is a step too far.
+This will break singling the `foldr` function:
+
+    foldr                   :: (a -> b -> b) -> b -> [a] -> b
+    foldr k z = go
+              where
+                go []     = z
+                go (y:ys) = y `k` go ys
+
+If the type of `sGo` is given a wildcard, then it will fail to typecheck. This
+is because `sGo` is polymorphically recursive, so disabling kind generalization
+forces GHC to infer `sGo`'s type. Attempting to infer a polymorphically
+recursive type, unsurprisingly, leads to failure.
+
+To avoid this sort of situation, where adopt a simple metric: if a function
+lacks a type signature, only put @_ in its singled type signature if it has
+zero arguments. This allows `sX` to typecheck without breaking things like
+`sGo`. This metric is a bit conservative, however, since it means that this
+small tweak to `x` still would not typecheck:
+
+  f :: forall a. MyProxy a -> MyProxy a
+  f MyProxy =
+    let x () = let z :: MyProxy a
+                   z = MyProxy in z
+    in x ()
+
+We need not let perfect be the enemy of good, however. It is extremely
+common for local definitions to have zero arguments, so it makes good sense
+to optimize for that special case. In fact, this special treatment is the only
+reason that `foo8` from the `T183` test case singles successfully, since
+the as-patterns in `foo8` desugar to code very similar to the `f` example
+above.
+-}
+
 singLetDecRHS :: Map Name [Name]
               -> Map Name DCxt    -- the context of the type signature
                                   -- (might not be known)
               -> Map Name DKind   -- result kind (might not be known)
               -> Name -> ALetDecRHS -> SgM DLetDec
-singLetDecRHS bound_names cxts res_kis name ld_rhs =
+singLetDecRHS bound_names cxts res_kis name ld_rhs = do
+  opts <- getOptions
   bindContext (Map.findWithDefault [] name cxts) $
     case ld_rhs of
       AValue prom num_arrows exp ->
-        DValD (DVarP (singValName name)) <$>
+        DValD (DVarP (singledValueName opts name)) <$>
         (wrapUnSingFun num_arrows prom <$> singExp exp (Map.lookup name res_kis))
       AFunction prom_fun num_arrows clauses ->
         let tyvar_names = case Map.lookup name bound_names of
@@ -627,7 +764,7 @@
                             Just ns -> ns
             res_ki = Map.lookup name res_kis
         in
-        DFunD (singValName name) <$>
+        DFunD (singledValueName opts name) <$>
               mapM (singClause prom_fun num_arrows tyvar_names res_ki) clauses
 
 singClause :: DType   -- the promoted function
@@ -666,12 +803,16 @@
     go (ADLitP _lit) =
       fail "Singling of literal patterns not yet supported"
     go (ADVarP name) = do
+      opts <- getOptions
       tyname <- case Map.lookup name var_proms of
                   Nothing     ->
                     fail "Internal error: unknown variable when singling pattern"
                   Just tyname -> return tyname
-      pure $ DVarP (singValName name) `DSigP` (singFamily `DAppT` DVarT tyname)
-    go (ADConP name pats) = DConP (singDataConName name) <$> mapM go pats
+      pure $ DVarP (singledValueName opts name)
+               `DSigP` (singFamily `DAppT` DVarT tyname)
+    go (ADConP name pats) = do
+      opts <- getOptions
+      DConP (singledDataConName opts name) <$> mapM go pats
     go (ADTildeP pat) = do
       qReportWarning
         "Lazy pattern converted into regular pattern during singleton generation."
@@ -810,8 +951,9 @@
         -> SgM DExp
   -- See Note [Why error is so special]
 singExp (ADVarE err `ADAppE` arg) _res_ki
-  | err == errorName = DAppE (DVarE (singValName err)) <$>
-                       singExp arg (Just (DConT symbolName))
+  | err == errorName = do opts <- getOptions
+                          DAppE (DVarE (singledValueName opts err)) <$>
+                            singExp arg (Just (DConT symbolName))
 singExp (ADVarE name) _res_ki = lookupVarE name
 singExp (ADConE name) _res_ki = lookupConE name
 singExp (ADLitE lit)  _res_ki = singLit lit
@@ -824,7 +966,8 @@
   then return $ e1' `DAppE` e2'
   else return $ (DVarE applySingName) `DAppE` e1' `DAppE` e2'
 singExp (ADLamE ty_names prom_lam names exp) _res_ki = do
-  let sNames = map singValName names
+  opts <- getOptions
+  let sNames = map (singledValueName opts) names
   exp' <- singExp exp Nothing
   -- we need to bind the type variables... but DLamE doesn't allow SigT patterns.
   -- So: build a case
@@ -951,10 +1094,6 @@
          else sing_str_lit
 singLit lit =
   fail ("Only string and natural number literals can be singled: " ++ show lit)
-
-maybeSigT :: DType -> Maybe DKind -> DType
-maybeSigT ty Nothing   = ty
-maybeSigT ty (Just ki) = ty `DSigT` ki
 
 {-
 Note [The id hack; or, how singletons learned to stop worrying and avoid kind generalization]
diff --git a/src/Data/Singletons/Single/Data.hs b/src/Data/Singletons/Single/Data.hs
--- a/src/Data/Singletons/Single/Data.hs
+++ b/src/Data/Singletons/Single/Data.hs
@@ -11,7 +11,6 @@
 module Data.Singletons.Single.Data where
 
 import Language.Haskell.TH.Desugar
-import Language.Haskell.TH.Desugar.OSet (OSet)
 import Language.Haskell.TH.Syntax
 import Data.Singletons.Single.Defun
 import Data.Singletons.Single.Monad
@@ -21,27 +20,21 @@
 import Data.Singletons.Util
 import Data.Singletons.Names
 import Data.Singletons.Syntax
+import Data.Singletons.TH.Options
 import Control.Monad
-import Data.Foldable
 
 -- We wish to consider the promotion of "Rep" to be *
 -- not a promoted data constructor.
 singDataD :: DataDecl -> SgM [DDec]
 singDataD (DataDecl name tvbs ctors) = do
-  let tvbNames = map extractTvbName tvbs
+  opts <- getOptions
+  let tvbNames      = map extractTvbName tvbs
+      ctor_names    = map extractName ctors
+      rec_sel_names = concatMap extractRecSelNames ctors
   k <- promoteType (foldType (DConT name) (map DVarT tvbNames))
+  mb_data_sak <- dsReifyType name
   ctors' <- mapM (singCtor name) ctors
-  ctorFixities <-
-    -- try to reify the fixity declarations for the constructors and then
-    -- singletonize them. In case the reification fails, we default to an
-    -- empty list of singletonized fixity declarations.
-    -- why this works:
-    -- 1. if we're in a call to 'genSingletons', the data type was defined
-    --    earlier and its constructors are in scope, the reification succeeds.
-    -- 2. if we're in a call to 'singletons', the reification will fail, but
-    --    the fixity declaration will get singletonized by itself (not from
-    --    here, look for other invocations of 'singInfixDecl')
-    singFixityDeclarations [ n | DCon _ _ n _ _ <- ctors ]
+  fixityDecs <- singReifiedInfixDecls $ ctor_names ++ rec_sel_names
   -- instance for SingKind
   fromSingClauses     <- mapM mkFromSingClause ctors
   emptyFromSingClause <- mkEmptyFromSingClause
@@ -60,19 +53,46 @@
                    , DLetDec $ DFunD toSingName
                                (toSingClauses   `orIfEmpty` [emptyToSingClause]) ]
 
-  let singDataName = singTyConName name
+  let singDataName = singledDataTypeName opts name
       -- e.g. type instance Sing @Nat = SNat
       singSynInst =
         DTySynInstD $ DTySynEqn Nothing
                                 (DConT singFamilyName `DAppKindT` k)
                                 (DConT singDataName)
-      kindedSingTy = DForallT (map DPlainTV tvbNames) [] $
-                     DArrowT `DAppT` k `DAppT` DConT typeKindName
 
-  return $ (DDataD Data [] singDataName [] (Just kindedSingTy) ctors' []) :
+      mk_data_dec tvbs' mb_kind =
+        DDataD Data [] singDataName tvbs' mb_kind ctors' []
+
+  data_decs <-
+    case mb_data_sak of
+      -- No standalone kind signature. Try to figure out the order of kind
+      -- variables on a best-effort basis.
+      Nothing -> do
+        ki <- promoteType $ foldType (DConT name) (map dTyVarBndrToDType tvbs)
+        let sing_tvbs = toposortTyVarsOf [k]
+            kinded_sing_ty = DForallT ForallInvis sing_tvbs $
+                             DArrowT `DAppT` ki `DAppT` DConT typeKindName
+        pure [mk_data_dec [] (Just kinded_sing_ty)]
+
+      -- A standalone kind signature is provided, so use that to determine the
+      -- order of kind variables.
+      Just data_sak -> do
+        let (args, _)  = unravelDType data_sak
+            vis_args   = filterDVisFunArgs args
+            invis_tvbs = filterInvisTvbArgs args
+            vis_tvbs   = zipWith replaceTvbKind vis_args tvbs
+        ki <- promoteType $ foldType (DConT name) (map dTyVarBndrToDType vis_tvbs)
+        z  <- qNewName "z"
+        let sing_data_sak = DForallT ForallInvis (invis_tvbs ++ vis_tvbs) $
+                            DArrowT `DAppT` ki `DAppT` DConT typeKindName
+        pure [ DKiSigD singDataName sing_data_sak
+             , mk_data_dec [DPlainTV z] Nothing
+             ]
+
+  return $ data_decs ++
            singSynInst :
-           singKindInst :
-           ctorFixities
+           [singKindInst | genSingKindInsts opts] ++
+           fixityDecs
   where -- in the Rep case, the names of the constructors are in the wrong scope
         -- (they're types, not datacons), so we have to reinterpret them.
         mkConName :: Name -> SgM Name
@@ -82,16 +102,18 @@
 
         mkFromSingClause :: DCon -> SgM DClause
         mkFromSingClause c = do
+          opts <- getOptions
           let (cname, numArgs) = extractNameArgs c
           cname' <- mkConName cname
           varNames <- replicateM numArgs (qNewName "b")
-          return $ DClause [DConP (singDataConName cname) (map DVarP varNames)]
+          return $ DClause [DConP (singledDataConName opts cname) (map DVarP varNames)]
                            (foldExp
                               (DConE cname')
                               (map (DAppE (DVarE fromSingName) . DVarE) varNames))
 
         mkToSingClause :: DCon -> SgM DClause
         mkToSingClause (DCon _tvbs _cxt cname fields _rty) = do
+          opts <- getOptions
           let types = tysOfConFields fields
           varNames  <- mapM (const $ qNewName "b") types
           svarNames <- mapM (const $ qNewName "c") types
@@ -105,7 +127,7 @@
                                (map (DConP someSingDataName . listify . DVarP)
                                     svarNames)
                                (DAppE (DConE someSingDataName)
-                                         (foldExp (DConE (singDataConName cname))
+                                         (foldExp (DConE (singledDataConName opts cname))
                                                   (map DVarE svarNames))))
 
         mkToSingVarPat :: Name -> DKind -> DPat
@@ -129,28 +151,29 @@
           pure $ DClause [DVarP x]
                $ DConE someSingDataName `DAppE` DCaseE (DVarE x) []
 
--- refine a constructor.
+-- Single a constructor.
 singCtor :: Name -> DCon -> SgM DCon
  -- polymorphic constructors are handled just
  -- like monomorphic ones -- the polymorphism in
  -- the kind is automatic
-singCtor dataName (DCon _tvbs cxt name fields rty)
+singCtor dataName (DCon con_tvbs cxt name fields rty)
   | not (null cxt)
   = fail "Singling of constrained constructors not yet supported"
   | otherwise
   = do
+  opts <- getOptions
   let types = tysOfConFields fields
-      sName = singDataConName name
+      sName = singledDataConName opts name
       sCon = DConE sName
       pCon = DConT name
+  checkVanillaDType $ ravelVanillaDType con_tvbs [] types rty
   indexNames <- mapM (const $ qNewName "n") types
+  kinds <- mapM promoteType_NC types
+  rty' <- promoteType_NC rty
   let indices = map DVarT indexNames
-  kinds <- mapM promoteType types
-  let bound_kvs = foldMap fvDType kinds
-  args <- zipWithM (buildArgType bound_kvs) types indices
-  rty' <- promoteType rty
-  let tvbs = map DPlainTV (toList bound_kvs) ++ zipWith DKindedTV indexNames kinds
       kindedIndices = zipWith DSigT indices kinds
+      kvbs = singTypeKVBs con_tvbs kinds [] rty' mempty
+      all_tvbs = kvbs ++ zipWith DKindedTV indexNames kinds
 
   -- SingI instance for data constructor
   emitDecs
@@ -166,18 +189,159 @@
   emitDecs =<< singDefuns name DataName [] (map Just kinds) (Just rty')
 
   let noBang    = Bang NoSourceUnpackedness NoSourceStrictness
+      args      = map ((noBang,) . DAppT singFamily) indices
       conFields = case fields of
-                    DNormalC dInfix _ -> DNormalC dInfix $ map (noBang,) args
-                    DRecC rec_fields ->
-                      DRecC [ (singValName field_name, noBang, arg)
-                            | (field_name, _, _) <- rec_fields
-                            | arg <- args ]
-  return $ DCon tvbs
-                []
-                sName
-                conFields
-                (DConT (singTyConName dataName) `DAppT` foldType pCon indices)
-  where buildArgType :: OSet Name -> DType -> DType -> SgM DType
-        buildArgType bound_kvs ty index = do
-          (ty', _, _, _, _, _) <- singType bound_kvs index ty
-          return ty'
+                    DNormalC dInfix _ -> DNormalC dInfix args
+                    DRecC _           -> DNormalC False  args
+                      -- Don't bother looking at record selectors, as they are
+                      -- handled separately in singTopLevelDecs.
+                      -- See Note [singletons and record selectors]
+  return $ DCon all_tvbs [] sName conFields
+                (DConT (singledDataTypeName opts dataName) `DAppT`
+                  (foldType pCon indices `DSigT` rty'))
+                  -- Make sure to include an explicit `rty'` kind annotation.
+                  -- See Note [Preserve the order of type variables during singling],
+                  -- wrinkle 3, in D.S.Single.Type.
+
+{-
+Note [singletons and record selectors]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Record selectors are annoying to deal with in singletons for various reasons:
+
+1. There is no record syntax at the type level, so promoting code that involves
+   records in some way is not straightforward.
+2. One can define record selectors for singled data types, but they're rife
+   with peril. Some pitfalls include:
+
+   * Singling record updates often produces code that does not typecheck. For
+     example, this works:
+
+       let i = Identity True in i { runIdentity = False }
+
+     But this does /not/ work:
+
+       let si = SIdentity STrue in si { sRunIdentity = SFalse }
+
+       error:
+           • Record update for insufficiently polymorphic field:
+               sRunIdentity :: Sing n
+           • In the expression: si {sRunIdentity = SFalse}
+             In the expression:
+               let si = SIdentity STrue in si {sRunIdentity = SFalse}
+
+     Ugh. See GHC#16501.
+
+   * Singling a data type with multiple constructors that share a record
+     selector name will /also/ not typecheck. While this works:
+
+       data X = X1 {y :: Bool} | X2 {y :: Bool}
+
+     This does not:
+
+       data SX :: X -> Type where
+         SX1 :: { sY :: Sing n } -> SX ('X1 n)
+         SY1 :: { sY :: Sing n } -> SX ('X2 n)
+
+       error:
+           • Constructors SX1 and SX2 have a common field ‘sY’,
+               but have different result types
+           • In the data type declaration for ‘SX’
+
+     Double ugh. See GHC#8673/GHC#12159.
+
+   * Even if a data type only has a single constructor with record selectors,
+     singling it can induce headaches. One might be tempted to single this type:
+
+       newtype Unit = MkUnit { runUnit :: () }
+
+     With this code:
+
+       data SUnit :: Unit -> Type where
+         SMkUnit :: { sRunUnit :: Sing u } -> SUnit (MkUnit u)
+
+     Somewhat surprisingly, the type of sRunUnit:
+
+       sRunUnit :: Sing (MkUnit u) -> Sing u
+
+     Is not general enough to handle common uses of record selectors. For
+     example, if you try to single this function:
+
+       f :: Unit -> ()
+       f = runUnit
+
+     Then the resulting code:
+
+       sF :: Sing (x :: Unit) -> Sing (F x :: ())
+       sF = sRunUnit
+
+     Will not typecheck. Note that sRunUnit expects an argument of type
+     `Sing (MkUnit u)`, but there is no way to know a priori that the `x` in
+     `Sing (x :: Unit)` is `MkUnit u` without pattern-matching on SMkUnit.
+
+Hopefully I have convinced you that handling records in singletons is a bit of
+a nightmare. Thankfully, there is a simple trick to avoid most of the pitfalls
+above: just desugar code (using th-desugar) to avoid records!
+In more concrete terms, we do the following:
+
+* A record constructions desugars to a normal constructor application. For example:
+
+    MkT{a = x, b = y}
+
+      ==>
+
+    MkT x y
+
+  Something similar occurs for record syntax in patterns.
+
+* A record update desugars to a case expression. For example:
+
+    t{a = x}
+
+      ==>
+
+    case t of MkT _ y => MkT x y
+
+We can't easily desugar away all uses of records, however. After all, records
+can be used as ordinary functions as well. We leave such uses of records alone
+when desugaring and accommodate them during promotion and singling by generating
+"manual" record selectors. As a running example, consider the earlier Unit example:
+
+  newtype Unit = MkUnit { runUnit :: () }
+
+When singling Unit, we do not give SMkUnit a record selector:
+
+  data SUnit :: Unit -> Type where
+    SMkUnit :: Sing u -> SUnit (MkUnit u)
+
+Instead, we generate a top-level function that behaves equivalently to runUnit.
+This function then gets promoted and singled (in D.S.Promote.promoteDecs and
+D.S.Single.singTopLevelDecs):
+
+  type family RunUnit (x :: Unit) :: () where
+    RunUnit (MkUnit x) = x
+
+  sRunUnit :: Sing (x :: Unit) -> Sing (RunUnit x :: ())
+  sRunUnit (SMkUnit sx) = sx
+
+Now promoting/singling uses of runUnit as an ordinary function work as expected
+since the types of RunUnit/sRunUnit are sufficiently general. This technique also
+scales up to data types with multiple constructors sharing a record selector name.
+For instance, in the earlier X example:
+
+  data X = X1 {y :: Bool} | X2 {y :: Bool}
+
+We would promote/single `y` like so:
+
+  type family Y (x :: X) :: Bool where
+    Y (X1 y) = y
+    Y (X2 y) = y
+
+  sY :: Sing (x :: X) -> Sing (Y x :: Bool)
+  sY (SX1 sy) = sy
+  sY (SX2 sy) = sy
+
+Manual record selectors cannot be used in record constructions or updates, but
+for most use cases this won't be an issue, since singletons makes an effort to
+desugar away fancy uses of records anyway. The only time this would bite is if
+you wanted to use record syntax in hand-written singletons code.
+-}
diff --git a/src/Data/Singletons/Single/Defun.hs b/src/Data/Singletons/Single/Defun.hs
--- a/src/Data/Singletons/Single/Defun.hs
+++ b/src/Data/Singletons/Single/Defun.hs
@@ -13,11 +13,13 @@
 
 module Data.Singletons.Single.Defun (singDefuns) where
 
-import Data.List
+import Control.Monad
+import Data.Foldable
 import Data.Singletons.Names
 import Data.Singletons.Promote.Defun
 import Data.Singletons.Single.Monad
 import Data.Singletons.Single.Type
+import Data.Singletons.TH.Options
 import Data.Singletons.Util
 import Language.Haskell.TH.Desugar
 import Language.Haskell.TH.Syntax
@@ -56,32 +58,63 @@
   case mb_ty_args of
     [] -> pure [] -- If a function has no arguments, then it has no
                   -- defunctionalization symbols, so there's nothing to be done.
-    _  -> do sty_ctxt <- mapM singPred ty_ctxt
-             go 0 sty_ctxt [] mb_ty_args
+    _  -> do opts     <- getOptions
+             sty_ctxt <- mapM singPred ty_ctxt
+             names    <- replicateM (length mb_ty_args) $ qNewName "d"
+             let tvbs       = zipWith inferMaybeKindTV names mb_ty_args
+                 (_, insts) = go opts 0 sty_ctxt [] tvbs
+             pure insts
   where
     num_ty_args :: Int
     num_ty_args = length mb_ty_args
 
-    -- Sadly, this algorithm is quadratic, because in each iteration of the loop
-    -- we must:
+    -- The inner loop. @go n ctxt arg_tvbs res_tvbs@ returns @(m_result, insts)@.
+    -- Using one particular example:
     --
-    -- * Construct an arrow type of the form (a ~> ... ~> z), using a suffix of
-    --   the promoted argument types.
-    -- * Append a new type variable to the end of an ordered list.
+    -- @
+    -- instance (SingI a, SingI b, SEq c, SEq d) =>
+    --   SingI (ExampleSym2 (x :: a) (y :: b) :: c ~> d ~> Type) where ...
+    -- @
     --
-    -- In practice, this is unlikely to be a bottleneck, as singletons does not
-    -- support functions with more than 7 or so arguments anyways.
-    go :: Int -> DCxt -> [DTyVarBndr] -> [Maybe DKind] -> SgM [DDec]
-    go sym_num sty_ctxt tvbs mb_tyss
-      | sym_num < num_ty_args
-      , mb_ty:mb_tys <- mb_tyss
-      = do new_tvb_name <- qNewName "d"
-           let new_tvb = inferMaybeKindTV new_tvb_name mb_ty
-           insts <- go (sym_num + 1) sty_ctxt (tvbs ++ [new_tvb]) mb_tys
-           pure $ new_insts ++ insts
-      | otherwise
-      = pure []
+    -- We have:
+    --
+    -- * @n@ is 2. This is incremented in each iteration of `go`.
+    --
+    -- * @ctxt@ is (SEq c, SEq d). The (SingI a, SingI b) part of the instance
+    --   context is added separately.
+    --
+    -- * @arg_tvbs@ is [(x :: a), (y :: b)].
+    --
+    -- * @res_tvbs@ is [(z :: c), (w :: d)]. The kinds of these type variable
+    --   binders appear in the result kind.
+    --
+    -- * @m_result@ is `Just (c ~> d ~> Type)`. @m_result@ is returned so
+    --   that earlier defunctionalization symbols can build on the result
+    --   kinds of later symbols. For instance, ExampleSym1 would get the
+    --   result kind `b ~> c ~> d ~> Type` by prepending `b` to ExampleSym2's
+    --   result kind `c ~> d ~> Type`.
+    --
+    -- * @insts@ are all of the instance declarations corresponding to
+    --   ExampleSym2 and later defunctionalization symbols. This is the main
+    --   payload of the function.
+    --
+    -- This function is quadratic because it appends a variable at the end of
+    -- the @arg_tvbs@ list at each iteration. In practice, this is unlikely
+    -- to be a performance bottleneck since the number of arguments rarely
+    -- gets to be that large.
+    go :: Options -> Int -> DCxt -> [DTyVarBndr] -> [DTyVarBndr]
+       -> (Maybe DKind, [DDec])
+    go _    _       _        _        []                 = (mb_ty_res, [])
+    go opts sym_num sty_ctxt arg_tvbs (res_tvb:res_tvbs) =
+      (mb_new_res, new_inst:insts)
       where
+        mb_res :: Maybe DKind
+        insts  :: [DDec]
+        (mb_res, insts) = go opts (sym_num + 1) sty_ctxt (arg_tvbs ++ [res_tvb]) res_tvbs
+
+        mb_new_res :: Maybe DKind
+        mb_new_res = mk_inst_kind res_tvb mb_res
+
         sing_fun_num :: Int
         sing_fun_num = num_ty_args - sym_num
 
@@ -89,19 +122,19 @@
         mk_sing_fun_expr sing_expr =
           foldl' (\f tvb_n -> f `DAppE` (DVarE singMethName `DAppTypeE` DVarT tvb_n))
                  sing_expr
-                 (map extractTvbName tvbs)
+                 (map extractTvbName arg_tvbs)
 
         singI_ctxt :: DCxt
-        singI_ctxt = map (DAppT (DConT singIName) . tvbToType) tvbs
+        singI_ctxt = map (DAppT (DConT singIName) . tvbToType) arg_tvbs
 
         mk_inst_ty :: DType -> DType
         mk_inst_ty inst_head
-          = case mb_inst_kind of
+          = case mb_new_res of
               Just inst_kind -> inst_head `DSigT` inst_kind
               Nothing        -> inst_head
 
-        tvb_tys :: [DType]
-        tvb_tys = map dTyVarBndrToDType tvbs
+        arg_tvb_tys :: [DType]
+        arg_tvb_tys = map dTyVarBndrToDType arg_tvbs
 
         -- Construct the arrow kind used to annotate the defunctionalization
         -- symbol (e.g., the `a ~> a ~> Bool` in
@@ -109,24 +142,25 @@
         -- If any of the argument kinds or result kind isn't known (i.e., is
         -- Nothing), then we opt not to construct this arrow kind altogether.
         -- See Note [singDefuns and type inference]
-        mb_inst_kind :: Maybe DType
-        mb_inst_kind = foldr buildTyFunArrow_maybe mb_ty_res mb_tyss
+        mk_inst_kind :: DTyVarBndr -> Maybe DKind -> Maybe DKind
+        mk_inst_kind tvb' = buildTyFunArrow_maybe (extractTvbKind tvb')
 
-        new_insts :: [DDec]
-        new_insts = [DInstanceD Nothing Nothing
-                                (sty_ctxt ++ singI_ctxt)
-                                (DConT singIName `DAppT` mk_inst_ty defun_inst_ty)
-                                [DLetDec $ DValD (DVarP singMethName)
-                                         $ wrapSingFun sing_fun_num defun_inst_ty
-                                         $ mk_sing_fun_expr sing_exp ]]
+        new_inst :: DDec
+        new_inst = DInstanceD Nothing Nothing
+                              (sty_ctxt ++ singI_ctxt)
+                              (DConT singIName `DAppT` mk_inst_ty defun_inst_ty)
+                              [DLetDec $ DValD (DVarP singMethName)
+                                       $ wrapSingFun sing_fun_num defun_inst_ty
+                                       $ mk_sing_fun_expr sing_exp ]
           where
             defun_inst_ty :: DType
-            defun_inst_ty = foldType (DConT (promoteTySym n sym_num)) tvb_tys
+            defun_inst_ty = foldType (DConT (defunctionalizedName opts n sym_num))
+                                     arg_tvb_tys
 
             sing_exp :: DExp
             sing_exp = case ns of
-                         DataName -> DConE $ singDataConName n
-                         _        -> DVarE $ singValName n
+                         DataName -> DConE $ singledDataConName opts n
+                         _        -> DVarE $ singledValueName opts n
 
 {-
 Note [singDefuns and type inference]
diff --git a/src/Data/Singletons/Single/Eq.hs b/src/Data/Singletons/Single/Eq.hs
--- a/src/Data/Singletons/Single/Eq.hs
+++ b/src/Data/Singletons/Single/Eq.hs
@@ -11,6 +11,7 @@
 import Language.Haskell.TH.Syntax
 import Language.Haskell.TH.Desugar
 import Data.Singletons.Deriving.Infer
+import Data.Singletons.TH.Options
 import Data.Singletons.Util
 import Data.Singletons.Names
 import Control.Monad
@@ -18,7 +19,7 @@
 -- making the SEq instance and the SDecide instance are rather similar,
 -- so we generalize
 type EqualityClassDesc q = ((DCon, DCon) -> q DClause, q DClause, Name, Name)
-sEqClassDesc, sDecideClassDesc :: Quasi q => EqualityClassDesc q
+sEqClassDesc, sDecideClassDesc :: OptionsMonad q => EqualityClassDesc q
 sEqClassDesc = (mkEqMethClause, mkEmptyEqMethClause, sEqClassName, sEqMethName)
 sDecideClassDesc = (mkDecideMethClause, mkEmptyDecideMethClause, sDecideClassName, sDecideMethName)
 
@@ -41,16 +42,17 @@
                   | TestCoercion
 
 -- Make an instance of TestEquality or TestCoercion by leveraging SDecide.
-mkTestInstance :: DsMonad q => Maybe DCxt -> DKind
+mkTestInstance :: OptionsMonad q => Maybe DCxt -> DKind
                -> Name   -- ^ The name of the data type
                -> [DCon] -- ^ The /original/ constructors (for inferring the instance context)
                -> TestInstance -> q DDec
 mkTestInstance mb_ctxt k data_name ctors ti = do
+  opts <- getOptions
   constraints <- inferConstraintsDef mb_ctxt (DConT sDecideClassName) k ctors
   pure $ DInstanceD Nothing Nothing
                     constraints
                     (DAppT (DConT tiClassName)
-                           (DConT (singTyConName data_name)
+                           (DConT (singledDataTypeName opts data_name)
                              `DSigT` (DArrowT `DAppT` k `DAppT` DConT typeKindName)))
                     [DLetDec $ DFunD tiMethName
                                      [DClause [] (DVarE tiDefaultName)]]
@@ -60,9 +62,10 @@
         TestEquality -> (testEqualityClassName, testEqualityMethName, decideEqualityName)
         TestCoercion -> (testCoercionClassName, testCoercionMethName, decideCoercionName)
 
-mkEqMethClause :: Quasi q => (DCon, DCon) -> q DClause
+mkEqMethClause :: OptionsMonad q => (DCon, DCon) -> q DClause
 mkEqMethClause (c1, c2)
   | lname == rname = do
+    opts <- getOptions
     lnames <- replicateM lNumArgs (qNewName "a")
     rnames <- replicateM lNumArgs (qNewName "b")
     let lpats = map DVarP lnames
@@ -71,17 +74,20 @@
         rvars = map DVarE rnames
     return $ DClause
       [DConP lname lpats, DConP rname rpats]
-      (allExp (zipWith (\l r -> foldExp (DVarE sEqMethName) [l, r])
-                        lvars rvars))
-  | otherwise =
+      (allExp opts (zipWith (\l r -> foldExp (DVarE sEqMethName) [l, r])
+                            lvars rvars))
+  | otherwise = do
+    opts <- getOptions
     return $ DClause
       [DConP lname (replicate lNumArgs DWildP),
        DConP rname (replicate rNumArgs DWildP)]
-      (DConE $ singDataConName falseName)
-  where allExp :: [DExp] -> DExp
-        allExp [] = DConE $ singDataConName trueName
-        allExp [one] = one
-        allExp (h:t) = DAppE (DAppE (DVarE $ singValName andName) h) (allExp t)
+      (DConE $ singledDataConName opts falseName)
+  where allExp :: Options -> [DExp] -> DExp
+        allExp opts = go
+          where
+            go [] = DConE $ singledDataConName opts trueName
+            go [one] = one
+            go (h:t) = DAppE (DAppE (DVarE $ singledValueName opts andName) h) (go t)
 
         (lname, lNumArgs) = extractNameArgs c1
         (rname, rNumArgs) = extractNameArgs c2
diff --git a/src/Data/Singletons/Single/Fixity.hs b/src/Data/Singletons/Single/Fixity.hs
--- a/src/Data/Singletons/Single/Fixity.hs
+++ b/src/Data/Singletons/Single/Fixity.hs
@@ -1,33 +1,171 @@
+{-# LANGUAGE ScopedTypeVariables #-}
 module Data.Singletons.Single.Fixity where
 
 import Prelude hiding ( exp )
 import Language.Haskell.TH hiding ( cxt )
 import Language.Haskell.TH.Syntax (NameSpace(..), Quasi(..))
+import Data.Singletons.TH.Options
 import Data.Singletons.Util
-import Data.Singletons.Names
 import Language.Haskell.TH.Desugar
 
-singInfixDecl :: DsMonad q => Name -> Fixity -> q DLetDec
+-- Single a fixity declaration.
+singInfixDecl :: forall q. OptionsMonad q => Name -> Fixity -> q (Maybe DLetDec)
 singInfixDecl name fixity = do
+  opts  <- getOptions
   mb_ns <- reifyNameSpace name
-  pure $ DInfixD fixity
-       $ case mb_ns of
-           Just TcClsName -> singTyConName name
-           Just DataName  -> singDataConName name
-           Just VarName   -> singValName name
-           -- If we can't find the Name for some odd reason,
-           -- fall back to singValName
-           Nothing        -> singValName name
-
-singFixityDeclaration :: DsMonad q => Name -> q [DDec]
-singFixityDeclaration name = do
-  mFixity <- qReifyFixity name
-  case mFixity of
-    Nothing     -> pure []
-    Just fixity -> sequenceA [DLetDec <$> singInfixDecl name fixity]
+  case mb_ns of
+    -- If we can't find the Name for some odd reason,
+    -- fall back to singValName
+    Nothing        -> finish $ singledValueName   opts name
+    Just VarName   -> finish $ singledValueName   opts name
+    Just DataName  -> finish $ singledDataConName opts name
+    Just TcClsName -> do
+      mb_info <- dsReify name
+      case mb_info of
+        Just (DTyConI DClassD{} _)
+          -> finish $ singledClassName opts name
+        _ -> pure Nothing
+          -- Don't produce anything for other type constructors (type synonyms,
+          -- type families, data types, etc.).
+          -- See [singletons and fixity declarations], wrinkle 1.
+  where
+    finish :: Name -> q (Maybe DLetDec)
+    finish = pure . Just . DInfixD fixity
 
-singFixityDeclarations :: DsMonad q => [Name] -> q [DDec]
-singFixityDeclarations = concatMapM trySingFixityDeclaration
+-- Try producing singled fixity declarations for Names by reifying them
+-- /without/ consulting quoted declarations. If reification fails, recover and
+-- return the empty list.
+-- See [singletons and fixity declarations], wrinkle 2.
+singReifiedInfixDecls :: forall q. OptionsMonad q => [Name] -> q [DDec]
+singReifiedInfixDecls = mapMaybeM trySingFixityDeclaration
   where
+    trySingFixityDeclaration :: Name -> q (Maybe DDec)
     trySingFixityDeclaration name =
-      qRecover (return []) (singFixityDeclaration name)
+      qRecover (return Nothing) $ do
+        mFixity <- qReifyFixity name
+        case mFixity of
+          Nothing     -> pure Nothing
+          Just fixity -> fmap (fmap DLetDec) $ singInfixDecl name fixity
+
+{-
+Note [singletons and fixity declarations]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Promoting and singling fixity declarations is surprisingly tricky to get right.
+This Note serves as a place to document the insights learned after getting this
+wrong at various points.
+
+As a general rule, when promoting something with a fixity declaration like this
+one:
+
+  infixl 5 `foo`
+
+singletons will produce promoted and singled versions of them:
+
+  infixl 5 `Foo`
+  infixl 5 `sFoo`
+
+singletons will also produce fixity declarations for its defunctionalization
+symbols (see Note [Fixity declarations for defunctionalization symbols] in
+D.S.Promote.Defun):
+
+  infixl 5 `FooSym0`
+  infixl 5 `FooSym1`
+  ...
+
+-----
+-- Wrinkle 1: When not to promote/single fixity declarations
+-----
+
+Rules are meant to be broken, and the general rule above is no exception. There
+are certain cases where singletons does *not* produce promoted or singled
+versions of fixity declarations:
+
+* During promotion, fixity declarations for the following sorts of names will
+  not receive promoted counterparts:
+
+  - Data types
+  - Type synonyms
+  - Type families
+  - Data constructors
+  - Infix values
+
+  We exclude the first four because the promoted versions of these names are
+  the same as the originals, so generating an extra fixity declaration for them
+  would run the risk of having duplicates, which GHC would reject with an error.
+
+  We exclude infix value because while their promoted versions are different,
+  they share the same name base. In concrete terms, this:
+
+    $(promote [d|
+      infixl 4 ###
+      (###) :: a -> a -> a
+      |])
+
+  Is promoted to the following:
+
+    type family (###) (x :: a) (y :: a) :: a where ...
+
+  So giving the type-level (###) a fixity declaration would clash with the
+  existing one for the value-level (###).
+
+  There *is* a scenario where we should generate a fixity declaration for the
+  type-level (###), however. Imagine the above example used the `promoteOnly`
+  function instead of `promote`. Then the type-level (###) would lack a fixity
+  declaration altogether because the original fixity declaration was discarded
+  by `promoteOnly`! The same problem would arise if one had to choose between
+  the `singletons` and `singletonsOnly` functions.
+
+  The difference between `promote` and `promoteOnly` (as well as `singletons`
+  and `singletonsOnly`) is whether the `genQuotedDecs` option is set to `True`
+  or `False`, respectively. Therefore, if `genQuotedDecs` is set to `False`
+  when promoting the fixity declaration for an infix value, we opt to generate
+  a fixity declaration (with the same name base) so that the type-level version
+  of that value gets one.
+
+* During singling, the following things will not have their fixity declarations
+  singled:
+
+  - Type synonyms or type families. This is because singletons does not
+    generate singled versions of them in the first place (they only receive
+    defunctionalization symbols).
+
+  - Data types. This is because the singled version of a data type T is
+    always of the form:
+
+      data ST :: forall a_1 ... a_n. T a_1 ... a_n -> Type where ...
+
+    Regardless of how many arguments T has, ST will have exactly one argument.
+    This makes is rather pointless to generate a fixity declaration for it.
+
+-----
+-- Wrinkle 2: Making sure fixity declarations are promoted/singled properly
+-----
+
+There are two situations where singletons must promote/single fixity
+declarations:
+
+1. When quoting code, i.e., with `promote` or `singletons`.
+2. When reifying code, i.e., with `genPromotions` or `genSingletons`.
+
+In the case of (1), singletons stores the quoted fixity declarations in the
+lde_infix field of LetDecEnv. Therefore, it suffices to call
+promoteInfixDecl/singleInfixDecl when processing LetDecEnvs.
+
+In the case of (2), there is no LetDecEnv to use, so we must instead reify
+the fixity declarations and promote/single those. See D.S.Single.Data.singDataD
+(which singles data constructors) for a place that does this—we will use
+singDataD as a running example for the rest of this section.
+
+One complication is that code paths like singDataD are invoked in both (1) and
+(2). This runs the risk that singletons will generate duplicate infix
+declarations for data constructors in situation (1), as it will try to single
+their fixity declarations once when processing them in LetDecEnvs and again
+when reifying them in singDataD.
+
+To avoid this pitfall, when reifying declarations in singDataD we take care
+*not* to consult any quoted declarations when reifying (i.e., we do not use
+reifyWithLocals for functions like it). Therefore, it we are in situation (1),
+then the reification in singDataD will fail (and recover gracefully), so it
+will not produce any singled fixity declarations. Therefore, the only singled
+fixity declarations will be produced by processing LetDecEnvs.
+-}
diff --git a/src/Data/Singletons/Single/Monad.hs b/src/Data/Singletons/Single/Monad.hs
--- a/src/Data/Singletons/Single/Monad.hs
+++ b/src/Data/Singletons/Single/Monad.hs
@@ -21,7 +21,7 @@
 import Data.Map ( Map )
 import qualified Data.Map as Map
 import Data.Singletons.Promote.Monad ( emitDecs, emitDecsM )
-import Data.Singletons.Names
+import Data.Singletons.TH.Options
 import Data.Singletons.Util
 import Data.Singletons.Internal
 import Language.Haskell.TH.Syntax hiding ( lift )
@@ -32,13 +32,15 @@
 
 -- environment during singling
 data SgEnv =
-  SgEnv { sg_let_binds   :: Map Name DExp   -- from the *original* name
+  SgEnv { sg_options     :: Options
+        , sg_let_binds   :: Map Name DExp   -- from the *original* name
         , sg_context     :: DCxt -- See Note [Tracking the current type signature context]
         , sg_local_decls :: [Dec]
         }
 
 emptySgEnv :: SgEnv
-emptySgEnv = SgEnv { sg_let_binds   = Map.empty
+emptySgEnv = SgEnv { sg_options     = defaultOptions
+                   , sg_let_binds   = Map.empty
                    , sg_context     = []
                    , sg_local_decls = []
                    }
@@ -47,47 +49,14 @@
 newtype SgM a = SgM (ReaderT SgEnv (WriterT [DDec] Q) a)
   deriving ( Functor, Applicative, Monad
            , MonadReader SgEnv, MonadWriter [DDec]
-           , MonadFail, MonadIO )
-
-liftSgM :: Q a -> SgM a
-liftSgM = SgM . lift . lift
-
-instance Quasi SgM where
-  qNewName          = liftSgM `comp1` qNewName
-  qReport           = liftSgM `comp2` qReport
-  qLookupName       = liftSgM `comp2` qLookupName
-  qReify            = liftSgM `comp1` qReify
-  qReifyInstances   = liftSgM `comp2` qReifyInstances
-  qLocation         = liftSgM qLocation
-  qRunIO            = liftSgM `comp1` qRunIO
-  qAddDependentFile = liftSgM `comp1` qAddDependentFile
-  qReifyRoles       = liftSgM `comp1` qReifyRoles
-  qReifyAnnotations = liftSgM `comp1` qReifyAnnotations
-  qReifyModule      = liftSgM `comp1` qReifyModule
-  qAddTopDecls      = liftSgM `comp1` qAddTopDecls
-  qAddModFinalizer  = liftSgM `comp1` qAddModFinalizer
-  qGetQ             = liftSgM qGetQ
-  qPutQ             = liftSgM `comp1` qPutQ
-
-  qReifyFixity        = liftSgM `comp1` qReifyFixity
-  qReifyConStrictness = liftSgM `comp1` qReifyConStrictness
-  qIsExtEnabled       = liftSgM `comp1` qIsExtEnabled
-  qExtsEnabled        = liftSgM qExtsEnabled
-  qAddForeignFilePath = liftSgM `comp2` qAddForeignFilePath
-  qAddTempFile        = liftSgM `comp1` qAddTempFile
-  qAddCorePlugin      = liftSgM `comp1` qAddCorePlugin
-
-  qRecover (SgM handler) (SgM body) = do
-    env <- ask
-    (result, aux) <- liftSgM $
-                     qRecover (runWriterT $ runReaderT handler env)
-                              (runWriterT $ runReaderT body env)
-    tell aux
-    return result
+           , MonadFail, MonadIO, Quasi )
 
 instance DsMonad SgM where
   localDeclarations = asks sg_local_decls
 
+instance OptionsMonad SgM where
+  getOptions = asks sg_options
+
 bindLets :: [(Name, DExp)] -> SgM a -> SgM a
 bindLets lets1 =
   local (\env@(SgEnv { sg_let_binds = lets2 }) ->
@@ -106,13 +75,20 @@
 askContext = asks sg_context
 
 lookupVarE :: Name -> SgM DExp
-lookupVarE = lookup_var_con singValName (DVarE . singValName)
+lookupVarE name = do
+  opts <- getOptions
+  lookup_var_con (singledValueName opts)
+                 (DVarE . singledValueName opts) name
 
 lookupConE :: Name -> SgM DExp
-lookupConE = lookup_var_con singDataConName (DConE . singDataConName)
+lookupConE name = do
+  opts <- getOptions
+  lookup_var_con (singledDataConName opts)
+                 (DConE . singledDataConName opts) name
 
 lookup_var_con :: (Name -> Name) -> (Name -> DExp) -> Name -> SgM DExp
 lookup_var_con mk_sing_name mk_exp name = do
+  opts <- getOptions
   letExpansions <- asks sg_let_binds
   sName <- mkDataName (nameBase (mk_sing_name name)) -- we want *term* names!
   case Map.lookup name letExpansions of
@@ -123,7 +99,8 @@
       case m_dinfo of
         Just (DVarI _ ty _) ->
           let num_args = countArgs ty in
-          return $ wrapSingFun num_args (promoteValRhs name) (mk_exp name)
+          return $ wrapSingFun num_args (DConT $ defunctionalizedName0 opts name)
+                               (mk_exp name)
         _ -> return $ mk_exp name   -- lambda-bound
     Just exp -> return exp
 
@@ -157,14 +134,16 @@
   in
   (unwrap_fun `DAppTypeE` ty `DAppE`)
 
-singM :: DsMonad q => [Dec] -> SgM a -> q (a, [DDec])
+singM :: OptionsMonad q => [Dec] -> SgM a -> q (a, [DDec])
 singM locals (SgM rdr) = do
+  opts         <- getOptions
   other_locals <- localDeclarations
-  let wr = runReaderT rdr (emptySgEnv { sg_local_decls = other_locals ++ locals })
+  let wr = runReaderT rdr (emptySgEnv { sg_options     = opts
+                                      , sg_local_decls = other_locals ++ locals })
       q  = runWriterT wr
   runQ q
 
-singDecsM :: DsMonad q => [Dec] -> SgM [DDec] -> q [DDec]
+singDecsM :: OptionsMonad q => [Dec] -> SgM [DDec] -> q [DDec]
 singDecsM locals thing = do
   (decs1, decs2) <- singM locals thing
   return $ decs1 ++ decs2
diff --git a/src/Data/Singletons/Single/Type.hs b/src/Data/Singletons/Single/Type.hs
--- a/src/Data/Singletons/Single/Type.hs
+++ b/src/Data/Singletons/Single/Type.hs
@@ -9,15 +9,17 @@
 module Data.Singletons.Single.Type where
 
 import Language.Haskell.TH.Desugar
-import qualified Language.Haskell.TH.Desugar.OSet as OSet
 import Language.Haskell.TH.Desugar.OSet (OSet)
 import Language.Haskell.TH.Syntax
 import Data.Singletons.Names
 import Data.Singletons.Single.Monad
 import Data.Singletons.Promote.Type
+import Data.Singletons.TH.Options
 import Data.Singletons.Util
 import Control.Monad
 import Data.Foldable
+import Data.Function
+import Data.List (deleteFirstsBy)
 
 singType :: OSet Name      -- the set of bound kind variables in this scope
                            -- see Note [Explicitly binding kind variables]
@@ -31,30 +33,69 @@
                 , [DKind]  -- the kinds of the argument types
                 , DKind )  -- the kind of the result type
 singType bound_kvs prom ty = do
-  let (_, cxt, args, res) = unravel ty
-      num_args            = length args
-  cxt' <- mapM singPred cxt
+  (orig_tvbs, cxt, args, res) <- unravelVanillaDType ty
+  let num_args = length args
+  cxt' <- mapM singPred_NC cxt
   arg_names <- replicateM num_args (qNewName "t")
-  prom_args <- mapM promoteType args
-  prom_res  <- promoteType res
+  prom_args <- mapM promoteType_NC args
+  prom_res  <- promoteType_NC res
   let args' = map (\n -> singFamily `DAppT` (DVarT n)) arg_names
       res'  = singFamily `DAppT` (foldl apply prom (map DVarT arg_names) `DSigT` prom_res)
-      tau   = ravel args' res'
-      -- Make sure to subtract out the bound variables currently in scope, lest we
-      -- accidentally shadow them in this type signature.
-      kv_names_to_bind = foldMap fvDType (prom_args ++ cxt' ++ [prom_res])
-                            OSet.\\ bound_kvs
-      kvs_to_bind      = toList kv_names_to_bind
-  let ty' = DForallT (map DPlainTV kvs_to_bind ++ zipWith DKindedTV arg_names prom_args)
-                     cxt' tau
+                -- Make sure to include an explicit `prom_res` kind annotation.
+                -- See Note [Preserve the order of type variables during singling],
+                -- wrinkle 3.
+      kvbs     = singTypeKVBs orig_tvbs prom_args cxt' prom_res bound_kvs
+      all_tvbs = kvbs ++ zipWith DKindedTV arg_names prom_args
+      ty'      = ravelVanillaDType all_tvbs cxt' args' res'
   return (ty', num_args, arg_names, cxt, prom_args, prom_res)
 
+-- Compute the kind variable binders to use in the singled version of a type
+-- signature. This has two main call sites: singType and D.S.Single.Data.singCtor.
+--
+-- This implements the advice documented in
+-- Note [Preserve the order of type variables during singling], wrinkle 1.
+singTypeKVBs ::
+     [DTyVarBndr] -- ^ The bound type variables from the original type signature.
+  -> [DType]      -- ^ The argument types of the signature (promoted).
+  -> DCxt         -- ^ The context of the signature (singled).
+  -> DType        -- ^ The result type of the signature (promoted).
+  -> OSet Name    -- ^ The type variables previously bound in the current scope.
+  -> [DTyVarBndr] -- ^ The kind variables for the singled type signature.
+singTypeKVBs orig_tvbs prom_args sing_ctxt prom_res bound_tvbs
+  | null orig_tvbs
+  -- There are no explicitly `forall`ed type variable binders, so we must
+  -- infer them ourselves.
+  = deleteFirstsBy
+      ((==) `on` extractTvbName)
+      (toposortTyVarsOf $ prom_args ++ sing_ctxt ++ [prom_res])
+      (map DPlainTV $ toList bound_tvbs)
+      -- Make sure to subtract out the bound variables currently in scope,
+      -- lest we accidentally shadow them in this type signature.
+      -- See Note [Explicitly binding kind variables] in D.S.Promote.Monad.
+  | otherwise
+  -- There is an explicit `forall`, so this case is easy.
+  = orig_tvbs
+
+-- Single a DPred, checking that it is a vanilla type in the process.
+-- See [Vanilla-type validity checking during promotion]
+-- in Data.Singletons.Promote.Type.
 singPred :: DPred -> SgM DPred
-singPred = singPredRec []
+singPred p = do
+  checkVanillaDType p
+  singPred_NC p
 
+-- Single a DPred. Does not check if the argument is a vanilla type.
+-- See [Vanilla-type validity checking during promotion]
+-- in Data.Singletons.Promote.Type.
+singPred_NC :: DPred -> SgM DPred
+singPred_NC = singPredRec []
+
+-- The workhorse for singPred_NC.
 singPredRec :: [DTypeArg] -> DPred -> SgM DPred
 singPredRec _cxt (DForallT {}) =
   fail "Singling of quantified constraints not yet supported"
+singPredRec _cxt (DConstrainedT {}) =
+  fail "Singling of quantified constraints not yet supported"
 singPredRec ctx (DAppT pr ty) = singPredRec (DTANormal ty : ctx) pr
 singPredRec ctx (DAppKindT pr ki) = singPredRec (DTyArg ki : ctx) pr
 singPredRec _ctx (DSigT _pr _ki) =
@@ -65,11 +106,195 @@
   | n == equalityName
   = fail "Singling of type equality constraints not yet supported"
   | otherwise = do
-    kis <- mapM promoteTypeArg ctx
-    let sName = singClassName n
+    opts <- getOptions
+    kis <- mapM promoteTypeArg_NC ctx
+    let sName = singledClassName opts n
     return $ applyDType (DConT sName) kis
 singPredRec _ctx DWildCardT = return DWildCardT  -- it just might work
 singPredRec _ctx DArrowT =
   fail "(->) spotted at head of a constraint"
 singPredRec _ctx (DLitT {}) =
   fail "Type-level literal spotted at head of a constraint"
+
+{-
+Note [Preserve the order of type variables during singling]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+singletons does its best to preseve the order in which users write type
+variables in type signatures for functions and data constructors. They are
+"preserved" in the sense that if one writes `foo @T1 @T2`, one should be
+able to write out `sFoo @T1 @T2` by hand and have the same order of visible
+type applications still work. Accomplishing this is surprisingly nontrivial,
+so this Note documents the various wrinkles one must iron out to get this
+working.
+
+-----
+-- Wrinkle 1: Dealing with the presence (and absence) of `forall`
+-----
+
+If we single a function that has an explicit `forall`, such as this example:
+
+  const2 :: forall b a. a -> b -> a
+  const2 x _ = x
+
+Then our job is easy, as the exact order of type variables has already been
+spelled out in advance. We single this to:
+
+  sConst2 :: forall b a (x :: a) (y :: b). Sing x -> Sing y -> Sing (Const2 x y :: a)
+  sConst2 = ...
+
+What happens if there is no explicit `forall`, as in this example?
+
+  data V a
+
+  absurd :: V a -> b
+  absurd v = case v of {}
+
+This time, the order of type variables vis-à-vis TypeApplications is determined
+by their left-to-right order of appearance in the type signature. It's tempting
+to think that since there is no explicit `forall` in the original type
+signature, we could get away without an explicit `forall` in the singled type
+signature. That is, one could write:
+
+  sAbsurd :: Sing (v :: V a) -> Sing (Absurd :: b)
+
+This would have the right type variable order, but unfortunately, this approach
+does not play well with singletons' style of code generation. Consider the code
+that would be generated for the body of sAbsurd:
+
+  sAbsurd :: Sing (v :: V a) -> Sing (Absurd :: b)
+  sAbsurd (sV :: Sing v) = id @(Case v v :: b) (case sV of {})
+
+Note the use of the type `Case v v :: b` in the right-hand side of sAbsurd.
+However, because `b` was not bound by a top-level `forall`, it won't be in
+scope here, resulting in an error!
+
+(Why do we generate the code `id @(Case v v :: b)` in the first place? See
+Note [The id hack; or, how singletons learned to stop worrying and avoid kind generalization]
+in D.S.Single.)
+
+The simplest approach is to just always generate singled type signatures with
+explicit `forall`s. In the event that the original type signature lacks an
+explicit `forall`, we inferr the correct type variable ordering ourselves and
+synthesize a `forall` with that order. The `singTypeKVBs` function implements
+this logic.
+
+-----
+-- Wrinkle 2: The TH reification swamp
+-----
+
+There is another issue with type signatures that lack explicit `forall`s, one
+which the current design of Template Haskell does not make simple to fix.
+If we single code that is wrapped in TH quotes, such as in the following example:
+
+  $(singletons [d|
+    data Proxy (a :: k) where
+      MkProxy :: Proxy a
+    |])
+
+Then our job is made much easier when singling MkProxy, since we know that the
+only type variable that must be quantified is `a`, as that is the only one
+specified in the type signature.
+
+However, this is not the only possible way to single MkProxy. One can
+alternatively use $(genSingletons [''Proxy]), which uses TH reification to
+infer the type of MkProxy. There is perilous, however, because this is how
+TH reifies MkProxy:
+
+  ForallC [KindedTV k StarT,KindedTV a (VarT k)] []
+          (GadtC [MkProxy] [] (AppT (ConT Proxy) (VarT a)))
+
+In terms of actual Haskell code, that's:
+
+  MkProxy :: forall k (a :: k). Proxy a
+
+This is subtly different than before, as `k` is now specified. Contrast this
+with `MkProxy :: Proxy a`, where `k` is invisible. In other words, if you
+single MkProxy using genSingletons, then `Proxy @True` will typecheck but
+`SMkProxy @True` will /not/ typecheck—you'd have to use `SMkProxy @_ @True`
+instead. Urk!
+
+At present, Template Haskell does not have a way to distinguish specified from
+inferred type variables—see GHC #17159—and it is unclear how one could work
+around this issue withouf first fixing #17159 upstream. Thankfully, it is
+only likely to bite in situations where the original type signature uses
+inferred variables, so the damage is somewhat minimal.
+
+-----
+-- Wrinkle 3: Where to put explicit kind annotations
+-----
+
+Type variable binders are only part of the story—we must also determine what
+the body of the type signature will be singled to. As a general rule, if the
+original type signature is of the form:
+
+  f :: forall a_1 ... a_m. (C_1, ..., C_n)
+    => T_1 -> ... -> T_p -> R
+
+Then the singled type signature will be:
+
+  sF :: forall a_1 ... a_m (x_1 :: PT_1) ... (x_p :: PT_p). (SC_1, ..., SC_n)
+     => Sing x1 -> ... -> Sing x_p -> SRes (F x1 ... x_p :: PR)
+
+Where:
+
+* x_i is a fresh type variable of kind PT_i.
+* PT_i is the promoted version of the type T_i, and PR is the promoted version
+  of the type R.
+* SC_i is the singled version of the constraint SC_i.
+* SRes is either `Sing` if dealing with a function, or a singled data type if
+  dealing with a data constructor. For instance, SRes is `SBool` in
+  `STrue :: SBool (True :: Bool)`.
+
+One aspect of this worth pointing out is the explicit `:: PR` kind annotation
+in the result type `Sing (F x1 ... x_p :: PR)`. As it turns out, this kind
+annotation is mandatory, as omitting can result in singled type signatures
+with the wrong semantics. For instance, consider the `Nothing` data
+constructor:
+
+  Nothing :: forall a. Maybe a
+
+Consider what would happen if it were singled to this type:
+
+  SNothing :: forall a. SMaybe Nothing
+
+This is not what we want at all, since the `a` has no connection to the
+`Nothing` in the result type. It's as if we had written this:
+
+  SNothing :: forall {t} a. SMaybe (Nothing :: Maybe t)
+
+If we instead generate `forall a. SMaybe (Nothing :: Maybe a)`, then this issue
+is handily avoided.
+
+You might wonder if it would be cleaner to use visible kind applications
+instead:
+
+  SNothing :: forall a. SMaybe (Nothing @a)
+
+This does work for many cases, but there are also some corner cases where this
+approach fails. Recall the `MkProxy` example from Wrinkle 2 above:
+
+  data Proxy (a :: k) where
+    MkProxy :: Proxy a
+  $(genSingletons [''Proxy])
+
+Due to the design of Template Haskell (discussed in Wrinkle 2), `MkProxy` will
+be reified with the type of `forall k (a :: k). Proxy a`. This means that
+if we used visible kind applications in the result type, we would end up with
+this:
+
+  SMkProxy :: forall k (a :: k). SProxy (MkProxy @k @a)
+
+This will not kind-check because MkProxy only accepts /one/ visible kind argument,
+whereas this supplies it with two. To avoid this issue, we instead use the type
+`forall k (a :: k). SProxy (MkProxy :: Proxy a)`. Granted, this type is /still/
+technically wrong due to the fact that it explicitly quantifies `k`, but at the
+very least it typechecks. If GHC #17159 were fixed, we could revisit this
+design choice.
+
+Finally, note that we need only write `Sing x_1 -> ... -> Sing x_p`, and not
+`Sing (x_1 :: PT_1) -> ... Sing (x_p :: PT_p)`. This is simply because we
+always use explicit `forall`s in singled type signatures, and therefore always
+explicitly bind `(x_1 :: PT_1) ... (x_p :: PT_p)`, which fully determine the
+kinds of `x_1 ... x_p`. It wouldn't be wrong to add extra kind annotations to
+`Sing x_1 -> ... -> Sing x_p`, just redundant.
+-}
diff --git a/src/Data/Singletons/SuppressUnusedWarnings.hs b/src/Data/Singletons/SuppressUnusedWarnings.hs
--- a/src/Data/Singletons/SuppressUnusedWarnings.hs
+++ b/src/Data/Singletons/SuppressUnusedWarnings.hs
@@ -7,12 +7,15 @@
 -- from the user. Why would anyone ever want this? Because what is below
 -- is dirty, and no one wants to see it.
 
-{-# LANGUAGE AllowAmbiguousTypes, PolyKinds #-}
+{-# LANGUAGE AllowAmbiguousTypes, PolyKinds, StandaloneKindSignatures #-}
 
 module Data.Singletons.SuppressUnusedWarnings where
 
+import Data.Kind
+
 -- | This class (which users should never see) is to be instantiated in order
 -- to use an otherwise-unused data constructor, such as the "kind-inference"
 -- data constructor for defunctionalization symbols.
-class SuppressUnusedWarnings (t :: k) where
+type SuppressUnusedWarnings :: k -> Constraint
+class SuppressUnusedWarnings t where
   suppressUnusedWarnings :: ()
diff --git a/src/Data/Singletons/Syntax.hs b/src/Data/Singletons/Syntax.hs
--- a/src/Data/Singletons/Syntax.hs
+++ b/src/Data/Singletons/Syntax.hs
@@ -62,12 +62,18 @@
 -- Whether a type family is open or closed.
 data FamilyInfo = Open | Closed
 
-data ClassDecl ann = ClassDecl { cd_cxt  :: DCxt
-                               , cd_name :: Name
-                               , cd_tvbs :: [DTyVarBndr]
-                               , cd_fds  :: [FunDep]
-                               , cd_lde  :: LetDecEnv ann
-                               }
+data ClassDecl ann
+  = ClassDecl { cd_cxt  :: DCxt
+              , cd_name :: Name
+              , cd_tvbs :: [DTyVarBndr]
+              , cd_fds  :: [FunDep]
+              , cd_lde  :: LetDecEnv ann
+              , cd_atfs :: [OpenTypeFamilyDecl]
+                  -- Associated type families. Only recorded for
+                  -- defunctionalization purposes.
+                  -- See Note [Partitioning, type synonyms, and type families]
+                  -- in D.S.Partition.
+              }
 
 data InstDecl  ann = InstDecl { id_cxt     :: DCxt
                               , id_name    :: Name
diff --git a/src/Data/Singletons/TH.hs b/src/Data/Singletons/TH.hs
--- a/src/Data/Singletons/TH.hs
+++ b/src/Data/Singletons/TH.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE ExplicitNamespaces, CPP #-}
+{-# LANGUAGE ExplicitNamespaces #-}
 
 -----------------------------------------------------------------------------
 -- |
@@ -105,7 +105,7 @@
   type (<*>@#@$), type (<*>@#@$$), type (<*>@#@$$$),
   LiftA2Sym0, LiftA2Sym1, LiftA2Sym2, LiftA2Sym3,
   type (.@#@$), type (.@#@$$), type (.@#@$$$), type (.@#@$$$$),
-  (:@#@$), (:@#@$$), (:@#@$$$),
+  NilSym0, (:@#@$), (:@#@$$), (:@#@$$$),
 
   SuppressUnusedWarnings(..)
 
@@ -129,9 +129,9 @@
 import Data.Singletons.Prelude.Show
 import Data.Singletons.Prelude.Traversable
 import Data.Singletons.Decide
+import Data.Singletons.TH.Options
 import Data.Singletons.TypeLits
 import Data.Singletons.SuppressUnusedWarnings
-import Data.Singletons.Names
 import Language.Haskell.TH.Desugar
 
 import Language.Haskell.TH
@@ -163,17 +163,18 @@
 -- each constructor is treated the same. For 'sCases', unlike 'cases', the
 -- scrutinee is a singleton. But make sure to pass in the name of the /original/
 -- datatype, preferring @''Maybe@ over @''SMaybe@.
-sCases :: DsMonad q
+sCases :: OptionsMonad q
        => Name        -- ^ The head of the type the scrutinee's type is based on.
                       -- (Like @''Maybe@ or @''Bool@.)
        -> q Exp       -- ^ The scrutinee, in a Template Haskell quote
        -> q Exp       -- ^ The body, in a Template Haskell quote
        -> q Exp
 sCases tyName expq bodyq = do
+  opts  <- getOptions
   dinfo <- dsReify tyName
   case dinfo of
     Just (DTyConI (DDataD _ _ _ _ _ ctors _) _) ->
-      let ctor_stuff = map (first singDataConName . extractNameArgs) ctors in
+      let ctor_stuff = map (first (singledDataConName opts) . extractNameArgs) ctors in
       expToTH <$> buildCases ctor_stuff expq bodyq
     Just _ ->
       fail $ "Using <<cases>> with something other than a type constructor: "
diff --git a/src/Data/Singletons/TH/Options.hs b/src/Data/Singletons/TH/Options.hs
new file mode 100644
--- /dev/null
+++ b/src/Data/Singletons/TH/Options.hs
@@ -0,0 +1,270 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE TemplateHaskell #-}
+
+-----------------------------------------------------------------------------
+-- |
+-- Module      :  Data.Singletons.TH.Options
+-- Copyright   :  (C) 2019 Ryan Scott
+-- License     :  BSD-style (see LICENSE)
+-- Maintainer  :  Ryan Scott
+-- Stability   :  experimental
+-- Portability :  non-portable
+--
+-- This module defines 'Options' that control finer details of how the Template
+-- Haskell machinery works, as well as an @mtl@-like 'OptionsMonad' class
+-- and an 'OptionsM' monad transformer.
+--
+----------------------------------------------------------------------------
+
+module Data.Singletons.TH.Options
+  ( -- * Options
+    Options, defaultOptions
+    -- ** Options record selectors
+  , genQuotedDecs
+  , genSingKindInsts
+  , promotedClassName
+  , promotedValueName
+  , singledDataTypeName
+  , singledClassName
+  , singledDataConName
+  , singledValueName
+  , defunctionalizedName
+    -- ** Derived functions over Options
+  , promotedTopLevelValueName
+  , promotedLetBoundValueName
+  , defunctionalizedName0
+
+    -- * OptionsMonad
+  , OptionsMonad(..), OptionsM, withOptions
+  ) where
+
+import Control.Applicative
+import Control.Monad.IO.Class (MonadIO)
+import Control.Monad.Reader (ReaderT(..), ask)
+import Control.Monad.RWS (RWST)
+import Control.Monad.State (StateT)
+import Control.Monad.Trans.Class (MonadTrans(..))
+import Control.Monad.Writer (WriterT)
+import Data.Singletons.Names ( consName, listName, nilName
+                             , mk_name_tc, mkTupleDataName, mkTupleTypeName
+                             , sconsName, sListName, snilName
+                             , splitUnderscores
+                             )
+import Data.Singletons.Util
+import Language.Haskell.TH.Desugar
+import Language.Haskell.TH.Syntax hiding (Lift(..))
+
+-- | Options that control the finer details of how @singletons@' Template
+-- Haskell machinery works.
+data Options = Options
+  { genQuotedDecs        :: Bool
+    -- ^ If 'True', then quoted declarations will be generated alongside their
+    --   promoted and singled counterparts. If 'False', then quoted
+    --   declarations will be discarded.
+  , genSingKindInsts     :: Bool
+    -- ^ If 'True', then 'SingKind' instances will be generated. If 'False',
+    --   they will be omitted entirely. This can be useful in scenarios where
+    --   TH-generated 'SingKind' instances do not typecheck (for instance,
+    --   when generating singletons for GADTs).
+  , promotedClassName    :: Name -> Name
+    -- ^ Given the name of the original, unrefined class, produces the name of
+    --   the promoted equivalent of the class.
+  , promotedValueName    :: Name -> Maybe Uniq -> Name
+    -- ^ Given the name of the original, unrefined value, produces the name of
+    --   the promoted equivalent of the value. This is used for both top-level
+    --   and @let@-bound names, and the difference is encoded in the
+    --   @'Maybe' 'Uniq'@ argument. If promoting a top-level name, the argument
+    --   is 'Nothing'. If promoting a @let@-bound name, the argument is
+    --   @Just uniq@, where @uniq@ is a globally unique number that can be used
+    --   to distinguish the name from other local definitions of the same name
+    --   (e.g., if two functions both use @let x = ... in x@).
+  , singledDataTypeName  :: Name -> Name
+    -- ^ Given the name of the original, unrefined data type, produces the name
+    --   of the corresponding singleton type.
+  , singledClassName     :: Name -> Name
+    -- ^ Given the name of the original, unrefined class, produces the name of
+    --   the singled equivalent of the class.
+  , singledDataConName   :: Name -> Name
+    -- ^ Given the name of the original, unrefined data constructor, produces
+    --   the name of the corresponding singleton data constructor.
+  , singledValueName     :: Name -> Name
+    -- ^ Given the name of the original, unrefined value, produces the name of
+    --   the singled equivalent of the value.
+  , defunctionalizedName :: Name -> Int -> Name
+    -- ^ Given the original name and the number of parameters it is applied to
+    --   (the 'Int' argument), produces a type-level function name that can be
+    --   partially applied when given the same number of parameters.
+    --
+    --   Note that defunctionalization works over both term-level names
+    --   (producing symbols for the promoted name) and type-level names
+    --   (producing symbols directly for the name itself). As a result, this
+    --   callback is used for names in both the term and type namespaces.
+  }
+
+-- | Sensible default 'Options'.
+--
+-- 'genQuotedDecs' defaults to 'True'.
+-- That is, quoted declarations are generated alongside their promoted and
+-- singled counterparts.
+--
+-- 'genSingKindInsts' defaults to 'True'.
+-- That is, 'SingKind' instances are generated.
+--
+-- The default behaviors for 'promotedClassName', 'promotedValueNamePrefix',
+-- 'singledDataTypeName', 'singledClassName', 'singledDataConName',
+-- 'singledValueName', and 'defunctionalizedName' are described in the
+-- \"On names\" section of the @singletons@
+-- @<https://github.com/goldfirere/singletons/blob/master/README.md README>@.
+defaultOptions :: Options
+defaultOptions = Options
+  { genQuotedDecs        = True
+  , genSingKindInsts     = True
+  , promotedClassName    = promoteClassName
+  , promotedValueName    = promoteValNameLhs
+  , singledDataTypeName  = singTyConName
+  , singledClassName     = singClassName
+  , singledDataConName   = singDataConName
+  , singledValueName     = singValName
+  , defunctionalizedName = promoteTySym
+  }
+
+-- | Given the name of the original, unrefined, top-level value, produces the
+-- name of the promoted equivalent of the value.
+promotedTopLevelValueName :: Options -> Name -> Name
+promotedTopLevelValueName opts name = promotedValueName opts name Nothing
+
+-- | Given the name of the original, unrefined, @let@-bound value and its
+-- globally unique number, produces the name of the promoted equivalent of the
+-- value.
+promotedLetBoundValueName :: Options -> Name -> Uniq -> Name
+promotedLetBoundValueName opts name = promotedValueName opts name . Just
+
+-- | Given the original name of a function (term- or type-level), produces a
+-- type-level function name that can be partially applied even without being
+-- given any arguments (i.e., @0@ arguments).
+defunctionalizedName0 :: Options -> Name -> Name
+defunctionalizedName0 opts name = defunctionalizedName opts name 0
+
+-- | Class that describes monads that contain 'Options'.
+class DsMonad m => OptionsMonad m where
+  getOptions :: m Options
+
+instance OptionsMonad Q where
+  getOptions = pure defaultOptions
+
+instance OptionsMonad m => OptionsMonad (DsM m) where
+  getOptions = lift getOptions
+
+instance (OptionsMonad q, Monoid m) => OptionsMonad (QWithAux m q) where
+  getOptions = lift getOptions
+
+instance OptionsMonad m => OptionsMonad (ReaderT r m) where
+  getOptions = lift getOptions
+
+instance OptionsMonad m => OptionsMonad (StateT s m) where
+  getOptions = lift getOptions
+
+instance (OptionsMonad m, Monoid w) => OptionsMonad (WriterT w m) where
+  getOptions = lift getOptions
+
+instance (OptionsMonad m, Monoid w) => OptionsMonad (RWST r w s m) where
+  getOptions = lift getOptions
+
+-- | A convenient implementation of the 'OptionsMonad' class. Use by calling
+-- 'withOptions'.
+newtype OptionsM m a = OptionsM (ReaderT Options m a)
+  deriving ( Functor, Applicative, Monad, MonadTrans
+           , Quasi, MonadFail, MonadIO, DsMonad )
+
+-- | Turn any 'DsMonad' into an 'OptionsMonad'.
+instance DsMonad m => OptionsMonad (OptionsM m) where
+  getOptions = OptionsM ask
+
+-- | Declare the 'Options' that a TH computation should use.
+withOptions :: Options -> OptionsM m a -> m a
+withOptions opts (OptionsM x) = runReaderT x opts
+
+-- Used when a value name appears in a pattern context.
+-- Works only for proper variables (lower-case names).
+--
+-- If the Maybe Uniq argument is Nothing, then the name is top-level (and
+-- thus globally unique on its own).
+-- If the Maybe Uniq argument is `Just uniq`, then the name is let-bound and
+-- should use `uniq` to make the promoted name globally unique.
+promoteValNameLhs :: Name -> Maybe Uniq -> Name
+promoteValNameLhs n mb_let_uniq
+    -- We can't promote promote idenitifers beginning with underscores to
+    -- type names, so we work around the issue by prepending "US" at the
+    -- front of the name (#229).
+  | Just (us, rest) <- splitUnderscores (nameBase n)
+  = mkName $ alpha ++ "US" ++ us ++ rest
+
+  | otherwise
+  = mkName $ toUpcaseStr pres n
+  where
+    pres = maybe noPrefix (uniquePrefixes "Let" "<<<") mb_let_uniq
+    (alpha, _) = pres
+
+-- generates type-level symbol for a given name. Int parameter represents
+-- saturation: 0 - no parameters passed to the symbol, 1 - one parameter
+-- passed to the symbol, and so on. Works on both promoted and unpromoted
+-- names.
+promoteTySym :: Name -> Int -> Name
+promoteTySym name sat
+      -- We can't promote promote idenitifers beginning with underscores to
+      -- type names, so we work around the issue by prepending "US" at the
+      -- front of the name (#229).
+    | Just (us, rest) <- splitUnderscores (nameBase name)
+    = default_case (mkName $ "US" ++ us ++ rest)
+
+    | name == nilName
+    = mkName $ "NilSym" ++ (show sat)
+
+       -- treat unboxed tuples like tuples
+    | Just degree <- tupleNameDegree_maybe name <|>
+                     unboxedTupleNameDegree_maybe name
+    = mk_name_tc "Data.Singletons.Prelude.Instances" $
+                 "Tuple" ++ show degree ++ "Sym" ++ (show sat)
+
+    | otherwise
+    = default_case name
+  where
+    default_case :: Name -> Name
+    default_case name' =
+      let capped = toUpcaseStr noPrefix name' in
+      if isHsLetter (head capped)
+      then mkName (capped ++ "Sym" ++ (show sat))
+      else mkName (capped ++ "@#@" -- See Note [Defunctionalization symbol suffixes]
+                          ++ (replicate (sat + 1) '$'))
+
+promoteClassName :: Name -> Name
+promoteClassName = prefixName "P" "#"
+
+-- Singletons
+
+singDataConName :: Name -> Name
+singDataConName nm
+  | nm == nilName                                  = snilName
+  | nm == consName                                 = sconsName
+  | Just degree <- tupleNameDegree_maybe nm        = mkTupleDataName degree
+  | Just degree <- unboxedTupleNameDegree_maybe nm = mkTupleDataName degree
+  | otherwise                                      = prefixConName "S" "%" nm
+
+singTyConName :: Name -> Name
+singTyConName name
+  | name == listName                                 = sListName
+  | Just degree <- tupleNameDegree_maybe name        = mkTupleTypeName degree
+  | Just degree <- unboxedTupleNameDegree_maybe name = mkTupleTypeName degree
+  | otherwise                                        = prefixName "S" "%" name
+
+singClassName :: Name -> Name
+singClassName = singTyConName
+
+singValName :: Name -> Name
+singValName n
+     -- Push the 's' past the underscores, as this lets us avoid some unused
+     -- variable warnings (#229).
+  | Just (us, rest) <- splitUnderscores (nameBase n)
+  = prefixName (us ++ "s") "%" $ mkName rest
+  | otherwise
+  = prefixName "s" "%" $ upcase n
diff --git a/src/Data/Singletons/TypeError.hs b/src/Data/Singletons/TypeError.hs
--- a/src/Data/Singletons/TypeError.hs
+++ b/src/Data/Singletons/TypeError.hs
@@ -4,6 +4,7 @@
 {-# LANGUAGE GADTs #-}
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -54,6 +55,7 @@
 -- text type is used in the 'Text' constructor. Instantiating it with
 -- 'Text.Text' gives you 'ErrorMessage', and instantiating it with 'Symbol'
 -- gives you 'PErrorMessage'.
+type ErrorMessage' :: Type -> Type
 data ErrorMessage' s
   = Text s
     -- ^ Show the text as is.
@@ -70,12 +72,15 @@
 infixl 5 :$$:
 
 -- | A value-level `ErrorMessage'` which uses 'Text.Text' as its text type.
+type ErrorMessage :: Type
 type ErrorMessage  = ErrorMessage' Text.Text
 
 -- | A type-level `ErrorMessage'` which uses 'Symbol' as its text kind.
+type PErrorMessage :: Type
 type PErrorMessage = ErrorMessage' Symbol
 
-data SErrorMessage :: PErrorMessage -> Type where
+type SErrorMessage :: PErrorMessage -> Type
+data SErrorMessage em where
   SText     :: Sing t             -> SErrorMessage ('Text t)
   SShowType :: Sing ty            -> SErrorMessage ('ShowType ty)
   (:%<>:)   :: Sing e1 -> Sing e2 -> SErrorMessage (e1 ':<>: e2)
@@ -131,7 +136,8 @@
 typeError = error . showErrorMessage
 
 -- | Convert a 'PErrorMessage' to a 'TL.ErrorMessage' from "GHC.TypeLits".
-type family ConvertPErrorMessage (a :: PErrorMessage) :: TL.ErrorMessage where
+type ConvertPErrorMessage :: PErrorMessage -> TL.ErrorMessage
+type family ConvertPErrorMessage a where
   ConvertPErrorMessage ('Text t)      = 'TL.Text t
   ConvertPErrorMessage ('ShowType ty) = 'TL.ShowType ty
   ConvertPErrorMessage (e1 ':<>: e2)  = ConvertPErrorMessage e1 'TL.:<>: ConvertPErrorMessage e2
@@ -139,7 +145,8 @@
 
 -- | A drop-in replacement for 'TL.TypeError'. This also exists at the
 -- value-level as 'typeError'.
-type family TypeError (a :: PErrorMessage) :: b where
+type TypeError :: PErrorMessage -> a
+type family TypeError a where
   -- We cannot define this as a type synonym due to Trac #12048.
   TypeError a = TL.TypeError (ConvertPErrorMessage a)
 
diff --git a/src/Data/Singletons/TypeLits.hs b/src/Data/Singletons/TypeLits.hs
--- a/src/Data/Singletons/TypeLits.hs
+++ b/src/Data/Singletons/TypeLits.hs
@@ -1,6 +1,6 @@
 {-# LANGUAGE TemplateHaskell, ScopedTypeVariables, ConstraintKinds,
              GADTs, TypeApplications, TypeFamilies, UndecidableInstances,
-             DataKinds, PolyKinds #-}
+             DataKinds, PolyKinds, StandaloneKindSignatures #-}
 
 -----------------------------------------------------------------------------
 -- |
diff --git a/src/Data/Singletons/TypeLits/Internal.hs b/src/Data/Singletons/TypeLits/Internal.hs
--- a/src/Data/Singletons/TypeLits/Internal.hs
+++ b/src/Data/Singletons/TypeLits/Internal.hs
@@ -16,7 +16,7 @@
 {-# LANGUAGE PolyKinds, DataKinds, TypeFamilies, FlexibleInstances,
              UndecidableInstances, ScopedTypeVariables, RankNTypes,
              GADTs, FlexibleContexts, TypeOperators, ConstraintKinds,
-             TemplateHaskell, TypeApplications #-}
+             TemplateHaskell, TypeApplications, StandaloneKindSignatures #-}
 {-# OPTIONS_GHC -Wno-orphans #-}
 
 module Data.Singletons.TypeLits.Internal (
@@ -39,6 +39,7 @@
   type (<=?@#@$),  type (<=?@#@$$),  type (<=?@#@$$$)
   ) where
 
+import Data.Kind
 import Data.Singletons.Promote
 import Data.Singletons.Internal
 import Data.Singletons.Prelude.Eq
@@ -58,7 +59,8 @@
 ---- TypeLits singletons ---------------------------------------------
 ----------------------------------------------------------------------
 
-data SNat (n :: Nat) = KnownNat n => SNat
+type SNat :: Nat -> Type
+data SNat n = KnownNat n => SNat
 type instance Sing = SNat
 
 instance KnownNat n => SingI n where
@@ -70,7 +72,8 @@
   toSing n = case TN.someNatVal n of
                SomeNat (_ :: Proxy n) -> SomeSing (SNat :: Sing n)
 
-data SSymbol (n :: Symbol) = KnownSymbol n => SSym
+type SSymbol :: Symbol -> Type
+data SSymbol n = KnownSymbol n => SSym
 type instance Sing = SSymbol
 
 instance KnownSymbol n => SingI n where
@@ -150,7 +153,8 @@
 
 -- | The promotion of 'error'. This version is more poly-kinded for
 -- easier use.
-type family Error (str :: k0) :: k where {}
+type Error :: k0 -> k
+type family Error str where {}
 $(genDefunSymbols [''Error])
 instance SingI (ErrorSym0 :: Symbol ~> a) where
   sing = singFun1 sError
@@ -161,7 +165,8 @@
 
 -- | The promotion of 'errorWithoutStackTrace'. This version is more
 -- poly-kinded for easier use.
-type family ErrorWithoutStackTrace (str :: k0) :: k where {}
+type ErrorWithoutStackTrace :: k0 -> k
+type family ErrorWithoutStackTrace str where {}
 $(genDefunSymbols [''ErrorWithoutStackTrace])
 instance SingI (ErrorWithoutStackTraceSym0 :: Symbol ~> a) where
   sing = singFun1 sErrorWithoutStackTrace
@@ -171,7 +176,8 @@
 sErrorWithoutStackTrace sstr = errorWithoutStackTrace (T.unpack (fromSing sstr))
 
 -- | The promotion of 'undefined'.
-type family Undefined :: k where {}
+type Undefined :: k
+type family Undefined where {}
 $(genDefunSymbols [''Undefined])
 
 -- | The singleton for 'undefined'.
diff --git a/src/Data/Singletons/TypeRepTYPE.hs b/src/Data/Singletons/TypeRepTYPE.hs
--- a/src/Data/Singletons/TypeRepTYPE.hs
+++ b/src/Data/Singletons/TypeRepTYPE.hs
@@ -1,6 +1,7 @@
 {-# LANGUAGE RankNTypes, TypeFamilies, FlexibleInstances,
              GADTs, UndecidableInstances, ScopedTypeVariables,
-             MagicHash, TypeOperators, PolyKinds, TypeApplications #-}
+             MagicHash, TypeOperators, PolyKinds, TypeApplications,
+             StandaloneKindSignatures #-}
 {-# OPTIONS_GHC -Wno-orphans #-}
 
 -----------------------------------------------------------------------------
@@ -57,7 +58,8 @@
 
 -- | A variant of 'SomeTypeRep' whose underlying 'TypeRep' is restricted to
 -- kind @'TYPE' rep@ (for some 'RuntimeRep' @rep@).
-data SomeTypeRepTYPE :: RuntimeRep -> Type where
+type SomeTypeRepTYPE :: RuntimeRep -> Type
+data SomeTypeRepTYPE r where
   SomeTypeRepTYPE :: forall (rep :: RuntimeRep) (a :: TYPE rep). !(TypeRep a) -> SomeTypeRepTYPE rep
 
 instance Eq (SomeTypeRepTYPE rep) where
diff --git a/src/Data/Singletons/Util.hs b/src/Data/Singletons/Util.hs
--- a/src/Data/Singletons/Util.hs
+++ b/src/Data/Singletons/Util.hs
@@ -10,17 +10,20 @@
 {-# LANGUAGE TypeSynonymInstances, FlexibleInstances, RankNTypes,
              TemplateHaskell, GeneralizedNewtypeDeriving,
              MultiParamTypeClasses, UndecidableInstances, MagicHash,
-             LambdaCase, NoMonomorphismRestriction #-}
+             LambdaCase, NoMonomorphismRestriction, ScopedTypeVariables,
+             FlexibleContexts #-}
 
 module Data.Singletons.Util where
 
 import Prelude hiding ( exp, foldl, concat, mapM, any, pred )
+import Language.Haskell.TH ( pprint )
 import Language.Haskell.TH.Syntax hiding ( lift )
 import Language.Haskell.TH.Desugar
 import Data.Char
 import Control.Monad hiding ( mapM )
-import Control.Monad.Writer hiding ( mapM )
+import Control.Monad.Except hiding ( mapM )
 import Control.Monad.Reader hiding ( mapM )
+import Control.Monad.Writer hiding ( mapM )
 import qualified Data.Map as Map
 import Data.List.NonEmpty (NonEmpty(..))
 import Data.Map ( Map )
@@ -112,17 +115,22 @@
 tysOfConFields (DNormalC _ stys) = map snd stys
 tysOfConFields (DRecC vstys)   = map (\(_,_,ty) -> ty) vstys
 
--- extract the name and number of arguments to a constructor
-extractNameArgs :: DCon -> (Name, Int)
-extractNameArgs = liftSnd length . extractNameTypes
+recSelsOfConFields :: DConFields -> [Name]
+recSelsOfConFields DNormalC{}    = []
+recSelsOfConFields (DRecC vstys) = map (\(n,_,_) -> n) vstys
 
--- extract the name and types of constructor arguments
-extractNameTypes :: DCon -> (Name, [DType])
-extractNameTypes (DCon _ _ n fields _) = (n, tysOfConFields fields)
+-- Extract a data constructor's name and the number of arguments it accepts.
+extractNameArgs :: DCon -> (Name, Int)
+extractNameArgs (DCon _ _ n fields _) = (n, length (tysOfConFields fields))
 
+-- Extract a data constructor's name.
 extractName :: DCon -> Name
 extractName (DCon _ _ n _ _) = n
 
+-- Extract the names of a data constructor's record selectors.
+extractRecSelNames :: DCon -> [Name]
+extractRecSelNames (DCon _ _ _ fields _) = recSelsOfConFields fields
+
 -- | is a valid Haskell infix data constructor (i.e., does it begin with a colon?)
 isInfixDataCon :: String -> Bool
 isInfixDataCon (':':_) = True
@@ -236,6 +244,17 @@
 tvbToType :: DTyVarBndr -> DType
 tvbToType = DVarT . extractTvbName
 
+-- If a type variable binder lacks an explicit kind, pick a default kind of
+-- Type. Otherwise, leave the binder alone.
+defaultTvbToTypeKind :: DTyVarBndr -> DTyVarBndr
+defaultTvbToTypeKind (DPlainTV tvname) = DKindedTV tvname $ DConT typeKindName
+defaultTvbToTypeKind tvb               = tvb
+
+-- If @Nothing@, return @Type@. If @Just k@, return @k@.
+defaultMaybeToTypeKind :: Maybe DKind -> DKind
+defaultMaybeToTypeKind (Just k) = k
+defaultMaybeToTypeKind Nothing  = DConT typeKindName
+
 inferMaybeKindTV :: Name -> Maybe DKind -> DTyVarBndr
 inferMaybeKindTV n Nothing =  DPlainTV n
 inferMaybeKindTV n (Just k) = DKindedTV n k
@@ -246,36 +265,183 @@
 resultSigToMaybeKind (DTyVarSig (DPlainTV _))    = Nothing
 resultSigToMaybeKind (DTyVarSig (DKindedTV _ k)) = Just k
 
--- Reconstruct arrow kind from the list of kinds
-ravel :: [DType] -> DType -> DType
-ravel []    res  = res
-ravel (h:t) res = DAppT (DAppT DArrowT h) (ravel t res)
+maybeKindToResultSig :: Maybe DKind -> DFamilyResultSig
+maybeKindToResultSig = maybe DNoSig DKindSig
 
+maybeSigT :: DType -> Maybe DKind -> DType
+maybeSigT ty Nothing   = ty
+maybeSigT ty (Just ki) = ty `DSigT` ki
+
+-- Reconstruct a vanilla function type from its individual type variable
+-- binders, constraints, argument types, and result type. (See
+-- Note [Vanilla-type validity checking during promotion] in
+-- Data.Singletons.Promote.Type for what "vanilla" means.)
+ravelVanillaDType :: [DTyVarBndr] -> DCxt -> [DType] -> DType -> DType
+ravelVanillaDType tvbs ctxt args res =
+  ifNonEmpty tvbs (DForallT ForallInvis) $
+  ifNonEmpty ctxt DConstrainedT $
+  go args
+  where
+    ifNonEmpty :: [a] -> ([a] -> b -> b) -> b -> b
+    ifNonEmpty [] _ z = z
+    ifNonEmpty l  f z = f l z
+
+    go :: [DType] -> DType
+    go []    = res
+    go (h:t) = DAppT (DAppT DArrowT h) (go t)
+
+-- Decompose a vanilla function type into its type variables, its context, its
+-- argument types, and its result type. (See
+-- Note [Vanilla-type validity checking during promotion] in
+-- Data.Singletons.Promote.Type for what "vanilla" means.)
+-- If a non-vanilla construct is encountered while decomposing the function
+-- type, an error is thrown monadically.
+--
+-- This should be contrasted with the 'unravelDType' function from
+-- @th-desugar@, which supports the full gamut of function types. @singletons@
+-- only supports a subset of these types, which is why this function is used
+-- to decompose them instead.
+unravelVanillaDType :: forall m. MonadFail m
+                    => DType -> m ([DTyVarBndr], DCxt, [DType], DType)
+unravelVanillaDType ty =
+  case unravelVanillaDType_either ty of
+    Left err      -> fail err
+    Right payload -> pure payload
+
+-- Ensures that a 'DType' is a vanilla type. (See
+-- Note [Vanilla-type validity checking during promotion] in
+-- Data.Singletons.Promote.Type for what "vanilla" means.)
+--
+-- The only monadic thing that this function can do is 'fail', which it does
+-- if a non-vanilla construct is encountered.
+checkVanillaDType :: forall m. MonadFail m => DType -> m ()
+checkVanillaDType ty =
+  case unravelVanillaDType_either ty of
+    Left err -> fail err
+    Right _  -> pure ()
+
+-- The workhorse that powers unravelVanillaDType and checkVanillaDType.
+-- Returns @Right payload@ upon success, and @Left error_msg@ upon failure.
+unravelVanillaDType_either ::
+  DType -> Either String ([DTyVarBndr], DCxt, [DType], DType)
+unravelVanillaDType_either ty =
+  runIdentity $ flip runReaderT True $ runExceptT $ runUnravelM $ go_ty ty
+  where
+    go_ty :: DType -> UnravelM ([DTyVarBndr], DCxt, [DType], DType)
+    go_ty typ = do
+      let (args1, res) = unravelDType typ
+      (args2, tvbs) <- take_tvbs  args1
+      (args3, ctxt) <- take_ctxt  args2
+      anons         <- take_anons args3
+      pure (tvbs, ctxt, anons, res)
+
+    -- Process a type in a higher-order position (e.g., the @forall a. a -> a@ in
+    -- @(forall a. a -> a) -> b -> b@). This is only done to check for the
+    -- presence of higher-rank foralls or constraints, which are not permitted
+    -- in vanilla types.
+    go_higher_order_ty :: DType -> UnravelM ()
+    go_higher_order_ty typ = () <$ local (const False) (go_ty typ)
+
+    take_tvbs :: DFunArgs -> UnravelM (DFunArgs, [DTyVarBndr])
+    take_tvbs (DFAForalls ForallInvis tvbs args) = do
+      rank_1 <- ask
+      unless rank_1 $ fail_forall "higher-rank"
+      _ <- traverse_ (traverse_ go_higher_order_ty . extractTvbKind) tvbs
+      (args', tvbs') <- take_tvbs args
+      pure (args', tvbs ++ tvbs')
+    take_tvbs (DFAForalls ForallVis _ _) = fail_vdq
+    take_tvbs args = pure (args, [])
+
+    take_ctxt :: DFunArgs -> UnravelM (DFunArgs, DCxt)
+    take_ctxt (DFACxt ctxt args) = do
+      rank_1 <- ask
+      unless rank_1 $ fail_ctxt "higher-rank"
+      traverse_ go_higher_order_ty ctxt
+      (args', ctxt') <- take_ctxt args
+      pure (args', ctxt ++ ctxt')
+    take_ctxt (DFAForalls fvf _ _) =
+      case fvf of
+        ForallInvis -> fail_forall "nested"
+        ForallVis   -> fail_vdq
+    take_ctxt args = pure (args, [])
+
+    take_anons :: DFunArgs -> UnravelM [DType]
+    take_anons (DFAAnon anon args) = do
+      go_higher_order_ty anon
+      anons <- take_anons args
+      pure (anon:anons)
+    take_anons (DFAForalls fvf _ _) =
+      case fvf of
+        ForallInvis -> fail_forall "nested"
+        ForallVis   -> fail_vdq
+    take_anons (DFACxt _ _) = fail_ctxt "nested"
+    take_anons DFANil = pure []
+
+    failWith :: MonadError String m => String -> m a
+    failWith thing = throwError $ unlines
+      [ "`singletons` does not support " ++ thing
+      , "In the type: " ++ pprint (sweeten ty)
+      ]
+
+    fail_forall :: MonadError String m => String -> m a
+    fail_forall sort = failWith $ sort ++ " `forall`s"
+
+    fail_vdq :: MonadError String m => m a
+    fail_vdq = failWith "visible dependent quantification"
+
+    fail_ctxt :: MonadError String m => String -> m a
+    fail_ctxt sort = failWith $ sort ++ " contexts"
+
+-- The monad that powers the internals of unravelVanillaDType_either.
+--
+-- * ExceptT String: records the error message upon failure.
+--
+-- * Reader Bool: True if we are in a rank-1 position in a type, False otherwise
+newtype UnravelM a = UnravelM { runUnravelM :: ExceptT String (Reader Bool) a }
+  deriving (Functor, Applicative, Monad, MonadError String, MonadReader Bool)
+
 -- count the number of arguments in a type
 countArgs :: DType -> Int
-countArgs ty = length args
-  where (_, _, args, _) = unravel ty
+countArgs ty = length $ filterDVisFunArgs args
+  where (args, _) = unravelDType ty
 
--- changes all TyVars not to be NameU's. Workaround for GHC#11812
+-- Collect the invisible type variable binders from a sequence of DFunArgs.
+filterInvisTvbArgs :: DFunArgs -> [DTyVarBndr]
+filterInvisTvbArgs DFANil           = []
+filterInvisTvbArgs (DFACxt  _ args) = filterInvisTvbArgs args
+filterInvisTvbArgs (DFAAnon _ args) = filterInvisTvbArgs args
+filterInvisTvbArgs (DFAForalls fvf tvbs' args) =
+  let res = filterInvisTvbArgs args in
+  case fvf of
+    ForallVis   -> res
+    ForallInvis -> tvbs' ++ res
+
+-- Infer the kind of a DTyVarBndr by using information from a DVisFunArg.
+replaceTvbKind :: DVisFunArg -> DTyVarBndr -> DTyVarBndr
+replaceTvbKind (DVisFADep tvb) _   = tvb
+replaceTvbKind (DVisFAAnon k)  tvb = DKindedTV (extractTvbName tvb) k
+
+-- changes all TyVars not to be NameU's. Workaround for GHC#11812/#17537
 noExactTyVars :: Data a => a -> a
 noExactTyVars = everywhere go
   where
     go :: Data a => a -> a
     go = mkT fix_tvb `extT` fix_ty `extT` fix_inj_ann
 
-    no_exact_name :: Name -> Name
-    no_exact_name (Name (OccName occ) (NameU unique)) = mkName (occ ++ show unique)
-    no_exact_name n                                   = n
-
-    fix_tvb (DPlainTV n)    = DPlainTV (no_exact_name n)
-    fix_tvb (DKindedTV n k) = DKindedTV (no_exact_name n) k
+    fix_tvb (DPlainTV n)    = DPlainTV (noExactName n)
+    fix_tvb (DKindedTV n k) = DKindedTV (noExactName n) k
 
-    fix_ty (DVarT n)           = DVarT (no_exact_name n)
+    fix_ty (DVarT n)           = DVarT (noExactName n)
     fix_ty ty                  = ty
 
     fix_inj_ann (InjectivityAnn lhs rhs)
-      = InjectivityAnn (no_exact_name lhs) (map no_exact_name rhs)
+      = InjectivityAnn (noExactName lhs) (map noExactName rhs)
 
+-- changes a Name not to be a NameU. Workaround for GHC#11812/#17537
+noExactName :: Name -> Name
+noExactName (Name (OccName occ) (NameU unique)) = mkName (occ ++ show unique)
+noExactName n                                   = n
+
 substKind :: Map Name DKind -> DKind -> DKind
 substKind = substType
 
@@ -283,12 +449,13 @@
 -- substitution, use @substTy@ from "Language.Haskell.TH.Desugar.Subst".
 substType :: Map Name DType -> DType -> DType
 substType subst ty | Map.null subst = ty
-substType subst (DForallT tvbs cxt inner_ty)
-  = DForallT tvbs' cxt' inner_ty'
+substType subst (DForallT fvf tvbs inner_ty)
+  = DForallT fvf tvbs' inner_ty'
   where
     (subst', tvbs') = mapAccumL subst_tvb subst tvbs
-    cxt'            = map (substType subst') cxt
     inner_ty'       = substType subst' inner_ty
+substType subst (DConstrainedT cxt inner_ty) =
+  DConstrainedT (map (substType subst) cxt) (substType subst inner_ty)
 substType subst (DAppT ty1 ty2) = substType subst ty1 `DAppT` substType subst ty2
 substType subst (DAppKindT ty ki) = substType subst ty `DAppKindT` substType subst ki
 substType subst (DSigT ty ki) = substType subst ty `DSigT` substType subst ki
@@ -305,9 +472,9 @@
 subst_tvb s tvb@(DPlainTV n) = (Map.delete n s, tvb)
 subst_tvb s (DKindedTV n k)  = (Map.delete n s, DKindedTV n (substKind s k))
 
-cuskify :: DTyVarBndr -> DTyVarBndr
-cuskify (DPlainTV tvname) = DKindedTV tvname $ DConT typeKindName
-cuskify tvb               = tvb
+dropTvbKind :: DTyVarBndr -> DTyVarBndr
+dropTvbKind tvb@(DPlainTV {}) = tvb
+dropTvbKind (DKindedTV n _)   = DPlainTV n
 
 -- apply a type to a list of types
 foldType :: DType -> [DType] -> DType
@@ -345,58 +512,11 @@
 multiCase scruts pats body =
   DCaseE (mkTupleDExp scruts) [DMatch (mkTupleDPat pats) body]
 
--- Make a desugar function into a TH function.
-wrapDesugar :: (Desugar th ds, DsMonad q) => (th -> ds -> q ds) -> th -> q th
-wrapDesugar f th = do
-  ds <- desugar th
-  fmap sweeten $ f th ds
-
 -- a monad transformer for writing a monoid alongside returning a Q
 newtype QWithAux m q a = QWA { runQWA :: WriterT m q a }
   deriving ( Functor, Applicative, Monad, MonadTrans
            , MonadWriter m, MonadReader r
-           , MonadFail, MonadIO )
-
--- make a Quasi instance for easy lifting
-instance (Quasi q, Monoid m) => Quasi (QWithAux m q) where
-  qNewName          = lift `comp1` qNewName
-  qReport           = lift `comp2` qReport
-  qLookupName       = lift `comp2` qLookupName
-  qReify            = lift `comp1` qReify
-  qReifyInstances   = lift `comp2` qReifyInstances
-  qLocation         = lift qLocation
-  qRunIO            = lift `comp1` qRunIO
-  qAddDependentFile = lift `comp1` qAddDependentFile
-  qReifyRoles       = lift `comp1` qReifyRoles
-  qReifyAnnotations = lift `comp1` qReifyAnnotations
-  qReifyModule      = lift `comp1` qReifyModule
-  qAddTopDecls      = lift `comp1` qAddTopDecls
-  qAddModFinalizer  = lift `comp1` qAddModFinalizer
-  qGetQ             = lift qGetQ
-  qPutQ             = lift `comp1` qPutQ
-
-  qReifyFixity        = lift `comp1` qReifyFixity
-  qReifyConStrictness = lift `comp1` qReifyConStrictness
-  qIsExtEnabled       = lift `comp1` qIsExtEnabled
-  qExtsEnabled        = lift qExtsEnabled
-  qAddForeignFilePath = lift `comp2` qAddForeignFilePath
-  qAddTempFile        = lift `comp1` qAddTempFile
-  qAddCorePlugin      = lift `comp1` qAddCorePlugin
-
-  qRecover exp handler = do
-    (result, aux) <- lift $ qRecover (evalForPair exp) (evalForPair handler)
-    tell aux
-    return result
-
-instance (DsMonad q, Monoid m) => DsMonad (QWithAux m q) where
-  localDeclarations = lift localDeclarations
-
--- helper functions for composition
-comp1 :: (b -> c) -> (a -> b) -> a -> c
-comp1 = (.)
-
-comp2 :: (c -> d) -> (a -> b -> c) -> a -> b -> d
-comp2 f g a b = f (g a b)
+           , MonadFail, MonadIO, Quasi, DsMonad )
 
 -- run a computation with an auxiliary monoid, discarding the monoid result
 evalWithoutAux :: Quasi q => QWithAux m q a -> q a
@@ -438,6 +558,16 @@
 concatMapM fn list = do
   bss <- mapM fn list
   return $ fold bss
+
+-- like GHC's
+mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]
+mapMaybeM _ [] = return []
+mapMaybeM f (x:xs) = do
+  y <- f x
+  ys <- mapMaybeM f xs
+  return $ case y of
+    Nothing -> ys
+    Just z  -> z : ys
 
 -- make a one-element list
 listify :: a -> [a]
diff --git a/tests/ByHand.hs b/tests/ByHand.hs
--- a/tests/ByHand.hs
+++ b/tests/ByHand.hs
@@ -15,12 +15,12 @@
              RankNTypes, TypeOperators, MultiParamTypeClasses,
              FunctionalDependencies, ScopedTypeVariables,
              LambdaCase, TemplateHaskell, EmptyCase,
-             TypeApplications, EmptyCase
+             TypeApplications, EmptyCase, StandaloneKindSignatures
  #-}
 
 module ByHand where
 
-import Data.Kind (Type)
+import Data.Kind
 import Prelude hiding (Bool, False, True, Maybe, Just, Nothing, Either, Left, Right, map, zipWith,
                        (&&), (||), (+), (-))
 import Unsafe.Coerce
@@ -35,27 +35,32 @@
 -- Original ADTs ------------------
 -----------------------------------
 
-data Nat :: Type where
+type Nat :: Type
+data Nat where
   Zero :: Nat
   Succ :: Nat -> Nat
   deriving Eq
 
-data Bool :: Type where
+type Bool :: Type
+data Bool where
   False :: Bool
   True :: Bool
 
-data Maybe :: Type -> Type where
+type Maybe :: Type -> Type
+data Maybe a where
   Nothing :: Maybe a
   Just :: a -> Maybe a
   deriving Eq
 
 -- Defined using names to avoid fighting with concrete syntax
-data List :: Type -> Type where
+type List :: Type -> Type
+data List a where
   Nil :: List a
   Cons :: a -> List a -> List a
   deriving Eq
 
-data Either :: Type -> Type -> Type where
+type Either :: Type -> Type -> Type
+data Either a b where
   Left :: a -> Either a b
   Right :: b -> Either a b
 
@@ -65,15 +70,18 @@
 -----------------------------------
 
 -- Promoted equality type class
+type PEq :: Type -> Constraint
 class PEq k where
   type (==) (a :: k) (b :: k) :: Bool
   -- omitting definition of /=
 
 -- Singleton type equality type class
+type SEq :: Type -> Constraint
 class SEq k where
   (%==) :: forall (a :: k) (b :: k). Sing a -> Sing b -> Sing (a == b)
   -- omitting definition of %/=
 
+type If :: Bool -> a -> a -> a
 type family If cond tru fls where
   If True  tru  fls = tru
   If False tru  fls = fls
@@ -88,15 +96,18 @@
 
 -- Nat
 
-data SNat :: Nat -> Type where
+type SNat :: Nat -> Type
+data SNat n where
   SZero :: SNat Zero
   SSucc :: SNat n -> SNat (Succ n)
 type instance Sing = SNat
 
-data SuccSym0 :: Nat ~> Nat
+type SuccSym0 :: Nat ~> Nat
+data SuccSym0 tf
 type instance Apply SuccSym0 x = Succ x
 
-type family EqualsNat (a :: Nat) (b :: Nat) where
+type EqualsNat :: Nat -> Nat -> Bool
+type family EqualsNat a b where
   EqualsNat Zero Zero = True
   EqualsNat (Succ a) (Succ b) = a == b
   EqualsNat (n1 :: Nat) (n2 :: Nat) = False
@@ -131,7 +142,8 @@
 
 -- Bool
 
-data SBool :: Bool -> Type where
+type SBool :: Bool -> Type
+data SBool b where
   SFalse :: SBool False
   STrue :: SBool True
 type instance Sing = SBool
@@ -140,7 +152,8 @@
 False && _ = False
 True  && x = x
 
-type family (a :: Bool) && (b :: Bool) :: Bool where
+type (&&) :: Bool -> Bool -> Bool
+type family a && b where
   False && _ = False
   True  && x = x
 
@@ -163,12 +176,14 @@
 
 -- Maybe
 
-data SMaybe :: forall k. Maybe k -> Type where
+type SMaybe :: Maybe k -> Type
+data SMaybe m where
   SNothing :: SMaybe Nothing
   SJust :: forall k (a :: k). Sing a -> SMaybe (Just a)
 type instance Sing = SMaybe
 
-type family EqualsMaybe (a :: Maybe k) (b :: Maybe k) where
+type EqualsMaybe :: Maybe k -> Maybe k -> Bool
+type family EqualsMaybe a b where
   EqualsMaybe Nothing Nothing = True
   EqualsMaybe (Just a) (Just a') = a == a'
   EqualsMaybe (x :: Maybe k) (y :: Maybe k) = False
@@ -205,22 +220,28 @@
 
 -- List
 
-data SList :: forall k. List k -> Type where
+type SList :: List k -> Type
+data SList l where
   SNil :: SList Nil
   SCons :: forall k (h :: k) (t :: List k). Sing h -> SList t -> SList (Cons h t)
 type instance Sing = SList
 
+type NilSym0 :: List a
 type NilSym0 = Nil
 
-data ConsSym0 :: a ~> List a ~> List a
+type ConsSym0 :: a ~> List a ~> List a
+data ConsSym0 tf
 type instance Apply ConsSym0 a = ConsSym1 a
 
-data ConsSym1 :: a -> List a ~> List a
+type ConsSym1 :: a -> List a ~> List a
+data ConsSym1 a tf
 type instance Apply (ConsSym1 a) b = ConsSym2 a b
 
+type ConsSym2 :: a -> List a -> List a
 type ConsSym2 a b = Cons a b
 
-type family EqualsList (a :: List k) (b :: List k) where
+type EqualsList :: List k -> List k -> Bool
+type family EqualsList a b where
   EqualsList Nil Nil = True
   EqualsList (Cons a b) (Cons a' b') = (a == a') && (b == b')
   EqualsList (x :: List k) (y :: List k) = False
@@ -260,7 +281,8 @@
 
 -- Either
 
-data SEither :: forall k1 k2. Either k1 k2 -> Type where
+type SEither :: Either k1 k2 -> Type
+data SEither e where
   SLeft :: forall k1 (a :: k1). Sing a -> SEither (Left a)
   SRight :: forall k2 (b :: k2). Sing b -> SEither (Right b)
 type instance Sing = SEither
@@ -294,10 +316,12 @@
 
 -- Composite
 
-data Composite :: Type -> Type -> Type where
+type Composite :: Type -> Type -> Type
+data Composite a b where
   MkComp :: Either (Maybe a) b -> Composite a b
 
-data SComposite :: forall k1 k2. Composite k1 k2 -> Type where
+type SComposite :: Composite k1 k2 -> Type
+data SComposite c where
   SMkComp :: forall k1 k2 (a :: Either (Maybe k1) k2). SEither a -> SComposite (MkComp a)
 type instance Sing = SComposite
 
@@ -319,8 +343,10 @@
 
 -- Empty
 
+type Empty :: Type
 data Empty
-data SEmpty :: Empty -> Type
+type SEmpty :: Empty -> Type
+data SEmpty e
 type instance Sing = SEmpty
 instance SingKind Empty where
   type Demote Empty = Empty
@@ -329,13 +355,16 @@
 
 -- Type
 
-data Vec :: Type -> Nat -> Type where
+type Vec :: Type -> Nat -> Type
+data Vec a n where
   VNil :: Vec a Zero
   VCons :: a -> Vec a n -> Vec a (Succ n)
 
+type Rep :: Type
 data Rep = Nat | Maybe Rep | Vec Rep Nat
 
-data SRep :: Type -> Type where
+type SRep :: Type -> Type
+data SRep r where
   SNat :: SRep Nat
   SMaybe :: SRep a -> SRep (Maybe a)
   SVec :: SRep a -> SNat n -> SRep (Vec a n)
@@ -382,7 +411,8 @@
       (Disproved contra, _) -> Disproved (\Refl -> contra Refl)
       (_, Disproved contra) -> Disproved (\Refl -> contra Refl)
 
-type family EqualsType (a :: Type) (b :: Type) where
+type EqualsType :: Type -> Type -> Bool
+type family EqualsType a b where
   EqualsType a a = True
   EqualsType _ _ = False
 instance PEq Type where
@@ -402,12 +432,14 @@
 isJust Nothing = False
 isJust (Just _) = True
 
-type family IsJust (a :: Maybe k) :: Bool where
+type IsJust :: Maybe k -> Bool
+type family IsJust a where
     IsJust Nothing = False
     IsJust (Just a) = True
 
 -- defunctionalization symbols
-data IsJustSym0 :: Maybe a ~> Bool
+type IsJustSym0 :: Maybe a ~> Bool
+data IsJustSym0 tf
 type instance Apply IsJustSym0 a = IsJust a
 
 sIsJust :: Sing a -> Sing (IsJust a)
@@ -418,11 +450,13 @@
 pred Zero = Zero
 pred (Succ n) = n
 
-type family Pred (a :: Nat) :: Nat where
+type Pred :: Nat -> Nat
+type family Pred a where
   Pred Zero = Zero
   Pred (Succ n) = n
 
-data PredSym0 :: Nat ~> Nat
+type PredSym0 :: Nat ~> Nat
+data PredSym0 tf
 type instance Apply PredSym0 a = Pred a
 
 sPred :: forall (t :: Nat). Sing t -> Sing (Pred t)
@@ -433,13 +467,16 @@
 map _ Nil = Nil
 map f (Cons h t) = Cons (f h) (map f t)
 
-type family Map (f :: k1 ~> k2) (l :: List k1) :: List k2 where
+type Map :: (k1 ~> k2) -> List k1 -> List k2
+type family Map f l where
     Map f Nil = Nil
     Map f (Cons h t) = Cons (Apply f h) (Map f t)
 
 -- defunctionalization symbols
-data MapSym1 :: (a ~> b) -> List a ~> List b
-data MapSym0 :: (a ~> b) ~> List a ~> List b
+type MapSym1 :: (a ~> b) -> List a ~> List b
+data MapSym1 f tf
+type MapSym0 :: (a ~> b) ~> List a ~> List b
+data MapSym0 tf
 type instance Apply (MapSym1 f) xs = Map f xs
 type instance Apply  MapSym0 f     = MapSym1 f
 
@@ -472,17 +509,19 @@
 zipWith _ (_:_) []      = []
 zipWith _ []    []      = []
 
-type family ZipWith (k1 :: a ~> b ~> c)
-                    (k2 :: List a)
-                    (k3 :: List b) :: List c where
+type ZipWith :: (a ~> b ~> c) -> List a -> List b -> List c
+type family ZipWith k1 k2 k3 where
   ZipWith f (Cons x xs) (Cons y ys) = Cons (Apply (Apply f x) y) (ZipWith f xs ys)
   ZipWith f Nil (Cons z1 z2) = Nil
   ZipWith f (Cons z1 z2) Nil = Nil
   ZipWith f Nil          Nil = Nil
 
-data ZipWithSym2 :: (a ~> b ~> c) -> List a -> List b ~> List c
-data ZipWithSym1 :: (a ~> b ~> c) -> List a ~> List b ~> List c
-data ZipWithSym0 :: (a ~> b ~> c) ~> List a ~> List b ~> List c
+type ZipWithSym2 :: (a ~> b ~> c) -> List a -> List b ~> List c
+data ZipWithSym2 f xs tf
+type ZipWithSym1 :: (a ~> b ~> c) -> List a ~> List b ~> List c
+data ZipWithSym1 f tf
+type ZipWithSym0 :: (a ~> b ~> c) ~> List a ~> List b ~> List c
+data ZipWithSym0 tf
 type instance Apply (ZipWithSym2 f xs) ys = ZipWith f xs ys
 type instance Apply (ZipWithSym1 f)    xs = ZipWithSym2 f xs
 type instance Apply  ZipWithSym0 f        = ZipWithSym1 f
@@ -500,14 +539,18 @@
 either l _ (Left x) = l x
 either _ r (Right x) = r x
 
-type family Either_ (l :: a ~> c) (r :: b ~> c) (e :: Either a b) :: c where
+type Either_ :: (a ~> c) -> (b ~> c) -> Either a b -> c
+type family Either_ l r e where
     Either_ l r (Left x) = Apply l x
     Either_ l r (Right x) = Apply r x
 
 -- defunctionalization symbols
-data Either_Sym2 :: (a ~> c) -> (b ~> c) -> Either a b ~> c
-data Either_Sym1 :: (a ~> c) -> (b ~> c) ~> Either a b ~> c
-data Either_Sym0 :: (a ~> c) ~> (b ~> c) ~> Either a b ~> c
+type Either_Sym2 :: (a ~> c) -> (b ~> c) -> Either a b ~> c
+data Either_Sym2 k1 k2 tf
+type Either_Sym1 :: (a ~> c) -> (b ~> c) ~> Either a b ~> c
+data Either_Sym1 f tf
+type Either_Sym0 :: (a ~> c) ~> (b ~> c) ~> Either a b ~> c
+data Either_Sym0 tf
 type instance Apply (Either_Sym2 k1 k2) k3 = Either_     k1 k2 k3
 type instance Apply (Either_Sym1 k1)    k2 = Either_Sym2 k1 k2
 type instance Apply  Either_Sym0        k1 = Either_Sym1 k1
@@ -549,7 +592,8 @@
 eitherToNat (Left  x) = x
 eitherToNat (Right x) = x
 
-type family EitherToNat (e :: Either Nat Nat) :: Nat where
+type EitherToNat :: Either Nat Nat -> Nat
+type family EitherToNat e where
     EitherToNat (Left x) = x
     EitherToNat (Right x) = x
 
@@ -561,12 +605,15 @@
 liftMaybe _ Nothing = Nothing
 liftMaybe f (Just a) = Just (f a)
 
-type family LiftMaybe (f :: a ~> b) (x :: Maybe a) :: Maybe b where
+type LiftMaybe :: (a ~> b) -> Maybe a -> Maybe b
+type family LiftMaybe f x where
     LiftMaybe f Nothing = Nothing
     LiftMaybe f (Just a) = Just (Apply f a)
 
-data LiftMaybeSym1 :: (a ~> b) -> Maybe a ~> Maybe b
-data LiftMaybeSym0 :: (a ~> b) ~> Maybe a ~> Maybe b
+type LiftMaybeSym1 :: (a ~> b) -> Maybe a ~> Maybe b
+data LiftMaybeSym1 f tf
+type LiftMaybeSym0 :: (a ~> b) ~> Maybe a ~> Maybe b
+data LiftMaybeSym0 tf
 type instance Apply (LiftMaybeSym1 k1) k2 = LiftMaybe k1 k2
 type instance Apply  LiftMaybeSym0     k1 = LiftMaybeSym1 k1
 
@@ -580,13 +627,16 @@
 Zero + x = x
 (Succ x) + y = Succ (x + y)
 
-type family (+) (m :: Nat) (n :: Nat) :: Nat where
+type (+) :: Nat -> Nat -> Nat
+type family (+) m n where
   Zero + x = x
   (Succ x) + y = Succ (x + y)
 
 -- defunctionalization symbols
-data (+$$) :: Nat -> Nat ~> Nat
-data (+$)  :: Nat ~> Nat ~> Nat
+type (+$$) :: Nat -> Nat ~> Nat
+data (+$$) k1 tf
+type (+$)  :: Nat ~> Nat ~> Nat
+data (+$)  tf
 type instance Apply ((+$$) k1) k2 = (+) k1 k2
 type instance Apply  (+$)  k1     = (+$$) k1
 
@@ -599,13 +649,16 @@
 (Succ x) - Zero = Succ x
 (Succ x) - (Succ y) = x - y
 
-type family (-) (m :: Nat) (n :: Nat) :: Nat where
+type (-) :: Nat -> Nat -> Nat
+type family (-) m n where
   Zero - x = Zero
   (Succ x) - Zero = Succ x
   (Succ x) - (Succ y) = x - y
 
-data (-$$) :: Nat -> Nat ~> Nat
-data (-$)  :: Nat ~> Nat ~> Nat
+type (-$$) :: Nat -> Nat ~> Nat
+data (-$$) k1 tf
+type (-$)  :: Nat ~> Nat ~> Nat
+data (-$)  tf
 type instance Apply ((-$$) k1) k2 = (-) k1 k2
 type instance Apply  (-$)  k1     = (-$$) k1
 
@@ -617,10 +670,12 @@
 isZero :: Nat -> Bool
 isZero n = if n == Zero then True else False
 
-type family IsZero (n :: Nat) :: Bool where
+type IsZero :: Nat -> Bool
+type family IsZero n where
   IsZero n = If (n == Zero) True False
 
-data IsZeroSym0 :: Nat ~> Bool
+type IsZeroSym0 :: Nat ~> Bool
+data IsZeroSym0 tf
 type instance Apply IsZeroSym0 a = IsZero a
 
 sIsZero :: Sing n -> Sing (IsZero n)
@@ -630,12 +685,15 @@
 False || x = x
 True || _ = True
 
-type family (a :: Bool) || (b :: Bool) :: Bool where
+type (||) :: Bool -> Bool -> Bool
+type family a || b where
   False || x = x
   True || x = True
 
-data (||$$) :: Bool -> Bool ~> Bool
-data (||$)  :: Bool ~> Bool ~> Bool
+type (||$$) :: Bool -> Bool ~> Bool
+data (||$$) a tf
+type (||$)  :: Bool ~> Bool ~> Bool
+data (||$)  tf
 type instance Apply ((||$$) a) b = (||) a b
 type instance Apply (||$) a = (||$$) a
 
@@ -649,12 +707,15 @@
 contains elt (Cons h t) = (elt == h) || contains elt t
 -}
 
-type family Contains (a :: k) (b :: List k) :: Bool where
+type Contains :: k -> List k -> Bool
+type family Contains a b where
   Contains elt Nil = False
   Contains elt (Cons h t) = (elt == h) || (Contains elt t)
 
-data ContainsSym1 :: a -> List a ~> Bool
-data ContainsSym0 :: a ~> List a ~> Bool
+type ContainsSym1 :: a -> List a ~> Bool
+data ContainsSym1 a tf
+type ContainsSym0 :: a ~> List a ~> Bool
+data ContainsSym0 tf
 type instance Apply (ContainsSym1 a) b = Contains a b
 type instance Apply  ContainsSym0 a    = ContainsSym1 a
 
@@ -686,7 +747,8 @@
   Cons h t -> (elt == h) || cont elt t
 -}
 
-type family Cont :: a ~> List a ~> Bool where
+type Cont :: a ~> List a ~> Bool
+type family Cont where
   Cont = Lambda10Sym0
 
 data Lambda10Sym0 f where
@@ -754,7 +816,8 @@
   in
   loop Zero ls
 
-type family FindIndices (f :: a ~> Bool) (ls :: List a) :: List Nat where
+type FindIndices :: (a ~> Bool) -> List a -> List Nat
+type family FindIndices f ls where
   FindIndices p ls = (Let123LoopSym2 p ls) @@ Zero @@ ls
 
 type family Let123Loop p ls (arg1 :: Nat) (arg2 :: List a) :: List Nat where
@@ -798,8 +861,8 @@
              -> Sing t2
              -> Sing (FindIndicesSym0 @@ t1 @@ t2)
 sFindIndices sP sLs =
-  let sLoop :: forall (u1 :: Nat). Sing u1
-            -> forall (u2 :: List a). Sing u2
+  let sLoop :: forall (u1 :: Nat) (u2 :: List a).
+               Sing u1 -> Sing u2
             -> Sing ((Let123LoopSym2 t1 t2) @@ u1 @@ u2)
       sLoop _ SNil = SNil
       sLoop sN (sX `SCons` sXs) = case sP @@ sX of
@@ -865,9 +928,11 @@
 
 ------------------------------------------------------------
 
-data G :: Type -> Type where
+type G :: Type -> Type
+data G a where
   MkG :: G Bool
 
-data SG :: forall a. G a -> Type where
+type SG :: G a -> Type
+data SG g where
   SMkG :: SG MkG
 type instance Sing = SG
diff --git a/tests/ByHand2.hs b/tests/ByHand2.hs
--- a/tests/ByHand2.hs
+++ b/tests/ByHand2.hs
@@ -1,22 +1,28 @@
 {-# LANGUAGE DataKinds, PolyKinds, TypeFamilies, GADTs, TypeOperators,
              DefaultSignatures, ScopedTypeVariables, InstanceSigs,
              MultiParamTypeClasses, FunctionalDependencies,
-             UndecidableInstances #-}
+             UndecidableInstances, StandaloneKindSignatures #-}
 {-# OPTIONS_GHC -Wno-missing-signatures #-}
 module ByHand2 where
 
 import Prelude hiding ( Eq(..), Ord(..), Bool(..), Ordering(..), not )
-import Data.Kind (Type)
+import Data.Kind
 import Data.Singletons (Sing)
 
+type Nat :: Type
 data Nat = Zero | Succ Nat
+
+type Bool :: Type
 data Bool = False | True
+
+type Ordering :: Type
 data Ordering = LT | EQ | GT
 
 not :: Bool -> Bool
 not False = True
 not True  = False
 
+type Eq :: Type -> Constraint
 class Eq a where
   (==) :: a -> a -> Bool
   (/=) :: a -> a -> Bool
@@ -31,17 +37,20 @@
   Succ _ == Zero = False
   Succ x == Succ y = x == y
 
-data SBool :: Bool -> Type where
+type SBool :: Bool -> Type
+data SBool b where
   SFalse :: SBool 'False
   STrue  :: SBool 'True
 type instance Sing = SBool
 
-data SNat :: Nat -> Type where
+type SNat :: Nat -> Type
+data SNat n where
   SZero :: SNat 'Zero
   SSucc :: SNat n -> SNat ('Succ n)
 type instance Sing = SNat
 
-type family Not (x :: Bool) :: Bool where
+type Not :: Bool -> Bool
+type family Not x where
   Not 'True = 'False
   Not 'False = 'True
 
@@ -49,6 +58,7 @@
 sNot STrue = SFalse
 sNot SFalse = STrue
 
+type PEq :: Type -> Constraint
 class PEq a where
   type (==) (x :: a) (y :: a) :: Bool
   type (/=) (x :: a) (y :: a) :: Bool
@@ -62,6 +72,7 @@
   type 'Zero   == 'Succ x = 'False
   type 'Succ x == 'Succ y = x == y
 
+type SEq :: Type -> Constraint
 class SEq a where
   (%==) :: Sing (x :: a) -> Sing (y :: a) -> Sing (x == y)
   (%/=) :: Sing (x :: a) -> Sing (y :: a) -> Sing (x /= y)
@@ -90,12 +101,14 @@
   GT == EQ = False
   GT == GT = True
 
+type Ord :: Type -> Constraint
 class Eq a => Ord a where
   compare :: a -> a -> Ordering
   (<) :: a -> a -> Bool
 
   x < y = compare x y == LT
 
+type POrd :: Type -> Constraint
 class PEq a => POrd a where
   type Compare (x :: a) (y :: a) :: Ordering
   type (<) (x :: a) (y :: a) :: Bool
@@ -114,7 +127,8 @@
   type Compare ('Succ x) 'Zero     = 'GT
   type Compare ('Succ x) ('Succ y) = Compare x y
 
-data SOrdering :: Ordering -> Type where
+type SOrdering :: Ordering -> Type
+data SOrdering o where
   SLT :: SOrdering 'LT
   SEQ :: SOrdering 'EQ
   SGT :: SOrdering 'GT
@@ -142,6 +156,7 @@
   SGT %== SEQ = SFalse
   SGT %== SGT = STrue
 
+type SOrd :: Type -> Constraint
 class SEq a => SOrd a where
   sCompare :: Sing (x :: a) -> Sing (y :: a) -> Sing (Compare x y)
   (%<) :: Sing (x :: a) -> Sing (y :: a) -> Sing (x < y)
@@ -155,12 +170,15 @@
   sCompare (SSucc _) SZero = SGT
   sCompare (SSucc x) (SSucc y) = sCompare x y
 
+type Pointed :: Type -> Constraint
 class Pointed a where
   point :: a
 
+type PPointed :: Type -> Constraint
 class PPointed a where
   type Point :: a
 
+type SPointed :: Type -> Constraint
 class SPointed a where
   sPoint :: Sing (Point :: a)
 
@@ -175,6 +193,7 @@
 
 --------------------------------
 
+type FD :: Type -> Type -> Constraint
 class FD a b | a -> b where
   meth :: a -> a
   l2r  :: a -> b
@@ -187,6 +206,7 @@
 t1 = meth True
 t2 = l2r False
 
+type PFD :: Type -> Type -> Constraint
 class PFD a b | a -> b where
   type Meth (x :: a) :: a
   type L2r (x :: a) :: b
@@ -196,9 +216,13 @@
   type L2r 'False = 'Zero
   type L2r 'True = 'Succ 'Zero
 
+type T1 :: Bool
 type T1 = Meth 'True
+
+type T2 :: Nat
 type T2 = L2r 'False
 
+type SFD :: Type -> Type -> Constraint
 class SFD a b | a -> b where
   sMeth :: forall (x :: a). Sing x -> Sing (Meth x :: a)
   sL2r :: forall (x :: a). Sing x -> Sing (L2r x :: b)
@@ -209,5 +233,5 @@
   sL2r STrue = SSucc SZero
 
 sT1 = sMeth STrue
-sT2 :: Sing (T2 :: Nat)
+sT2 :: Sing T2
 sT2 = sL2r SFalse
diff --git a/tests/README.md b/tests/README.md
new file mode 100644
--- /dev/null
+++ b/tests/README.md
@@ -0,0 +1,71 @@
+`singletons` testsuite notes
+============================
+
+The `singletons` testsuite is built using the
+[`tasty`](http://hackage.haskell.org/package/tasty) testing framework. Aside
+from the standard `HUnit` and `QuickCheck` tests, it contains a number of
+compile-and-dump tests. These tests run GHC to compile a test file that uses
+the `singletons` library and compare the generated Template Haskell splices
+against expected output saved in a "golden" file. Below are some details about
+these tests:
+
+ * GHC uses the in-tree `singletons` library. This means there is no need to
+   install the library in your system before running the tests. You can simply
+   run the tests with:
+
+      ```bash
+      cabal test
+      ```
+
+ * Compile-and-dump tests are stored in the subdirectories of the
+   `tests/compile-and-dump/` directory. Files with a `.golden` extension store
+   the expected output. Running the testsuite produces files with an `.actual`
+   extension which contain the actual output produced by GHC. These files are
+   not deleted by the testsuite, which allows one to inspect them in case a
+   test fails. To remove the `.actual` files, run:
+
+      ```bash
+      make clean-tests
+      ```
+
+ * Running the testsuite requires `diff`, as `diff` is used to compare golden
+   and actual files.
+
+ * Each compile-and-dump test requires a set of GHC options to be used for
+   compilation. The testsuite defines a default set of options that enable all
+   of the language extensions required by `singletons`. This makes writing
+   tests easier since there is no need to put all the extensions into a source
+   file. The default options also enable `-ddump-splices` (which dumps splices
+   generated by Template Haskell), `-dsuppress-uniques` (which avoids test
+   failures due to unique identifiers), `-v0` (which silences GHC's build
+   output) and `-fforce-recomp` (which forces recompilation each time a
+   testsuite is run). There is a convenience function (`compileAndDumpTest`)
+   that creates a test with the standard GHC options defined by the testsuite.
+
+ * Because `singletons` only supports one version of GHC, the `.golden` files
+   should not be assumed to be portable across multiple versions of GHC. Beware
+   of this should you try testing `singletons` against GHC HEAD.
+
+ * You can run single tests or groups of tests whose name match a regexp using
+   tasty's pattern feature. For example:
+
+   ```bash
+   cabal test --test-options="--pattern=Testsuite/Singletons/*"
+   ```
+
+   runs all tests in the `Testsuite/Singletons` branch of the test tree.
+   The `SingletonsTestSuite` module defines the structure of the test tree.
+
+ * If you modify `singletons`, you may cause the actual output of some tests to
+   change. If these changes are what you intended, you can accept the new
+   output by running the following command:
+
+   ```bash
+   cabal test --test-options="--accept"
+   ```
+
+## ByHand files
+
+`tests` directory contains `ByHand.hs` and `ByHandAux.hs` files. They are
+intended as a sandbox where all the definitions generated by `singletons` are
+written by hand.
diff --git a/tests/SingletonsTestSuite.hs b/tests/SingletonsTestSuite.hs
--- a/tests/SingletonsTestSuite.hs
+++ b/tests/SingletonsTestSuite.hs
@@ -75,6 +75,8 @@
     , compileAndDumpStdTest "T145"
     , compileAndDumpStdTest "PolyKinds"
     , compileAndDumpStdTest "PolyKindsApp"
+    , afterSingletonsNat .
+      compileAndDumpStdTest "T150"
     , compileAndDumpStdTest "T160"
     , compileAndDumpStdTest "T163"
     , compileAndDumpStdTest "T166"
@@ -92,6 +94,7 @@
     , compileAndDumpStdTest "T197"
     , compileAndDumpStdTest "T197b"
     , compileAndDumpStdTest "T200"
+    , compileAndDumpStdTest "T204"
     , compileAndDumpStdTest "T206"
     , compileAndDumpStdTest "T209"
     , compileAndDumpStdTest "T216"
@@ -102,11 +105,13 @@
     , compileAndDumpStdTest "T271"
     , compileAndDumpStdTest "T287"
     , compileAndDumpStdTest "TypeRepTYPE"
+    , compileAndDumpStdTest "T296"
     , compileAndDumpStdTest "T297"
     , compileAndDumpStdTest "T312"
     , compileAndDumpStdTest "T313"
     , compileAndDumpStdTest "T316"
     , compileAndDumpStdTest "T322"
+    , compileAndDumpStdTest "T326"
     , compileAndDumpStdTest "NatSymbolReflexive"
     , compileAndDumpStdTest "T323"
     , compileAndDumpStdTest "T332"
@@ -117,7 +122,13 @@
     , compileAndDumpStdTest "T367"
     , compileAndDumpStdTest "T371"
     , compileAndDumpStdTest "T376"
+    , compileAndDumpStdTest "T378a"
+    , compileAndDumpStdTest "T401"
+    , compileAndDumpStdTest "T401b"
     , compileAndDumpStdTest "T402"
+    , compileAndDumpStdTest "T410"
+    , compileAndDumpStdTest "T412"
+    , compileAndDumpStdTest "T414"
     ],
     testCompileAndDumpGroup "Promote"
     [ compileAndDumpStdTest "Constructors"
diff --git a/tests/SingletonsTestSuiteUtils.hs b/tests/SingletonsTestSuiteUtils.hs
--- a/tests/SingletonsTestSuiteUtils.hs
+++ b/tests/SingletonsTestSuiteUtils.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
 {-# LANGUAGE DeriveAnyClass #-}
 {-# LANGUAGE DerivingStrategies #-}
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
@@ -13,15 +12,13 @@
  ) where
 
 import Build_singletons   ( ghcPath, ghcFlags, rootDir          )
-import Control.Exception  ( Exception, throw                    )
-import Data.Foldable      ( asum )
-import Data.List          ( intercalate                         )
+import Control.Exception  ( Exception                           )
+import Data.Foldable      ( asum                                )
 import Data.Text          ( Text                                )
 import Data.String        ( IsString(fromString)                )
-import System.Exit        ( ExitCode(..)                        )
 import System.FilePath    ( takeBaseName, pathSeparator         )
-import System.IO          ( IOMode(..), hGetContents, openFile  )
 import System.FilePath    ( (</>)                               )
+import System.IO          ( IOMode(..), openFile                )
 import System.Process     ( CreateProcess(..), StdStream(..)
                           , createProcess, proc, waitForProcess
                           , callCommand                         )
@@ -38,9 +35,6 @@
 goldenPath :: FilePath
 goldenPath = rootDir </> "tests/compile-and-dump/"
 
-ghcVersion :: String
-ghcVersion = ".ghc88"
-
 -- GHC options used when running the tests
 ghcOpts :: [String]
 ghcOpts = ghcFlags ++ [
@@ -75,6 +69,7 @@
   , "-XTypeApplications"
   , "-XEmptyCase"
   , "-XNoStarIsType"
+  , "-XStandaloneKindSignatures"
   ]
 
 -- Compile a test using specified GHC options. Save output to file, normalize
@@ -94,7 +89,6 @@
       compileWithGHC
   where
     testPath         = testName ++ ".hs"
-    templateFilePath = goldenPath ++ testName ++ ghcVersion ++ ".template"
     goldenFilePath   = goldenPath ++ testName ++ ".golden"
     actualFilePath   = goldenPath ++ testName ++ ".actual"
 
@@ -105,9 +99,8 @@
                                               { std_out = UseHandle hActualFile
                                               , std_err = UseHandle hActualFile
                                               , cwd     = Just goldenPath }
-      _ <- waitForProcess pid      -- see Note [Ignore exit code]
+      _ <- waitForProcess pid        -- see Note [Ignore exit code]
       normalizeOutput actualFilePath -- see Note [Output normalization]
-      buildGoldenFile templateFilePath goldenFilePath
       return ()
 
 -- Compile-and-dump test using standard GHC options defined by the testsuite.
@@ -127,41 +120,40 @@
 testCompileAndDumpGroup testDir tests =
     testGroup testDir $ map ($ testDir) tests
 
--- Note [Ignore exit code]
--- ~~~~~~~~~~~~~~~~~~~~~~~
----- It may happen that compilation of a source file fails. We could find out
--- whether that happened by inspecting the exit code of GHC process. But it
--- would be tricky to get a helpful message from the failing test: we would need
--- to display stderr which we just wrote into a file. Luckliy we don't have to
--- do that - we can ignore the problem here and let the test fail when the
--- actual file is compared with the golden file.
+{-
+Note [Ignore exit code]
+~~~~~~~~~~~~~~~~~~~~~~~
+It may happen that the compilation of a source file fails. We could find out
+whether that happened by inspecting the exit code of the `ghc` process. But it
+would be tricky to get a helpful message from the failing test; we would need
+to display the stderr that we just wrote into a file. Luckliy, we don't have to
+do that - we can ignore the problem here and let the test fail when the
+actual file is compared with the golden file.
 
--- Note [Diff options]
--- ~~~~~~~~~~~~~~~~~~~
---
--- We use following diff options:
---  -w - Ignore all white space.
---  -B - Ignore changes whose lines are all blank.
+Note [Diff options]
+~~~~~~~~~~~~~~~~~~~
+We use following diff options:
+ -w - Ignore all white space.
+ -B - Ignore changes whose lines are all blank.
 
--- Note [Output normalization]
--- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
--- Output file is normalized inplace. Line numbers generated in splices:
---
---   Foo:(40,3)-(42,4)
---   Foo.hs:7:3:
---   Equals_1235967303
---
--- are turned into:
---
---   Foo:(0,0)-(0,0)
---   Foo.hs:0:0:
---   Equals_0123456789
---
--- This allows to insert comments into test file without the need to modify the
--- golden file to adjust line numbers.
---
+Note [Output normalization]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Output file is normalized inplace. Line numbers generated in splices:
 
+  Foo:(40,3)-(42,4)
+  Foo.hs:7:3:
+  Equals_1235967303
+
+are turned into:
+
+  Foo:(0,0)-(0,0)
+  Foo.hs:0:0:
+  Equals_0123456789
+
+This allows inserting comments into test files without the need to modify the
+golden file to adjust line numbers.
+-}
+
 normalizeOutput :: FilePath -> IO ()
 normalizeOutput file = Turtle.inplace pat (fromString file)
   where
@@ -182,28 +174,6 @@
     punctSym = Turtle.oneOf "!#$%&*+./>"
     numPeriod = zipWith const (cycle "0123456789876543210")
     d = Turtle.some Turtle.digit
-
-buildGoldenFile :: FilePath -> FilePath -> IO ()
-buildGoldenFile templateFilePath goldenFilePath = do
-  hGoldenFile <- openFile goldenFilePath WriteMode
-  runProcessWithOpts (UseHandle hGoldenFile) "awk"
-            [ "-f", goldenPath </> "buildGoldenFiles.awk"
-            , templateFilePath
-            ]
-
-runProcessWithOpts :: StdStream -> String -> [String] -> IO ()
-runProcessWithOpts stdout program opts = do
-  (_, _, Just serr, pid) <-
-      createProcess (proc "bash" ["-c", (intercalate " " (program : opts))])
-                    { std_out = stdout
-                    , std_err = CreatePipe }
-  ecode <- waitForProcess pid
-  case ecode of
-    ExitSuccess   -> return ()
-    ExitFailure _ -> do
-       err <- hGetContents serr -- Text would be faster than String, but this is
-                                -- a corner case so probably not worth it.
-       throw $ ProcessException ("Error when running " ++ program ++ ":\n" ++ err)
 
 cleanFiles :: IO ()
 cleanFiles = callCommand $ "rm -f " ++ rootDir </> "tests/compile-and-dump/*/*.{hi,o}"
diff --git a/tests/compile-and-dump/GradingClient/Database.ghc88.template b/tests/compile-and-dump/GradingClient/Database.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/GradingClient/Database.ghc88.template
+++ /dev/null
@@ -1,2663 +0,0 @@
-GradingClient/Database.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| data Nat
-            = Zero | Succ Nat
-            deriving (Eq, Ord) |]
-  ======>
-    data Nat
-      = Zero | Succ Nat
-      deriving (Eq, Ord)
-    type ZeroSym0 = Zero
-    type SuccSym1 (t0123456789876543210 :: Nat) =
-        Succ t0123456789876543210
-    instance SuppressUnusedWarnings SuccSym0 where
-      suppressUnusedWarnings = snd (((,) SuccSym0KindInference) ())
-    data SuccSym0 :: (~>) Nat Nat
-      where
-        SuccSym0KindInference :: forall t0123456789876543210
-                                        arg. SameKind (Apply SuccSym0 arg) (SuccSym1 arg) =>
-                                 SuccSym0 t0123456789876543210
-    type instance Apply SuccSym0 t0123456789876543210 = Succ t0123456789876543210
-    type family Compare_0123456789876543210 (a :: Nat) (a :: Nat) :: Ordering where
-      Compare_0123456789876543210 Zero Zero = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) '[]
-      Compare_0123456789876543210 (Succ a_0123456789876543210) (Succ b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) '[])
-      Compare_0123456789876543210 Zero (Succ _) = LTSym0
-      Compare_0123456789876543210 (Succ _) Zero = GTSym0
-    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
-        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
-    data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Nat) :: (~>) Nat Ordering
-      where
-        Compare_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                               a0123456789876543210
-                                                               arg. SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
-    data Compare_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Ordering)
-      where
-        Compare_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                               arg. SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
-                                                        Compare_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
-    instance POrd Nat where
-      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
-    type family Equals_0123456789876543210 (a :: Nat) (b :: Nat) :: Bool where
-      Equals_0123456789876543210 Zero Zero = TrueSym0
-      Equals_0123456789876543210 (Succ a) (Succ b) = (==) a b
-      Equals_0123456789876543210 (_ :: Nat) (_ :: Nat) = FalseSym0
-    instance PEq Nat where
-      type (==) a b = Equals_0123456789876543210 a b
-    data SNat :: Nat -> Type
-      where
-        SZero :: SNat Zero
-        SSucc :: forall (n :: Nat). (Sing (n :: Nat)) -> SNat (Succ n)
-    type instance Sing @Nat = SNat
-    instance SingKind Nat where
-      type Demote Nat = Nat
-      fromSing SZero = Zero
-      fromSing (SSucc b) = Succ (fromSing b)
-      toSing Zero = SomeSing SZero
-      toSing (Succ (b :: Demote Nat))
-        = case toSing b :: SomeSing Nat of {
-            SomeSing c -> SomeSing (SSucc c) }
-    instance SOrd Nat => SOrd Nat where
-      sCompare ::
-        forall (t1 :: Nat) (t2 :: Nat).
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply (CompareSym0 :: TyFun Nat ((~>) Nat Ordering)
-                                                 -> Type) t1) t2)
-      sCompare SZero SZero
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            SNil
-      sCompare
-        (SSucc (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        (SSucc (sB_0123456789876543210 :: Sing b_0123456789876543210))
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            ((applySing
-                ((applySing ((singFun2 @(:@#@$)) SCons))
-                   ((applySing
-                       ((applySing ((singFun2 @CompareSym0) sCompare))
-                          sA_0123456789876543210))
-                      sB_0123456789876543210)))
-               SNil)
-      sCompare SZero (SSucc _) = SLT
-      sCompare (SSucc _) SZero = SGT
-    instance SEq Nat => SEq Nat where
-      (%==) SZero SZero = STrue
-      (%==) SZero (SSucc _) = SFalse
-      (%==) (SSucc _) SZero = SFalse
-      (%==) (SSucc a) (SSucc b) = ((%==) a) b
-    instance SDecide Nat => SDecide Nat where
-      (%~) SZero SZero = Proved Refl
-      (%~) SZero (SSucc _) = Disproved (\ x -> case x of)
-      (%~) (SSucc _) SZero = Disproved (\ x -> case x of)
-      (%~) (SSucc a) (SSucc b)
-        = case ((%~) a) b of
-            Proved Refl -> Proved Refl
-            Disproved contra
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-    instance SDecide Nat =>
-             Data.Type.Equality.TestEquality (SNat :: Nat -> Type) where
-      Data.Type.Equality.testEquality
-        = Data.Singletons.Decide.decideEquality
-    instance SDecide Nat =>
-             Data.Type.Coercion.TestCoercion (SNat :: Nat -> Type) where
-      Data.Type.Coercion.testCoercion
-        = Data.Singletons.Decide.decideCoercion
-    instance SingI Zero where
-      sing = SZero
-    instance SingI n => SingI (Succ (n :: Nat)) where
-      sing = SSucc sing
-    instance SingI (SuccSym0 :: (~>) Nat Nat) where
-      sing = (singFun1 @SuccSym0) SSucc
-GradingClient/Database.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| append :: Schema -> Schema -> Schema
-          append (Sch s1) (Sch s2) = Sch (s1 ++ s2)
-          attrNotIn :: Attribute -> Schema -> Bool
-          attrNotIn _ (Sch []) = True
-          attrNotIn (Attr name u) (Sch ((Attr name' _) : t))
-            = (name /= name') && (attrNotIn (Attr name u) (Sch t))
-          disjoint :: Schema -> Schema -> Bool
-          disjoint (Sch []) _ = True
-          disjoint (Sch (h : t)) s = (attrNotIn h s) && (disjoint (Sch t) s)
-          occurs :: [AChar] -> Schema -> Bool
-          occurs _ (Sch []) = False
-          occurs name (Sch ((Attr name' _) : attrs))
-            = name == name' || occurs name (Sch attrs)
-          lookup :: [AChar] -> Schema -> U
-          lookup _ (Sch []) = undefined
-          lookup name (Sch ((Attr name' u) : attrs))
-            = if name == name' then u else lookup name (Sch attrs)
-          
-          data U
-            = BOOL | STRING | NAT | VEC U Nat
-            deriving (Read, Eq, Show)
-          data AChar
-            = CA |
-              CB |
-              CC |
-              CD |
-              CE |
-              CF |
-              CG |
-              CH |
-              CI |
-              CJ |
-              CK |
-              CL |
-              CM |
-              CN |
-              CO |
-              CP |
-              CQ |
-              CR |
-              CS |
-              CT |
-              CU |
-              CV |
-              CW |
-              CX |
-              CY |
-              CZ
-            deriving (Read, Show, Eq)
-          data Attribute = Attr [AChar] U
-          data Schema = Sch [Attribute] |]
-  ======>
-    data U
-      = BOOL | STRING | NAT | VEC U Nat
-      deriving (Read, Eq, Show)
-    data AChar
-      = CA |
-        CB |
-        CC |
-        CD |
-        CE |
-        CF |
-        CG |
-        CH |
-        CI |
-        CJ |
-        CK |
-        CL |
-        CM |
-        CN |
-        CO |
-        CP |
-        CQ |
-        CR |
-        CS |
-        CT |
-        CU |
-        CV |
-        CW |
-        CX |
-        CY |
-        CZ
-      deriving (Read, Show, Eq)
-    data Attribute = Attr [AChar] U
-    data Schema = Sch [Attribute]
-    append :: Schema -> Schema -> Schema
-    append (Sch s1) (Sch s2) = Sch (s1 ++ s2)
-    attrNotIn :: Attribute -> Schema -> Bool
-    attrNotIn _ (Sch []) = True
-    attrNotIn (Attr name u) (Sch (Attr name' _ : t))
-      = ((name /= name') && (attrNotIn ((Attr name) u)) (Sch t))
-    disjoint :: Schema -> Schema -> Bool
-    disjoint (Sch []) _ = True
-    disjoint (Sch (h : t)) s
-      = ((attrNotIn h) s && (disjoint (Sch t)) s)
-    occurs :: [AChar] -> Schema -> Bool
-    occurs _ (Sch []) = False
-    occurs name (Sch (Attr name' _ : attrs))
-      = ((name == name') || (occurs name) (Sch attrs))
-    lookup :: [AChar] -> Schema -> U
-    lookup _ (Sch []) = undefined
-    lookup name (Sch (Attr name' u : attrs))
-      = if (name == name') then u else (lookup name) (Sch attrs)
-    type BOOLSym0 = BOOL
-    type STRINGSym0 = STRING
-    type NATSym0 = NAT
-    type VECSym2 (t0123456789876543210 :: U) (t0123456789876543210 :: Nat) =
-        VEC t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (VECSym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) VECSym1KindInference) ())
-    data VECSym1 (t0123456789876543210 :: U) :: (~>) Nat U
-      where
-        VECSym1KindInference :: forall t0123456789876543210
-                                       t0123456789876543210
-                                       arg. SameKind (Apply (VECSym1 t0123456789876543210) arg) (VECSym2 t0123456789876543210 arg) =>
-                                VECSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (VECSym1 t0123456789876543210) t0123456789876543210 = VEC t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings VECSym0 where
-      suppressUnusedWarnings = snd (((,) VECSym0KindInference) ())
-    data VECSym0 :: (~>) U ((~>) Nat U)
-      where
-        VECSym0KindInference :: forall t0123456789876543210
-                                       arg. SameKind (Apply VECSym0 arg) (VECSym1 arg) =>
-                                VECSym0 t0123456789876543210
-    type instance Apply VECSym0 t0123456789876543210 = VECSym1 t0123456789876543210
-    type CASym0 = CA
-    type CBSym0 = CB
-    type CCSym0 = CC
-    type CDSym0 = CD
-    type CESym0 = CE
-    type CFSym0 = CF
-    type CGSym0 = CG
-    type CHSym0 = CH
-    type CISym0 = CI
-    type CJSym0 = CJ
-    type CKSym0 = CK
-    type CLSym0 = CL
-    type CMSym0 = CM
-    type CNSym0 = CN
-    type COSym0 = CO
-    type CPSym0 = CP
-    type CQSym0 = CQ
-    type CRSym0 = CR
-    type CSSym0 = CS
-    type CTSym0 = CT
-    type CUSym0 = CU
-    type CVSym0 = CV
-    type CWSym0 = CW
-    type CXSym0 = CX
-    type CYSym0 = CY
-    type CZSym0 = CZ
-    type AttrSym2 (t0123456789876543210 :: [AChar]) (t0123456789876543210 :: U) =
-        Attr t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (AttrSym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) AttrSym1KindInference) ())
-    data AttrSym1 (t0123456789876543210 :: [AChar]) :: (~>) U Attribute
-      where
-        AttrSym1KindInference :: forall t0123456789876543210
-                                        t0123456789876543210
-                                        arg. SameKind (Apply (AttrSym1 t0123456789876543210) arg) (AttrSym2 t0123456789876543210 arg) =>
-                                 AttrSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (AttrSym1 t0123456789876543210) t0123456789876543210 = Attr t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings AttrSym0 where
-      suppressUnusedWarnings = snd (((,) AttrSym0KindInference) ())
-    data AttrSym0 :: (~>) [AChar] ((~>) U Attribute)
-      where
-        AttrSym0KindInference :: forall t0123456789876543210
-                                        arg. SameKind (Apply AttrSym0 arg) (AttrSym1 arg) =>
-                                 AttrSym0 t0123456789876543210
-    type instance Apply AttrSym0 t0123456789876543210 = AttrSym1 t0123456789876543210
-    type SchSym1 (t0123456789876543210 :: [Attribute]) =
-        Sch t0123456789876543210
-    instance SuppressUnusedWarnings SchSym0 where
-      suppressUnusedWarnings = snd (((,) SchSym0KindInference) ())
-    data SchSym0 :: (~>) [Attribute] Schema
-      where
-        SchSym0KindInference :: forall t0123456789876543210
-                                       arg. SameKind (Apply SchSym0 arg) (SchSym1 arg) =>
-                                SchSym0 t0123456789876543210
-    type instance Apply SchSym0 t0123456789876543210 = Sch t0123456789876543210
-    type Let0123456789876543210Scrutinee_0123456789876543210Sym4 name0123456789876543210 name'0123456789876543210 u0123456789876543210 attrs0123456789876543210 =
-        Let0123456789876543210Scrutinee_0123456789876543210 name0123456789876543210 name'0123456789876543210 u0123456789876543210 attrs0123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210Scrutinee_0123456789876543210Sym3 u0123456789876543210 name'0123456789876543210 name0123456789876543210) where
-      suppressUnusedWarnings
-        = snd
-            (((,)
-                Let0123456789876543210Scrutinee_0123456789876543210Sym3KindInference)
-               ())
-    data Let0123456789876543210Scrutinee_0123456789876543210Sym3 name0123456789876543210 name'0123456789876543210 u0123456789876543210 attrs0123456789876543210
-      where
-        Let0123456789876543210Scrutinee_0123456789876543210Sym3KindInference :: forall name0123456789876543210
-                                                                                       name'0123456789876543210
-                                                                                       u0123456789876543210
-                                                                                       attrs0123456789876543210
-                                                                                       arg. SameKind (Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym3 name0123456789876543210 name'0123456789876543210 u0123456789876543210) arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym4 name0123456789876543210 name'0123456789876543210 u0123456789876543210 arg) =>
-                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym3 name0123456789876543210 name'0123456789876543210 u0123456789876543210 attrs0123456789876543210
-    type instance Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym3 u0123456789876543210 name'0123456789876543210 name0123456789876543210) attrs0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210 u0123456789876543210 name'0123456789876543210 name0123456789876543210 attrs0123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210Scrutinee_0123456789876543210Sym2 name'0123456789876543210 name0123456789876543210) where
-      suppressUnusedWarnings
-        = snd
-            (((,)
-                Let0123456789876543210Scrutinee_0123456789876543210Sym2KindInference)
-               ())
-    data Let0123456789876543210Scrutinee_0123456789876543210Sym2 name0123456789876543210 name'0123456789876543210 u0123456789876543210
-      where
-        Let0123456789876543210Scrutinee_0123456789876543210Sym2KindInference :: forall name0123456789876543210
-                                                                                       name'0123456789876543210
-                                                                                       u0123456789876543210
-                                                                                       arg. SameKind (Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym2 name0123456789876543210 name'0123456789876543210) arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym3 name0123456789876543210 name'0123456789876543210 arg) =>
-                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym2 name0123456789876543210 name'0123456789876543210 u0123456789876543210
-    type instance Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym2 name'0123456789876543210 name0123456789876543210) u0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym3 name'0123456789876543210 name0123456789876543210 u0123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210Scrutinee_0123456789876543210Sym1 name0123456789876543210) where
-      suppressUnusedWarnings
-        = snd
-            (((,)
-                Let0123456789876543210Scrutinee_0123456789876543210Sym1KindInference)
-               ())
-    data Let0123456789876543210Scrutinee_0123456789876543210Sym1 name0123456789876543210 name'0123456789876543210
-      where
-        Let0123456789876543210Scrutinee_0123456789876543210Sym1KindInference :: forall name0123456789876543210
-                                                                                       name'0123456789876543210
-                                                                                       arg. SameKind (Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym1 name0123456789876543210) arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym2 name0123456789876543210 arg) =>
-                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym1 name0123456789876543210 name'0123456789876543210
-    type instance Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym1 name0123456789876543210) name'0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym2 name0123456789876543210 name'0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210Scrutinee_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd
-            (((,)
-                Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference)
-               ())
-    data Let0123456789876543210Scrutinee_0123456789876543210Sym0 name0123456789876543210
-      where
-        Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference :: forall name0123456789876543210
-                                                                                       arg. SameKind (Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym1 arg) =>
-                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym0 name0123456789876543210
-    type instance Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 name0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym1 name0123456789876543210
-    type family Let0123456789876543210Scrutinee_0123456789876543210 name name' u attrs where
-      Let0123456789876543210Scrutinee_0123456789876543210 name name' u attrs = Apply (Apply (==@#@$) name) name'
-    type family Case_0123456789876543210 name name' u attrs t where
-      Case_0123456789876543210 name name' u attrs 'True = u
-      Case_0123456789876543210 name name' u attrs 'False = Apply (Apply LookupSym0 name) (Apply SchSym0 attrs)
-    type LookupSym2 (a0123456789876543210 :: [AChar]) (a0123456789876543210 :: Schema) =
-        Lookup a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (LookupSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) LookupSym1KindInference) ())
-    data LookupSym1 (a0123456789876543210 :: [AChar]) :: (~>) Schema U
-      where
-        LookupSym1KindInference :: forall a0123456789876543210
-                                          a0123456789876543210
-                                          arg. SameKind (Apply (LookupSym1 a0123456789876543210) arg) (LookupSym2 a0123456789876543210 arg) =>
-                                   LookupSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (LookupSym1 a0123456789876543210) a0123456789876543210 = Lookup a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings LookupSym0 where
-      suppressUnusedWarnings = snd (((,) LookupSym0KindInference) ())
-    data LookupSym0 :: (~>) [AChar] ((~>) Schema U)
-      where
-        LookupSym0KindInference :: forall a0123456789876543210
-                                          arg. SameKind (Apply LookupSym0 arg) (LookupSym1 arg) =>
-                                   LookupSym0 a0123456789876543210
-    type instance Apply LookupSym0 a0123456789876543210 = LookupSym1 a0123456789876543210
-    type OccursSym2 (a0123456789876543210 :: [AChar]) (a0123456789876543210 :: Schema) =
-        Occurs a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (OccursSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) OccursSym1KindInference) ())
-    data OccursSym1 (a0123456789876543210 :: [AChar]) :: (~>) Schema Bool
-      where
-        OccursSym1KindInference :: forall a0123456789876543210
-                                          a0123456789876543210
-                                          arg. SameKind (Apply (OccursSym1 a0123456789876543210) arg) (OccursSym2 a0123456789876543210 arg) =>
-                                   OccursSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (OccursSym1 a0123456789876543210) a0123456789876543210 = Occurs a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings OccursSym0 where
-      suppressUnusedWarnings = snd (((,) OccursSym0KindInference) ())
-    data OccursSym0 :: (~>) [AChar] ((~>) Schema Bool)
-      where
-        OccursSym0KindInference :: forall a0123456789876543210
-                                          arg. SameKind (Apply OccursSym0 arg) (OccursSym1 arg) =>
-                                   OccursSym0 a0123456789876543210
-    type instance Apply OccursSym0 a0123456789876543210 = OccursSym1 a0123456789876543210
-    type DisjointSym2 (a0123456789876543210 :: Schema) (a0123456789876543210 :: Schema) =
-        Disjoint a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (DisjointSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) DisjointSym1KindInference) ())
-    data DisjointSym1 (a0123456789876543210 :: Schema) :: (~>) Schema Bool
-      where
-        DisjointSym1KindInference :: forall a0123456789876543210
-                                            a0123456789876543210
-                                            arg. SameKind (Apply (DisjointSym1 a0123456789876543210) arg) (DisjointSym2 a0123456789876543210 arg) =>
-                                     DisjointSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (DisjointSym1 a0123456789876543210) a0123456789876543210 = Disjoint a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings DisjointSym0 where
-      suppressUnusedWarnings = snd (((,) DisjointSym0KindInference) ())
-    data DisjointSym0 :: (~>) Schema ((~>) Schema Bool)
-      where
-        DisjointSym0KindInference :: forall a0123456789876543210
-                                            arg. SameKind (Apply DisjointSym0 arg) (DisjointSym1 arg) =>
-                                     DisjointSym0 a0123456789876543210
-    type instance Apply DisjointSym0 a0123456789876543210 = DisjointSym1 a0123456789876543210
-    type AttrNotInSym2 (a0123456789876543210 :: Attribute) (a0123456789876543210 :: Schema) =
-        AttrNotIn a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (AttrNotInSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) AttrNotInSym1KindInference) ())
-    data AttrNotInSym1 (a0123456789876543210 :: Attribute) :: (~>) Schema Bool
-      where
-        AttrNotInSym1KindInference :: forall a0123456789876543210
-                                             a0123456789876543210
-                                             arg. SameKind (Apply (AttrNotInSym1 a0123456789876543210) arg) (AttrNotInSym2 a0123456789876543210 arg) =>
-                                      AttrNotInSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (AttrNotInSym1 a0123456789876543210) a0123456789876543210 = AttrNotIn a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings AttrNotInSym0 where
-      suppressUnusedWarnings = snd (((,) AttrNotInSym0KindInference) ())
-    data AttrNotInSym0 :: (~>) Attribute ((~>) Schema Bool)
-      where
-        AttrNotInSym0KindInference :: forall a0123456789876543210
-                                             arg. SameKind (Apply AttrNotInSym0 arg) (AttrNotInSym1 arg) =>
-                                      AttrNotInSym0 a0123456789876543210
-    type instance Apply AttrNotInSym0 a0123456789876543210 = AttrNotInSym1 a0123456789876543210
-    type AppendSym2 (a0123456789876543210 :: Schema) (a0123456789876543210 :: Schema) =
-        Append a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (AppendSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) AppendSym1KindInference) ())
-    data AppendSym1 (a0123456789876543210 :: Schema) :: (~>) Schema Schema
-      where
-        AppendSym1KindInference :: forall a0123456789876543210
-                                          a0123456789876543210
-                                          arg. SameKind (Apply (AppendSym1 a0123456789876543210) arg) (AppendSym2 a0123456789876543210 arg) =>
-                                   AppendSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (AppendSym1 a0123456789876543210) a0123456789876543210 = Append a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings AppendSym0 where
-      suppressUnusedWarnings = snd (((,) AppendSym0KindInference) ())
-    data AppendSym0 :: (~>) Schema ((~>) Schema Schema)
-      where
-        AppendSym0KindInference :: forall a0123456789876543210
-                                          arg. SameKind (Apply AppendSym0 arg) (AppendSym1 arg) =>
-                                   AppendSym0 a0123456789876543210
-    type instance Apply AppendSym0 a0123456789876543210 = AppendSym1 a0123456789876543210
-    type family Lookup (a :: [AChar]) (a :: Schema) :: U where
-      Lookup _ (Sch '[]) = UndefinedSym0
-      Lookup name (Sch ('(:) (Attr name' u) attrs)) = Case_0123456789876543210 name name' u attrs (Let0123456789876543210Scrutinee_0123456789876543210Sym4 name name' u attrs)
-    type family Occurs (a :: [AChar]) (a :: Schema) :: Bool where
-      Occurs _ (Sch '[]) = FalseSym0
-      Occurs name (Sch ('(:) (Attr name' _) attrs)) = Apply (Apply (||@#@$) (Apply (Apply (==@#@$) name) name')) (Apply (Apply OccursSym0 name) (Apply SchSym0 attrs))
-    type family Disjoint (a :: Schema) (a :: Schema) :: Bool where
-      Disjoint (Sch '[]) _ = TrueSym0
-      Disjoint (Sch ('(:) h t)) s = Apply (Apply (&&@#@$) (Apply (Apply AttrNotInSym0 h) s)) (Apply (Apply DisjointSym0 (Apply SchSym0 t)) s)
-    type family AttrNotIn (a :: Attribute) (a :: Schema) :: Bool where
-      AttrNotIn _ (Sch '[]) = TrueSym0
-      AttrNotIn (Attr name u) (Sch ('(:) (Attr name' _) t)) = Apply (Apply (&&@#@$) (Apply (Apply (/=@#@$) name) name')) (Apply (Apply AttrNotInSym0 (Apply (Apply AttrSym0 name) u)) (Apply SchSym0 t))
-    type family Append (a :: Schema) (a :: Schema) :: Schema where
-      Append (Sch s1) (Sch s2) = Apply SchSym0 (Apply (Apply (++@#@$) s1) s2)
-    type family ShowsPrec_0123456789876543210 (a :: GHC.Types.Nat) (a :: U) (a :: Symbol) :: Symbol where
-      ShowsPrec_0123456789876543210 _ BOOL a_0123456789876543210 = Apply (Apply ShowStringSym0 "BOOL") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ STRING a_0123456789876543210 = Apply (Apply ShowStringSym0 "STRING") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ NAT a_0123456789876543210 = Apply (Apply ShowStringSym0 "NAT") a_0123456789876543210
-      ShowsPrec_0123456789876543210 p_0123456789876543210 (VEC arg_0123456789876543210 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "VEC ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowSpaceSym0) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))))) a_0123456789876543210
-    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: U) (a0123456789876543210 :: Symbol) =
-        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
-    data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: U) :: (~>) Symbol Symbol
-      where
-        ShowsPrec_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
-    data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) :: (~>) U ((~>) Symbol Symbol)
-      where
-        ShowsPrec_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
-    data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) U ((~>) Symbol Symbol))
-      where
-        ShowsPrec_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
-    instance PShow U where
-      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
-    type family ShowsPrec_0123456789876543210 (a :: GHC.Types.Nat) (a :: AChar) (a :: Symbol) :: Symbol where
-      ShowsPrec_0123456789876543210 _ CA a_0123456789876543210 = Apply (Apply ShowStringSym0 "CA") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CB a_0123456789876543210 = Apply (Apply ShowStringSym0 "CB") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CC a_0123456789876543210 = Apply (Apply ShowStringSym0 "CC") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CD a_0123456789876543210 = Apply (Apply ShowStringSym0 "CD") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CE a_0123456789876543210 = Apply (Apply ShowStringSym0 "CE") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CF a_0123456789876543210 = Apply (Apply ShowStringSym0 "CF") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CG a_0123456789876543210 = Apply (Apply ShowStringSym0 "CG") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CH a_0123456789876543210 = Apply (Apply ShowStringSym0 "CH") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CI a_0123456789876543210 = Apply (Apply ShowStringSym0 "CI") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CJ a_0123456789876543210 = Apply (Apply ShowStringSym0 "CJ") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CK a_0123456789876543210 = Apply (Apply ShowStringSym0 "CK") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CL a_0123456789876543210 = Apply (Apply ShowStringSym0 "CL") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CM a_0123456789876543210 = Apply (Apply ShowStringSym0 "CM") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CN a_0123456789876543210 = Apply (Apply ShowStringSym0 "CN") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CO a_0123456789876543210 = Apply (Apply ShowStringSym0 "CO") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CP a_0123456789876543210 = Apply (Apply ShowStringSym0 "CP") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CQ a_0123456789876543210 = Apply (Apply ShowStringSym0 "CQ") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CR a_0123456789876543210 = Apply (Apply ShowStringSym0 "CR") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CS a_0123456789876543210 = Apply (Apply ShowStringSym0 "CS") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CT a_0123456789876543210 = Apply (Apply ShowStringSym0 "CT") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CU a_0123456789876543210 = Apply (Apply ShowStringSym0 "CU") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CV a_0123456789876543210 = Apply (Apply ShowStringSym0 "CV") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CW a_0123456789876543210 = Apply (Apply ShowStringSym0 "CW") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CX a_0123456789876543210 = Apply (Apply ShowStringSym0 "CX") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CY a_0123456789876543210 = Apply (Apply ShowStringSym0 "CY") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ CZ a_0123456789876543210 = Apply (Apply ShowStringSym0 "CZ") a_0123456789876543210
-    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: AChar) (a0123456789876543210 :: Symbol) =
-        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
-    data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: AChar) :: (~>) Symbol Symbol
-      where
-        ShowsPrec_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
-    data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) :: (~>) AChar ((~>) Symbol Symbol)
-      where
-        ShowsPrec_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
-    data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) AChar ((~>) Symbol Symbol))
-      where
-        ShowsPrec_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
-    instance PShow AChar where
-      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
-    type family Equals_0123456789876543210 (a :: U) (b :: U) :: Bool where
-      Equals_0123456789876543210 BOOL BOOL = TrueSym0
-      Equals_0123456789876543210 STRING STRING = TrueSym0
-      Equals_0123456789876543210 NAT NAT = TrueSym0
-      Equals_0123456789876543210 (VEC a a) (VEC b b) = (&&) ((==) a b) ((==) a b)
-      Equals_0123456789876543210 (_ :: U) (_ :: U) = FalseSym0
-    instance PEq U where
-      type (==) a b = Equals_0123456789876543210 a b
-    type family Equals_0123456789876543210 (a :: AChar) (b :: AChar) :: Bool where
-      Equals_0123456789876543210 CA CA = TrueSym0
-      Equals_0123456789876543210 CB CB = TrueSym0
-      Equals_0123456789876543210 CC CC = TrueSym0
-      Equals_0123456789876543210 CD CD = TrueSym0
-      Equals_0123456789876543210 CE CE = TrueSym0
-      Equals_0123456789876543210 CF CF = TrueSym0
-      Equals_0123456789876543210 CG CG = TrueSym0
-      Equals_0123456789876543210 CH CH = TrueSym0
-      Equals_0123456789876543210 CI CI = TrueSym0
-      Equals_0123456789876543210 CJ CJ = TrueSym0
-      Equals_0123456789876543210 CK CK = TrueSym0
-      Equals_0123456789876543210 CL CL = TrueSym0
-      Equals_0123456789876543210 CM CM = TrueSym0
-      Equals_0123456789876543210 CN CN = TrueSym0
-      Equals_0123456789876543210 CO CO = TrueSym0
-      Equals_0123456789876543210 CP CP = TrueSym0
-      Equals_0123456789876543210 CQ CQ = TrueSym0
-      Equals_0123456789876543210 CR CR = TrueSym0
-      Equals_0123456789876543210 CS CS = TrueSym0
-      Equals_0123456789876543210 CT CT = TrueSym0
-      Equals_0123456789876543210 CU CU = TrueSym0
-      Equals_0123456789876543210 CV CV = TrueSym0
-      Equals_0123456789876543210 CW CW = TrueSym0
-      Equals_0123456789876543210 CX CX = TrueSym0
-      Equals_0123456789876543210 CY CY = TrueSym0
-      Equals_0123456789876543210 CZ CZ = TrueSym0
-      Equals_0123456789876543210 (_ :: AChar) (_ :: AChar) = FalseSym0
-    instance PEq AChar where
-      type (==) a b = Equals_0123456789876543210 a b
-    sLookup ::
-      forall (t :: [AChar]) (t :: Schema).
-      Sing t -> Sing t -> Sing (Apply (Apply LookupSym0 t) t :: U)
-    sOccurs ::
-      forall (t :: [AChar]) (t :: Schema).
-      Sing t -> Sing t -> Sing (Apply (Apply OccursSym0 t) t :: Bool)
-    sDisjoint ::
-      forall (t :: Schema) (t :: Schema).
-      Sing t -> Sing t -> Sing (Apply (Apply DisjointSym0 t) t :: Bool)
-    sAttrNotIn ::
-      forall (t :: Attribute) (t :: Schema).
-      Sing t -> Sing t -> Sing (Apply (Apply AttrNotInSym0 t) t :: Bool)
-    sAppend ::
-      forall (t :: Schema) (t :: Schema).
-      Sing t -> Sing t -> Sing (Apply (Apply AppendSym0 t) t :: Schema)
-    sLookup _ (SSch SNil) = sUndefined
-    sLookup
-      (sName :: Sing name)
-      (SSch (SCons (SAttr (sName' :: Sing name') (sU :: Sing u))
-                   (sAttrs :: Sing attrs)))
-      = let
-          sScrutinee_0123456789876543210 ::
-            Sing (Let0123456789876543210Scrutinee_0123456789876543210Sym4 name name' u attrs)
-          sScrutinee_0123456789876543210
-            = (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sName))
-                sName'
-        in
-          (GHC.Base.id
-             @(Sing (Case_0123456789876543210 name name' u attrs (Let0123456789876543210Scrutinee_0123456789876543210Sym4 name name' u attrs) :: U)))
-            (case sScrutinee_0123456789876543210 of
-               STrue -> sU
-               SFalse
-                 -> (applySing ((applySing ((singFun2 @LookupSym0) sLookup)) sName))
-                      ((applySing ((singFun1 @SchSym0) SSch)) sAttrs))
-    sOccurs _ (SSch SNil) = SFalse
-    sOccurs
-      (sName :: Sing name)
-      (SSch (SCons (SAttr (sName' :: Sing name') _)
-                   (sAttrs :: Sing attrs)))
-      = (applySing
-           ((applySing ((singFun2 @(||@#@$)) (%||)))
-              ((applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sName))
-                 sName')))
-          ((applySing ((applySing ((singFun2 @OccursSym0) sOccurs)) sName))
-             ((applySing ((singFun1 @SchSym0) SSch)) sAttrs))
-    sDisjoint (SSch SNil) _ = STrue
-    sDisjoint
-      (SSch (SCons (sH :: Sing h) (sT :: Sing t)))
-      (sS :: Sing s)
-      = (applySing
-           ((applySing ((singFun2 @(&&@#@$)) (%&&)))
-              ((applySing
-                  ((applySing ((singFun2 @AttrNotInSym0) sAttrNotIn)) sH))
-                 sS)))
-          ((applySing
-              ((applySing ((singFun2 @DisjointSym0) sDisjoint))
-                 ((applySing ((singFun1 @SchSym0) SSch)) sT)))
-             sS)
-    sAttrNotIn _ (SSch SNil) = STrue
-    sAttrNotIn
-      (SAttr (sName :: Sing name) (sU :: Sing u))
-      (SSch (SCons (SAttr (sName' :: Sing name') _) (sT :: Sing t)))
-      = (applySing
-           ((applySing ((singFun2 @(&&@#@$)) (%&&)))
-              ((applySing ((applySing ((singFun2 @(/=@#@$)) (%/=))) sName))
-                 sName')))
-          ((applySing
-              ((applySing ((singFun2 @AttrNotInSym0) sAttrNotIn))
-                 ((applySing ((applySing ((singFun2 @AttrSym0) SAttr)) sName)) sU)))
-             ((applySing ((singFun1 @SchSym0) SSch)) sT))
-    sAppend (SSch (sS1 :: Sing s1)) (SSch (sS2 :: Sing s2))
-      = (applySing ((singFun1 @SchSym0) SSch))
-          ((applySing ((applySing ((singFun2 @(++@#@$)) (%++))) sS1)) sS2)
-    instance SingI (LookupSym0 :: (~>) [AChar] ((~>) Schema U)) where
-      sing = (singFun2 @LookupSym0) sLookup
-    instance SingI d =>
-             SingI (LookupSym1 (d :: [AChar]) :: (~>) Schema U) where
-      sing = (singFun1 @(LookupSym1 (d :: [AChar]))) (sLookup (sing @d))
-    instance SingI (OccursSym0 :: (~>) [AChar] ((~>) Schema Bool)) where
-      sing = (singFun2 @OccursSym0) sOccurs
-    instance SingI d =>
-             SingI (OccursSym1 (d :: [AChar]) :: (~>) Schema Bool) where
-      sing = (singFun1 @(OccursSym1 (d :: [AChar]))) (sOccurs (sing @d))
-    instance SingI (DisjointSym0 :: (~>) Schema ((~>) Schema Bool)) where
-      sing = (singFun2 @DisjointSym0) sDisjoint
-    instance SingI d =>
-             SingI (DisjointSym1 (d :: Schema) :: (~>) Schema Bool) where
-      sing
-        = (singFun1 @(DisjointSym1 (d :: Schema))) (sDisjoint (sing @d))
-    instance SingI (AttrNotInSym0 :: (~>) Attribute ((~>) Schema Bool)) where
-      sing = (singFun2 @AttrNotInSym0) sAttrNotIn
-    instance SingI d =>
-             SingI (AttrNotInSym1 (d :: Attribute) :: (~>) Schema Bool) where
-      sing
-        = (singFun1 @(AttrNotInSym1 (d :: Attribute)))
-            (sAttrNotIn (sing @d))
-    instance SingI (AppendSym0 :: (~>) Schema ((~>) Schema Schema)) where
-      sing = (singFun2 @AppendSym0) sAppend
-    instance SingI d =>
-             SingI (AppendSym1 (d :: Schema) :: (~>) Schema Schema) where
-      sing = (singFun1 @(AppendSym1 (d :: Schema))) (sAppend (sing @d))
-    data SU :: U -> Type
-      where
-        SBOOL :: SU BOOL
-        SSTRING :: SU STRING
-        SNAT :: SU NAT
-        SVEC :: forall (n :: U) (n :: Nat).
-                (Sing (n :: U)) -> (Sing (n :: Nat)) -> SU (VEC n n)
-    type instance Sing @U = SU
-    instance SingKind U where
-      type Demote U = U
-      fromSing SBOOL = BOOL
-      fromSing SSTRING = STRING
-      fromSing SNAT = NAT
-      fromSing (SVEC b b) = (VEC (fromSing b)) (fromSing b)
-      toSing BOOL = SomeSing SBOOL
-      toSing STRING = SomeSing SSTRING
-      toSing NAT = SomeSing SNAT
-      toSing (VEC (b :: Demote U) (b :: Demote Nat))
-        = case
-              ((,) (toSing b :: SomeSing U)) (toSing b :: SomeSing Nat)
-          of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SVEC c) c) }
-    data SAChar :: AChar -> Type
-      where
-        SCA :: SAChar CA
-        SCB :: SAChar CB
-        SCC :: SAChar CC
-        SCD :: SAChar CD
-        SCE :: SAChar CE
-        SCF :: SAChar CF
-        SCG :: SAChar CG
-        SCH :: SAChar CH
-        SCI :: SAChar CI
-        SCJ :: SAChar CJ
-        SCK :: SAChar CK
-        SCL :: SAChar CL
-        SCM :: SAChar CM
-        SCN :: SAChar CN
-        SCO :: SAChar CO
-        SCP :: SAChar CP
-        SCQ :: SAChar CQ
-        SCR :: SAChar CR
-        SCS :: SAChar CS
-        SCT :: SAChar CT
-        SCU :: SAChar CU
-        SCV :: SAChar CV
-        SCW :: SAChar CW
-        SCX :: SAChar CX
-        SCY :: SAChar CY
-        SCZ :: SAChar CZ
-    type instance Sing @AChar = SAChar
-    instance SingKind AChar where
-      type Demote AChar = AChar
-      fromSing SCA = CA
-      fromSing SCB = CB
-      fromSing SCC = CC
-      fromSing SCD = CD
-      fromSing SCE = CE
-      fromSing SCF = CF
-      fromSing SCG = CG
-      fromSing SCH = CH
-      fromSing SCI = CI
-      fromSing SCJ = CJ
-      fromSing SCK = CK
-      fromSing SCL = CL
-      fromSing SCM = CM
-      fromSing SCN = CN
-      fromSing SCO = CO
-      fromSing SCP = CP
-      fromSing SCQ = CQ
-      fromSing SCR = CR
-      fromSing SCS = CS
-      fromSing SCT = CT
-      fromSing SCU = CU
-      fromSing SCV = CV
-      fromSing SCW = CW
-      fromSing SCX = CX
-      fromSing SCY = CY
-      fromSing SCZ = CZ
-      toSing CA = SomeSing SCA
-      toSing CB = SomeSing SCB
-      toSing CC = SomeSing SCC
-      toSing CD = SomeSing SCD
-      toSing CE = SomeSing SCE
-      toSing CF = SomeSing SCF
-      toSing CG = SomeSing SCG
-      toSing CH = SomeSing SCH
-      toSing CI = SomeSing SCI
-      toSing CJ = SomeSing SCJ
-      toSing CK = SomeSing SCK
-      toSing CL = SomeSing SCL
-      toSing CM = SomeSing SCM
-      toSing CN = SomeSing SCN
-      toSing CO = SomeSing SCO
-      toSing CP = SomeSing SCP
-      toSing CQ = SomeSing SCQ
-      toSing CR = SomeSing SCR
-      toSing CS = SomeSing SCS
-      toSing CT = SomeSing SCT
-      toSing CU = SomeSing SCU
-      toSing CV = SomeSing SCV
-      toSing CW = SomeSing SCW
-      toSing CX = SomeSing SCX
-      toSing CY = SomeSing SCY
-      toSing CZ = SomeSing SCZ
-    data SAttribute :: Attribute -> Type
-      where
-        SAttr :: forall (n :: [AChar]) (n :: U).
-                 (Sing (n :: [AChar])) -> (Sing (n :: U)) -> SAttribute (Attr n n)
-    type instance Sing @Attribute = SAttribute
-    instance SingKind Attribute where
-      type Demote Attribute = Attribute
-      fromSing (SAttr b b) = (Attr (fromSing b)) (fromSing b)
-      toSing (Attr (b :: Demote [AChar]) (b :: Demote U))
-        = case
-              ((,) (toSing b :: SomeSing [AChar])) (toSing b :: SomeSing U)
-          of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SAttr c) c) }
-    data SSchema :: Schema -> Type
-      where
-        SSch :: forall (n :: [Attribute]).
-                (Sing (n :: [Attribute])) -> SSchema (Sch n)
-    type instance Sing @Schema = SSchema
-    instance SingKind Schema where
-      type Demote Schema = Schema
-      fromSing (SSch b) = Sch (fromSing b)
-      toSing (Sch (b :: Demote [Attribute]))
-        = case toSing b :: SomeSing [Attribute] of {
-            SomeSing c -> SomeSing (SSch c) }
-    instance (SShow U, SShow Nat) => SShow U where
-      sShowsPrec ::
-        forall (t1 :: GHC.Types.Nat) (t2 :: U) (t3 :: Symbol).
-        Sing t1
-        -> Sing t2
-           -> Sing t3
-              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) U ((~>) Symbol Symbol))
-                                                             -> Type) t1) t2) t3)
-      sShowsPrec
-        _
-        SBOOL
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "BOOL")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SSTRING
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "STRING")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SNAT
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "NAT")))
-            sA_0123456789876543210
-      sShowsPrec
-        (sP_0123456789876543210 :: Sing p_0123456789876543210)
-        (SVEC (sArg_0123456789876543210 :: Sing arg_0123456789876543210)
-              (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
-                    ((applySing
-                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
-                       (sFromInteger (sing :: Sing 10)))))
-                ((applySing
-                    ((applySing ((singFun3 @(.@#@$)) (%.)))
-                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                          (sing :: Sing "VEC "))))
-                   ((applySing
-                       ((applySing ((singFun3 @(.@#@$)) (%.)))
-                          ((applySing
-                              ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                                 (sFromInteger (sing :: Sing 11))))
-                             sArg_0123456789876543210)))
-                      ((applySing
-                          ((applySing ((singFun3 @(.@#@$)) (%.)))
-                             ((singFun1 @ShowSpaceSym0) sShowSpace)))
-                         ((applySing
-                             ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                                (sFromInteger (sing :: Sing 11))))
-                            sArg_0123456789876543210))))))
-            sA_0123456789876543210
-    instance SShow AChar where
-      sShowsPrec ::
-        forall (t1 :: GHC.Types.Nat) (t2 :: AChar) (t3 :: Symbol).
-        Sing t1
-        -> Sing t2
-           -> Sing t3
-              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) AChar ((~>) Symbol Symbol))
-                                                             -> Type) t1) t2) t3)
-      sShowsPrec
-        _
-        SCA
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CA")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCB
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CB")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCC
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CC")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCD
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CD")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCE
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CE")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCF
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CF")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCG
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CG")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCH
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CH")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCI
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CI")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCJ
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CJ")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCK
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CK")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCL
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CL")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCM
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CM")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCN
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CN")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCO
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CO")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCP
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CP")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCQ
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CQ")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCR
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CR")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCS
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CS")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCT
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CT")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCU
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CU")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCV
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CV")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCW
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CW")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCX
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CX")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCY
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CY")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SCZ
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "CZ")))
-            sA_0123456789876543210
-    instance (SEq U, SEq Nat) => SEq U where
-      (%==) SBOOL SBOOL = STrue
-      (%==) SBOOL SSTRING = SFalse
-      (%==) SBOOL SNAT = SFalse
-      (%==) SBOOL (SVEC _ _) = SFalse
-      (%==) SSTRING SBOOL = SFalse
-      (%==) SSTRING SSTRING = STrue
-      (%==) SSTRING SNAT = SFalse
-      (%==) SSTRING (SVEC _ _) = SFalse
-      (%==) SNAT SBOOL = SFalse
-      (%==) SNAT SSTRING = SFalse
-      (%==) SNAT SNAT = STrue
-      (%==) SNAT (SVEC _ _) = SFalse
-      (%==) (SVEC _ _) SBOOL = SFalse
-      (%==) (SVEC _ _) SSTRING = SFalse
-      (%==) (SVEC _ _) SNAT = SFalse
-      (%==) (SVEC a a) (SVEC b b) = ((%&&) (((%==) a) b)) (((%==) a) b)
-    instance (SDecide U, SDecide Nat) => SDecide U where
-      (%~) SBOOL SBOOL = Proved Refl
-      (%~) SBOOL SSTRING = Disproved (\ x -> case x of)
-      (%~) SBOOL SNAT = Disproved (\ x -> case x of)
-      (%~) SBOOL (SVEC _ _) = Disproved (\ x -> case x of)
-      (%~) SSTRING SBOOL = Disproved (\ x -> case x of)
-      (%~) SSTRING SSTRING = Proved Refl
-      (%~) SSTRING SNAT = Disproved (\ x -> case x of)
-      (%~) SSTRING (SVEC _ _) = Disproved (\ x -> case x of)
-      (%~) SNAT SBOOL = Disproved (\ x -> case x of)
-      (%~) SNAT SSTRING = Disproved (\ x -> case x of)
-      (%~) SNAT SNAT = Proved Refl
-      (%~) SNAT (SVEC _ _) = Disproved (\ x -> case x of)
-      (%~) (SVEC _ _) SBOOL = Disproved (\ x -> case x of)
-      (%~) (SVEC _ _) SSTRING = Disproved (\ x -> case x of)
-      (%~) (SVEC _ _) SNAT = Disproved (\ x -> case x of)
-      (%~) (SVEC a a) (SVEC b b)
-        = case ((,) (((%~) a) b)) (((%~) a) b) of
-            (,) (Proved Refl) (Proved Refl) -> Proved Refl
-            (,) (Disproved contra) _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,) _ (Disproved contra)
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-    instance (SDecide U, SDecide Nat) =>
-             Data.Type.Equality.TestEquality (SU :: U -> Type) where
-      Data.Type.Equality.testEquality
-        = Data.Singletons.Decide.decideEquality
-    instance (SDecide U, SDecide Nat) =>
-             Data.Type.Coercion.TestCoercion (SU :: U -> Type) where
-      Data.Type.Coercion.testCoercion
-        = Data.Singletons.Decide.decideCoercion
-    instance SEq AChar where
-      (%==) SCA SCA = STrue
-      (%==) SCA SCB = SFalse
-      (%==) SCA SCC = SFalse
-      (%==) SCA SCD = SFalse
-      (%==) SCA SCE = SFalse
-      (%==) SCA SCF = SFalse
-      (%==) SCA SCG = SFalse
-      (%==) SCA SCH = SFalse
-      (%==) SCA SCI = SFalse
-      (%==) SCA SCJ = SFalse
-      (%==) SCA SCK = SFalse
-      (%==) SCA SCL = SFalse
-      (%==) SCA SCM = SFalse
-      (%==) SCA SCN = SFalse
-      (%==) SCA SCO = SFalse
-      (%==) SCA SCP = SFalse
-      (%==) SCA SCQ = SFalse
-      (%==) SCA SCR = SFalse
-      (%==) SCA SCS = SFalse
-      (%==) SCA SCT = SFalse
-      (%==) SCA SCU = SFalse
-      (%==) SCA SCV = SFalse
-      (%==) SCA SCW = SFalse
-      (%==) SCA SCX = SFalse
-      (%==) SCA SCY = SFalse
-      (%==) SCA SCZ = SFalse
-      (%==) SCB SCA = SFalse
-      (%==) SCB SCB = STrue
-      (%==) SCB SCC = SFalse
-      (%==) SCB SCD = SFalse
-      (%==) SCB SCE = SFalse
-      (%==) SCB SCF = SFalse
-      (%==) SCB SCG = SFalse
-      (%==) SCB SCH = SFalse
-      (%==) SCB SCI = SFalse
-      (%==) SCB SCJ = SFalse
-      (%==) SCB SCK = SFalse
-      (%==) SCB SCL = SFalse
-      (%==) SCB SCM = SFalse
-      (%==) SCB SCN = SFalse
-      (%==) SCB SCO = SFalse
-      (%==) SCB SCP = SFalse
-      (%==) SCB SCQ = SFalse
-      (%==) SCB SCR = SFalse
-      (%==) SCB SCS = SFalse
-      (%==) SCB SCT = SFalse
-      (%==) SCB SCU = SFalse
-      (%==) SCB SCV = SFalse
-      (%==) SCB SCW = SFalse
-      (%==) SCB SCX = SFalse
-      (%==) SCB SCY = SFalse
-      (%==) SCB SCZ = SFalse
-      (%==) SCC SCA = SFalse
-      (%==) SCC SCB = SFalse
-      (%==) SCC SCC = STrue
-      (%==) SCC SCD = SFalse
-      (%==) SCC SCE = SFalse
-      (%==) SCC SCF = SFalse
-      (%==) SCC SCG = SFalse
-      (%==) SCC SCH = SFalse
-      (%==) SCC SCI = SFalse
-      (%==) SCC SCJ = SFalse
-      (%==) SCC SCK = SFalse
-      (%==) SCC SCL = SFalse
-      (%==) SCC SCM = SFalse
-      (%==) SCC SCN = SFalse
-      (%==) SCC SCO = SFalse
-      (%==) SCC SCP = SFalse
-      (%==) SCC SCQ = SFalse
-      (%==) SCC SCR = SFalse
-      (%==) SCC SCS = SFalse
-      (%==) SCC SCT = SFalse
-      (%==) SCC SCU = SFalse
-      (%==) SCC SCV = SFalse
-      (%==) SCC SCW = SFalse
-      (%==) SCC SCX = SFalse
-      (%==) SCC SCY = SFalse
-      (%==) SCC SCZ = SFalse
-      (%==) SCD SCA = SFalse
-      (%==) SCD SCB = SFalse
-      (%==) SCD SCC = SFalse
-      (%==) SCD SCD = STrue
-      (%==) SCD SCE = SFalse
-      (%==) SCD SCF = SFalse
-      (%==) SCD SCG = SFalse
-      (%==) SCD SCH = SFalse
-      (%==) SCD SCI = SFalse
-      (%==) SCD SCJ = SFalse
-      (%==) SCD SCK = SFalse
-      (%==) SCD SCL = SFalse
-      (%==) SCD SCM = SFalse
-      (%==) SCD SCN = SFalse
-      (%==) SCD SCO = SFalse
-      (%==) SCD SCP = SFalse
-      (%==) SCD SCQ = SFalse
-      (%==) SCD SCR = SFalse
-      (%==) SCD SCS = SFalse
-      (%==) SCD SCT = SFalse
-      (%==) SCD SCU = SFalse
-      (%==) SCD SCV = SFalse
-      (%==) SCD SCW = SFalse
-      (%==) SCD SCX = SFalse
-      (%==) SCD SCY = SFalse
-      (%==) SCD SCZ = SFalse
-      (%==) SCE SCA = SFalse
-      (%==) SCE SCB = SFalse
-      (%==) SCE SCC = SFalse
-      (%==) SCE SCD = SFalse
-      (%==) SCE SCE = STrue
-      (%==) SCE SCF = SFalse
-      (%==) SCE SCG = SFalse
-      (%==) SCE SCH = SFalse
-      (%==) SCE SCI = SFalse
-      (%==) SCE SCJ = SFalse
-      (%==) SCE SCK = SFalse
-      (%==) SCE SCL = SFalse
-      (%==) SCE SCM = SFalse
-      (%==) SCE SCN = SFalse
-      (%==) SCE SCO = SFalse
-      (%==) SCE SCP = SFalse
-      (%==) SCE SCQ = SFalse
-      (%==) SCE SCR = SFalse
-      (%==) SCE SCS = SFalse
-      (%==) SCE SCT = SFalse
-      (%==) SCE SCU = SFalse
-      (%==) SCE SCV = SFalse
-      (%==) SCE SCW = SFalse
-      (%==) SCE SCX = SFalse
-      (%==) SCE SCY = SFalse
-      (%==) SCE SCZ = SFalse
-      (%==) SCF SCA = SFalse
-      (%==) SCF SCB = SFalse
-      (%==) SCF SCC = SFalse
-      (%==) SCF SCD = SFalse
-      (%==) SCF SCE = SFalse
-      (%==) SCF SCF = STrue
-      (%==) SCF SCG = SFalse
-      (%==) SCF SCH = SFalse
-      (%==) SCF SCI = SFalse
-      (%==) SCF SCJ = SFalse
-      (%==) SCF SCK = SFalse
-      (%==) SCF SCL = SFalse
-      (%==) SCF SCM = SFalse
-      (%==) SCF SCN = SFalse
-      (%==) SCF SCO = SFalse
-      (%==) SCF SCP = SFalse
-      (%==) SCF SCQ = SFalse
-      (%==) SCF SCR = SFalse
-      (%==) SCF SCS = SFalse
-      (%==) SCF SCT = SFalse
-      (%==) SCF SCU = SFalse
-      (%==) SCF SCV = SFalse
-      (%==) SCF SCW = SFalse
-      (%==) SCF SCX = SFalse
-      (%==) SCF SCY = SFalse
-      (%==) SCF SCZ = SFalse
-      (%==) SCG SCA = SFalse
-      (%==) SCG SCB = SFalse
-      (%==) SCG SCC = SFalse
-      (%==) SCG SCD = SFalse
-      (%==) SCG SCE = SFalse
-      (%==) SCG SCF = SFalse
-      (%==) SCG SCG = STrue
-      (%==) SCG SCH = SFalse
-      (%==) SCG SCI = SFalse
-      (%==) SCG SCJ = SFalse
-      (%==) SCG SCK = SFalse
-      (%==) SCG SCL = SFalse
-      (%==) SCG SCM = SFalse
-      (%==) SCG SCN = SFalse
-      (%==) SCG SCO = SFalse
-      (%==) SCG SCP = SFalse
-      (%==) SCG SCQ = SFalse
-      (%==) SCG SCR = SFalse
-      (%==) SCG SCS = SFalse
-      (%==) SCG SCT = SFalse
-      (%==) SCG SCU = SFalse
-      (%==) SCG SCV = SFalse
-      (%==) SCG SCW = SFalse
-      (%==) SCG SCX = SFalse
-      (%==) SCG SCY = SFalse
-      (%==) SCG SCZ = SFalse
-      (%==) SCH SCA = SFalse
-      (%==) SCH SCB = SFalse
-      (%==) SCH SCC = SFalse
-      (%==) SCH SCD = SFalse
-      (%==) SCH SCE = SFalse
-      (%==) SCH SCF = SFalse
-      (%==) SCH SCG = SFalse
-      (%==) SCH SCH = STrue
-      (%==) SCH SCI = SFalse
-      (%==) SCH SCJ = SFalse
-      (%==) SCH SCK = SFalse
-      (%==) SCH SCL = SFalse
-      (%==) SCH SCM = SFalse
-      (%==) SCH SCN = SFalse
-      (%==) SCH SCO = SFalse
-      (%==) SCH SCP = SFalse
-      (%==) SCH SCQ = SFalse
-      (%==) SCH SCR = SFalse
-      (%==) SCH SCS = SFalse
-      (%==) SCH SCT = SFalse
-      (%==) SCH SCU = SFalse
-      (%==) SCH SCV = SFalse
-      (%==) SCH SCW = SFalse
-      (%==) SCH SCX = SFalse
-      (%==) SCH SCY = SFalse
-      (%==) SCH SCZ = SFalse
-      (%==) SCI SCA = SFalse
-      (%==) SCI SCB = SFalse
-      (%==) SCI SCC = SFalse
-      (%==) SCI SCD = SFalse
-      (%==) SCI SCE = SFalse
-      (%==) SCI SCF = SFalse
-      (%==) SCI SCG = SFalse
-      (%==) SCI SCH = SFalse
-      (%==) SCI SCI = STrue
-      (%==) SCI SCJ = SFalse
-      (%==) SCI SCK = SFalse
-      (%==) SCI SCL = SFalse
-      (%==) SCI SCM = SFalse
-      (%==) SCI SCN = SFalse
-      (%==) SCI SCO = SFalse
-      (%==) SCI SCP = SFalse
-      (%==) SCI SCQ = SFalse
-      (%==) SCI SCR = SFalse
-      (%==) SCI SCS = SFalse
-      (%==) SCI SCT = SFalse
-      (%==) SCI SCU = SFalse
-      (%==) SCI SCV = SFalse
-      (%==) SCI SCW = SFalse
-      (%==) SCI SCX = SFalse
-      (%==) SCI SCY = SFalse
-      (%==) SCI SCZ = SFalse
-      (%==) SCJ SCA = SFalse
-      (%==) SCJ SCB = SFalse
-      (%==) SCJ SCC = SFalse
-      (%==) SCJ SCD = SFalse
-      (%==) SCJ SCE = SFalse
-      (%==) SCJ SCF = SFalse
-      (%==) SCJ SCG = SFalse
-      (%==) SCJ SCH = SFalse
-      (%==) SCJ SCI = SFalse
-      (%==) SCJ SCJ = STrue
-      (%==) SCJ SCK = SFalse
-      (%==) SCJ SCL = SFalse
-      (%==) SCJ SCM = SFalse
-      (%==) SCJ SCN = SFalse
-      (%==) SCJ SCO = SFalse
-      (%==) SCJ SCP = SFalse
-      (%==) SCJ SCQ = SFalse
-      (%==) SCJ SCR = SFalse
-      (%==) SCJ SCS = SFalse
-      (%==) SCJ SCT = SFalse
-      (%==) SCJ SCU = SFalse
-      (%==) SCJ SCV = SFalse
-      (%==) SCJ SCW = SFalse
-      (%==) SCJ SCX = SFalse
-      (%==) SCJ SCY = SFalse
-      (%==) SCJ SCZ = SFalse
-      (%==) SCK SCA = SFalse
-      (%==) SCK SCB = SFalse
-      (%==) SCK SCC = SFalse
-      (%==) SCK SCD = SFalse
-      (%==) SCK SCE = SFalse
-      (%==) SCK SCF = SFalse
-      (%==) SCK SCG = SFalse
-      (%==) SCK SCH = SFalse
-      (%==) SCK SCI = SFalse
-      (%==) SCK SCJ = SFalse
-      (%==) SCK SCK = STrue
-      (%==) SCK SCL = SFalse
-      (%==) SCK SCM = SFalse
-      (%==) SCK SCN = SFalse
-      (%==) SCK SCO = SFalse
-      (%==) SCK SCP = SFalse
-      (%==) SCK SCQ = SFalse
-      (%==) SCK SCR = SFalse
-      (%==) SCK SCS = SFalse
-      (%==) SCK SCT = SFalse
-      (%==) SCK SCU = SFalse
-      (%==) SCK SCV = SFalse
-      (%==) SCK SCW = SFalse
-      (%==) SCK SCX = SFalse
-      (%==) SCK SCY = SFalse
-      (%==) SCK SCZ = SFalse
-      (%==) SCL SCA = SFalse
-      (%==) SCL SCB = SFalse
-      (%==) SCL SCC = SFalse
-      (%==) SCL SCD = SFalse
-      (%==) SCL SCE = SFalse
-      (%==) SCL SCF = SFalse
-      (%==) SCL SCG = SFalse
-      (%==) SCL SCH = SFalse
-      (%==) SCL SCI = SFalse
-      (%==) SCL SCJ = SFalse
-      (%==) SCL SCK = SFalse
-      (%==) SCL SCL = STrue
-      (%==) SCL SCM = SFalse
-      (%==) SCL SCN = SFalse
-      (%==) SCL SCO = SFalse
-      (%==) SCL SCP = SFalse
-      (%==) SCL SCQ = SFalse
-      (%==) SCL SCR = SFalse
-      (%==) SCL SCS = SFalse
-      (%==) SCL SCT = SFalse
-      (%==) SCL SCU = SFalse
-      (%==) SCL SCV = SFalse
-      (%==) SCL SCW = SFalse
-      (%==) SCL SCX = SFalse
-      (%==) SCL SCY = SFalse
-      (%==) SCL SCZ = SFalse
-      (%==) SCM SCA = SFalse
-      (%==) SCM SCB = SFalse
-      (%==) SCM SCC = SFalse
-      (%==) SCM SCD = SFalse
-      (%==) SCM SCE = SFalse
-      (%==) SCM SCF = SFalse
-      (%==) SCM SCG = SFalse
-      (%==) SCM SCH = SFalse
-      (%==) SCM SCI = SFalse
-      (%==) SCM SCJ = SFalse
-      (%==) SCM SCK = SFalse
-      (%==) SCM SCL = SFalse
-      (%==) SCM SCM = STrue
-      (%==) SCM SCN = SFalse
-      (%==) SCM SCO = SFalse
-      (%==) SCM SCP = SFalse
-      (%==) SCM SCQ = SFalse
-      (%==) SCM SCR = SFalse
-      (%==) SCM SCS = SFalse
-      (%==) SCM SCT = SFalse
-      (%==) SCM SCU = SFalse
-      (%==) SCM SCV = SFalse
-      (%==) SCM SCW = SFalse
-      (%==) SCM SCX = SFalse
-      (%==) SCM SCY = SFalse
-      (%==) SCM SCZ = SFalse
-      (%==) SCN SCA = SFalse
-      (%==) SCN SCB = SFalse
-      (%==) SCN SCC = SFalse
-      (%==) SCN SCD = SFalse
-      (%==) SCN SCE = SFalse
-      (%==) SCN SCF = SFalse
-      (%==) SCN SCG = SFalse
-      (%==) SCN SCH = SFalse
-      (%==) SCN SCI = SFalse
-      (%==) SCN SCJ = SFalse
-      (%==) SCN SCK = SFalse
-      (%==) SCN SCL = SFalse
-      (%==) SCN SCM = SFalse
-      (%==) SCN SCN = STrue
-      (%==) SCN SCO = SFalse
-      (%==) SCN SCP = SFalse
-      (%==) SCN SCQ = SFalse
-      (%==) SCN SCR = SFalse
-      (%==) SCN SCS = SFalse
-      (%==) SCN SCT = SFalse
-      (%==) SCN SCU = SFalse
-      (%==) SCN SCV = SFalse
-      (%==) SCN SCW = SFalse
-      (%==) SCN SCX = SFalse
-      (%==) SCN SCY = SFalse
-      (%==) SCN SCZ = SFalse
-      (%==) SCO SCA = SFalse
-      (%==) SCO SCB = SFalse
-      (%==) SCO SCC = SFalse
-      (%==) SCO SCD = SFalse
-      (%==) SCO SCE = SFalse
-      (%==) SCO SCF = SFalse
-      (%==) SCO SCG = SFalse
-      (%==) SCO SCH = SFalse
-      (%==) SCO SCI = SFalse
-      (%==) SCO SCJ = SFalse
-      (%==) SCO SCK = SFalse
-      (%==) SCO SCL = SFalse
-      (%==) SCO SCM = SFalse
-      (%==) SCO SCN = SFalse
-      (%==) SCO SCO = STrue
-      (%==) SCO SCP = SFalse
-      (%==) SCO SCQ = SFalse
-      (%==) SCO SCR = SFalse
-      (%==) SCO SCS = SFalse
-      (%==) SCO SCT = SFalse
-      (%==) SCO SCU = SFalse
-      (%==) SCO SCV = SFalse
-      (%==) SCO SCW = SFalse
-      (%==) SCO SCX = SFalse
-      (%==) SCO SCY = SFalse
-      (%==) SCO SCZ = SFalse
-      (%==) SCP SCA = SFalse
-      (%==) SCP SCB = SFalse
-      (%==) SCP SCC = SFalse
-      (%==) SCP SCD = SFalse
-      (%==) SCP SCE = SFalse
-      (%==) SCP SCF = SFalse
-      (%==) SCP SCG = SFalse
-      (%==) SCP SCH = SFalse
-      (%==) SCP SCI = SFalse
-      (%==) SCP SCJ = SFalse
-      (%==) SCP SCK = SFalse
-      (%==) SCP SCL = SFalse
-      (%==) SCP SCM = SFalse
-      (%==) SCP SCN = SFalse
-      (%==) SCP SCO = SFalse
-      (%==) SCP SCP = STrue
-      (%==) SCP SCQ = SFalse
-      (%==) SCP SCR = SFalse
-      (%==) SCP SCS = SFalse
-      (%==) SCP SCT = SFalse
-      (%==) SCP SCU = SFalse
-      (%==) SCP SCV = SFalse
-      (%==) SCP SCW = SFalse
-      (%==) SCP SCX = SFalse
-      (%==) SCP SCY = SFalse
-      (%==) SCP SCZ = SFalse
-      (%==) SCQ SCA = SFalse
-      (%==) SCQ SCB = SFalse
-      (%==) SCQ SCC = SFalse
-      (%==) SCQ SCD = SFalse
-      (%==) SCQ SCE = SFalse
-      (%==) SCQ SCF = SFalse
-      (%==) SCQ SCG = SFalse
-      (%==) SCQ SCH = SFalse
-      (%==) SCQ SCI = SFalse
-      (%==) SCQ SCJ = SFalse
-      (%==) SCQ SCK = SFalse
-      (%==) SCQ SCL = SFalse
-      (%==) SCQ SCM = SFalse
-      (%==) SCQ SCN = SFalse
-      (%==) SCQ SCO = SFalse
-      (%==) SCQ SCP = SFalse
-      (%==) SCQ SCQ = STrue
-      (%==) SCQ SCR = SFalse
-      (%==) SCQ SCS = SFalse
-      (%==) SCQ SCT = SFalse
-      (%==) SCQ SCU = SFalse
-      (%==) SCQ SCV = SFalse
-      (%==) SCQ SCW = SFalse
-      (%==) SCQ SCX = SFalse
-      (%==) SCQ SCY = SFalse
-      (%==) SCQ SCZ = SFalse
-      (%==) SCR SCA = SFalse
-      (%==) SCR SCB = SFalse
-      (%==) SCR SCC = SFalse
-      (%==) SCR SCD = SFalse
-      (%==) SCR SCE = SFalse
-      (%==) SCR SCF = SFalse
-      (%==) SCR SCG = SFalse
-      (%==) SCR SCH = SFalse
-      (%==) SCR SCI = SFalse
-      (%==) SCR SCJ = SFalse
-      (%==) SCR SCK = SFalse
-      (%==) SCR SCL = SFalse
-      (%==) SCR SCM = SFalse
-      (%==) SCR SCN = SFalse
-      (%==) SCR SCO = SFalse
-      (%==) SCR SCP = SFalse
-      (%==) SCR SCQ = SFalse
-      (%==) SCR SCR = STrue
-      (%==) SCR SCS = SFalse
-      (%==) SCR SCT = SFalse
-      (%==) SCR SCU = SFalse
-      (%==) SCR SCV = SFalse
-      (%==) SCR SCW = SFalse
-      (%==) SCR SCX = SFalse
-      (%==) SCR SCY = SFalse
-      (%==) SCR SCZ = SFalse
-      (%==) SCS SCA = SFalse
-      (%==) SCS SCB = SFalse
-      (%==) SCS SCC = SFalse
-      (%==) SCS SCD = SFalse
-      (%==) SCS SCE = SFalse
-      (%==) SCS SCF = SFalse
-      (%==) SCS SCG = SFalse
-      (%==) SCS SCH = SFalse
-      (%==) SCS SCI = SFalse
-      (%==) SCS SCJ = SFalse
-      (%==) SCS SCK = SFalse
-      (%==) SCS SCL = SFalse
-      (%==) SCS SCM = SFalse
-      (%==) SCS SCN = SFalse
-      (%==) SCS SCO = SFalse
-      (%==) SCS SCP = SFalse
-      (%==) SCS SCQ = SFalse
-      (%==) SCS SCR = SFalse
-      (%==) SCS SCS = STrue
-      (%==) SCS SCT = SFalse
-      (%==) SCS SCU = SFalse
-      (%==) SCS SCV = SFalse
-      (%==) SCS SCW = SFalse
-      (%==) SCS SCX = SFalse
-      (%==) SCS SCY = SFalse
-      (%==) SCS SCZ = SFalse
-      (%==) SCT SCA = SFalse
-      (%==) SCT SCB = SFalse
-      (%==) SCT SCC = SFalse
-      (%==) SCT SCD = SFalse
-      (%==) SCT SCE = SFalse
-      (%==) SCT SCF = SFalse
-      (%==) SCT SCG = SFalse
-      (%==) SCT SCH = SFalse
-      (%==) SCT SCI = SFalse
-      (%==) SCT SCJ = SFalse
-      (%==) SCT SCK = SFalse
-      (%==) SCT SCL = SFalse
-      (%==) SCT SCM = SFalse
-      (%==) SCT SCN = SFalse
-      (%==) SCT SCO = SFalse
-      (%==) SCT SCP = SFalse
-      (%==) SCT SCQ = SFalse
-      (%==) SCT SCR = SFalse
-      (%==) SCT SCS = SFalse
-      (%==) SCT SCT = STrue
-      (%==) SCT SCU = SFalse
-      (%==) SCT SCV = SFalse
-      (%==) SCT SCW = SFalse
-      (%==) SCT SCX = SFalse
-      (%==) SCT SCY = SFalse
-      (%==) SCT SCZ = SFalse
-      (%==) SCU SCA = SFalse
-      (%==) SCU SCB = SFalse
-      (%==) SCU SCC = SFalse
-      (%==) SCU SCD = SFalse
-      (%==) SCU SCE = SFalse
-      (%==) SCU SCF = SFalse
-      (%==) SCU SCG = SFalse
-      (%==) SCU SCH = SFalse
-      (%==) SCU SCI = SFalse
-      (%==) SCU SCJ = SFalse
-      (%==) SCU SCK = SFalse
-      (%==) SCU SCL = SFalse
-      (%==) SCU SCM = SFalse
-      (%==) SCU SCN = SFalse
-      (%==) SCU SCO = SFalse
-      (%==) SCU SCP = SFalse
-      (%==) SCU SCQ = SFalse
-      (%==) SCU SCR = SFalse
-      (%==) SCU SCS = SFalse
-      (%==) SCU SCT = SFalse
-      (%==) SCU SCU = STrue
-      (%==) SCU SCV = SFalse
-      (%==) SCU SCW = SFalse
-      (%==) SCU SCX = SFalse
-      (%==) SCU SCY = SFalse
-      (%==) SCU SCZ = SFalse
-      (%==) SCV SCA = SFalse
-      (%==) SCV SCB = SFalse
-      (%==) SCV SCC = SFalse
-      (%==) SCV SCD = SFalse
-      (%==) SCV SCE = SFalse
-      (%==) SCV SCF = SFalse
-      (%==) SCV SCG = SFalse
-      (%==) SCV SCH = SFalse
-      (%==) SCV SCI = SFalse
-      (%==) SCV SCJ = SFalse
-      (%==) SCV SCK = SFalse
-      (%==) SCV SCL = SFalse
-      (%==) SCV SCM = SFalse
-      (%==) SCV SCN = SFalse
-      (%==) SCV SCO = SFalse
-      (%==) SCV SCP = SFalse
-      (%==) SCV SCQ = SFalse
-      (%==) SCV SCR = SFalse
-      (%==) SCV SCS = SFalse
-      (%==) SCV SCT = SFalse
-      (%==) SCV SCU = SFalse
-      (%==) SCV SCV = STrue
-      (%==) SCV SCW = SFalse
-      (%==) SCV SCX = SFalse
-      (%==) SCV SCY = SFalse
-      (%==) SCV SCZ = SFalse
-      (%==) SCW SCA = SFalse
-      (%==) SCW SCB = SFalse
-      (%==) SCW SCC = SFalse
-      (%==) SCW SCD = SFalse
-      (%==) SCW SCE = SFalse
-      (%==) SCW SCF = SFalse
-      (%==) SCW SCG = SFalse
-      (%==) SCW SCH = SFalse
-      (%==) SCW SCI = SFalse
-      (%==) SCW SCJ = SFalse
-      (%==) SCW SCK = SFalse
-      (%==) SCW SCL = SFalse
-      (%==) SCW SCM = SFalse
-      (%==) SCW SCN = SFalse
-      (%==) SCW SCO = SFalse
-      (%==) SCW SCP = SFalse
-      (%==) SCW SCQ = SFalse
-      (%==) SCW SCR = SFalse
-      (%==) SCW SCS = SFalse
-      (%==) SCW SCT = SFalse
-      (%==) SCW SCU = SFalse
-      (%==) SCW SCV = SFalse
-      (%==) SCW SCW = STrue
-      (%==) SCW SCX = SFalse
-      (%==) SCW SCY = SFalse
-      (%==) SCW SCZ = SFalse
-      (%==) SCX SCA = SFalse
-      (%==) SCX SCB = SFalse
-      (%==) SCX SCC = SFalse
-      (%==) SCX SCD = SFalse
-      (%==) SCX SCE = SFalse
-      (%==) SCX SCF = SFalse
-      (%==) SCX SCG = SFalse
-      (%==) SCX SCH = SFalse
-      (%==) SCX SCI = SFalse
-      (%==) SCX SCJ = SFalse
-      (%==) SCX SCK = SFalse
-      (%==) SCX SCL = SFalse
-      (%==) SCX SCM = SFalse
-      (%==) SCX SCN = SFalse
-      (%==) SCX SCO = SFalse
-      (%==) SCX SCP = SFalse
-      (%==) SCX SCQ = SFalse
-      (%==) SCX SCR = SFalse
-      (%==) SCX SCS = SFalse
-      (%==) SCX SCT = SFalse
-      (%==) SCX SCU = SFalse
-      (%==) SCX SCV = SFalse
-      (%==) SCX SCW = SFalse
-      (%==) SCX SCX = STrue
-      (%==) SCX SCY = SFalse
-      (%==) SCX SCZ = SFalse
-      (%==) SCY SCA = SFalse
-      (%==) SCY SCB = SFalse
-      (%==) SCY SCC = SFalse
-      (%==) SCY SCD = SFalse
-      (%==) SCY SCE = SFalse
-      (%==) SCY SCF = SFalse
-      (%==) SCY SCG = SFalse
-      (%==) SCY SCH = SFalse
-      (%==) SCY SCI = SFalse
-      (%==) SCY SCJ = SFalse
-      (%==) SCY SCK = SFalse
-      (%==) SCY SCL = SFalse
-      (%==) SCY SCM = SFalse
-      (%==) SCY SCN = SFalse
-      (%==) SCY SCO = SFalse
-      (%==) SCY SCP = SFalse
-      (%==) SCY SCQ = SFalse
-      (%==) SCY SCR = SFalse
-      (%==) SCY SCS = SFalse
-      (%==) SCY SCT = SFalse
-      (%==) SCY SCU = SFalse
-      (%==) SCY SCV = SFalse
-      (%==) SCY SCW = SFalse
-      (%==) SCY SCX = SFalse
-      (%==) SCY SCY = STrue
-      (%==) SCY SCZ = SFalse
-      (%==) SCZ SCA = SFalse
-      (%==) SCZ SCB = SFalse
-      (%==) SCZ SCC = SFalse
-      (%==) SCZ SCD = SFalse
-      (%==) SCZ SCE = SFalse
-      (%==) SCZ SCF = SFalse
-      (%==) SCZ SCG = SFalse
-      (%==) SCZ SCH = SFalse
-      (%==) SCZ SCI = SFalse
-      (%==) SCZ SCJ = SFalse
-      (%==) SCZ SCK = SFalse
-      (%==) SCZ SCL = SFalse
-      (%==) SCZ SCM = SFalse
-      (%==) SCZ SCN = SFalse
-      (%==) SCZ SCO = SFalse
-      (%==) SCZ SCP = SFalse
-      (%==) SCZ SCQ = SFalse
-      (%==) SCZ SCR = SFalse
-      (%==) SCZ SCS = SFalse
-      (%==) SCZ SCT = SFalse
-      (%==) SCZ SCU = SFalse
-      (%==) SCZ SCV = SFalse
-      (%==) SCZ SCW = SFalse
-      (%==) SCZ SCX = SFalse
-      (%==) SCZ SCY = SFalse
-      (%==) SCZ SCZ = STrue
-    instance SDecide AChar where
-      (%~) SCA SCA = Proved Refl
-      (%~) SCA SCB = Disproved (\ x -> case x of)
-      (%~) SCA SCC = Disproved (\ x -> case x of)
-      (%~) SCA SCD = Disproved (\ x -> case x of)
-      (%~) SCA SCE = Disproved (\ x -> case x of)
-      (%~) SCA SCF = Disproved (\ x -> case x of)
-      (%~) SCA SCG = Disproved (\ x -> case x of)
-      (%~) SCA SCH = Disproved (\ x -> case x of)
-      (%~) SCA SCI = Disproved (\ x -> case x of)
-      (%~) SCA SCJ = Disproved (\ x -> case x of)
-      (%~) SCA SCK = Disproved (\ x -> case x of)
-      (%~) SCA SCL = Disproved (\ x -> case x of)
-      (%~) SCA SCM = Disproved (\ x -> case x of)
-      (%~) SCA SCN = Disproved (\ x -> case x of)
-      (%~) SCA SCO = Disproved (\ x -> case x of)
-      (%~) SCA SCP = Disproved (\ x -> case x of)
-      (%~) SCA SCQ = Disproved (\ x -> case x of)
-      (%~) SCA SCR = Disproved (\ x -> case x of)
-      (%~) SCA SCS = Disproved (\ x -> case x of)
-      (%~) SCA SCT = Disproved (\ x -> case x of)
-      (%~) SCA SCU = Disproved (\ x -> case x of)
-      (%~) SCA SCV = Disproved (\ x -> case x of)
-      (%~) SCA SCW = Disproved (\ x -> case x of)
-      (%~) SCA SCX = Disproved (\ x -> case x of)
-      (%~) SCA SCY = Disproved (\ x -> case x of)
-      (%~) SCA SCZ = Disproved (\ x -> case x of)
-      (%~) SCB SCA = Disproved (\ x -> case x of)
-      (%~) SCB SCB = Proved Refl
-      (%~) SCB SCC = Disproved (\ x -> case x of)
-      (%~) SCB SCD = Disproved (\ x -> case x of)
-      (%~) SCB SCE = Disproved (\ x -> case x of)
-      (%~) SCB SCF = Disproved (\ x -> case x of)
-      (%~) SCB SCG = Disproved (\ x -> case x of)
-      (%~) SCB SCH = Disproved (\ x -> case x of)
-      (%~) SCB SCI = Disproved (\ x -> case x of)
-      (%~) SCB SCJ = Disproved (\ x -> case x of)
-      (%~) SCB SCK = Disproved (\ x -> case x of)
-      (%~) SCB SCL = Disproved (\ x -> case x of)
-      (%~) SCB SCM = Disproved (\ x -> case x of)
-      (%~) SCB SCN = Disproved (\ x -> case x of)
-      (%~) SCB SCO = Disproved (\ x -> case x of)
-      (%~) SCB SCP = Disproved (\ x -> case x of)
-      (%~) SCB SCQ = Disproved (\ x -> case x of)
-      (%~) SCB SCR = Disproved (\ x -> case x of)
-      (%~) SCB SCS = Disproved (\ x -> case x of)
-      (%~) SCB SCT = Disproved (\ x -> case x of)
-      (%~) SCB SCU = Disproved (\ x -> case x of)
-      (%~) SCB SCV = Disproved (\ x -> case x of)
-      (%~) SCB SCW = Disproved (\ x -> case x of)
-      (%~) SCB SCX = Disproved (\ x -> case x of)
-      (%~) SCB SCY = Disproved (\ x -> case x of)
-      (%~) SCB SCZ = Disproved (\ x -> case x of)
-      (%~) SCC SCA = Disproved (\ x -> case x of)
-      (%~) SCC SCB = Disproved (\ x -> case x of)
-      (%~) SCC SCC = Proved Refl
-      (%~) SCC SCD = Disproved (\ x -> case x of)
-      (%~) SCC SCE = Disproved (\ x -> case x of)
-      (%~) SCC SCF = Disproved (\ x -> case x of)
-      (%~) SCC SCG = Disproved (\ x -> case x of)
-      (%~) SCC SCH = Disproved (\ x -> case x of)
-      (%~) SCC SCI = Disproved (\ x -> case x of)
-      (%~) SCC SCJ = Disproved (\ x -> case x of)
-      (%~) SCC SCK = Disproved (\ x -> case x of)
-      (%~) SCC SCL = Disproved (\ x -> case x of)
-      (%~) SCC SCM = Disproved (\ x -> case x of)
-      (%~) SCC SCN = Disproved (\ x -> case x of)
-      (%~) SCC SCO = Disproved (\ x -> case x of)
-      (%~) SCC SCP = Disproved (\ x -> case x of)
-      (%~) SCC SCQ = Disproved (\ x -> case x of)
-      (%~) SCC SCR = Disproved (\ x -> case x of)
-      (%~) SCC SCS = Disproved (\ x -> case x of)
-      (%~) SCC SCT = Disproved (\ x -> case x of)
-      (%~) SCC SCU = Disproved (\ x -> case x of)
-      (%~) SCC SCV = Disproved (\ x -> case x of)
-      (%~) SCC SCW = Disproved (\ x -> case x of)
-      (%~) SCC SCX = Disproved (\ x -> case x of)
-      (%~) SCC SCY = Disproved (\ x -> case x of)
-      (%~) SCC SCZ = Disproved (\ x -> case x of)
-      (%~) SCD SCA = Disproved (\ x -> case x of)
-      (%~) SCD SCB = Disproved (\ x -> case x of)
-      (%~) SCD SCC = Disproved (\ x -> case x of)
-      (%~) SCD SCD = Proved Refl
-      (%~) SCD SCE = Disproved (\ x -> case x of)
-      (%~) SCD SCF = Disproved (\ x -> case x of)
-      (%~) SCD SCG = Disproved (\ x -> case x of)
-      (%~) SCD SCH = Disproved (\ x -> case x of)
-      (%~) SCD SCI = Disproved (\ x -> case x of)
-      (%~) SCD SCJ = Disproved (\ x -> case x of)
-      (%~) SCD SCK = Disproved (\ x -> case x of)
-      (%~) SCD SCL = Disproved (\ x -> case x of)
-      (%~) SCD SCM = Disproved (\ x -> case x of)
-      (%~) SCD SCN = Disproved (\ x -> case x of)
-      (%~) SCD SCO = Disproved (\ x -> case x of)
-      (%~) SCD SCP = Disproved (\ x -> case x of)
-      (%~) SCD SCQ = Disproved (\ x -> case x of)
-      (%~) SCD SCR = Disproved (\ x -> case x of)
-      (%~) SCD SCS = Disproved (\ x -> case x of)
-      (%~) SCD SCT = Disproved (\ x -> case x of)
-      (%~) SCD SCU = Disproved (\ x -> case x of)
-      (%~) SCD SCV = Disproved (\ x -> case x of)
-      (%~) SCD SCW = Disproved (\ x -> case x of)
-      (%~) SCD SCX = Disproved (\ x -> case x of)
-      (%~) SCD SCY = Disproved (\ x -> case x of)
-      (%~) SCD SCZ = Disproved (\ x -> case x of)
-      (%~) SCE SCA = Disproved (\ x -> case x of)
-      (%~) SCE SCB = Disproved (\ x -> case x of)
-      (%~) SCE SCC = Disproved (\ x -> case x of)
-      (%~) SCE SCD = Disproved (\ x -> case x of)
-      (%~) SCE SCE = Proved Refl
-      (%~) SCE SCF = Disproved (\ x -> case x of)
-      (%~) SCE SCG = Disproved (\ x -> case x of)
-      (%~) SCE SCH = Disproved (\ x -> case x of)
-      (%~) SCE SCI = Disproved (\ x -> case x of)
-      (%~) SCE SCJ = Disproved (\ x -> case x of)
-      (%~) SCE SCK = Disproved (\ x -> case x of)
-      (%~) SCE SCL = Disproved (\ x -> case x of)
-      (%~) SCE SCM = Disproved (\ x -> case x of)
-      (%~) SCE SCN = Disproved (\ x -> case x of)
-      (%~) SCE SCO = Disproved (\ x -> case x of)
-      (%~) SCE SCP = Disproved (\ x -> case x of)
-      (%~) SCE SCQ = Disproved (\ x -> case x of)
-      (%~) SCE SCR = Disproved (\ x -> case x of)
-      (%~) SCE SCS = Disproved (\ x -> case x of)
-      (%~) SCE SCT = Disproved (\ x -> case x of)
-      (%~) SCE SCU = Disproved (\ x -> case x of)
-      (%~) SCE SCV = Disproved (\ x -> case x of)
-      (%~) SCE SCW = Disproved (\ x -> case x of)
-      (%~) SCE SCX = Disproved (\ x -> case x of)
-      (%~) SCE SCY = Disproved (\ x -> case x of)
-      (%~) SCE SCZ = Disproved (\ x -> case x of)
-      (%~) SCF SCA = Disproved (\ x -> case x of)
-      (%~) SCF SCB = Disproved (\ x -> case x of)
-      (%~) SCF SCC = Disproved (\ x -> case x of)
-      (%~) SCF SCD = Disproved (\ x -> case x of)
-      (%~) SCF SCE = Disproved (\ x -> case x of)
-      (%~) SCF SCF = Proved Refl
-      (%~) SCF SCG = Disproved (\ x -> case x of)
-      (%~) SCF SCH = Disproved (\ x -> case x of)
-      (%~) SCF SCI = Disproved (\ x -> case x of)
-      (%~) SCF SCJ = Disproved (\ x -> case x of)
-      (%~) SCF SCK = Disproved (\ x -> case x of)
-      (%~) SCF SCL = Disproved (\ x -> case x of)
-      (%~) SCF SCM = Disproved (\ x -> case x of)
-      (%~) SCF SCN = Disproved (\ x -> case x of)
-      (%~) SCF SCO = Disproved (\ x -> case x of)
-      (%~) SCF SCP = Disproved (\ x -> case x of)
-      (%~) SCF SCQ = Disproved (\ x -> case x of)
-      (%~) SCF SCR = Disproved (\ x -> case x of)
-      (%~) SCF SCS = Disproved (\ x -> case x of)
-      (%~) SCF SCT = Disproved (\ x -> case x of)
-      (%~) SCF SCU = Disproved (\ x -> case x of)
-      (%~) SCF SCV = Disproved (\ x -> case x of)
-      (%~) SCF SCW = Disproved (\ x -> case x of)
-      (%~) SCF SCX = Disproved (\ x -> case x of)
-      (%~) SCF SCY = Disproved (\ x -> case x of)
-      (%~) SCF SCZ = Disproved (\ x -> case x of)
-      (%~) SCG SCA = Disproved (\ x -> case x of)
-      (%~) SCG SCB = Disproved (\ x -> case x of)
-      (%~) SCG SCC = Disproved (\ x -> case x of)
-      (%~) SCG SCD = Disproved (\ x -> case x of)
-      (%~) SCG SCE = Disproved (\ x -> case x of)
-      (%~) SCG SCF = Disproved (\ x -> case x of)
-      (%~) SCG SCG = Proved Refl
-      (%~) SCG SCH = Disproved (\ x -> case x of)
-      (%~) SCG SCI = Disproved (\ x -> case x of)
-      (%~) SCG SCJ = Disproved (\ x -> case x of)
-      (%~) SCG SCK = Disproved (\ x -> case x of)
-      (%~) SCG SCL = Disproved (\ x -> case x of)
-      (%~) SCG SCM = Disproved (\ x -> case x of)
-      (%~) SCG SCN = Disproved (\ x -> case x of)
-      (%~) SCG SCO = Disproved (\ x -> case x of)
-      (%~) SCG SCP = Disproved (\ x -> case x of)
-      (%~) SCG SCQ = Disproved (\ x -> case x of)
-      (%~) SCG SCR = Disproved (\ x -> case x of)
-      (%~) SCG SCS = Disproved (\ x -> case x of)
-      (%~) SCG SCT = Disproved (\ x -> case x of)
-      (%~) SCG SCU = Disproved (\ x -> case x of)
-      (%~) SCG SCV = Disproved (\ x -> case x of)
-      (%~) SCG SCW = Disproved (\ x -> case x of)
-      (%~) SCG SCX = Disproved (\ x -> case x of)
-      (%~) SCG SCY = Disproved (\ x -> case x of)
-      (%~) SCG SCZ = Disproved (\ x -> case x of)
-      (%~) SCH SCA = Disproved (\ x -> case x of)
-      (%~) SCH SCB = Disproved (\ x -> case x of)
-      (%~) SCH SCC = Disproved (\ x -> case x of)
-      (%~) SCH SCD = Disproved (\ x -> case x of)
-      (%~) SCH SCE = Disproved (\ x -> case x of)
-      (%~) SCH SCF = Disproved (\ x -> case x of)
-      (%~) SCH SCG = Disproved (\ x -> case x of)
-      (%~) SCH SCH = Proved Refl
-      (%~) SCH SCI = Disproved (\ x -> case x of)
-      (%~) SCH SCJ = Disproved (\ x -> case x of)
-      (%~) SCH SCK = Disproved (\ x -> case x of)
-      (%~) SCH SCL = Disproved (\ x -> case x of)
-      (%~) SCH SCM = Disproved (\ x -> case x of)
-      (%~) SCH SCN = Disproved (\ x -> case x of)
-      (%~) SCH SCO = Disproved (\ x -> case x of)
-      (%~) SCH SCP = Disproved (\ x -> case x of)
-      (%~) SCH SCQ = Disproved (\ x -> case x of)
-      (%~) SCH SCR = Disproved (\ x -> case x of)
-      (%~) SCH SCS = Disproved (\ x -> case x of)
-      (%~) SCH SCT = Disproved (\ x -> case x of)
-      (%~) SCH SCU = Disproved (\ x -> case x of)
-      (%~) SCH SCV = Disproved (\ x -> case x of)
-      (%~) SCH SCW = Disproved (\ x -> case x of)
-      (%~) SCH SCX = Disproved (\ x -> case x of)
-      (%~) SCH SCY = Disproved (\ x -> case x of)
-      (%~) SCH SCZ = Disproved (\ x -> case x of)
-      (%~) SCI SCA = Disproved (\ x -> case x of)
-      (%~) SCI SCB = Disproved (\ x -> case x of)
-      (%~) SCI SCC = Disproved (\ x -> case x of)
-      (%~) SCI SCD = Disproved (\ x -> case x of)
-      (%~) SCI SCE = Disproved (\ x -> case x of)
-      (%~) SCI SCF = Disproved (\ x -> case x of)
-      (%~) SCI SCG = Disproved (\ x -> case x of)
-      (%~) SCI SCH = Disproved (\ x -> case x of)
-      (%~) SCI SCI = Proved Refl
-      (%~) SCI SCJ = Disproved (\ x -> case x of)
-      (%~) SCI SCK = Disproved (\ x -> case x of)
-      (%~) SCI SCL = Disproved (\ x -> case x of)
-      (%~) SCI SCM = Disproved (\ x -> case x of)
-      (%~) SCI SCN = Disproved (\ x -> case x of)
-      (%~) SCI SCO = Disproved (\ x -> case x of)
-      (%~) SCI SCP = Disproved (\ x -> case x of)
-      (%~) SCI SCQ = Disproved (\ x -> case x of)
-      (%~) SCI SCR = Disproved (\ x -> case x of)
-      (%~) SCI SCS = Disproved (\ x -> case x of)
-      (%~) SCI SCT = Disproved (\ x -> case x of)
-      (%~) SCI SCU = Disproved (\ x -> case x of)
-      (%~) SCI SCV = Disproved (\ x -> case x of)
-      (%~) SCI SCW = Disproved (\ x -> case x of)
-      (%~) SCI SCX = Disproved (\ x -> case x of)
-      (%~) SCI SCY = Disproved (\ x -> case x of)
-      (%~) SCI SCZ = Disproved (\ x -> case x of)
-      (%~) SCJ SCA = Disproved (\ x -> case x of)
-      (%~) SCJ SCB = Disproved (\ x -> case x of)
-      (%~) SCJ SCC = Disproved (\ x -> case x of)
-      (%~) SCJ SCD = Disproved (\ x -> case x of)
-      (%~) SCJ SCE = Disproved (\ x -> case x of)
-      (%~) SCJ SCF = Disproved (\ x -> case x of)
-      (%~) SCJ SCG = Disproved (\ x -> case x of)
-      (%~) SCJ SCH = Disproved (\ x -> case x of)
-      (%~) SCJ SCI = Disproved (\ x -> case x of)
-      (%~) SCJ SCJ = Proved Refl
-      (%~) SCJ SCK = Disproved (\ x -> case x of)
-      (%~) SCJ SCL = Disproved (\ x -> case x of)
-      (%~) SCJ SCM = Disproved (\ x -> case x of)
-      (%~) SCJ SCN = Disproved (\ x -> case x of)
-      (%~) SCJ SCO = Disproved (\ x -> case x of)
-      (%~) SCJ SCP = Disproved (\ x -> case x of)
-      (%~) SCJ SCQ = Disproved (\ x -> case x of)
-      (%~) SCJ SCR = Disproved (\ x -> case x of)
-      (%~) SCJ SCS = Disproved (\ x -> case x of)
-      (%~) SCJ SCT = Disproved (\ x -> case x of)
-      (%~) SCJ SCU = Disproved (\ x -> case x of)
-      (%~) SCJ SCV = Disproved (\ x -> case x of)
-      (%~) SCJ SCW = Disproved (\ x -> case x of)
-      (%~) SCJ SCX = Disproved (\ x -> case x of)
-      (%~) SCJ SCY = Disproved (\ x -> case x of)
-      (%~) SCJ SCZ = Disproved (\ x -> case x of)
-      (%~) SCK SCA = Disproved (\ x -> case x of)
-      (%~) SCK SCB = Disproved (\ x -> case x of)
-      (%~) SCK SCC = Disproved (\ x -> case x of)
-      (%~) SCK SCD = Disproved (\ x -> case x of)
-      (%~) SCK SCE = Disproved (\ x -> case x of)
-      (%~) SCK SCF = Disproved (\ x -> case x of)
-      (%~) SCK SCG = Disproved (\ x -> case x of)
-      (%~) SCK SCH = Disproved (\ x -> case x of)
-      (%~) SCK SCI = Disproved (\ x -> case x of)
-      (%~) SCK SCJ = Disproved (\ x -> case x of)
-      (%~) SCK SCK = Proved Refl
-      (%~) SCK SCL = Disproved (\ x -> case x of)
-      (%~) SCK SCM = Disproved (\ x -> case x of)
-      (%~) SCK SCN = Disproved (\ x -> case x of)
-      (%~) SCK SCO = Disproved (\ x -> case x of)
-      (%~) SCK SCP = Disproved (\ x -> case x of)
-      (%~) SCK SCQ = Disproved (\ x -> case x of)
-      (%~) SCK SCR = Disproved (\ x -> case x of)
-      (%~) SCK SCS = Disproved (\ x -> case x of)
-      (%~) SCK SCT = Disproved (\ x -> case x of)
-      (%~) SCK SCU = Disproved (\ x -> case x of)
-      (%~) SCK SCV = Disproved (\ x -> case x of)
-      (%~) SCK SCW = Disproved (\ x -> case x of)
-      (%~) SCK SCX = Disproved (\ x -> case x of)
-      (%~) SCK SCY = Disproved (\ x -> case x of)
-      (%~) SCK SCZ = Disproved (\ x -> case x of)
-      (%~) SCL SCA = Disproved (\ x -> case x of)
-      (%~) SCL SCB = Disproved (\ x -> case x of)
-      (%~) SCL SCC = Disproved (\ x -> case x of)
-      (%~) SCL SCD = Disproved (\ x -> case x of)
-      (%~) SCL SCE = Disproved (\ x -> case x of)
-      (%~) SCL SCF = Disproved (\ x -> case x of)
-      (%~) SCL SCG = Disproved (\ x -> case x of)
-      (%~) SCL SCH = Disproved (\ x -> case x of)
-      (%~) SCL SCI = Disproved (\ x -> case x of)
-      (%~) SCL SCJ = Disproved (\ x -> case x of)
-      (%~) SCL SCK = Disproved (\ x -> case x of)
-      (%~) SCL SCL = Proved Refl
-      (%~) SCL SCM = Disproved (\ x -> case x of)
-      (%~) SCL SCN = Disproved (\ x -> case x of)
-      (%~) SCL SCO = Disproved (\ x -> case x of)
-      (%~) SCL SCP = Disproved (\ x -> case x of)
-      (%~) SCL SCQ = Disproved (\ x -> case x of)
-      (%~) SCL SCR = Disproved (\ x -> case x of)
-      (%~) SCL SCS = Disproved (\ x -> case x of)
-      (%~) SCL SCT = Disproved (\ x -> case x of)
-      (%~) SCL SCU = Disproved (\ x -> case x of)
-      (%~) SCL SCV = Disproved (\ x -> case x of)
-      (%~) SCL SCW = Disproved (\ x -> case x of)
-      (%~) SCL SCX = Disproved (\ x -> case x of)
-      (%~) SCL SCY = Disproved (\ x -> case x of)
-      (%~) SCL SCZ = Disproved (\ x -> case x of)
-      (%~) SCM SCA = Disproved (\ x -> case x of)
-      (%~) SCM SCB = Disproved (\ x -> case x of)
-      (%~) SCM SCC = Disproved (\ x -> case x of)
-      (%~) SCM SCD = Disproved (\ x -> case x of)
-      (%~) SCM SCE = Disproved (\ x -> case x of)
-      (%~) SCM SCF = Disproved (\ x -> case x of)
-      (%~) SCM SCG = Disproved (\ x -> case x of)
-      (%~) SCM SCH = Disproved (\ x -> case x of)
-      (%~) SCM SCI = Disproved (\ x -> case x of)
-      (%~) SCM SCJ = Disproved (\ x -> case x of)
-      (%~) SCM SCK = Disproved (\ x -> case x of)
-      (%~) SCM SCL = Disproved (\ x -> case x of)
-      (%~) SCM SCM = Proved Refl
-      (%~) SCM SCN = Disproved (\ x -> case x of)
-      (%~) SCM SCO = Disproved (\ x -> case x of)
-      (%~) SCM SCP = Disproved (\ x -> case x of)
-      (%~) SCM SCQ = Disproved (\ x -> case x of)
-      (%~) SCM SCR = Disproved (\ x -> case x of)
-      (%~) SCM SCS = Disproved (\ x -> case x of)
-      (%~) SCM SCT = Disproved (\ x -> case x of)
-      (%~) SCM SCU = Disproved (\ x -> case x of)
-      (%~) SCM SCV = Disproved (\ x -> case x of)
-      (%~) SCM SCW = Disproved (\ x -> case x of)
-      (%~) SCM SCX = Disproved (\ x -> case x of)
-      (%~) SCM SCY = Disproved (\ x -> case x of)
-      (%~) SCM SCZ = Disproved (\ x -> case x of)
-      (%~) SCN SCA = Disproved (\ x -> case x of)
-      (%~) SCN SCB = Disproved (\ x -> case x of)
-      (%~) SCN SCC = Disproved (\ x -> case x of)
-      (%~) SCN SCD = Disproved (\ x -> case x of)
-      (%~) SCN SCE = Disproved (\ x -> case x of)
-      (%~) SCN SCF = Disproved (\ x -> case x of)
-      (%~) SCN SCG = Disproved (\ x -> case x of)
-      (%~) SCN SCH = Disproved (\ x -> case x of)
-      (%~) SCN SCI = Disproved (\ x -> case x of)
-      (%~) SCN SCJ = Disproved (\ x -> case x of)
-      (%~) SCN SCK = Disproved (\ x -> case x of)
-      (%~) SCN SCL = Disproved (\ x -> case x of)
-      (%~) SCN SCM = Disproved (\ x -> case x of)
-      (%~) SCN SCN = Proved Refl
-      (%~) SCN SCO = Disproved (\ x -> case x of)
-      (%~) SCN SCP = Disproved (\ x -> case x of)
-      (%~) SCN SCQ = Disproved (\ x -> case x of)
-      (%~) SCN SCR = Disproved (\ x -> case x of)
-      (%~) SCN SCS = Disproved (\ x -> case x of)
-      (%~) SCN SCT = Disproved (\ x -> case x of)
-      (%~) SCN SCU = Disproved (\ x -> case x of)
-      (%~) SCN SCV = Disproved (\ x -> case x of)
-      (%~) SCN SCW = Disproved (\ x -> case x of)
-      (%~) SCN SCX = Disproved (\ x -> case x of)
-      (%~) SCN SCY = Disproved (\ x -> case x of)
-      (%~) SCN SCZ = Disproved (\ x -> case x of)
-      (%~) SCO SCA = Disproved (\ x -> case x of)
-      (%~) SCO SCB = Disproved (\ x -> case x of)
-      (%~) SCO SCC = Disproved (\ x -> case x of)
-      (%~) SCO SCD = Disproved (\ x -> case x of)
-      (%~) SCO SCE = Disproved (\ x -> case x of)
-      (%~) SCO SCF = Disproved (\ x -> case x of)
-      (%~) SCO SCG = Disproved (\ x -> case x of)
-      (%~) SCO SCH = Disproved (\ x -> case x of)
-      (%~) SCO SCI = Disproved (\ x -> case x of)
-      (%~) SCO SCJ = Disproved (\ x -> case x of)
-      (%~) SCO SCK = Disproved (\ x -> case x of)
-      (%~) SCO SCL = Disproved (\ x -> case x of)
-      (%~) SCO SCM = Disproved (\ x -> case x of)
-      (%~) SCO SCN = Disproved (\ x -> case x of)
-      (%~) SCO SCO = Proved Refl
-      (%~) SCO SCP = Disproved (\ x -> case x of)
-      (%~) SCO SCQ = Disproved (\ x -> case x of)
-      (%~) SCO SCR = Disproved (\ x -> case x of)
-      (%~) SCO SCS = Disproved (\ x -> case x of)
-      (%~) SCO SCT = Disproved (\ x -> case x of)
-      (%~) SCO SCU = Disproved (\ x -> case x of)
-      (%~) SCO SCV = Disproved (\ x -> case x of)
-      (%~) SCO SCW = Disproved (\ x -> case x of)
-      (%~) SCO SCX = Disproved (\ x -> case x of)
-      (%~) SCO SCY = Disproved (\ x -> case x of)
-      (%~) SCO SCZ = Disproved (\ x -> case x of)
-      (%~) SCP SCA = Disproved (\ x -> case x of)
-      (%~) SCP SCB = Disproved (\ x -> case x of)
-      (%~) SCP SCC = Disproved (\ x -> case x of)
-      (%~) SCP SCD = Disproved (\ x -> case x of)
-      (%~) SCP SCE = Disproved (\ x -> case x of)
-      (%~) SCP SCF = Disproved (\ x -> case x of)
-      (%~) SCP SCG = Disproved (\ x -> case x of)
-      (%~) SCP SCH = Disproved (\ x -> case x of)
-      (%~) SCP SCI = Disproved (\ x -> case x of)
-      (%~) SCP SCJ = Disproved (\ x -> case x of)
-      (%~) SCP SCK = Disproved (\ x -> case x of)
-      (%~) SCP SCL = Disproved (\ x -> case x of)
-      (%~) SCP SCM = Disproved (\ x -> case x of)
-      (%~) SCP SCN = Disproved (\ x -> case x of)
-      (%~) SCP SCO = Disproved (\ x -> case x of)
-      (%~) SCP SCP = Proved Refl
-      (%~) SCP SCQ = Disproved (\ x -> case x of)
-      (%~) SCP SCR = Disproved (\ x -> case x of)
-      (%~) SCP SCS = Disproved (\ x -> case x of)
-      (%~) SCP SCT = Disproved (\ x -> case x of)
-      (%~) SCP SCU = Disproved (\ x -> case x of)
-      (%~) SCP SCV = Disproved (\ x -> case x of)
-      (%~) SCP SCW = Disproved (\ x -> case x of)
-      (%~) SCP SCX = Disproved (\ x -> case x of)
-      (%~) SCP SCY = Disproved (\ x -> case x of)
-      (%~) SCP SCZ = Disproved (\ x -> case x of)
-      (%~) SCQ SCA = Disproved (\ x -> case x of)
-      (%~) SCQ SCB = Disproved (\ x -> case x of)
-      (%~) SCQ SCC = Disproved (\ x -> case x of)
-      (%~) SCQ SCD = Disproved (\ x -> case x of)
-      (%~) SCQ SCE = Disproved (\ x -> case x of)
-      (%~) SCQ SCF = Disproved (\ x -> case x of)
-      (%~) SCQ SCG = Disproved (\ x -> case x of)
-      (%~) SCQ SCH = Disproved (\ x -> case x of)
-      (%~) SCQ SCI = Disproved (\ x -> case x of)
-      (%~) SCQ SCJ = Disproved (\ x -> case x of)
-      (%~) SCQ SCK = Disproved (\ x -> case x of)
-      (%~) SCQ SCL = Disproved (\ x -> case x of)
-      (%~) SCQ SCM = Disproved (\ x -> case x of)
-      (%~) SCQ SCN = Disproved (\ x -> case x of)
-      (%~) SCQ SCO = Disproved (\ x -> case x of)
-      (%~) SCQ SCP = Disproved (\ x -> case x of)
-      (%~) SCQ SCQ = Proved Refl
-      (%~) SCQ SCR = Disproved (\ x -> case x of)
-      (%~) SCQ SCS = Disproved (\ x -> case x of)
-      (%~) SCQ SCT = Disproved (\ x -> case x of)
-      (%~) SCQ SCU = Disproved (\ x -> case x of)
-      (%~) SCQ SCV = Disproved (\ x -> case x of)
-      (%~) SCQ SCW = Disproved (\ x -> case x of)
-      (%~) SCQ SCX = Disproved (\ x -> case x of)
-      (%~) SCQ SCY = Disproved (\ x -> case x of)
-      (%~) SCQ SCZ = Disproved (\ x -> case x of)
-      (%~) SCR SCA = Disproved (\ x -> case x of)
-      (%~) SCR SCB = Disproved (\ x -> case x of)
-      (%~) SCR SCC = Disproved (\ x -> case x of)
-      (%~) SCR SCD = Disproved (\ x -> case x of)
-      (%~) SCR SCE = Disproved (\ x -> case x of)
-      (%~) SCR SCF = Disproved (\ x -> case x of)
-      (%~) SCR SCG = Disproved (\ x -> case x of)
-      (%~) SCR SCH = Disproved (\ x -> case x of)
-      (%~) SCR SCI = Disproved (\ x -> case x of)
-      (%~) SCR SCJ = Disproved (\ x -> case x of)
-      (%~) SCR SCK = Disproved (\ x -> case x of)
-      (%~) SCR SCL = Disproved (\ x -> case x of)
-      (%~) SCR SCM = Disproved (\ x -> case x of)
-      (%~) SCR SCN = Disproved (\ x -> case x of)
-      (%~) SCR SCO = Disproved (\ x -> case x of)
-      (%~) SCR SCP = Disproved (\ x -> case x of)
-      (%~) SCR SCQ = Disproved (\ x -> case x of)
-      (%~) SCR SCR = Proved Refl
-      (%~) SCR SCS = Disproved (\ x -> case x of)
-      (%~) SCR SCT = Disproved (\ x -> case x of)
-      (%~) SCR SCU = Disproved (\ x -> case x of)
-      (%~) SCR SCV = Disproved (\ x -> case x of)
-      (%~) SCR SCW = Disproved (\ x -> case x of)
-      (%~) SCR SCX = Disproved (\ x -> case x of)
-      (%~) SCR SCY = Disproved (\ x -> case x of)
-      (%~) SCR SCZ = Disproved (\ x -> case x of)
-      (%~) SCS SCA = Disproved (\ x -> case x of)
-      (%~) SCS SCB = Disproved (\ x -> case x of)
-      (%~) SCS SCC = Disproved (\ x -> case x of)
-      (%~) SCS SCD = Disproved (\ x -> case x of)
-      (%~) SCS SCE = Disproved (\ x -> case x of)
-      (%~) SCS SCF = Disproved (\ x -> case x of)
-      (%~) SCS SCG = Disproved (\ x -> case x of)
-      (%~) SCS SCH = Disproved (\ x -> case x of)
-      (%~) SCS SCI = Disproved (\ x -> case x of)
-      (%~) SCS SCJ = Disproved (\ x -> case x of)
-      (%~) SCS SCK = Disproved (\ x -> case x of)
-      (%~) SCS SCL = Disproved (\ x -> case x of)
-      (%~) SCS SCM = Disproved (\ x -> case x of)
-      (%~) SCS SCN = Disproved (\ x -> case x of)
-      (%~) SCS SCO = Disproved (\ x -> case x of)
-      (%~) SCS SCP = Disproved (\ x -> case x of)
-      (%~) SCS SCQ = Disproved (\ x -> case x of)
-      (%~) SCS SCR = Disproved (\ x -> case x of)
-      (%~) SCS SCS = Proved Refl
-      (%~) SCS SCT = Disproved (\ x -> case x of)
-      (%~) SCS SCU = Disproved (\ x -> case x of)
-      (%~) SCS SCV = Disproved (\ x -> case x of)
-      (%~) SCS SCW = Disproved (\ x -> case x of)
-      (%~) SCS SCX = Disproved (\ x -> case x of)
-      (%~) SCS SCY = Disproved (\ x -> case x of)
-      (%~) SCS SCZ = Disproved (\ x -> case x of)
-      (%~) SCT SCA = Disproved (\ x -> case x of)
-      (%~) SCT SCB = Disproved (\ x -> case x of)
-      (%~) SCT SCC = Disproved (\ x -> case x of)
-      (%~) SCT SCD = Disproved (\ x -> case x of)
-      (%~) SCT SCE = Disproved (\ x -> case x of)
-      (%~) SCT SCF = Disproved (\ x -> case x of)
-      (%~) SCT SCG = Disproved (\ x -> case x of)
-      (%~) SCT SCH = Disproved (\ x -> case x of)
-      (%~) SCT SCI = Disproved (\ x -> case x of)
-      (%~) SCT SCJ = Disproved (\ x -> case x of)
-      (%~) SCT SCK = Disproved (\ x -> case x of)
-      (%~) SCT SCL = Disproved (\ x -> case x of)
-      (%~) SCT SCM = Disproved (\ x -> case x of)
-      (%~) SCT SCN = Disproved (\ x -> case x of)
-      (%~) SCT SCO = Disproved (\ x -> case x of)
-      (%~) SCT SCP = Disproved (\ x -> case x of)
-      (%~) SCT SCQ = Disproved (\ x -> case x of)
-      (%~) SCT SCR = Disproved (\ x -> case x of)
-      (%~) SCT SCS = Disproved (\ x -> case x of)
-      (%~) SCT SCT = Proved Refl
-      (%~) SCT SCU = Disproved (\ x -> case x of)
-      (%~) SCT SCV = Disproved (\ x -> case x of)
-      (%~) SCT SCW = Disproved (\ x -> case x of)
-      (%~) SCT SCX = Disproved (\ x -> case x of)
-      (%~) SCT SCY = Disproved (\ x -> case x of)
-      (%~) SCT SCZ = Disproved (\ x -> case x of)
-      (%~) SCU SCA = Disproved (\ x -> case x of)
-      (%~) SCU SCB = Disproved (\ x -> case x of)
-      (%~) SCU SCC = Disproved (\ x -> case x of)
-      (%~) SCU SCD = Disproved (\ x -> case x of)
-      (%~) SCU SCE = Disproved (\ x -> case x of)
-      (%~) SCU SCF = Disproved (\ x -> case x of)
-      (%~) SCU SCG = Disproved (\ x -> case x of)
-      (%~) SCU SCH = Disproved (\ x -> case x of)
-      (%~) SCU SCI = Disproved (\ x -> case x of)
-      (%~) SCU SCJ = Disproved (\ x -> case x of)
-      (%~) SCU SCK = Disproved (\ x -> case x of)
-      (%~) SCU SCL = Disproved (\ x -> case x of)
-      (%~) SCU SCM = Disproved (\ x -> case x of)
-      (%~) SCU SCN = Disproved (\ x -> case x of)
-      (%~) SCU SCO = Disproved (\ x -> case x of)
-      (%~) SCU SCP = Disproved (\ x -> case x of)
-      (%~) SCU SCQ = Disproved (\ x -> case x of)
-      (%~) SCU SCR = Disproved (\ x -> case x of)
-      (%~) SCU SCS = Disproved (\ x -> case x of)
-      (%~) SCU SCT = Disproved (\ x -> case x of)
-      (%~) SCU SCU = Proved Refl
-      (%~) SCU SCV = Disproved (\ x -> case x of)
-      (%~) SCU SCW = Disproved (\ x -> case x of)
-      (%~) SCU SCX = Disproved (\ x -> case x of)
-      (%~) SCU SCY = Disproved (\ x -> case x of)
-      (%~) SCU SCZ = Disproved (\ x -> case x of)
-      (%~) SCV SCA = Disproved (\ x -> case x of)
-      (%~) SCV SCB = Disproved (\ x -> case x of)
-      (%~) SCV SCC = Disproved (\ x -> case x of)
-      (%~) SCV SCD = Disproved (\ x -> case x of)
-      (%~) SCV SCE = Disproved (\ x -> case x of)
-      (%~) SCV SCF = Disproved (\ x -> case x of)
-      (%~) SCV SCG = Disproved (\ x -> case x of)
-      (%~) SCV SCH = Disproved (\ x -> case x of)
-      (%~) SCV SCI = Disproved (\ x -> case x of)
-      (%~) SCV SCJ = Disproved (\ x -> case x of)
-      (%~) SCV SCK = Disproved (\ x -> case x of)
-      (%~) SCV SCL = Disproved (\ x -> case x of)
-      (%~) SCV SCM = Disproved (\ x -> case x of)
-      (%~) SCV SCN = Disproved (\ x -> case x of)
-      (%~) SCV SCO = Disproved (\ x -> case x of)
-      (%~) SCV SCP = Disproved (\ x -> case x of)
-      (%~) SCV SCQ = Disproved (\ x -> case x of)
-      (%~) SCV SCR = Disproved (\ x -> case x of)
-      (%~) SCV SCS = Disproved (\ x -> case x of)
-      (%~) SCV SCT = Disproved (\ x -> case x of)
-      (%~) SCV SCU = Disproved (\ x -> case x of)
-      (%~) SCV SCV = Proved Refl
-      (%~) SCV SCW = Disproved (\ x -> case x of)
-      (%~) SCV SCX = Disproved (\ x -> case x of)
-      (%~) SCV SCY = Disproved (\ x -> case x of)
-      (%~) SCV SCZ = Disproved (\ x -> case x of)
-      (%~) SCW SCA = Disproved (\ x -> case x of)
-      (%~) SCW SCB = Disproved (\ x -> case x of)
-      (%~) SCW SCC = Disproved (\ x -> case x of)
-      (%~) SCW SCD = Disproved (\ x -> case x of)
-      (%~) SCW SCE = Disproved (\ x -> case x of)
-      (%~) SCW SCF = Disproved (\ x -> case x of)
-      (%~) SCW SCG = Disproved (\ x -> case x of)
-      (%~) SCW SCH = Disproved (\ x -> case x of)
-      (%~) SCW SCI = Disproved (\ x -> case x of)
-      (%~) SCW SCJ = Disproved (\ x -> case x of)
-      (%~) SCW SCK = Disproved (\ x -> case x of)
-      (%~) SCW SCL = Disproved (\ x -> case x of)
-      (%~) SCW SCM = Disproved (\ x -> case x of)
-      (%~) SCW SCN = Disproved (\ x -> case x of)
-      (%~) SCW SCO = Disproved (\ x -> case x of)
-      (%~) SCW SCP = Disproved (\ x -> case x of)
-      (%~) SCW SCQ = Disproved (\ x -> case x of)
-      (%~) SCW SCR = Disproved (\ x -> case x of)
-      (%~) SCW SCS = Disproved (\ x -> case x of)
-      (%~) SCW SCT = Disproved (\ x -> case x of)
-      (%~) SCW SCU = Disproved (\ x -> case x of)
-      (%~) SCW SCV = Disproved (\ x -> case x of)
-      (%~) SCW SCW = Proved Refl
-      (%~) SCW SCX = Disproved (\ x -> case x of)
-      (%~) SCW SCY = Disproved (\ x -> case x of)
-      (%~) SCW SCZ = Disproved (\ x -> case x of)
-      (%~) SCX SCA = Disproved (\ x -> case x of)
-      (%~) SCX SCB = Disproved (\ x -> case x of)
-      (%~) SCX SCC = Disproved (\ x -> case x of)
-      (%~) SCX SCD = Disproved (\ x -> case x of)
-      (%~) SCX SCE = Disproved (\ x -> case x of)
-      (%~) SCX SCF = Disproved (\ x -> case x of)
-      (%~) SCX SCG = Disproved (\ x -> case x of)
-      (%~) SCX SCH = Disproved (\ x -> case x of)
-      (%~) SCX SCI = Disproved (\ x -> case x of)
-      (%~) SCX SCJ = Disproved (\ x -> case x of)
-      (%~) SCX SCK = Disproved (\ x -> case x of)
-      (%~) SCX SCL = Disproved (\ x -> case x of)
-      (%~) SCX SCM = Disproved (\ x -> case x of)
-      (%~) SCX SCN = Disproved (\ x -> case x of)
-      (%~) SCX SCO = Disproved (\ x -> case x of)
-      (%~) SCX SCP = Disproved (\ x -> case x of)
-      (%~) SCX SCQ = Disproved (\ x -> case x of)
-      (%~) SCX SCR = Disproved (\ x -> case x of)
-      (%~) SCX SCS = Disproved (\ x -> case x of)
-      (%~) SCX SCT = Disproved (\ x -> case x of)
-      (%~) SCX SCU = Disproved (\ x -> case x of)
-      (%~) SCX SCV = Disproved (\ x -> case x of)
-      (%~) SCX SCW = Disproved (\ x -> case x of)
-      (%~) SCX SCX = Proved Refl
-      (%~) SCX SCY = Disproved (\ x -> case x of)
-      (%~) SCX SCZ = Disproved (\ x -> case x of)
-      (%~) SCY SCA = Disproved (\ x -> case x of)
-      (%~) SCY SCB = Disproved (\ x -> case x of)
-      (%~) SCY SCC = Disproved (\ x -> case x of)
-      (%~) SCY SCD = Disproved (\ x -> case x of)
-      (%~) SCY SCE = Disproved (\ x -> case x of)
-      (%~) SCY SCF = Disproved (\ x -> case x of)
-      (%~) SCY SCG = Disproved (\ x -> case x of)
-      (%~) SCY SCH = Disproved (\ x -> case x of)
-      (%~) SCY SCI = Disproved (\ x -> case x of)
-      (%~) SCY SCJ = Disproved (\ x -> case x of)
-      (%~) SCY SCK = Disproved (\ x -> case x of)
-      (%~) SCY SCL = Disproved (\ x -> case x of)
-      (%~) SCY SCM = Disproved (\ x -> case x of)
-      (%~) SCY SCN = Disproved (\ x -> case x of)
-      (%~) SCY SCO = Disproved (\ x -> case x of)
-      (%~) SCY SCP = Disproved (\ x -> case x of)
-      (%~) SCY SCQ = Disproved (\ x -> case x of)
-      (%~) SCY SCR = Disproved (\ x -> case x of)
-      (%~) SCY SCS = Disproved (\ x -> case x of)
-      (%~) SCY SCT = Disproved (\ x -> case x of)
-      (%~) SCY SCU = Disproved (\ x -> case x of)
-      (%~) SCY SCV = Disproved (\ x -> case x of)
-      (%~) SCY SCW = Disproved (\ x -> case x of)
-      (%~) SCY SCX = Disproved (\ x -> case x of)
-      (%~) SCY SCY = Proved Refl
-      (%~) SCY SCZ = Disproved (\ x -> case x of)
-      (%~) SCZ SCA = Disproved (\ x -> case x of)
-      (%~) SCZ SCB = Disproved (\ x -> case x of)
-      (%~) SCZ SCC = Disproved (\ x -> case x of)
-      (%~) SCZ SCD = Disproved (\ x -> case x of)
-      (%~) SCZ SCE = Disproved (\ x -> case x of)
-      (%~) SCZ SCF = Disproved (\ x -> case x of)
-      (%~) SCZ SCG = Disproved (\ x -> case x of)
-      (%~) SCZ SCH = Disproved (\ x -> case x of)
-      (%~) SCZ SCI = Disproved (\ x -> case x of)
-      (%~) SCZ SCJ = Disproved (\ x -> case x of)
-      (%~) SCZ SCK = Disproved (\ x -> case x of)
-      (%~) SCZ SCL = Disproved (\ x -> case x of)
-      (%~) SCZ SCM = Disproved (\ x -> case x of)
-      (%~) SCZ SCN = Disproved (\ x -> case x of)
-      (%~) SCZ SCO = Disproved (\ x -> case x of)
-      (%~) SCZ SCP = Disproved (\ x -> case x of)
-      (%~) SCZ SCQ = Disproved (\ x -> case x of)
-      (%~) SCZ SCR = Disproved (\ x -> case x of)
-      (%~) SCZ SCS = Disproved (\ x -> case x of)
-      (%~) SCZ SCT = Disproved (\ x -> case x of)
-      (%~) SCZ SCU = Disproved (\ x -> case x of)
-      (%~) SCZ SCV = Disproved (\ x -> case x of)
-      (%~) SCZ SCW = Disproved (\ x -> case x of)
-      (%~) SCZ SCX = Disproved (\ x -> case x of)
-      (%~) SCZ SCY = Disproved (\ x -> case x of)
-      (%~) SCZ SCZ = Proved Refl
-    instance Data.Type.Equality.TestEquality (SAChar :: AChar
-                                                        -> Type) where
-      Data.Type.Equality.testEquality
-        = Data.Singletons.Decide.decideEquality
-    instance Data.Type.Coercion.TestCoercion (SAChar :: AChar
-                                                        -> Type) where
-      Data.Type.Coercion.testCoercion
-        = Data.Singletons.Decide.decideCoercion
-    instance (Data.Singletons.ShowSing.ShowSing U,
-              Data.Singletons.ShowSing.ShowSing Nat) =>
-             Show (SU (z :: U)) where
-      showsPrec _ SBOOL = showString "SBOOL"
-      showsPrec _ SSTRING = showString "SSTRING"
-      showsPrec _ SNAT = showString "SNAT"
-      showsPrec
-        p_0123456789876543210
-        (SVEC (arg_0123456789876543210 :: Sing argTy_0123456789876543210)
-              (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
-        = (showParen (((>) p_0123456789876543210) 10))
-            (((.) (showString "SVEC "))
-               (((.) ((showsPrec 11) arg_0123456789876543210))
-                  (((.) GHC.Show.showSpace)
-                     ((showsPrec 11) arg_0123456789876543210)))) ::
-            (Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210,
-             Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210) =>
-            ShowS
-    instance Show (SAChar (z :: AChar)) where
-      showsPrec _ SCA = showString "SCA"
-      showsPrec _ SCB = showString "SCB"
-      showsPrec _ SCC = showString "SCC"
-      showsPrec _ SCD = showString "SCD"
-      showsPrec _ SCE = showString "SCE"
-      showsPrec _ SCF = showString "SCF"
-      showsPrec _ SCG = showString "SCG"
-      showsPrec _ SCH = showString "SCH"
-      showsPrec _ SCI = showString "SCI"
-      showsPrec _ SCJ = showString "SCJ"
-      showsPrec _ SCK = showString "SCK"
-      showsPrec _ SCL = showString "SCL"
-      showsPrec _ SCM = showString "SCM"
-      showsPrec _ SCN = showString "SCN"
-      showsPrec _ SCO = showString "SCO"
-      showsPrec _ SCP = showString "SCP"
-      showsPrec _ SCQ = showString "SCQ"
-      showsPrec _ SCR = showString "SCR"
-      showsPrec _ SCS = showString "SCS"
-      showsPrec _ SCT = showString "SCT"
-      showsPrec _ SCU = showString "SCU"
-      showsPrec _ SCV = showString "SCV"
-      showsPrec _ SCW = showString "SCW"
-      showsPrec _ SCX = showString "SCX"
-      showsPrec _ SCY = showString "SCY"
-      showsPrec _ SCZ = showString "SCZ"
-    instance SingI BOOL where
-      sing = SBOOL
-    instance SingI STRING where
-      sing = SSTRING
-    instance SingI NAT where
-      sing = SNAT
-    instance (SingI n, SingI n) =>
-             SingI (VEC (n :: U) (n :: Nat)) where
-      sing = (SVEC sing) sing
-    instance SingI (VECSym0 :: (~>) U ((~>) Nat U)) where
-      sing = (singFun2 @VECSym0) SVEC
-    instance SingI d => SingI (VECSym1 (d :: U) :: (~>) Nat U) where
-      sing = (singFun1 @(VECSym1 (d :: U))) (SVEC (sing @d))
-    instance SingI CA where
-      sing = SCA
-    instance SingI CB where
-      sing = SCB
-    instance SingI CC where
-      sing = SCC
-    instance SingI CD where
-      sing = SCD
-    instance SingI CE where
-      sing = SCE
-    instance SingI CF where
-      sing = SCF
-    instance SingI CG where
-      sing = SCG
-    instance SingI CH where
-      sing = SCH
-    instance SingI CI where
-      sing = SCI
-    instance SingI CJ where
-      sing = SCJ
-    instance SingI CK where
-      sing = SCK
-    instance SingI CL where
-      sing = SCL
-    instance SingI CM where
-      sing = SCM
-    instance SingI CN where
-      sing = SCN
-    instance SingI CO where
-      sing = SCO
-    instance SingI CP where
-      sing = SCP
-    instance SingI CQ where
-      sing = SCQ
-    instance SingI CR where
-      sing = SCR
-    instance SingI CS where
-      sing = SCS
-    instance SingI CT where
-      sing = SCT
-    instance SingI CU where
-      sing = SCU
-    instance SingI CV where
-      sing = SCV
-    instance SingI CW where
-      sing = SCW
-    instance SingI CX where
-      sing = SCX
-    instance SingI CY where
-      sing = SCY
-    instance SingI CZ where
-      sing = SCZ
-    instance (SingI n, SingI n) =>
-             SingI (Attr (n :: [AChar]) (n :: U)) where
-      sing = (SAttr sing) sing
-    instance SingI (AttrSym0 :: (~>) [AChar] ((~>) U Attribute)) where
-      sing = (singFun2 @AttrSym0) SAttr
-    instance SingI d =>
-             SingI (AttrSym1 (d :: [AChar]) :: (~>) U Attribute) where
-      sing = (singFun1 @(AttrSym1 (d :: [AChar]))) (SAttr (sing @d))
-    instance SingI n => SingI (Sch (n :: [Attribute])) where
-      sing = SSch sing
-    instance SingI (SchSym0 :: (~>) [Attribute] Schema) where
-      sing = (singFun1 @SchSym0) SSch
-GradingClient/Database.hs:0:0:: Splicing declarations
-    return [] ======>
-GradingClient/Database.hs:(0,0)-(0,0): Splicing expression
-    cases ''Row [| r |] [| changeId (n ++ (getId r)) r |]
-  ======>
-    case r of
-      EmptyRow _ -> (changeId (((++) n) (getId r))) r
-      ConsRow _ _ -> (changeId (((++) n) (getId r))) r
diff --git a/tests/compile-and-dump/GradingClient/Database.golden b/tests/compile-and-dump/GradingClient/Database.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/GradingClient/Database.golden
@@ -0,0 +1,2656 @@
+GradingClient/Database.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| data Nat
+            = Zero | Succ Nat
+            deriving (Eq, Ord) |]
+  ======>
+    data Nat
+      = Zero | Succ Nat
+      deriving (Eq, Ord)
+    type ZeroSym0 = Zero :: Nat
+    type SuccSym0 :: (~>) Nat Nat
+    data SuccSym0 a0123456789876543210
+      where
+        SuccSym0KindInference :: SameKind (Apply SuccSym0 arg) (SuccSym1 arg) =>
+                                 SuccSym0 a0123456789876543210
+    type instance Apply SuccSym0 a0123456789876543210 = SuccSym1 a0123456789876543210
+    instance SuppressUnusedWarnings SuccSym0 where
+      suppressUnusedWarnings = snd (((,) SuccSym0KindInference) ())
+    type SuccSym1 (a0123456789876543210 :: Nat) =
+        Succ a0123456789876543210 :: Nat
+    type Compare_0123456789876543210 :: Nat -> Nat -> Ordering
+    type family Compare_0123456789876543210 a a where
+      Compare_0123456789876543210 Zero Zero = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) NilSym0
+      Compare_0123456789876543210 (Succ a_0123456789876543210) (Succ b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0)
+      Compare_0123456789876543210 Zero (Succ _) = LTSym0
+      Compare_0123456789876543210 (Succ _) Zero = GTSym0
+    type Compare_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Ordering)
+    data Compare_0123456789876543210Sym0 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
+                                                        Compare_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
+    type Compare_0123456789876543210Sym1 :: Nat -> (~>) Nat Ordering
+    data Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
+    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
+        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    instance POrd Nat where
+      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
+    type Equals_0123456789876543210 :: Nat -> Nat -> Bool
+    type family Equals_0123456789876543210 a b where
+      Equals_0123456789876543210 Zero Zero = TrueSym0
+      Equals_0123456789876543210 (Succ a) (Succ b) = (==) a b
+      Equals_0123456789876543210 (_ :: Nat) (_ :: Nat) = FalseSym0
+    instance PEq Nat where
+      type (==) a b = Equals_0123456789876543210 a b
+    data SNat :: Nat -> Type
+      where
+        SZero :: SNat (Zero :: Nat)
+        SSucc :: forall (n :: Nat). (Sing n) -> SNat (Succ n :: Nat)
+    type instance Sing @Nat = SNat
+    instance SingKind Nat where
+      type Demote Nat = Nat
+      fromSing SZero = Zero
+      fromSing (SSucc b) = Succ (fromSing b)
+      toSing Zero = SomeSing SZero
+      toSing (Succ (b :: Demote Nat))
+        = case toSing b :: SomeSing Nat of {
+            SomeSing c -> SomeSing (SSucc c) }
+    instance SOrd Nat => SOrd Nat where
+      sCompare ::
+        forall (t1 :: Nat) (t2 :: Nat).
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply (CompareSym0 :: TyFun Nat ((~>) Nat Ordering)
+                                                 -> Type) t1) t2)
+      sCompare SZero SZero
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            SNil
+      sCompare
+        (SSucc (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        (SSucc (sB_0123456789876543210 :: Sing b_0123456789876543210))
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            ((applySing
+                ((applySing ((singFun2 @(:@#@$)) SCons))
+                   ((applySing
+                       ((applySing ((singFun2 @CompareSym0) sCompare))
+                          sA_0123456789876543210))
+                      sB_0123456789876543210)))
+               SNil)
+      sCompare SZero (SSucc _) = SLT
+      sCompare (SSucc _) SZero = SGT
+    instance SEq Nat => SEq Nat where
+      (%==) SZero SZero = STrue
+      (%==) SZero (SSucc _) = SFalse
+      (%==) (SSucc _) SZero = SFalse
+      (%==) (SSucc a) (SSucc b) = ((%==) a) b
+    instance SDecide Nat => SDecide Nat where
+      (%~) SZero SZero = Proved Refl
+      (%~) SZero (SSucc _) = Disproved (\ x -> case x of)
+      (%~) (SSucc _) SZero = Disproved (\ x -> case x of)
+      (%~) (SSucc a) (SSucc b)
+        = case ((%~) a) b of
+            Proved Refl -> Proved Refl
+            Disproved contra
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+    instance SDecide Nat =>
+             Data.Type.Equality.TestEquality (SNat :: Nat -> Type) where
+      Data.Type.Equality.testEquality
+        = Data.Singletons.Decide.decideEquality
+    instance SDecide Nat =>
+             Data.Type.Coercion.TestCoercion (SNat :: Nat -> Type) where
+      Data.Type.Coercion.testCoercion
+        = Data.Singletons.Decide.decideCoercion
+    instance SingI Zero where
+      sing = SZero
+    instance SingI n => SingI (Succ (n :: Nat)) where
+      sing = SSucc sing
+    instance SingI (SuccSym0 :: (~>) Nat Nat) where
+      sing = (singFun1 @SuccSym0) SSucc
+GradingClient/Database.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| append :: Schema -> Schema -> Schema
+          append (Sch s1) (Sch s2) = Sch (s1 ++ s2)
+          attrNotIn :: Attribute -> Schema -> Bool
+          attrNotIn _ (Sch []) = True
+          attrNotIn (Attr name u) (Sch ((Attr name' _) : t))
+            = (name /= name') && (attrNotIn (Attr name u) (Sch t))
+          disjoint :: Schema -> Schema -> Bool
+          disjoint (Sch []) _ = True
+          disjoint (Sch (h : t)) s = (attrNotIn h s) && (disjoint (Sch t) s)
+          occurs :: [AChar] -> Schema -> Bool
+          occurs _ (Sch []) = False
+          occurs name (Sch ((Attr name' _) : attrs))
+            = name == name' || occurs name (Sch attrs)
+          lookup :: [AChar] -> Schema -> U
+          lookup _ (Sch []) = undefined
+          lookup name (Sch ((Attr name' u) : attrs))
+            = if name == name' then u else lookup name (Sch attrs)
+          
+          data U
+            = BOOL | STRING | NAT | VEC U Nat
+            deriving (Read, Eq, Show)
+          data AChar
+            = CA |
+              CB |
+              CC |
+              CD |
+              CE |
+              CF |
+              CG |
+              CH |
+              CI |
+              CJ |
+              CK |
+              CL |
+              CM |
+              CN |
+              CO |
+              CP |
+              CQ |
+              CR |
+              CS |
+              CT |
+              CU |
+              CV |
+              CW |
+              CX |
+              CY |
+              CZ
+            deriving (Read, Show, Eq)
+          data Attribute = Attr [AChar] U
+          data Schema = Sch [Attribute] |]
+  ======>
+    data U
+      = BOOL | STRING | NAT | VEC U Nat
+      deriving (Read, Eq, Show)
+    data AChar
+      = CA |
+        CB |
+        CC |
+        CD |
+        CE |
+        CF |
+        CG |
+        CH |
+        CI |
+        CJ |
+        CK |
+        CL |
+        CM |
+        CN |
+        CO |
+        CP |
+        CQ |
+        CR |
+        CS |
+        CT |
+        CU |
+        CV |
+        CW |
+        CX |
+        CY |
+        CZ
+      deriving (Read, Show, Eq)
+    data Attribute = Attr [AChar] U
+    data Schema = Sch [Attribute]
+    append :: Schema -> Schema -> Schema
+    append (Sch s1) (Sch s2) = Sch (s1 ++ s2)
+    attrNotIn :: Attribute -> Schema -> Bool
+    attrNotIn _ (Sch []) = True
+    attrNotIn (Attr name u) (Sch (Attr name' _ : t))
+      = ((name /= name') && (attrNotIn ((Attr name) u)) (Sch t))
+    disjoint :: Schema -> Schema -> Bool
+    disjoint (Sch []) _ = True
+    disjoint (Sch (h : t)) s
+      = ((attrNotIn h) s && (disjoint (Sch t)) s)
+    occurs :: [AChar] -> Schema -> Bool
+    occurs _ (Sch []) = False
+    occurs name (Sch (Attr name' _ : attrs))
+      = ((name == name') || (occurs name) (Sch attrs))
+    lookup :: [AChar] -> Schema -> U
+    lookup _ (Sch []) = undefined
+    lookup name (Sch (Attr name' u : attrs))
+      = if (name == name') then u else (lookup name) (Sch attrs)
+    type BOOLSym0 = BOOL :: U
+    type STRINGSym0 = STRING :: U
+    type NATSym0 = NAT :: U
+    type VECSym0 :: (~>) U ((~>) Nat U)
+    data VECSym0 a0123456789876543210
+      where
+        VECSym0KindInference :: SameKind (Apply VECSym0 arg) (VECSym1 arg) =>
+                                VECSym0 a0123456789876543210
+    type instance Apply VECSym0 a0123456789876543210 = VECSym1 a0123456789876543210
+    instance SuppressUnusedWarnings VECSym0 where
+      suppressUnusedWarnings = snd (((,) VECSym0KindInference) ())
+    type VECSym1 :: U -> (~>) Nat U
+    data VECSym1 a0123456789876543210 a0123456789876543210
+      where
+        VECSym1KindInference :: SameKind (Apply (VECSym1 a0123456789876543210) arg) (VECSym2 a0123456789876543210 arg) =>
+                                VECSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (VECSym1 a0123456789876543210) a0123456789876543210 = VECSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (VECSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) VECSym1KindInference) ())
+    type VECSym2 (a0123456789876543210 :: U) (a0123456789876543210 :: Nat) =
+        VEC a0123456789876543210 a0123456789876543210 :: U
+    type CASym0 = CA :: AChar
+    type CBSym0 = CB :: AChar
+    type CCSym0 = CC :: AChar
+    type CDSym0 = CD :: AChar
+    type CESym0 = CE :: AChar
+    type CFSym0 = CF :: AChar
+    type CGSym0 = CG :: AChar
+    type CHSym0 = CH :: AChar
+    type CISym0 = CI :: AChar
+    type CJSym0 = CJ :: AChar
+    type CKSym0 = CK :: AChar
+    type CLSym0 = CL :: AChar
+    type CMSym0 = CM :: AChar
+    type CNSym0 = CN :: AChar
+    type COSym0 = CO :: AChar
+    type CPSym0 = CP :: AChar
+    type CQSym0 = CQ :: AChar
+    type CRSym0 = CR :: AChar
+    type CSSym0 = CS :: AChar
+    type CTSym0 = CT :: AChar
+    type CUSym0 = CU :: AChar
+    type CVSym0 = CV :: AChar
+    type CWSym0 = CW :: AChar
+    type CXSym0 = CX :: AChar
+    type CYSym0 = CY :: AChar
+    type CZSym0 = CZ :: AChar
+    type AttrSym0 :: (~>) [AChar] ((~>) U Attribute)
+    data AttrSym0 a0123456789876543210
+      where
+        AttrSym0KindInference :: SameKind (Apply AttrSym0 arg) (AttrSym1 arg) =>
+                                 AttrSym0 a0123456789876543210
+    type instance Apply AttrSym0 a0123456789876543210 = AttrSym1 a0123456789876543210
+    instance SuppressUnusedWarnings AttrSym0 where
+      suppressUnusedWarnings = snd (((,) AttrSym0KindInference) ())
+    type AttrSym1 :: [AChar] -> (~>) U Attribute
+    data AttrSym1 a0123456789876543210 a0123456789876543210
+      where
+        AttrSym1KindInference :: SameKind (Apply (AttrSym1 a0123456789876543210) arg) (AttrSym2 a0123456789876543210 arg) =>
+                                 AttrSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (AttrSym1 a0123456789876543210) a0123456789876543210 = AttrSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (AttrSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) AttrSym1KindInference) ())
+    type AttrSym2 (a0123456789876543210 :: [AChar]) (a0123456789876543210 :: U) =
+        Attr a0123456789876543210 a0123456789876543210 :: Attribute
+    type SchSym0 :: (~>) [Attribute] Schema
+    data SchSym0 a0123456789876543210
+      where
+        SchSym0KindInference :: SameKind (Apply SchSym0 arg) (SchSym1 arg) =>
+                                SchSym0 a0123456789876543210
+    type instance Apply SchSym0 a0123456789876543210 = SchSym1 a0123456789876543210
+    instance SuppressUnusedWarnings SchSym0 where
+      suppressUnusedWarnings = snd (((,) SchSym0KindInference) ())
+    type SchSym1 (a0123456789876543210 :: [Attribute]) =
+        Sch a0123456789876543210 :: Schema
+    data Let0123456789876543210Scrutinee_0123456789876543210Sym0 name0123456789876543210
+      where
+        Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference :: SameKind (Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym1 arg) =>
+                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym0 name0123456789876543210
+    type instance Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 name0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym1 name0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210Scrutinee_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd
+            (((,)
+                Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference)
+               ())
+    data Let0123456789876543210Scrutinee_0123456789876543210Sym1 name0123456789876543210 name'0123456789876543210
+      where
+        Let0123456789876543210Scrutinee_0123456789876543210Sym1KindInference :: SameKind (Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym1 name0123456789876543210) arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym2 name0123456789876543210 arg) =>
+                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym1 name0123456789876543210 name'0123456789876543210
+    type instance Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym1 name0123456789876543210) name'0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym2 name0123456789876543210 name'0123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210Scrutinee_0123456789876543210Sym1 name0123456789876543210) where
+      suppressUnusedWarnings
+        = snd
+            (((,)
+                Let0123456789876543210Scrutinee_0123456789876543210Sym1KindInference)
+               ())
+    data Let0123456789876543210Scrutinee_0123456789876543210Sym2 name0123456789876543210 name'0123456789876543210 u0123456789876543210
+      where
+        Let0123456789876543210Scrutinee_0123456789876543210Sym2KindInference :: SameKind (Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym2 name0123456789876543210 name'0123456789876543210) arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym3 name0123456789876543210 name'0123456789876543210 arg) =>
+                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym2 name0123456789876543210 name'0123456789876543210 u0123456789876543210
+    type instance Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym2 name0123456789876543210 name'0123456789876543210) u0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym3 name0123456789876543210 name'0123456789876543210 u0123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210Scrutinee_0123456789876543210Sym2 name0123456789876543210 name'0123456789876543210) where
+      suppressUnusedWarnings
+        = snd
+            (((,)
+                Let0123456789876543210Scrutinee_0123456789876543210Sym2KindInference)
+               ())
+    data Let0123456789876543210Scrutinee_0123456789876543210Sym3 name0123456789876543210 name'0123456789876543210 u0123456789876543210 attrs0123456789876543210
+      where
+        Let0123456789876543210Scrutinee_0123456789876543210Sym3KindInference :: SameKind (Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym3 name0123456789876543210 name'0123456789876543210 u0123456789876543210) arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym4 name0123456789876543210 name'0123456789876543210 u0123456789876543210 arg) =>
+                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym3 name0123456789876543210 name'0123456789876543210 u0123456789876543210 attrs0123456789876543210
+    type instance Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym3 name0123456789876543210 name'0123456789876543210 u0123456789876543210) attrs0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym4 name0123456789876543210 name'0123456789876543210 u0123456789876543210 attrs0123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210Scrutinee_0123456789876543210Sym3 name0123456789876543210 name'0123456789876543210 u0123456789876543210) where
+      suppressUnusedWarnings
+        = snd
+            (((,)
+                Let0123456789876543210Scrutinee_0123456789876543210Sym3KindInference)
+               ())
+    type Let0123456789876543210Scrutinee_0123456789876543210Sym4 name0123456789876543210 name'0123456789876543210 u0123456789876543210 attrs0123456789876543210 =
+        Let0123456789876543210Scrutinee_0123456789876543210 name0123456789876543210 name'0123456789876543210 u0123456789876543210 attrs0123456789876543210
+    type family Let0123456789876543210Scrutinee_0123456789876543210 name name' u attrs where
+      Let0123456789876543210Scrutinee_0123456789876543210 name name' u attrs = Apply (Apply (==@#@$) name) name'
+    type family Case_0123456789876543210 name name' u attrs t where
+      Case_0123456789876543210 name name' u attrs 'True = u
+      Case_0123456789876543210 name name' u attrs 'False = Apply (Apply LookupSym0 name) (Apply SchSym0 attrs)
+    type LookupSym0 :: (~>) [AChar] ((~>) Schema U)
+    data LookupSym0 a0123456789876543210
+      where
+        LookupSym0KindInference :: SameKind (Apply LookupSym0 arg) (LookupSym1 arg) =>
+                                   LookupSym0 a0123456789876543210
+    type instance Apply LookupSym0 a0123456789876543210 = LookupSym1 a0123456789876543210
+    instance SuppressUnusedWarnings LookupSym0 where
+      suppressUnusedWarnings = snd (((,) LookupSym0KindInference) ())
+    type LookupSym1 :: [AChar] -> (~>) Schema U
+    data LookupSym1 a0123456789876543210 a0123456789876543210
+      where
+        LookupSym1KindInference :: SameKind (Apply (LookupSym1 a0123456789876543210) arg) (LookupSym2 a0123456789876543210 arg) =>
+                                   LookupSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (LookupSym1 a0123456789876543210) a0123456789876543210 = LookupSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (LookupSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) LookupSym1KindInference) ())
+    type LookupSym2 (a0123456789876543210 :: [AChar]) (a0123456789876543210 :: Schema) =
+        Lookup a0123456789876543210 a0123456789876543210 :: U
+    type OccursSym0 :: (~>) [AChar] ((~>) Schema Bool)
+    data OccursSym0 a0123456789876543210
+      where
+        OccursSym0KindInference :: SameKind (Apply OccursSym0 arg) (OccursSym1 arg) =>
+                                   OccursSym0 a0123456789876543210
+    type instance Apply OccursSym0 a0123456789876543210 = OccursSym1 a0123456789876543210
+    instance SuppressUnusedWarnings OccursSym0 where
+      suppressUnusedWarnings = snd (((,) OccursSym0KindInference) ())
+    type OccursSym1 :: [AChar] -> (~>) Schema Bool
+    data OccursSym1 a0123456789876543210 a0123456789876543210
+      where
+        OccursSym1KindInference :: SameKind (Apply (OccursSym1 a0123456789876543210) arg) (OccursSym2 a0123456789876543210 arg) =>
+                                   OccursSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (OccursSym1 a0123456789876543210) a0123456789876543210 = OccursSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (OccursSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) OccursSym1KindInference) ())
+    type OccursSym2 (a0123456789876543210 :: [AChar]) (a0123456789876543210 :: Schema) =
+        Occurs a0123456789876543210 a0123456789876543210 :: Bool
+    type DisjointSym0 :: (~>) Schema ((~>) Schema Bool)
+    data DisjointSym0 a0123456789876543210
+      where
+        DisjointSym0KindInference :: SameKind (Apply DisjointSym0 arg) (DisjointSym1 arg) =>
+                                     DisjointSym0 a0123456789876543210
+    type instance Apply DisjointSym0 a0123456789876543210 = DisjointSym1 a0123456789876543210
+    instance SuppressUnusedWarnings DisjointSym0 where
+      suppressUnusedWarnings = snd (((,) DisjointSym0KindInference) ())
+    type DisjointSym1 :: Schema -> (~>) Schema Bool
+    data DisjointSym1 a0123456789876543210 a0123456789876543210
+      where
+        DisjointSym1KindInference :: SameKind (Apply (DisjointSym1 a0123456789876543210) arg) (DisjointSym2 a0123456789876543210 arg) =>
+                                     DisjointSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (DisjointSym1 a0123456789876543210) a0123456789876543210 = DisjointSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (DisjointSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) DisjointSym1KindInference) ())
+    type DisjointSym2 (a0123456789876543210 :: Schema) (a0123456789876543210 :: Schema) =
+        Disjoint a0123456789876543210 a0123456789876543210 :: Bool
+    type AttrNotInSym0 :: (~>) Attribute ((~>) Schema Bool)
+    data AttrNotInSym0 a0123456789876543210
+      where
+        AttrNotInSym0KindInference :: SameKind (Apply AttrNotInSym0 arg) (AttrNotInSym1 arg) =>
+                                      AttrNotInSym0 a0123456789876543210
+    type instance Apply AttrNotInSym0 a0123456789876543210 = AttrNotInSym1 a0123456789876543210
+    instance SuppressUnusedWarnings AttrNotInSym0 where
+      suppressUnusedWarnings = snd (((,) AttrNotInSym0KindInference) ())
+    type AttrNotInSym1 :: Attribute -> (~>) Schema Bool
+    data AttrNotInSym1 a0123456789876543210 a0123456789876543210
+      where
+        AttrNotInSym1KindInference :: SameKind (Apply (AttrNotInSym1 a0123456789876543210) arg) (AttrNotInSym2 a0123456789876543210 arg) =>
+                                      AttrNotInSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (AttrNotInSym1 a0123456789876543210) a0123456789876543210 = AttrNotInSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (AttrNotInSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) AttrNotInSym1KindInference) ())
+    type AttrNotInSym2 (a0123456789876543210 :: Attribute) (a0123456789876543210 :: Schema) =
+        AttrNotIn a0123456789876543210 a0123456789876543210 :: Bool
+    type AppendSym0 :: (~>) Schema ((~>) Schema Schema)
+    data AppendSym0 a0123456789876543210
+      where
+        AppendSym0KindInference :: SameKind (Apply AppendSym0 arg) (AppendSym1 arg) =>
+                                   AppendSym0 a0123456789876543210
+    type instance Apply AppendSym0 a0123456789876543210 = AppendSym1 a0123456789876543210
+    instance SuppressUnusedWarnings AppendSym0 where
+      suppressUnusedWarnings = snd (((,) AppendSym0KindInference) ())
+    type AppendSym1 :: Schema -> (~>) Schema Schema
+    data AppendSym1 a0123456789876543210 a0123456789876543210
+      where
+        AppendSym1KindInference :: SameKind (Apply (AppendSym1 a0123456789876543210) arg) (AppendSym2 a0123456789876543210 arg) =>
+                                   AppendSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (AppendSym1 a0123456789876543210) a0123456789876543210 = AppendSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (AppendSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) AppendSym1KindInference) ())
+    type AppendSym2 (a0123456789876543210 :: Schema) (a0123456789876543210 :: Schema) =
+        Append a0123456789876543210 a0123456789876543210 :: Schema
+    type Lookup :: [AChar] -> Schema -> U
+    type family Lookup a a where
+      Lookup _ (Sch '[]) = UndefinedSym0
+      Lookup name (Sch ('(:) (Attr name' u) attrs)) = Case_0123456789876543210 name name' u attrs (Let0123456789876543210Scrutinee_0123456789876543210Sym4 name name' u attrs)
+    type Occurs :: [AChar] -> Schema -> Bool
+    type family Occurs a a where
+      Occurs _ (Sch '[]) = FalseSym0
+      Occurs name (Sch ('(:) (Attr name' _) attrs)) = Apply (Apply (||@#@$) (Apply (Apply (==@#@$) name) name')) (Apply (Apply OccursSym0 name) (Apply SchSym0 attrs))
+    type Disjoint :: Schema -> Schema -> Bool
+    type family Disjoint a a where
+      Disjoint (Sch '[]) _ = TrueSym0
+      Disjoint (Sch ('(:) h t)) s = Apply (Apply (&&@#@$) (Apply (Apply AttrNotInSym0 h) s)) (Apply (Apply DisjointSym0 (Apply SchSym0 t)) s)
+    type AttrNotIn :: Attribute -> Schema -> Bool
+    type family AttrNotIn a a where
+      AttrNotIn _ (Sch '[]) = TrueSym0
+      AttrNotIn (Attr name u) (Sch ('(:) (Attr name' _) t)) = Apply (Apply (&&@#@$) (Apply (Apply (/=@#@$) name) name')) (Apply (Apply AttrNotInSym0 (Apply (Apply AttrSym0 name) u)) (Apply SchSym0 t))
+    type Append :: Schema -> Schema -> Schema
+    type family Append a a where
+      Append (Sch s1) (Sch s2) = Apply SchSym0 (Apply (Apply (++@#@$) s1) s2)
+    type ShowsPrec_0123456789876543210 :: GHC.Types.Nat
+                                          -> U -> Symbol -> Symbol
+    type family ShowsPrec_0123456789876543210 a a a where
+      ShowsPrec_0123456789876543210 _ BOOL a_0123456789876543210 = Apply (Apply ShowStringSym0 "BOOL") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ STRING a_0123456789876543210 = Apply (Apply ShowStringSym0 "STRING") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ NAT a_0123456789876543210 = Apply (Apply ShowStringSym0 "NAT") a_0123456789876543210
+      ShowsPrec_0123456789876543210 p_0123456789876543210 (VEC arg_0123456789876543210 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "VEC ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowSpaceSym0) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))))) a_0123456789876543210
+    type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) U ((~>) Symbol Symbol))
+    data ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
+    type ShowsPrec_0123456789876543210Sym1 :: GHC.Types.Nat
+                                              -> (~>) U ((~>) Symbol Symbol)
+    data ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
+    type ShowsPrec_0123456789876543210Sym2 :: GHC.Types.Nat
+                                              -> U -> (~>) Symbol Symbol
+    data ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
+    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: U) (a0123456789876543210 :: Symbol) =
+        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Symbol
+    instance PShow U where
+      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
+    type ShowsPrec_0123456789876543210 :: GHC.Types.Nat
+                                          -> AChar -> Symbol -> Symbol
+    type family ShowsPrec_0123456789876543210 a a a where
+      ShowsPrec_0123456789876543210 _ CA a_0123456789876543210 = Apply (Apply ShowStringSym0 "CA") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CB a_0123456789876543210 = Apply (Apply ShowStringSym0 "CB") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CC a_0123456789876543210 = Apply (Apply ShowStringSym0 "CC") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CD a_0123456789876543210 = Apply (Apply ShowStringSym0 "CD") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CE a_0123456789876543210 = Apply (Apply ShowStringSym0 "CE") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CF a_0123456789876543210 = Apply (Apply ShowStringSym0 "CF") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CG a_0123456789876543210 = Apply (Apply ShowStringSym0 "CG") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CH a_0123456789876543210 = Apply (Apply ShowStringSym0 "CH") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CI a_0123456789876543210 = Apply (Apply ShowStringSym0 "CI") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CJ a_0123456789876543210 = Apply (Apply ShowStringSym0 "CJ") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CK a_0123456789876543210 = Apply (Apply ShowStringSym0 "CK") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CL a_0123456789876543210 = Apply (Apply ShowStringSym0 "CL") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CM a_0123456789876543210 = Apply (Apply ShowStringSym0 "CM") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CN a_0123456789876543210 = Apply (Apply ShowStringSym0 "CN") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CO a_0123456789876543210 = Apply (Apply ShowStringSym0 "CO") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CP a_0123456789876543210 = Apply (Apply ShowStringSym0 "CP") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CQ a_0123456789876543210 = Apply (Apply ShowStringSym0 "CQ") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CR a_0123456789876543210 = Apply (Apply ShowStringSym0 "CR") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CS a_0123456789876543210 = Apply (Apply ShowStringSym0 "CS") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CT a_0123456789876543210 = Apply (Apply ShowStringSym0 "CT") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CU a_0123456789876543210 = Apply (Apply ShowStringSym0 "CU") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CV a_0123456789876543210 = Apply (Apply ShowStringSym0 "CV") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CW a_0123456789876543210 = Apply (Apply ShowStringSym0 "CW") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CX a_0123456789876543210 = Apply (Apply ShowStringSym0 "CX") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CY a_0123456789876543210 = Apply (Apply ShowStringSym0 "CY") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ CZ a_0123456789876543210 = Apply (Apply ShowStringSym0 "CZ") a_0123456789876543210
+    type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) AChar ((~>) Symbol Symbol))
+    data ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
+    type ShowsPrec_0123456789876543210Sym1 :: GHC.Types.Nat
+                                              -> (~>) AChar ((~>) Symbol Symbol)
+    data ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
+    type ShowsPrec_0123456789876543210Sym2 :: GHC.Types.Nat
+                                              -> AChar -> (~>) Symbol Symbol
+    data ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
+    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: AChar) (a0123456789876543210 :: Symbol) =
+        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Symbol
+    instance PShow AChar where
+      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
+    type Equals_0123456789876543210 :: U -> U -> Bool
+    type family Equals_0123456789876543210 a b where
+      Equals_0123456789876543210 BOOL BOOL = TrueSym0
+      Equals_0123456789876543210 STRING STRING = TrueSym0
+      Equals_0123456789876543210 NAT NAT = TrueSym0
+      Equals_0123456789876543210 (VEC a a) (VEC b b) = (&&) ((==) a b) ((==) a b)
+      Equals_0123456789876543210 (_ :: U) (_ :: U) = FalseSym0
+    instance PEq U where
+      type (==) a b = Equals_0123456789876543210 a b
+    type Equals_0123456789876543210 :: AChar -> AChar -> Bool
+    type family Equals_0123456789876543210 a b where
+      Equals_0123456789876543210 CA CA = TrueSym0
+      Equals_0123456789876543210 CB CB = TrueSym0
+      Equals_0123456789876543210 CC CC = TrueSym0
+      Equals_0123456789876543210 CD CD = TrueSym0
+      Equals_0123456789876543210 CE CE = TrueSym0
+      Equals_0123456789876543210 CF CF = TrueSym0
+      Equals_0123456789876543210 CG CG = TrueSym0
+      Equals_0123456789876543210 CH CH = TrueSym0
+      Equals_0123456789876543210 CI CI = TrueSym0
+      Equals_0123456789876543210 CJ CJ = TrueSym0
+      Equals_0123456789876543210 CK CK = TrueSym0
+      Equals_0123456789876543210 CL CL = TrueSym0
+      Equals_0123456789876543210 CM CM = TrueSym0
+      Equals_0123456789876543210 CN CN = TrueSym0
+      Equals_0123456789876543210 CO CO = TrueSym0
+      Equals_0123456789876543210 CP CP = TrueSym0
+      Equals_0123456789876543210 CQ CQ = TrueSym0
+      Equals_0123456789876543210 CR CR = TrueSym0
+      Equals_0123456789876543210 CS CS = TrueSym0
+      Equals_0123456789876543210 CT CT = TrueSym0
+      Equals_0123456789876543210 CU CU = TrueSym0
+      Equals_0123456789876543210 CV CV = TrueSym0
+      Equals_0123456789876543210 CW CW = TrueSym0
+      Equals_0123456789876543210 CX CX = TrueSym0
+      Equals_0123456789876543210 CY CY = TrueSym0
+      Equals_0123456789876543210 CZ CZ = TrueSym0
+      Equals_0123456789876543210 (_ :: AChar) (_ :: AChar) = FalseSym0
+    instance PEq AChar where
+      type (==) a b = Equals_0123456789876543210 a b
+    sLookup ::
+      forall (t :: [AChar]) (t :: Schema).
+      Sing t -> Sing t -> Sing (Apply (Apply LookupSym0 t) t :: U)
+    sOccurs ::
+      forall (t :: [AChar]) (t :: Schema).
+      Sing t -> Sing t -> Sing (Apply (Apply OccursSym0 t) t :: Bool)
+    sDisjoint ::
+      forall (t :: Schema) (t :: Schema).
+      Sing t -> Sing t -> Sing (Apply (Apply DisjointSym0 t) t :: Bool)
+    sAttrNotIn ::
+      forall (t :: Attribute) (t :: Schema).
+      Sing t -> Sing t -> Sing (Apply (Apply AttrNotInSym0 t) t :: Bool)
+    sAppend ::
+      forall (t :: Schema) (t :: Schema).
+      Sing t -> Sing t -> Sing (Apply (Apply AppendSym0 t) t :: Schema)
+    sLookup _ (SSch SNil) = sUndefined
+    sLookup
+      (sName :: Sing name)
+      (SSch (SCons (SAttr (sName' :: Sing name') (sU :: Sing u))
+                   (sAttrs :: Sing attrs)))
+      = let
+          sScrutinee_0123456789876543210 ::
+            Sing @_ (Let0123456789876543210Scrutinee_0123456789876543210Sym4 name name' u attrs)
+          sScrutinee_0123456789876543210
+            = (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sName))
+                sName'
+        in
+          (GHC.Base.id
+             @(Sing (Case_0123456789876543210 name name' u attrs (Let0123456789876543210Scrutinee_0123456789876543210Sym4 name name' u attrs) :: U)))
+            (case sScrutinee_0123456789876543210 of
+               STrue -> sU
+               SFalse
+                 -> (applySing ((applySing ((singFun2 @LookupSym0) sLookup)) sName))
+                      ((applySing ((singFun1 @SchSym0) SSch)) sAttrs))
+    sOccurs _ (SSch SNil) = SFalse
+    sOccurs
+      (sName :: Sing name)
+      (SSch (SCons (SAttr (sName' :: Sing name') _)
+                   (sAttrs :: Sing attrs)))
+      = (applySing
+           ((applySing ((singFun2 @(||@#@$)) (%||)))
+              ((applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sName))
+                 sName')))
+          ((applySing ((applySing ((singFun2 @OccursSym0) sOccurs)) sName))
+             ((applySing ((singFun1 @SchSym0) SSch)) sAttrs))
+    sDisjoint (SSch SNil) _ = STrue
+    sDisjoint
+      (SSch (SCons (sH :: Sing h) (sT :: Sing t)))
+      (sS :: Sing s)
+      = (applySing
+           ((applySing ((singFun2 @(&&@#@$)) (%&&)))
+              ((applySing
+                  ((applySing ((singFun2 @AttrNotInSym0) sAttrNotIn)) sH))
+                 sS)))
+          ((applySing
+              ((applySing ((singFun2 @DisjointSym0) sDisjoint))
+                 ((applySing ((singFun1 @SchSym0) SSch)) sT)))
+             sS)
+    sAttrNotIn _ (SSch SNil) = STrue
+    sAttrNotIn
+      (SAttr (sName :: Sing name) (sU :: Sing u))
+      (SSch (SCons (SAttr (sName' :: Sing name') _) (sT :: Sing t)))
+      = (applySing
+           ((applySing ((singFun2 @(&&@#@$)) (%&&)))
+              ((applySing ((applySing ((singFun2 @(/=@#@$)) (%/=))) sName))
+                 sName')))
+          ((applySing
+              ((applySing ((singFun2 @AttrNotInSym0) sAttrNotIn))
+                 ((applySing ((applySing ((singFun2 @AttrSym0) SAttr)) sName)) sU)))
+             ((applySing ((singFun1 @SchSym0) SSch)) sT))
+    sAppend (SSch (sS1 :: Sing s1)) (SSch (sS2 :: Sing s2))
+      = (applySing ((singFun1 @SchSym0) SSch))
+          ((applySing ((applySing ((singFun2 @(++@#@$)) (%++))) sS1)) sS2)
+    instance SingI (LookupSym0 :: (~>) [AChar] ((~>) Schema U)) where
+      sing = (singFun2 @LookupSym0) sLookup
+    instance SingI d =>
+             SingI (LookupSym1 (d :: [AChar]) :: (~>) Schema U) where
+      sing = (singFun1 @(LookupSym1 (d :: [AChar]))) (sLookup (sing @d))
+    instance SingI (OccursSym0 :: (~>) [AChar] ((~>) Schema Bool)) where
+      sing = (singFun2 @OccursSym0) sOccurs
+    instance SingI d =>
+             SingI (OccursSym1 (d :: [AChar]) :: (~>) Schema Bool) where
+      sing = (singFun1 @(OccursSym1 (d :: [AChar]))) (sOccurs (sing @d))
+    instance SingI (DisjointSym0 :: (~>) Schema ((~>) Schema Bool)) where
+      sing = (singFun2 @DisjointSym0) sDisjoint
+    instance SingI d =>
+             SingI (DisjointSym1 (d :: Schema) :: (~>) Schema Bool) where
+      sing
+        = (singFun1 @(DisjointSym1 (d :: Schema))) (sDisjoint (sing @d))
+    instance SingI (AttrNotInSym0 :: (~>) Attribute ((~>) Schema Bool)) where
+      sing = (singFun2 @AttrNotInSym0) sAttrNotIn
+    instance SingI d =>
+             SingI (AttrNotInSym1 (d :: Attribute) :: (~>) Schema Bool) where
+      sing
+        = (singFun1 @(AttrNotInSym1 (d :: Attribute)))
+            (sAttrNotIn (sing @d))
+    instance SingI (AppendSym0 :: (~>) Schema ((~>) Schema Schema)) where
+      sing = (singFun2 @AppendSym0) sAppend
+    instance SingI d =>
+             SingI (AppendSym1 (d :: Schema) :: (~>) Schema Schema) where
+      sing = (singFun1 @(AppendSym1 (d :: Schema))) (sAppend (sing @d))
+    data SU :: U -> Type
+      where
+        SBOOL :: SU (BOOL :: U)
+        SSTRING :: SU (STRING :: U)
+        SNAT :: SU (NAT :: U)
+        SVEC :: forall (n :: U) (n :: Nat).
+                (Sing n) -> (Sing n) -> SU (VEC n n :: U)
+    type instance Sing @U = SU
+    instance SingKind U where
+      type Demote U = U
+      fromSing SBOOL = BOOL
+      fromSing SSTRING = STRING
+      fromSing SNAT = NAT
+      fromSing (SVEC b b) = (VEC (fromSing b)) (fromSing b)
+      toSing BOOL = SomeSing SBOOL
+      toSing STRING = SomeSing SSTRING
+      toSing NAT = SomeSing SNAT
+      toSing (VEC (b :: Demote U) (b :: Demote Nat))
+        = case
+              ((,) (toSing b :: SomeSing U)) (toSing b :: SomeSing Nat)
+          of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SVEC c) c) }
+    data SAChar :: AChar -> Type
+      where
+        SCA :: SAChar (CA :: AChar)
+        SCB :: SAChar (CB :: AChar)
+        SCC :: SAChar (CC :: AChar)
+        SCD :: SAChar (CD :: AChar)
+        SCE :: SAChar (CE :: AChar)
+        SCF :: SAChar (CF :: AChar)
+        SCG :: SAChar (CG :: AChar)
+        SCH :: SAChar (CH :: AChar)
+        SCI :: SAChar (CI :: AChar)
+        SCJ :: SAChar (CJ :: AChar)
+        SCK :: SAChar (CK :: AChar)
+        SCL :: SAChar (CL :: AChar)
+        SCM :: SAChar (CM :: AChar)
+        SCN :: SAChar (CN :: AChar)
+        SCO :: SAChar (CO :: AChar)
+        SCP :: SAChar (CP :: AChar)
+        SCQ :: SAChar (CQ :: AChar)
+        SCR :: SAChar (CR :: AChar)
+        SCS :: SAChar (CS :: AChar)
+        SCT :: SAChar (CT :: AChar)
+        SCU :: SAChar (CU :: AChar)
+        SCV :: SAChar (CV :: AChar)
+        SCW :: SAChar (CW :: AChar)
+        SCX :: SAChar (CX :: AChar)
+        SCY :: SAChar (CY :: AChar)
+        SCZ :: SAChar (CZ :: AChar)
+    type instance Sing @AChar = SAChar
+    instance SingKind AChar where
+      type Demote AChar = AChar
+      fromSing SCA = CA
+      fromSing SCB = CB
+      fromSing SCC = CC
+      fromSing SCD = CD
+      fromSing SCE = CE
+      fromSing SCF = CF
+      fromSing SCG = CG
+      fromSing SCH = CH
+      fromSing SCI = CI
+      fromSing SCJ = CJ
+      fromSing SCK = CK
+      fromSing SCL = CL
+      fromSing SCM = CM
+      fromSing SCN = CN
+      fromSing SCO = CO
+      fromSing SCP = CP
+      fromSing SCQ = CQ
+      fromSing SCR = CR
+      fromSing SCS = CS
+      fromSing SCT = CT
+      fromSing SCU = CU
+      fromSing SCV = CV
+      fromSing SCW = CW
+      fromSing SCX = CX
+      fromSing SCY = CY
+      fromSing SCZ = CZ
+      toSing CA = SomeSing SCA
+      toSing CB = SomeSing SCB
+      toSing CC = SomeSing SCC
+      toSing CD = SomeSing SCD
+      toSing CE = SomeSing SCE
+      toSing CF = SomeSing SCF
+      toSing CG = SomeSing SCG
+      toSing CH = SomeSing SCH
+      toSing CI = SomeSing SCI
+      toSing CJ = SomeSing SCJ
+      toSing CK = SomeSing SCK
+      toSing CL = SomeSing SCL
+      toSing CM = SomeSing SCM
+      toSing CN = SomeSing SCN
+      toSing CO = SomeSing SCO
+      toSing CP = SomeSing SCP
+      toSing CQ = SomeSing SCQ
+      toSing CR = SomeSing SCR
+      toSing CS = SomeSing SCS
+      toSing CT = SomeSing SCT
+      toSing CU = SomeSing SCU
+      toSing CV = SomeSing SCV
+      toSing CW = SomeSing SCW
+      toSing CX = SomeSing SCX
+      toSing CY = SomeSing SCY
+      toSing CZ = SomeSing SCZ
+    data SAttribute :: Attribute -> Type
+      where
+        SAttr :: forall (n :: [AChar]) (n :: U).
+                 (Sing n) -> (Sing n) -> SAttribute (Attr n n :: Attribute)
+    type instance Sing @Attribute = SAttribute
+    instance SingKind Attribute where
+      type Demote Attribute = Attribute
+      fromSing (SAttr b b) = (Attr (fromSing b)) (fromSing b)
+      toSing (Attr (b :: Demote [AChar]) (b :: Demote U))
+        = case
+              ((,) (toSing b :: SomeSing [AChar])) (toSing b :: SomeSing U)
+          of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SAttr c) c) }
+    data SSchema :: Schema -> Type
+      where
+        SSch :: forall (n :: [Attribute]).
+                (Sing n) -> SSchema (Sch n :: Schema)
+    type instance Sing @Schema = SSchema
+    instance SingKind Schema where
+      type Demote Schema = Schema
+      fromSing (SSch b) = Sch (fromSing b)
+      toSing (Sch (b :: Demote [Attribute]))
+        = case toSing b :: SomeSing [Attribute] of {
+            SomeSing c -> SomeSing (SSch c) }
+    instance (SShow U, SShow Nat) => SShow U where
+      sShowsPrec ::
+        forall (t1 :: GHC.Types.Nat) (t2 :: U) (t3 :: Symbol).
+        Sing t1
+        -> Sing t2
+           -> Sing t3
+              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) U ((~>) Symbol Symbol))
+                                                             -> Type) t1) t2) t3)
+      sShowsPrec
+        _
+        SBOOL
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "BOOL")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SSTRING
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "STRING")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SNAT
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "NAT")))
+            sA_0123456789876543210
+      sShowsPrec
+        (sP_0123456789876543210 :: Sing p_0123456789876543210)
+        (SVEC (sArg_0123456789876543210 :: Sing arg_0123456789876543210)
+              (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
+                    ((applySing
+                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
+                       (sFromInteger (sing :: Sing 10)))))
+                ((applySing
+                    ((applySing ((singFun3 @(.@#@$)) (%.)))
+                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                          (sing :: Sing "VEC "))))
+                   ((applySing
+                       ((applySing ((singFun3 @(.@#@$)) (%.)))
+                          ((applySing
+                              ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                                 (sFromInteger (sing :: Sing 11))))
+                             sArg_0123456789876543210)))
+                      ((applySing
+                          ((applySing ((singFun3 @(.@#@$)) (%.)))
+                             ((singFun1 @ShowSpaceSym0) sShowSpace)))
+                         ((applySing
+                             ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                                (sFromInteger (sing :: Sing 11))))
+                            sArg_0123456789876543210))))))
+            sA_0123456789876543210
+    instance SShow AChar where
+      sShowsPrec ::
+        forall (t1 :: GHC.Types.Nat) (t2 :: AChar) (t3 :: Symbol).
+        Sing t1
+        -> Sing t2
+           -> Sing t3
+              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) AChar ((~>) Symbol Symbol))
+                                                             -> Type) t1) t2) t3)
+      sShowsPrec
+        _
+        SCA
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CA")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCB
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CB")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCC
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CC")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCD
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CD")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCE
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CE")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCF
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CF")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCG
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CG")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCH
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CH")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCI
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CI")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCJ
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CJ")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCK
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CK")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCL
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CL")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCM
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CM")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCN
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CN")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCO
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CO")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCP
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CP")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCQ
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CQ")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCR
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CR")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCS
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CS")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCT
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CT")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCU
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CU")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCV
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CV")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCW
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CW")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCX
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CX")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCY
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CY")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SCZ
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "CZ")))
+            sA_0123456789876543210
+    instance (SEq U, SEq Nat) => SEq U where
+      (%==) SBOOL SBOOL = STrue
+      (%==) SBOOL SSTRING = SFalse
+      (%==) SBOOL SNAT = SFalse
+      (%==) SBOOL (SVEC _ _) = SFalse
+      (%==) SSTRING SBOOL = SFalse
+      (%==) SSTRING SSTRING = STrue
+      (%==) SSTRING SNAT = SFalse
+      (%==) SSTRING (SVEC _ _) = SFalse
+      (%==) SNAT SBOOL = SFalse
+      (%==) SNAT SSTRING = SFalse
+      (%==) SNAT SNAT = STrue
+      (%==) SNAT (SVEC _ _) = SFalse
+      (%==) (SVEC _ _) SBOOL = SFalse
+      (%==) (SVEC _ _) SSTRING = SFalse
+      (%==) (SVEC _ _) SNAT = SFalse
+      (%==) (SVEC a a) (SVEC b b) = ((%&&) (((%==) a) b)) (((%==) a) b)
+    instance (SDecide U, SDecide Nat) => SDecide U where
+      (%~) SBOOL SBOOL = Proved Refl
+      (%~) SBOOL SSTRING = Disproved (\ x -> case x of)
+      (%~) SBOOL SNAT = Disproved (\ x -> case x of)
+      (%~) SBOOL (SVEC _ _) = Disproved (\ x -> case x of)
+      (%~) SSTRING SBOOL = Disproved (\ x -> case x of)
+      (%~) SSTRING SSTRING = Proved Refl
+      (%~) SSTRING SNAT = Disproved (\ x -> case x of)
+      (%~) SSTRING (SVEC _ _) = Disproved (\ x -> case x of)
+      (%~) SNAT SBOOL = Disproved (\ x -> case x of)
+      (%~) SNAT SSTRING = Disproved (\ x -> case x of)
+      (%~) SNAT SNAT = Proved Refl
+      (%~) SNAT (SVEC _ _) = Disproved (\ x -> case x of)
+      (%~) (SVEC _ _) SBOOL = Disproved (\ x -> case x of)
+      (%~) (SVEC _ _) SSTRING = Disproved (\ x -> case x of)
+      (%~) (SVEC _ _) SNAT = Disproved (\ x -> case x of)
+      (%~) (SVEC a a) (SVEC b b)
+        = case ((,) (((%~) a) b)) (((%~) a) b) of
+            (,) (Proved Refl) (Proved Refl) -> Proved Refl
+            (,) (Disproved contra) _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,) _ (Disproved contra)
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+    instance (SDecide U, SDecide Nat) =>
+             Data.Type.Equality.TestEquality (SU :: U -> Type) where
+      Data.Type.Equality.testEquality
+        = Data.Singletons.Decide.decideEquality
+    instance (SDecide U, SDecide Nat) =>
+             Data.Type.Coercion.TestCoercion (SU :: U -> Type) where
+      Data.Type.Coercion.testCoercion
+        = Data.Singletons.Decide.decideCoercion
+    instance SEq AChar where
+      (%==) SCA SCA = STrue
+      (%==) SCA SCB = SFalse
+      (%==) SCA SCC = SFalse
+      (%==) SCA SCD = SFalse
+      (%==) SCA SCE = SFalse
+      (%==) SCA SCF = SFalse
+      (%==) SCA SCG = SFalse
+      (%==) SCA SCH = SFalse
+      (%==) SCA SCI = SFalse
+      (%==) SCA SCJ = SFalse
+      (%==) SCA SCK = SFalse
+      (%==) SCA SCL = SFalse
+      (%==) SCA SCM = SFalse
+      (%==) SCA SCN = SFalse
+      (%==) SCA SCO = SFalse
+      (%==) SCA SCP = SFalse
+      (%==) SCA SCQ = SFalse
+      (%==) SCA SCR = SFalse
+      (%==) SCA SCS = SFalse
+      (%==) SCA SCT = SFalse
+      (%==) SCA SCU = SFalse
+      (%==) SCA SCV = SFalse
+      (%==) SCA SCW = SFalse
+      (%==) SCA SCX = SFalse
+      (%==) SCA SCY = SFalse
+      (%==) SCA SCZ = SFalse
+      (%==) SCB SCA = SFalse
+      (%==) SCB SCB = STrue
+      (%==) SCB SCC = SFalse
+      (%==) SCB SCD = SFalse
+      (%==) SCB SCE = SFalse
+      (%==) SCB SCF = SFalse
+      (%==) SCB SCG = SFalse
+      (%==) SCB SCH = SFalse
+      (%==) SCB SCI = SFalse
+      (%==) SCB SCJ = SFalse
+      (%==) SCB SCK = SFalse
+      (%==) SCB SCL = SFalse
+      (%==) SCB SCM = SFalse
+      (%==) SCB SCN = SFalse
+      (%==) SCB SCO = SFalse
+      (%==) SCB SCP = SFalse
+      (%==) SCB SCQ = SFalse
+      (%==) SCB SCR = SFalse
+      (%==) SCB SCS = SFalse
+      (%==) SCB SCT = SFalse
+      (%==) SCB SCU = SFalse
+      (%==) SCB SCV = SFalse
+      (%==) SCB SCW = SFalse
+      (%==) SCB SCX = SFalse
+      (%==) SCB SCY = SFalse
+      (%==) SCB SCZ = SFalse
+      (%==) SCC SCA = SFalse
+      (%==) SCC SCB = SFalse
+      (%==) SCC SCC = STrue
+      (%==) SCC SCD = SFalse
+      (%==) SCC SCE = SFalse
+      (%==) SCC SCF = SFalse
+      (%==) SCC SCG = SFalse
+      (%==) SCC SCH = SFalse
+      (%==) SCC SCI = SFalse
+      (%==) SCC SCJ = SFalse
+      (%==) SCC SCK = SFalse
+      (%==) SCC SCL = SFalse
+      (%==) SCC SCM = SFalse
+      (%==) SCC SCN = SFalse
+      (%==) SCC SCO = SFalse
+      (%==) SCC SCP = SFalse
+      (%==) SCC SCQ = SFalse
+      (%==) SCC SCR = SFalse
+      (%==) SCC SCS = SFalse
+      (%==) SCC SCT = SFalse
+      (%==) SCC SCU = SFalse
+      (%==) SCC SCV = SFalse
+      (%==) SCC SCW = SFalse
+      (%==) SCC SCX = SFalse
+      (%==) SCC SCY = SFalse
+      (%==) SCC SCZ = SFalse
+      (%==) SCD SCA = SFalse
+      (%==) SCD SCB = SFalse
+      (%==) SCD SCC = SFalse
+      (%==) SCD SCD = STrue
+      (%==) SCD SCE = SFalse
+      (%==) SCD SCF = SFalse
+      (%==) SCD SCG = SFalse
+      (%==) SCD SCH = SFalse
+      (%==) SCD SCI = SFalse
+      (%==) SCD SCJ = SFalse
+      (%==) SCD SCK = SFalse
+      (%==) SCD SCL = SFalse
+      (%==) SCD SCM = SFalse
+      (%==) SCD SCN = SFalse
+      (%==) SCD SCO = SFalse
+      (%==) SCD SCP = SFalse
+      (%==) SCD SCQ = SFalse
+      (%==) SCD SCR = SFalse
+      (%==) SCD SCS = SFalse
+      (%==) SCD SCT = SFalse
+      (%==) SCD SCU = SFalse
+      (%==) SCD SCV = SFalse
+      (%==) SCD SCW = SFalse
+      (%==) SCD SCX = SFalse
+      (%==) SCD SCY = SFalse
+      (%==) SCD SCZ = SFalse
+      (%==) SCE SCA = SFalse
+      (%==) SCE SCB = SFalse
+      (%==) SCE SCC = SFalse
+      (%==) SCE SCD = SFalse
+      (%==) SCE SCE = STrue
+      (%==) SCE SCF = SFalse
+      (%==) SCE SCG = SFalse
+      (%==) SCE SCH = SFalse
+      (%==) SCE SCI = SFalse
+      (%==) SCE SCJ = SFalse
+      (%==) SCE SCK = SFalse
+      (%==) SCE SCL = SFalse
+      (%==) SCE SCM = SFalse
+      (%==) SCE SCN = SFalse
+      (%==) SCE SCO = SFalse
+      (%==) SCE SCP = SFalse
+      (%==) SCE SCQ = SFalse
+      (%==) SCE SCR = SFalse
+      (%==) SCE SCS = SFalse
+      (%==) SCE SCT = SFalse
+      (%==) SCE SCU = SFalse
+      (%==) SCE SCV = SFalse
+      (%==) SCE SCW = SFalse
+      (%==) SCE SCX = SFalse
+      (%==) SCE SCY = SFalse
+      (%==) SCE SCZ = SFalse
+      (%==) SCF SCA = SFalse
+      (%==) SCF SCB = SFalse
+      (%==) SCF SCC = SFalse
+      (%==) SCF SCD = SFalse
+      (%==) SCF SCE = SFalse
+      (%==) SCF SCF = STrue
+      (%==) SCF SCG = SFalse
+      (%==) SCF SCH = SFalse
+      (%==) SCF SCI = SFalse
+      (%==) SCF SCJ = SFalse
+      (%==) SCF SCK = SFalse
+      (%==) SCF SCL = SFalse
+      (%==) SCF SCM = SFalse
+      (%==) SCF SCN = SFalse
+      (%==) SCF SCO = SFalse
+      (%==) SCF SCP = SFalse
+      (%==) SCF SCQ = SFalse
+      (%==) SCF SCR = SFalse
+      (%==) SCF SCS = SFalse
+      (%==) SCF SCT = SFalse
+      (%==) SCF SCU = SFalse
+      (%==) SCF SCV = SFalse
+      (%==) SCF SCW = SFalse
+      (%==) SCF SCX = SFalse
+      (%==) SCF SCY = SFalse
+      (%==) SCF SCZ = SFalse
+      (%==) SCG SCA = SFalse
+      (%==) SCG SCB = SFalse
+      (%==) SCG SCC = SFalse
+      (%==) SCG SCD = SFalse
+      (%==) SCG SCE = SFalse
+      (%==) SCG SCF = SFalse
+      (%==) SCG SCG = STrue
+      (%==) SCG SCH = SFalse
+      (%==) SCG SCI = SFalse
+      (%==) SCG SCJ = SFalse
+      (%==) SCG SCK = SFalse
+      (%==) SCG SCL = SFalse
+      (%==) SCG SCM = SFalse
+      (%==) SCG SCN = SFalse
+      (%==) SCG SCO = SFalse
+      (%==) SCG SCP = SFalse
+      (%==) SCG SCQ = SFalse
+      (%==) SCG SCR = SFalse
+      (%==) SCG SCS = SFalse
+      (%==) SCG SCT = SFalse
+      (%==) SCG SCU = SFalse
+      (%==) SCG SCV = SFalse
+      (%==) SCG SCW = SFalse
+      (%==) SCG SCX = SFalse
+      (%==) SCG SCY = SFalse
+      (%==) SCG SCZ = SFalse
+      (%==) SCH SCA = SFalse
+      (%==) SCH SCB = SFalse
+      (%==) SCH SCC = SFalse
+      (%==) SCH SCD = SFalse
+      (%==) SCH SCE = SFalse
+      (%==) SCH SCF = SFalse
+      (%==) SCH SCG = SFalse
+      (%==) SCH SCH = STrue
+      (%==) SCH SCI = SFalse
+      (%==) SCH SCJ = SFalse
+      (%==) SCH SCK = SFalse
+      (%==) SCH SCL = SFalse
+      (%==) SCH SCM = SFalse
+      (%==) SCH SCN = SFalse
+      (%==) SCH SCO = SFalse
+      (%==) SCH SCP = SFalse
+      (%==) SCH SCQ = SFalse
+      (%==) SCH SCR = SFalse
+      (%==) SCH SCS = SFalse
+      (%==) SCH SCT = SFalse
+      (%==) SCH SCU = SFalse
+      (%==) SCH SCV = SFalse
+      (%==) SCH SCW = SFalse
+      (%==) SCH SCX = SFalse
+      (%==) SCH SCY = SFalse
+      (%==) SCH SCZ = SFalse
+      (%==) SCI SCA = SFalse
+      (%==) SCI SCB = SFalse
+      (%==) SCI SCC = SFalse
+      (%==) SCI SCD = SFalse
+      (%==) SCI SCE = SFalse
+      (%==) SCI SCF = SFalse
+      (%==) SCI SCG = SFalse
+      (%==) SCI SCH = SFalse
+      (%==) SCI SCI = STrue
+      (%==) SCI SCJ = SFalse
+      (%==) SCI SCK = SFalse
+      (%==) SCI SCL = SFalse
+      (%==) SCI SCM = SFalse
+      (%==) SCI SCN = SFalse
+      (%==) SCI SCO = SFalse
+      (%==) SCI SCP = SFalse
+      (%==) SCI SCQ = SFalse
+      (%==) SCI SCR = SFalse
+      (%==) SCI SCS = SFalse
+      (%==) SCI SCT = SFalse
+      (%==) SCI SCU = SFalse
+      (%==) SCI SCV = SFalse
+      (%==) SCI SCW = SFalse
+      (%==) SCI SCX = SFalse
+      (%==) SCI SCY = SFalse
+      (%==) SCI SCZ = SFalse
+      (%==) SCJ SCA = SFalse
+      (%==) SCJ SCB = SFalse
+      (%==) SCJ SCC = SFalse
+      (%==) SCJ SCD = SFalse
+      (%==) SCJ SCE = SFalse
+      (%==) SCJ SCF = SFalse
+      (%==) SCJ SCG = SFalse
+      (%==) SCJ SCH = SFalse
+      (%==) SCJ SCI = SFalse
+      (%==) SCJ SCJ = STrue
+      (%==) SCJ SCK = SFalse
+      (%==) SCJ SCL = SFalse
+      (%==) SCJ SCM = SFalse
+      (%==) SCJ SCN = SFalse
+      (%==) SCJ SCO = SFalse
+      (%==) SCJ SCP = SFalse
+      (%==) SCJ SCQ = SFalse
+      (%==) SCJ SCR = SFalse
+      (%==) SCJ SCS = SFalse
+      (%==) SCJ SCT = SFalse
+      (%==) SCJ SCU = SFalse
+      (%==) SCJ SCV = SFalse
+      (%==) SCJ SCW = SFalse
+      (%==) SCJ SCX = SFalse
+      (%==) SCJ SCY = SFalse
+      (%==) SCJ SCZ = SFalse
+      (%==) SCK SCA = SFalse
+      (%==) SCK SCB = SFalse
+      (%==) SCK SCC = SFalse
+      (%==) SCK SCD = SFalse
+      (%==) SCK SCE = SFalse
+      (%==) SCK SCF = SFalse
+      (%==) SCK SCG = SFalse
+      (%==) SCK SCH = SFalse
+      (%==) SCK SCI = SFalse
+      (%==) SCK SCJ = SFalse
+      (%==) SCK SCK = STrue
+      (%==) SCK SCL = SFalse
+      (%==) SCK SCM = SFalse
+      (%==) SCK SCN = SFalse
+      (%==) SCK SCO = SFalse
+      (%==) SCK SCP = SFalse
+      (%==) SCK SCQ = SFalse
+      (%==) SCK SCR = SFalse
+      (%==) SCK SCS = SFalse
+      (%==) SCK SCT = SFalse
+      (%==) SCK SCU = SFalse
+      (%==) SCK SCV = SFalse
+      (%==) SCK SCW = SFalse
+      (%==) SCK SCX = SFalse
+      (%==) SCK SCY = SFalse
+      (%==) SCK SCZ = SFalse
+      (%==) SCL SCA = SFalse
+      (%==) SCL SCB = SFalse
+      (%==) SCL SCC = SFalse
+      (%==) SCL SCD = SFalse
+      (%==) SCL SCE = SFalse
+      (%==) SCL SCF = SFalse
+      (%==) SCL SCG = SFalse
+      (%==) SCL SCH = SFalse
+      (%==) SCL SCI = SFalse
+      (%==) SCL SCJ = SFalse
+      (%==) SCL SCK = SFalse
+      (%==) SCL SCL = STrue
+      (%==) SCL SCM = SFalse
+      (%==) SCL SCN = SFalse
+      (%==) SCL SCO = SFalse
+      (%==) SCL SCP = SFalse
+      (%==) SCL SCQ = SFalse
+      (%==) SCL SCR = SFalse
+      (%==) SCL SCS = SFalse
+      (%==) SCL SCT = SFalse
+      (%==) SCL SCU = SFalse
+      (%==) SCL SCV = SFalse
+      (%==) SCL SCW = SFalse
+      (%==) SCL SCX = SFalse
+      (%==) SCL SCY = SFalse
+      (%==) SCL SCZ = SFalse
+      (%==) SCM SCA = SFalse
+      (%==) SCM SCB = SFalse
+      (%==) SCM SCC = SFalse
+      (%==) SCM SCD = SFalse
+      (%==) SCM SCE = SFalse
+      (%==) SCM SCF = SFalse
+      (%==) SCM SCG = SFalse
+      (%==) SCM SCH = SFalse
+      (%==) SCM SCI = SFalse
+      (%==) SCM SCJ = SFalse
+      (%==) SCM SCK = SFalse
+      (%==) SCM SCL = SFalse
+      (%==) SCM SCM = STrue
+      (%==) SCM SCN = SFalse
+      (%==) SCM SCO = SFalse
+      (%==) SCM SCP = SFalse
+      (%==) SCM SCQ = SFalse
+      (%==) SCM SCR = SFalse
+      (%==) SCM SCS = SFalse
+      (%==) SCM SCT = SFalse
+      (%==) SCM SCU = SFalse
+      (%==) SCM SCV = SFalse
+      (%==) SCM SCW = SFalse
+      (%==) SCM SCX = SFalse
+      (%==) SCM SCY = SFalse
+      (%==) SCM SCZ = SFalse
+      (%==) SCN SCA = SFalse
+      (%==) SCN SCB = SFalse
+      (%==) SCN SCC = SFalse
+      (%==) SCN SCD = SFalse
+      (%==) SCN SCE = SFalse
+      (%==) SCN SCF = SFalse
+      (%==) SCN SCG = SFalse
+      (%==) SCN SCH = SFalse
+      (%==) SCN SCI = SFalse
+      (%==) SCN SCJ = SFalse
+      (%==) SCN SCK = SFalse
+      (%==) SCN SCL = SFalse
+      (%==) SCN SCM = SFalse
+      (%==) SCN SCN = STrue
+      (%==) SCN SCO = SFalse
+      (%==) SCN SCP = SFalse
+      (%==) SCN SCQ = SFalse
+      (%==) SCN SCR = SFalse
+      (%==) SCN SCS = SFalse
+      (%==) SCN SCT = SFalse
+      (%==) SCN SCU = SFalse
+      (%==) SCN SCV = SFalse
+      (%==) SCN SCW = SFalse
+      (%==) SCN SCX = SFalse
+      (%==) SCN SCY = SFalse
+      (%==) SCN SCZ = SFalse
+      (%==) SCO SCA = SFalse
+      (%==) SCO SCB = SFalse
+      (%==) SCO SCC = SFalse
+      (%==) SCO SCD = SFalse
+      (%==) SCO SCE = SFalse
+      (%==) SCO SCF = SFalse
+      (%==) SCO SCG = SFalse
+      (%==) SCO SCH = SFalse
+      (%==) SCO SCI = SFalse
+      (%==) SCO SCJ = SFalse
+      (%==) SCO SCK = SFalse
+      (%==) SCO SCL = SFalse
+      (%==) SCO SCM = SFalse
+      (%==) SCO SCN = SFalse
+      (%==) SCO SCO = STrue
+      (%==) SCO SCP = SFalse
+      (%==) SCO SCQ = SFalse
+      (%==) SCO SCR = SFalse
+      (%==) SCO SCS = SFalse
+      (%==) SCO SCT = SFalse
+      (%==) SCO SCU = SFalse
+      (%==) SCO SCV = SFalse
+      (%==) SCO SCW = SFalse
+      (%==) SCO SCX = SFalse
+      (%==) SCO SCY = SFalse
+      (%==) SCO SCZ = SFalse
+      (%==) SCP SCA = SFalse
+      (%==) SCP SCB = SFalse
+      (%==) SCP SCC = SFalse
+      (%==) SCP SCD = SFalse
+      (%==) SCP SCE = SFalse
+      (%==) SCP SCF = SFalse
+      (%==) SCP SCG = SFalse
+      (%==) SCP SCH = SFalse
+      (%==) SCP SCI = SFalse
+      (%==) SCP SCJ = SFalse
+      (%==) SCP SCK = SFalse
+      (%==) SCP SCL = SFalse
+      (%==) SCP SCM = SFalse
+      (%==) SCP SCN = SFalse
+      (%==) SCP SCO = SFalse
+      (%==) SCP SCP = STrue
+      (%==) SCP SCQ = SFalse
+      (%==) SCP SCR = SFalse
+      (%==) SCP SCS = SFalse
+      (%==) SCP SCT = SFalse
+      (%==) SCP SCU = SFalse
+      (%==) SCP SCV = SFalse
+      (%==) SCP SCW = SFalse
+      (%==) SCP SCX = SFalse
+      (%==) SCP SCY = SFalse
+      (%==) SCP SCZ = SFalse
+      (%==) SCQ SCA = SFalse
+      (%==) SCQ SCB = SFalse
+      (%==) SCQ SCC = SFalse
+      (%==) SCQ SCD = SFalse
+      (%==) SCQ SCE = SFalse
+      (%==) SCQ SCF = SFalse
+      (%==) SCQ SCG = SFalse
+      (%==) SCQ SCH = SFalse
+      (%==) SCQ SCI = SFalse
+      (%==) SCQ SCJ = SFalse
+      (%==) SCQ SCK = SFalse
+      (%==) SCQ SCL = SFalse
+      (%==) SCQ SCM = SFalse
+      (%==) SCQ SCN = SFalse
+      (%==) SCQ SCO = SFalse
+      (%==) SCQ SCP = SFalse
+      (%==) SCQ SCQ = STrue
+      (%==) SCQ SCR = SFalse
+      (%==) SCQ SCS = SFalse
+      (%==) SCQ SCT = SFalse
+      (%==) SCQ SCU = SFalse
+      (%==) SCQ SCV = SFalse
+      (%==) SCQ SCW = SFalse
+      (%==) SCQ SCX = SFalse
+      (%==) SCQ SCY = SFalse
+      (%==) SCQ SCZ = SFalse
+      (%==) SCR SCA = SFalse
+      (%==) SCR SCB = SFalse
+      (%==) SCR SCC = SFalse
+      (%==) SCR SCD = SFalse
+      (%==) SCR SCE = SFalse
+      (%==) SCR SCF = SFalse
+      (%==) SCR SCG = SFalse
+      (%==) SCR SCH = SFalse
+      (%==) SCR SCI = SFalse
+      (%==) SCR SCJ = SFalse
+      (%==) SCR SCK = SFalse
+      (%==) SCR SCL = SFalse
+      (%==) SCR SCM = SFalse
+      (%==) SCR SCN = SFalse
+      (%==) SCR SCO = SFalse
+      (%==) SCR SCP = SFalse
+      (%==) SCR SCQ = SFalse
+      (%==) SCR SCR = STrue
+      (%==) SCR SCS = SFalse
+      (%==) SCR SCT = SFalse
+      (%==) SCR SCU = SFalse
+      (%==) SCR SCV = SFalse
+      (%==) SCR SCW = SFalse
+      (%==) SCR SCX = SFalse
+      (%==) SCR SCY = SFalse
+      (%==) SCR SCZ = SFalse
+      (%==) SCS SCA = SFalse
+      (%==) SCS SCB = SFalse
+      (%==) SCS SCC = SFalse
+      (%==) SCS SCD = SFalse
+      (%==) SCS SCE = SFalse
+      (%==) SCS SCF = SFalse
+      (%==) SCS SCG = SFalse
+      (%==) SCS SCH = SFalse
+      (%==) SCS SCI = SFalse
+      (%==) SCS SCJ = SFalse
+      (%==) SCS SCK = SFalse
+      (%==) SCS SCL = SFalse
+      (%==) SCS SCM = SFalse
+      (%==) SCS SCN = SFalse
+      (%==) SCS SCO = SFalse
+      (%==) SCS SCP = SFalse
+      (%==) SCS SCQ = SFalse
+      (%==) SCS SCR = SFalse
+      (%==) SCS SCS = STrue
+      (%==) SCS SCT = SFalse
+      (%==) SCS SCU = SFalse
+      (%==) SCS SCV = SFalse
+      (%==) SCS SCW = SFalse
+      (%==) SCS SCX = SFalse
+      (%==) SCS SCY = SFalse
+      (%==) SCS SCZ = SFalse
+      (%==) SCT SCA = SFalse
+      (%==) SCT SCB = SFalse
+      (%==) SCT SCC = SFalse
+      (%==) SCT SCD = SFalse
+      (%==) SCT SCE = SFalse
+      (%==) SCT SCF = SFalse
+      (%==) SCT SCG = SFalse
+      (%==) SCT SCH = SFalse
+      (%==) SCT SCI = SFalse
+      (%==) SCT SCJ = SFalse
+      (%==) SCT SCK = SFalse
+      (%==) SCT SCL = SFalse
+      (%==) SCT SCM = SFalse
+      (%==) SCT SCN = SFalse
+      (%==) SCT SCO = SFalse
+      (%==) SCT SCP = SFalse
+      (%==) SCT SCQ = SFalse
+      (%==) SCT SCR = SFalse
+      (%==) SCT SCS = SFalse
+      (%==) SCT SCT = STrue
+      (%==) SCT SCU = SFalse
+      (%==) SCT SCV = SFalse
+      (%==) SCT SCW = SFalse
+      (%==) SCT SCX = SFalse
+      (%==) SCT SCY = SFalse
+      (%==) SCT SCZ = SFalse
+      (%==) SCU SCA = SFalse
+      (%==) SCU SCB = SFalse
+      (%==) SCU SCC = SFalse
+      (%==) SCU SCD = SFalse
+      (%==) SCU SCE = SFalse
+      (%==) SCU SCF = SFalse
+      (%==) SCU SCG = SFalse
+      (%==) SCU SCH = SFalse
+      (%==) SCU SCI = SFalse
+      (%==) SCU SCJ = SFalse
+      (%==) SCU SCK = SFalse
+      (%==) SCU SCL = SFalse
+      (%==) SCU SCM = SFalse
+      (%==) SCU SCN = SFalse
+      (%==) SCU SCO = SFalse
+      (%==) SCU SCP = SFalse
+      (%==) SCU SCQ = SFalse
+      (%==) SCU SCR = SFalse
+      (%==) SCU SCS = SFalse
+      (%==) SCU SCT = SFalse
+      (%==) SCU SCU = STrue
+      (%==) SCU SCV = SFalse
+      (%==) SCU SCW = SFalse
+      (%==) SCU SCX = SFalse
+      (%==) SCU SCY = SFalse
+      (%==) SCU SCZ = SFalse
+      (%==) SCV SCA = SFalse
+      (%==) SCV SCB = SFalse
+      (%==) SCV SCC = SFalse
+      (%==) SCV SCD = SFalse
+      (%==) SCV SCE = SFalse
+      (%==) SCV SCF = SFalse
+      (%==) SCV SCG = SFalse
+      (%==) SCV SCH = SFalse
+      (%==) SCV SCI = SFalse
+      (%==) SCV SCJ = SFalse
+      (%==) SCV SCK = SFalse
+      (%==) SCV SCL = SFalse
+      (%==) SCV SCM = SFalse
+      (%==) SCV SCN = SFalse
+      (%==) SCV SCO = SFalse
+      (%==) SCV SCP = SFalse
+      (%==) SCV SCQ = SFalse
+      (%==) SCV SCR = SFalse
+      (%==) SCV SCS = SFalse
+      (%==) SCV SCT = SFalse
+      (%==) SCV SCU = SFalse
+      (%==) SCV SCV = STrue
+      (%==) SCV SCW = SFalse
+      (%==) SCV SCX = SFalse
+      (%==) SCV SCY = SFalse
+      (%==) SCV SCZ = SFalse
+      (%==) SCW SCA = SFalse
+      (%==) SCW SCB = SFalse
+      (%==) SCW SCC = SFalse
+      (%==) SCW SCD = SFalse
+      (%==) SCW SCE = SFalse
+      (%==) SCW SCF = SFalse
+      (%==) SCW SCG = SFalse
+      (%==) SCW SCH = SFalse
+      (%==) SCW SCI = SFalse
+      (%==) SCW SCJ = SFalse
+      (%==) SCW SCK = SFalse
+      (%==) SCW SCL = SFalse
+      (%==) SCW SCM = SFalse
+      (%==) SCW SCN = SFalse
+      (%==) SCW SCO = SFalse
+      (%==) SCW SCP = SFalse
+      (%==) SCW SCQ = SFalse
+      (%==) SCW SCR = SFalse
+      (%==) SCW SCS = SFalse
+      (%==) SCW SCT = SFalse
+      (%==) SCW SCU = SFalse
+      (%==) SCW SCV = SFalse
+      (%==) SCW SCW = STrue
+      (%==) SCW SCX = SFalse
+      (%==) SCW SCY = SFalse
+      (%==) SCW SCZ = SFalse
+      (%==) SCX SCA = SFalse
+      (%==) SCX SCB = SFalse
+      (%==) SCX SCC = SFalse
+      (%==) SCX SCD = SFalse
+      (%==) SCX SCE = SFalse
+      (%==) SCX SCF = SFalse
+      (%==) SCX SCG = SFalse
+      (%==) SCX SCH = SFalse
+      (%==) SCX SCI = SFalse
+      (%==) SCX SCJ = SFalse
+      (%==) SCX SCK = SFalse
+      (%==) SCX SCL = SFalse
+      (%==) SCX SCM = SFalse
+      (%==) SCX SCN = SFalse
+      (%==) SCX SCO = SFalse
+      (%==) SCX SCP = SFalse
+      (%==) SCX SCQ = SFalse
+      (%==) SCX SCR = SFalse
+      (%==) SCX SCS = SFalse
+      (%==) SCX SCT = SFalse
+      (%==) SCX SCU = SFalse
+      (%==) SCX SCV = SFalse
+      (%==) SCX SCW = SFalse
+      (%==) SCX SCX = STrue
+      (%==) SCX SCY = SFalse
+      (%==) SCX SCZ = SFalse
+      (%==) SCY SCA = SFalse
+      (%==) SCY SCB = SFalse
+      (%==) SCY SCC = SFalse
+      (%==) SCY SCD = SFalse
+      (%==) SCY SCE = SFalse
+      (%==) SCY SCF = SFalse
+      (%==) SCY SCG = SFalse
+      (%==) SCY SCH = SFalse
+      (%==) SCY SCI = SFalse
+      (%==) SCY SCJ = SFalse
+      (%==) SCY SCK = SFalse
+      (%==) SCY SCL = SFalse
+      (%==) SCY SCM = SFalse
+      (%==) SCY SCN = SFalse
+      (%==) SCY SCO = SFalse
+      (%==) SCY SCP = SFalse
+      (%==) SCY SCQ = SFalse
+      (%==) SCY SCR = SFalse
+      (%==) SCY SCS = SFalse
+      (%==) SCY SCT = SFalse
+      (%==) SCY SCU = SFalse
+      (%==) SCY SCV = SFalse
+      (%==) SCY SCW = SFalse
+      (%==) SCY SCX = SFalse
+      (%==) SCY SCY = STrue
+      (%==) SCY SCZ = SFalse
+      (%==) SCZ SCA = SFalse
+      (%==) SCZ SCB = SFalse
+      (%==) SCZ SCC = SFalse
+      (%==) SCZ SCD = SFalse
+      (%==) SCZ SCE = SFalse
+      (%==) SCZ SCF = SFalse
+      (%==) SCZ SCG = SFalse
+      (%==) SCZ SCH = SFalse
+      (%==) SCZ SCI = SFalse
+      (%==) SCZ SCJ = SFalse
+      (%==) SCZ SCK = SFalse
+      (%==) SCZ SCL = SFalse
+      (%==) SCZ SCM = SFalse
+      (%==) SCZ SCN = SFalse
+      (%==) SCZ SCO = SFalse
+      (%==) SCZ SCP = SFalse
+      (%==) SCZ SCQ = SFalse
+      (%==) SCZ SCR = SFalse
+      (%==) SCZ SCS = SFalse
+      (%==) SCZ SCT = SFalse
+      (%==) SCZ SCU = SFalse
+      (%==) SCZ SCV = SFalse
+      (%==) SCZ SCW = SFalse
+      (%==) SCZ SCX = SFalse
+      (%==) SCZ SCY = SFalse
+      (%==) SCZ SCZ = STrue
+    instance SDecide AChar where
+      (%~) SCA SCA = Proved Refl
+      (%~) SCA SCB = Disproved (\ x -> case x of)
+      (%~) SCA SCC = Disproved (\ x -> case x of)
+      (%~) SCA SCD = Disproved (\ x -> case x of)
+      (%~) SCA SCE = Disproved (\ x -> case x of)
+      (%~) SCA SCF = Disproved (\ x -> case x of)
+      (%~) SCA SCG = Disproved (\ x -> case x of)
+      (%~) SCA SCH = Disproved (\ x -> case x of)
+      (%~) SCA SCI = Disproved (\ x -> case x of)
+      (%~) SCA SCJ = Disproved (\ x -> case x of)
+      (%~) SCA SCK = Disproved (\ x -> case x of)
+      (%~) SCA SCL = Disproved (\ x -> case x of)
+      (%~) SCA SCM = Disproved (\ x -> case x of)
+      (%~) SCA SCN = Disproved (\ x -> case x of)
+      (%~) SCA SCO = Disproved (\ x -> case x of)
+      (%~) SCA SCP = Disproved (\ x -> case x of)
+      (%~) SCA SCQ = Disproved (\ x -> case x of)
+      (%~) SCA SCR = Disproved (\ x -> case x of)
+      (%~) SCA SCS = Disproved (\ x -> case x of)
+      (%~) SCA SCT = Disproved (\ x -> case x of)
+      (%~) SCA SCU = Disproved (\ x -> case x of)
+      (%~) SCA SCV = Disproved (\ x -> case x of)
+      (%~) SCA SCW = Disproved (\ x -> case x of)
+      (%~) SCA SCX = Disproved (\ x -> case x of)
+      (%~) SCA SCY = Disproved (\ x -> case x of)
+      (%~) SCA SCZ = Disproved (\ x -> case x of)
+      (%~) SCB SCA = Disproved (\ x -> case x of)
+      (%~) SCB SCB = Proved Refl
+      (%~) SCB SCC = Disproved (\ x -> case x of)
+      (%~) SCB SCD = Disproved (\ x -> case x of)
+      (%~) SCB SCE = Disproved (\ x -> case x of)
+      (%~) SCB SCF = Disproved (\ x -> case x of)
+      (%~) SCB SCG = Disproved (\ x -> case x of)
+      (%~) SCB SCH = Disproved (\ x -> case x of)
+      (%~) SCB SCI = Disproved (\ x -> case x of)
+      (%~) SCB SCJ = Disproved (\ x -> case x of)
+      (%~) SCB SCK = Disproved (\ x -> case x of)
+      (%~) SCB SCL = Disproved (\ x -> case x of)
+      (%~) SCB SCM = Disproved (\ x -> case x of)
+      (%~) SCB SCN = Disproved (\ x -> case x of)
+      (%~) SCB SCO = Disproved (\ x -> case x of)
+      (%~) SCB SCP = Disproved (\ x -> case x of)
+      (%~) SCB SCQ = Disproved (\ x -> case x of)
+      (%~) SCB SCR = Disproved (\ x -> case x of)
+      (%~) SCB SCS = Disproved (\ x -> case x of)
+      (%~) SCB SCT = Disproved (\ x -> case x of)
+      (%~) SCB SCU = Disproved (\ x -> case x of)
+      (%~) SCB SCV = Disproved (\ x -> case x of)
+      (%~) SCB SCW = Disproved (\ x -> case x of)
+      (%~) SCB SCX = Disproved (\ x -> case x of)
+      (%~) SCB SCY = Disproved (\ x -> case x of)
+      (%~) SCB SCZ = Disproved (\ x -> case x of)
+      (%~) SCC SCA = Disproved (\ x -> case x of)
+      (%~) SCC SCB = Disproved (\ x -> case x of)
+      (%~) SCC SCC = Proved Refl
+      (%~) SCC SCD = Disproved (\ x -> case x of)
+      (%~) SCC SCE = Disproved (\ x -> case x of)
+      (%~) SCC SCF = Disproved (\ x -> case x of)
+      (%~) SCC SCG = Disproved (\ x -> case x of)
+      (%~) SCC SCH = Disproved (\ x -> case x of)
+      (%~) SCC SCI = Disproved (\ x -> case x of)
+      (%~) SCC SCJ = Disproved (\ x -> case x of)
+      (%~) SCC SCK = Disproved (\ x -> case x of)
+      (%~) SCC SCL = Disproved (\ x -> case x of)
+      (%~) SCC SCM = Disproved (\ x -> case x of)
+      (%~) SCC SCN = Disproved (\ x -> case x of)
+      (%~) SCC SCO = Disproved (\ x -> case x of)
+      (%~) SCC SCP = Disproved (\ x -> case x of)
+      (%~) SCC SCQ = Disproved (\ x -> case x of)
+      (%~) SCC SCR = Disproved (\ x -> case x of)
+      (%~) SCC SCS = Disproved (\ x -> case x of)
+      (%~) SCC SCT = Disproved (\ x -> case x of)
+      (%~) SCC SCU = Disproved (\ x -> case x of)
+      (%~) SCC SCV = Disproved (\ x -> case x of)
+      (%~) SCC SCW = Disproved (\ x -> case x of)
+      (%~) SCC SCX = Disproved (\ x -> case x of)
+      (%~) SCC SCY = Disproved (\ x -> case x of)
+      (%~) SCC SCZ = Disproved (\ x -> case x of)
+      (%~) SCD SCA = Disproved (\ x -> case x of)
+      (%~) SCD SCB = Disproved (\ x -> case x of)
+      (%~) SCD SCC = Disproved (\ x -> case x of)
+      (%~) SCD SCD = Proved Refl
+      (%~) SCD SCE = Disproved (\ x -> case x of)
+      (%~) SCD SCF = Disproved (\ x -> case x of)
+      (%~) SCD SCG = Disproved (\ x -> case x of)
+      (%~) SCD SCH = Disproved (\ x -> case x of)
+      (%~) SCD SCI = Disproved (\ x -> case x of)
+      (%~) SCD SCJ = Disproved (\ x -> case x of)
+      (%~) SCD SCK = Disproved (\ x -> case x of)
+      (%~) SCD SCL = Disproved (\ x -> case x of)
+      (%~) SCD SCM = Disproved (\ x -> case x of)
+      (%~) SCD SCN = Disproved (\ x -> case x of)
+      (%~) SCD SCO = Disproved (\ x -> case x of)
+      (%~) SCD SCP = Disproved (\ x -> case x of)
+      (%~) SCD SCQ = Disproved (\ x -> case x of)
+      (%~) SCD SCR = Disproved (\ x -> case x of)
+      (%~) SCD SCS = Disproved (\ x -> case x of)
+      (%~) SCD SCT = Disproved (\ x -> case x of)
+      (%~) SCD SCU = Disproved (\ x -> case x of)
+      (%~) SCD SCV = Disproved (\ x -> case x of)
+      (%~) SCD SCW = Disproved (\ x -> case x of)
+      (%~) SCD SCX = Disproved (\ x -> case x of)
+      (%~) SCD SCY = Disproved (\ x -> case x of)
+      (%~) SCD SCZ = Disproved (\ x -> case x of)
+      (%~) SCE SCA = Disproved (\ x -> case x of)
+      (%~) SCE SCB = Disproved (\ x -> case x of)
+      (%~) SCE SCC = Disproved (\ x -> case x of)
+      (%~) SCE SCD = Disproved (\ x -> case x of)
+      (%~) SCE SCE = Proved Refl
+      (%~) SCE SCF = Disproved (\ x -> case x of)
+      (%~) SCE SCG = Disproved (\ x -> case x of)
+      (%~) SCE SCH = Disproved (\ x -> case x of)
+      (%~) SCE SCI = Disproved (\ x -> case x of)
+      (%~) SCE SCJ = Disproved (\ x -> case x of)
+      (%~) SCE SCK = Disproved (\ x -> case x of)
+      (%~) SCE SCL = Disproved (\ x -> case x of)
+      (%~) SCE SCM = Disproved (\ x -> case x of)
+      (%~) SCE SCN = Disproved (\ x -> case x of)
+      (%~) SCE SCO = Disproved (\ x -> case x of)
+      (%~) SCE SCP = Disproved (\ x -> case x of)
+      (%~) SCE SCQ = Disproved (\ x -> case x of)
+      (%~) SCE SCR = Disproved (\ x -> case x of)
+      (%~) SCE SCS = Disproved (\ x -> case x of)
+      (%~) SCE SCT = Disproved (\ x -> case x of)
+      (%~) SCE SCU = Disproved (\ x -> case x of)
+      (%~) SCE SCV = Disproved (\ x -> case x of)
+      (%~) SCE SCW = Disproved (\ x -> case x of)
+      (%~) SCE SCX = Disproved (\ x -> case x of)
+      (%~) SCE SCY = Disproved (\ x -> case x of)
+      (%~) SCE SCZ = Disproved (\ x -> case x of)
+      (%~) SCF SCA = Disproved (\ x -> case x of)
+      (%~) SCF SCB = Disproved (\ x -> case x of)
+      (%~) SCF SCC = Disproved (\ x -> case x of)
+      (%~) SCF SCD = Disproved (\ x -> case x of)
+      (%~) SCF SCE = Disproved (\ x -> case x of)
+      (%~) SCF SCF = Proved Refl
+      (%~) SCF SCG = Disproved (\ x -> case x of)
+      (%~) SCF SCH = Disproved (\ x -> case x of)
+      (%~) SCF SCI = Disproved (\ x -> case x of)
+      (%~) SCF SCJ = Disproved (\ x -> case x of)
+      (%~) SCF SCK = Disproved (\ x -> case x of)
+      (%~) SCF SCL = Disproved (\ x -> case x of)
+      (%~) SCF SCM = Disproved (\ x -> case x of)
+      (%~) SCF SCN = Disproved (\ x -> case x of)
+      (%~) SCF SCO = Disproved (\ x -> case x of)
+      (%~) SCF SCP = Disproved (\ x -> case x of)
+      (%~) SCF SCQ = Disproved (\ x -> case x of)
+      (%~) SCF SCR = Disproved (\ x -> case x of)
+      (%~) SCF SCS = Disproved (\ x -> case x of)
+      (%~) SCF SCT = Disproved (\ x -> case x of)
+      (%~) SCF SCU = Disproved (\ x -> case x of)
+      (%~) SCF SCV = Disproved (\ x -> case x of)
+      (%~) SCF SCW = Disproved (\ x -> case x of)
+      (%~) SCF SCX = Disproved (\ x -> case x of)
+      (%~) SCF SCY = Disproved (\ x -> case x of)
+      (%~) SCF SCZ = Disproved (\ x -> case x of)
+      (%~) SCG SCA = Disproved (\ x -> case x of)
+      (%~) SCG SCB = Disproved (\ x -> case x of)
+      (%~) SCG SCC = Disproved (\ x -> case x of)
+      (%~) SCG SCD = Disproved (\ x -> case x of)
+      (%~) SCG SCE = Disproved (\ x -> case x of)
+      (%~) SCG SCF = Disproved (\ x -> case x of)
+      (%~) SCG SCG = Proved Refl
+      (%~) SCG SCH = Disproved (\ x -> case x of)
+      (%~) SCG SCI = Disproved (\ x -> case x of)
+      (%~) SCG SCJ = Disproved (\ x -> case x of)
+      (%~) SCG SCK = Disproved (\ x -> case x of)
+      (%~) SCG SCL = Disproved (\ x -> case x of)
+      (%~) SCG SCM = Disproved (\ x -> case x of)
+      (%~) SCG SCN = Disproved (\ x -> case x of)
+      (%~) SCG SCO = Disproved (\ x -> case x of)
+      (%~) SCG SCP = Disproved (\ x -> case x of)
+      (%~) SCG SCQ = Disproved (\ x -> case x of)
+      (%~) SCG SCR = Disproved (\ x -> case x of)
+      (%~) SCG SCS = Disproved (\ x -> case x of)
+      (%~) SCG SCT = Disproved (\ x -> case x of)
+      (%~) SCG SCU = Disproved (\ x -> case x of)
+      (%~) SCG SCV = Disproved (\ x -> case x of)
+      (%~) SCG SCW = Disproved (\ x -> case x of)
+      (%~) SCG SCX = Disproved (\ x -> case x of)
+      (%~) SCG SCY = Disproved (\ x -> case x of)
+      (%~) SCG SCZ = Disproved (\ x -> case x of)
+      (%~) SCH SCA = Disproved (\ x -> case x of)
+      (%~) SCH SCB = Disproved (\ x -> case x of)
+      (%~) SCH SCC = Disproved (\ x -> case x of)
+      (%~) SCH SCD = Disproved (\ x -> case x of)
+      (%~) SCH SCE = Disproved (\ x -> case x of)
+      (%~) SCH SCF = Disproved (\ x -> case x of)
+      (%~) SCH SCG = Disproved (\ x -> case x of)
+      (%~) SCH SCH = Proved Refl
+      (%~) SCH SCI = Disproved (\ x -> case x of)
+      (%~) SCH SCJ = Disproved (\ x -> case x of)
+      (%~) SCH SCK = Disproved (\ x -> case x of)
+      (%~) SCH SCL = Disproved (\ x -> case x of)
+      (%~) SCH SCM = Disproved (\ x -> case x of)
+      (%~) SCH SCN = Disproved (\ x -> case x of)
+      (%~) SCH SCO = Disproved (\ x -> case x of)
+      (%~) SCH SCP = Disproved (\ x -> case x of)
+      (%~) SCH SCQ = Disproved (\ x -> case x of)
+      (%~) SCH SCR = Disproved (\ x -> case x of)
+      (%~) SCH SCS = Disproved (\ x -> case x of)
+      (%~) SCH SCT = Disproved (\ x -> case x of)
+      (%~) SCH SCU = Disproved (\ x -> case x of)
+      (%~) SCH SCV = Disproved (\ x -> case x of)
+      (%~) SCH SCW = Disproved (\ x -> case x of)
+      (%~) SCH SCX = Disproved (\ x -> case x of)
+      (%~) SCH SCY = Disproved (\ x -> case x of)
+      (%~) SCH SCZ = Disproved (\ x -> case x of)
+      (%~) SCI SCA = Disproved (\ x -> case x of)
+      (%~) SCI SCB = Disproved (\ x -> case x of)
+      (%~) SCI SCC = Disproved (\ x -> case x of)
+      (%~) SCI SCD = Disproved (\ x -> case x of)
+      (%~) SCI SCE = Disproved (\ x -> case x of)
+      (%~) SCI SCF = Disproved (\ x -> case x of)
+      (%~) SCI SCG = Disproved (\ x -> case x of)
+      (%~) SCI SCH = Disproved (\ x -> case x of)
+      (%~) SCI SCI = Proved Refl
+      (%~) SCI SCJ = Disproved (\ x -> case x of)
+      (%~) SCI SCK = Disproved (\ x -> case x of)
+      (%~) SCI SCL = Disproved (\ x -> case x of)
+      (%~) SCI SCM = Disproved (\ x -> case x of)
+      (%~) SCI SCN = Disproved (\ x -> case x of)
+      (%~) SCI SCO = Disproved (\ x -> case x of)
+      (%~) SCI SCP = Disproved (\ x -> case x of)
+      (%~) SCI SCQ = Disproved (\ x -> case x of)
+      (%~) SCI SCR = Disproved (\ x -> case x of)
+      (%~) SCI SCS = Disproved (\ x -> case x of)
+      (%~) SCI SCT = Disproved (\ x -> case x of)
+      (%~) SCI SCU = Disproved (\ x -> case x of)
+      (%~) SCI SCV = Disproved (\ x -> case x of)
+      (%~) SCI SCW = Disproved (\ x -> case x of)
+      (%~) SCI SCX = Disproved (\ x -> case x of)
+      (%~) SCI SCY = Disproved (\ x -> case x of)
+      (%~) SCI SCZ = Disproved (\ x -> case x of)
+      (%~) SCJ SCA = Disproved (\ x -> case x of)
+      (%~) SCJ SCB = Disproved (\ x -> case x of)
+      (%~) SCJ SCC = Disproved (\ x -> case x of)
+      (%~) SCJ SCD = Disproved (\ x -> case x of)
+      (%~) SCJ SCE = Disproved (\ x -> case x of)
+      (%~) SCJ SCF = Disproved (\ x -> case x of)
+      (%~) SCJ SCG = Disproved (\ x -> case x of)
+      (%~) SCJ SCH = Disproved (\ x -> case x of)
+      (%~) SCJ SCI = Disproved (\ x -> case x of)
+      (%~) SCJ SCJ = Proved Refl
+      (%~) SCJ SCK = Disproved (\ x -> case x of)
+      (%~) SCJ SCL = Disproved (\ x -> case x of)
+      (%~) SCJ SCM = Disproved (\ x -> case x of)
+      (%~) SCJ SCN = Disproved (\ x -> case x of)
+      (%~) SCJ SCO = Disproved (\ x -> case x of)
+      (%~) SCJ SCP = Disproved (\ x -> case x of)
+      (%~) SCJ SCQ = Disproved (\ x -> case x of)
+      (%~) SCJ SCR = Disproved (\ x -> case x of)
+      (%~) SCJ SCS = Disproved (\ x -> case x of)
+      (%~) SCJ SCT = Disproved (\ x -> case x of)
+      (%~) SCJ SCU = Disproved (\ x -> case x of)
+      (%~) SCJ SCV = Disproved (\ x -> case x of)
+      (%~) SCJ SCW = Disproved (\ x -> case x of)
+      (%~) SCJ SCX = Disproved (\ x -> case x of)
+      (%~) SCJ SCY = Disproved (\ x -> case x of)
+      (%~) SCJ SCZ = Disproved (\ x -> case x of)
+      (%~) SCK SCA = Disproved (\ x -> case x of)
+      (%~) SCK SCB = Disproved (\ x -> case x of)
+      (%~) SCK SCC = Disproved (\ x -> case x of)
+      (%~) SCK SCD = Disproved (\ x -> case x of)
+      (%~) SCK SCE = Disproved (\ x -> case x of)
+      (%~) SCK SCF = Disproved (\ x -> case x of)
+      (%~) SCK SCG = Disproved (\ x -> case x of)
+      (%~) SCK SCH = Disproved (\ x -> case x of)
+      (%~) SCK SCI = Disproved (\ x -> case x of)
+      (%~) SCK SCJ = Disproved (\ x -> case x of)
+      (%~) SCK SCK = Proved Refl
+      (%~) SCK SCL = Disproved (\ x -> case x of)
+      (%~) SCK SCM = Disproved (\ x -> case x of)
+      (%~) SCK SCN = Disproved (\ x -> case x of)
+      (%~) SCK SCO = Disproved (\ x -> case x of)
+      (%~) SCK SCP = Disproved (\ x -> case x of)
+      (%~) SCK SCQ = Disproved (\ x -> case x of)
+      (%~) SCK SCR = Disproved (\ x -> case x of)
+      (%~) SCK SCS = Disproved (\ x -> case x of)
+      (%~) SCK SCT = Disproved (\ x -> case x of)
+      (%~) SCK SCU = Disproved (\ x -> case x of)
+      (%~) SCK SCV = Disproved (\ x -> case x of)
+      (%~) SCK SCW = Disproved (\ x -> case x of)
+      (%~) SCK SCX = Disproved (\ x -> case x of)
+      (%~) SCK SCY = Disproved (\ x -> case x of)
+      (%~) SCK SCZ = Disproved (\ x -> case x of)
+      (%~) SCL SCA = Disproved (\ x -> case x of)
+      (%~) SCL SCB = Disproved (\ x -> case x of)
+      (%~) SCL SCC = Disproved (\ x -> case x of)
+      (%~) SCL SCD = Disproved (\ x -> case x of)
+      (%~) SCL SCE = Disproved (\ x -> case x of)
+      (%~) SCL SCF = Disproved (\ x -> case x of)
+      (%~) SCL SCG = Disproved (\ x -> case x of)
+      (%~) SCL SCH = Disproved (\ x -> case x of)
+      (%~) SCL SCI = Disproved (\ x -> case x of)
+      (%~) SCL SCJ = Disproved (\ x -> case x of)
+      (%~) SCL SCK = Disproved (\ x -> case x of)
+      (%~) SCL SCL = Proved Refl
+      (%~) SCL SCM = Disproved (\ x -> case x of)
+      (%~) SCL SCN = Disproved (\ x -> case x of)
+      (%~) SCL SCO = Disproved (\ x -> case x of)
+      (%~) SCL SCP = Disproved (\ x -> case x of)
+      (%~) SCL SCQ = Disproved (\ x -> case x of)
+      (%~) SCL SCR = Disproved (\ x -> case x of)
+      (%~) SCL SCS = Disproved (\ x -> case x of)
+      (%~) SCL SCT = Disproved (\ x -> case x of)
+      (%~) SCL SCU = Disproved (\ x -> case x of)
+      (%~) SCL SCV = Disproved (\ x -> case x of)
+      (%~) SCL SCW = Disproved (\ x -> case x of)
+      (%~) SCL SCX = Disproved (\ x -> case x of)
+      (%~) SCL SCY = Disproved (\ x -> case x of)
+      (%~) SCL SCZ = Disproved (\ x -> case x of)
+      (%~) SCM SCA = Disproved (\ x -> case x of)
+      (%~) SCM SCB = Disproved (\ x -> case x of)
+      (%~) SCM SCC = Disproved (\ x -> case x of)
+      (%~) SCM SCD = Disproved (\ x -> case x of)
+      (%~) SCM SCE = Disproved (\ x -> case x of)
+      (%~) SCM SCF = Disproved (\ x -> case x of)
+      (%~) SCM SCG = Disproved (\ x -> case x of)
+      (%~) SCM SCH = Disproved (\ x -> case x of)
+      (%~) SCM SCI = Disproved (\ x -> case x of)
+      (%~) SCM SCJ = Disproved (\ x -> case x of)
+      (%~) SCM SCK = Disproved (\ x -> case x of)
+      (%~) SCM SCL = Disproved (\ x -> case x of)
+      (%~) SCM SCM = Proved Refl
+      (%~) SCM SCN = Disproved (\ x -> case x of)
+      (%~) SCM SCO = Disproved (\ x -> case x of)
+      (%~) SCM SCP = Disproved (\ x -> case x of)
+      (%~) SCM SCQ = Disproved (\ x -> case x of)
+      (%~) SCM SCR = Disproved (\ x -> case x of)
+      (%~) SCM SCS = Disproved (\ x -> case x of)
+      (%~) SCM SCT = Disproved (\ x -> case x of)
+      (%~) SCM SCU = Disproved (\ x -> case x of)
+      (%~) SCM SCV = Disproved (\ x -> case x of)
+      (%~) SCM SCW = Disproved (\ x -> case x of)
+      (%~) SCM SCX = Disproved (\ x -> case x of)
+      (%~) SCM SCY = Disproved (\ x -> case x of)
+      (%~) SCM SCZ = Disproved (\ x -> case x of)
+      (%~) SCN SCA = Disproved (\ x -> case x of)
+      (%~) SCN SCB = Disproved (\ x -> case x of)
+      (%~) SCN SCC = Disproved (\ x -> case x of)
+      (%~) SCN SCD = Disproved (\ x -> case x of)
+      (%~) SCN SCE = Disproved (\ x -> case x of)
+      (%~) SCN SCF = Disproved (\ x -> case x of)
+      (%~) SCN SCG = Disproved (\ x -> case x of)
+      (%~) SCN SCH = Disproved (\ x -> case x of)
+      (%~) SCN SCI = Disproved (\ x -> case x of)
+      (%~) SCN SCJ = Disproved (\ x -> case x of)
+      (%~) SCN SCK = Disproved (\ x -> case x of)
+      (%~) SCN SCL = Disproved (\ x -> case x of)
+      (%~) SCN SCM = Disproved (\ x -> case x of)
+      (%~) SCN SCN = Proved Refl
+      (%~) SCN SCO = Disproved (\ x -> case x of)
+      (%~) SCN SCP = Disproved (\ x -> case x of)
+      (%~) SCN SCQ = Disproved (\ x -> case x of)
+      (%~) SCN SCR = Disproved (\ x -> case x of)
+      (%~) SCN SCS = Disproved (\ x -> case x of)
+      (%~) SCN SCT = Disproved (\ x -> case x of)
+      (%~) SCN SCU = Disproved (\ x -> case x of)
+      (%~) SCN SCV = Disproved (\ x -> case x of)
+      (%~) SCN SCW = Disproved (\ x -> case x of)
+      (%~) SCN SCX = Disproved (\ x -> case x of)
+      (%~) SCN SCY = Disproved (\ x -> case x of)
+      (%~) SCN SCZ = Disproved (\ x -> case x of)
+      (%~) SCO SCA = Disproved (\ x -> case x of)
+      (%~) SCO SCB = Disproved (\ x -> case x of)
+      (%~) SCO SCC = Disproved (\ x -> case x of)
+      (%~) SCO SCD = Disproved (\ x -> case x of)
+      (%~) SCO SCE = Disproved (\ x -> case x of)
+      (%~) SCO SCF = Disproved (\ x -> case x of)
+      (%~) SCO SCG = Disproved (\ x -> case x of)
+      (%~) SCO SCH = Disproved (\ x -> case x of)
+      (%~) SCO SCI = Disproved (\ x -> case x of)
+      (%~) SCO SCJ = Disproved (\ x -> case x of)
+      (%~) SCO SCK = Disproved (\ x -> case x of)
+      (%~) SCO SCL = Disproved (\ x -> case x of)
+      (%~) SCO SCM = Disproved (\ x -> case x of)
+      (%~) SCO SCN = Disproved (\ x -> case x of)
+      (%~) SCO SCO = Proved Refl
+      (%~) SCO SCP = Disproved (\ x -> case x of)
+      (%~) SCO SCQ = Disproved (\ x -> case x of)
+      (%~) SCO SCR = Disproved (\ x -> case x of)
+      (%~) SCO SCS = Disproved (\ x -> case x of)
+      (%~) SCO SCT = Disproved (\ x -> case x of)
+      (%~) SCO SCU = Disproved (\ x -> case x of)
+      (%~) SCO SCV = Disproved (\ x -> case x of)
+      (%~) SCO SCW = Disproved (\ x -> case x of)
+      (%~) SCO SCX = Disproved (\ x -> case x of)
+      (%~) SCO SCY = Disproved (\ x -> case x of)
+      (%~) SCO SCZ = Disproved (\ x -> case x of)
+      (%~) SCP SCA = Disproved (\ x -> case x of)
+      (%~) SCP SCB = Disproved (\ x -> case x of)
+      (%~) SCP SCC = Disproved (\ x -> case x of)
+      (%~) SCP SCD = Disproved (\ x -> case x of)
+      (%~) SCP SCE = Disproved (\ x -> case x of)
+      (%~) SCP SCF = Disproved (\ x -> case x of)
+      (%~) SCP SCG = Disproved (\ x -> case x of)
+      (%~) SCP SCH = Disproved (\ x -> case x of)
+      (%~) SCP SCI = Disproved (\ x -> case x of)
+      (%~) SCP SCJ = Disproved (\ x -> case x of)
+      (%~) SCP SCK = Disproved (\ x -> case x of)
+      (%~) SCP SCL = Disproved (\ x -> case x of)
+      (%~) SCP SCM = Disproved (\ x -> case x of)
+      (%~) SCP SCN = Disproved (\ x -> case x of)
+      (%~) SCP SCO = Disproved (\ x -> case x of)
+      (%~) SCP SCP = Proved Refl
+      (%~) SCP SCQ = Disproved (\ x -> case x of)
+      (%~) SCP SCR = Disproved (\ x -> case x of)
+      (%~) SCP SCS = Disproved (\ x -> case x of)
+      (%~) SCP SCT = Disproved (\ x -> case x of)
+      (%~) SCP SCU = Disproved (\ x -> case x of)
+      (%~) SCP SCV = Disproved (\ x -> case x of)
+      (%~) SCP SCW = Disproved (\ x -> case x of)
+      (%~) SCP SCX = Disproved (\ x -> case x of)
+      (%~) SCP SCY = Disproved (\ x -> case x of)
+      (%~) SCP SCZ = Disproved (\ x -> case x of)
+      (%~) SCQ SCA = Disproved (\ x -> case x of)
+      (%~) SCQ SCB = Disproved (\ x -> case x of)
+      (%~) SCQ SCC = Disproved (\ x -> case x of)
+      (%~) SCQ SCD = Disproved (\ x -> case x of)
+      (%~) SCQ SCE = Disproved (\ x -> case x of)
+      (%~) SCQ SCF = Disproved (\ x -> case x of)
+      (%~) SCQ SCG = Disproved (\ x -> case x of)
+      (%~) SCQ SCH = Disproved (\ x -> case x of)
+      (%~) SCQ SCI = Disproved (\ x -> case x of)
+      (%~) SCQ SCJ = Disproved (\ x -> case x of)
+      (%~) SCQ SCK = Disproved (\ x -> case x of)
+      (%~) SCQ SCL = Disproved (\ x -> case x of)
+      (%~) SCQ SCM = Disproved (\ x -> case x of)
+      (%~) SCQ SCN = Disproved (\ x -> case x of)
+      (%~) SCQ SCO = Disproved (\ x -> case x of)
+      (%~) SCQ SCP = Disproved (\ x -> case x of)
+      (%~) SCQ SCQ = Proved Refl
+      (%~) SCQ SCR = Disproved (\ x -> case x of)
+      (%~) SCQ SCS = Disproved (\ x -> case x of)
+      (%~) SCQ SCT = Disproved (\ x -> case x of)
+      (%~) SCQ SCU = Disproved (\ x -> case x of)
+      (%~) SCQ SCV = Disproved (\ x -> case x of)
+      (%~) SCQ SCW = Disproved (\ x -> case x of)
+      (%~) SCQ SCX = Disproved (\ x -> case x of)
+      (%~) SCQ SCY = Disproved (\ x -> case x of)
+      (%~) SCQ SCZ = Disproved (\ x -> case x of)
+      (%~) SCR SCA = Disproved (\ x -> case x of)
+      (%~) SCR SCB = Disproved (\ x -> case x of)
+      (%~) SCR SCC = Disproved (\ x -> case x of)
+      (%~) SCR SCD = Disproved (\ x -> case x of)
+      (%~) SCR SCE = Disproved (\ x -> case x of)
+      (%~) SCR SCF = Disproved (\ x -> case x of)
+      (%~) SCR SCG = Disproved (\ x -> case x of)
+      (%~) SCR SCH = Disproved (\ x -> case x of)
+      (%~) SCR SCI = Disproved (\ x -> case x of)
+      (%~) SCR SCJ = Disproved (\ x -> case x of)
+      (%~) SCR SCK = Disproved (\ x -> case x of)
+      (%~) SCR SCL = Disproved (\ x -> case x of)
+      (%~) SCR SCM = Disproved (\ x -> case x of)
+      (%~) SCR SCN = Disproved (\ x -> case x of)
+      (%~) SCR SCO = Disproved (\ x -> case x of)
+      (%~) SCR SCP = Disproved (\ x -> case x of)
+      (%~) SCR SCQ = Disproved (\ x -> case x of)
+      (%~) SCR SCR = Proved Refl
+      (%~) SCR SCS = Disproved (\ x -> case x of)
+      (%~) SCR SCT = Disproved (\ x -> case x of)
+      (%~) SCR SCU = Disproved (\ x -> case x of)
+      (%~) SCR SCV = Disproved (\ x -> case x of)
+      (%~) SCR SCW = Disproved (\ x -> case x of)
+      (%~) SCR SCX = Disproved (\ x -> case x of)
+      (%~) SCR SCY = Disproved (\ x -> case x of)
+      (%~) SCR SCZ = Disproved (\ x -> case x of)
+      (%~) SCS SCA = Disproved (\ x -> case x of)
+      (%~) SCS SCB = Disproved (\ x -> case x of)
+      (%~) SCS SCC = Disproved (\ x -> case x of)
+      (%~) SCS SCD = Disproved (\ x -> case x of)
+      (%~) SCS SCE = Disproved (\ x -> case x of)
+      (%~) SCS SCF = Disproved (\ x -> case x of)
+      (%~) SCS SCG = Disproved (\ x -> case x of)
+      (%~) SCS SCH = Disproved (\ x -> case x of)
+      (%~) SCS SCI = Disproved (\ x -> case x of)
+      (%~) SCS SCJ = Disproved (\ x -> case x of)
+      (%~) SCS SCK = Disproved (\ x -> case x of)
+      (%~) SCS SCL = Disproved (\ x -> case x of)
+      (%~) SCS SCM = Disproved (\ x -> case x of)
+      (%~) SCS SCN = Disproved (\ x -> case x of)
+      (%~) SCS SCO = Disproved (\ x -> case x of)
+      (%~) SCS SCP = Disproved (\ x -> case x of)
+      (%~) SCS SCQ = Disproved (\ x -> case x of)
+      (%~) SCS SCR = Disproved (\ x -> case x of)
+      (%~) SCS SCS = Proved Refl
+      (%~) SCS SCT = Disproved (\ x -> case x of)
+      (%~) SCS SCU = Disproved (\ x -> case x of)
+      (%~) SCS SCV = Disproved (\ x -> case x of)
+      (%~) SCS SCW = Disproved (\ x -> case x of)
+      (%~) SCS SCX = Disproved (\ x -> case x of)
+      (%~) SCS SCY = Disproved (\ x -> case x of)
+      (%~) SCS SCZ = Disproved (\ x -> case x of)
+      (%~) SCT SCA = Disproved (\ x -> case x of)
+      (%~) SCT SCB = Disproved (\ x -> case x of)
+      (%~) SCT SCC = Disproved (\ x -> case x of)
+      (%~) SCT SCD = Disproved (\ x -> case x of)
+      (%~) SCT SCE = Disproved (\ x -> case x of)
+      (%~) SCT SCF = Disproved (\ x -> case x of)
+      (%~) SCT SCG = Disproved (\ x -> case x of)
+      (%~) SCT SCH = Disproved (\ x -> case x of)
+      (%~) SCT SCI = Disproved (\ x -> case x of)
+      (%~) SCT SCJ = Disproved (\ x -> case x of)
+      (%~) SCT SCK = Disproved (\ x -> case x of)
+      (%~) SCT SCL = Disproved (\ x -> case x of)
+      (%~) SCT SCM = Disproved (\ x -> case x of)
+      (%~) SCT SCN = Disproved (\ x -> case x of)
+      (%~) SCT SCO = Disproved (\ x -> case x of)
+      (%~) SCT SCP = Disproved (\ x -> case x of)
+      (%~) SCT SCQ = Disproved (\ x -> case x of)
+      (%~) SCT SCR = Disproved (\ x -> case x of)
+      (%~) SCT SCS = Disproved (\ x -> case x of)
+      (%~) SCT SCT = Proved Refl
+      (%~) SCT SCU = Disproved (\ x -> case x of)
+      (%~) SCT SCV = Disproved (\ x -> case x of)
+      (%~) SCT SCW = Disproved (\ x -> case x of)
+      (%~) SCT SCX = Disproved (\ x -> case x of)
+      (%~) SCT SCY = Disproved (\ x -> case x of)
+      (%~) SCT SCZ = Disproved (\ x -> case x of)
+      (%~) SCU SCA = Disproved (\ x -> case x of)
+      (%~) SCU SCB = Disproved (\ x -> case x of)
+      (%~) SCU SCC = Disproved (\ x -> case x of)
+      (%~) SCU SCD = Disproved (\ x -> case x of)
+      (%~) SCU SCE = Disproved (\ x -> case x of)
+      (%~) SCU SCF = Disproved (\ x -> case x of)
+      (%~) SCU SCG = Disproved (\ x -> case x of)
+      (%~) SCU SCH = Disproved (\ x -> case x of)
+      (%~) SCU SCI = Disproved (\ x -> case x of)
+      (%~) SCU SCJ = Disproved (\ x -> case x of)
+      (%~) SCU SCK = Disproved (\ x -> case x of)
+      (%~) SCU SCL = Disproved (\ x -> case x of)
+      (%~) SCU SCM = Disproved (\ x -> case x of)
+      (%~) SCU SCN = Disproved (\ x -> case x of)
+      (%~) SCU SCO = Disproved (\ x -> case x of)
+      (%~) SCU SCP = Disproved (\ x -> case x of)
+      (%~) SCU SCQ = Disproved (\ x -> case x of)
+      (%~) SCU SCR = Disproved (\ x -> case x of)
+      (%~) SCU SCS = Disproved (\ x -> case x of)
+      (%~) SCU SCT = Disproved (\ x -> case x of)
+      (%~) SCU SCU = Proved Refl
+      (%~) SCU SCV = Disproved (\ x -> case x of)
+      (%~) SCU SCW = Disproved (\ x -> case x of)
+      (%~) SCU SCX = Disproved (\ x -> case x of)
+      (%~) SCU SCY = Disproved (\ x -> case x of)
+      (%~) SCU SCZ = Disproved (\ x -> case x of)
+      (%~) SCV SCA = Disproved (\ x -> case x of)
+      (%~) SCV SCB = Disproved (\ x -> case x of)
+      (%~) SCV SCC = Disproved (\ x -> case x of)
+      (%~) SCV SCD = Disproved (\ x -> case x of)
+      (%~) SCV SCE = Disproved (\ x -> case x of)
+      (%~) SCV SCF = Disproved (\ x -> case x of)
+      (%~) SCV SCG = Disproved (\ x -> case x of)
+      (%~) SCV SCH = Disproved (\ x -> case x of)
+      (%~) SCV SCI = Disproved (\ x -> case x of)
+      (%~) SCV SCJ = Disproved (\ x -> case x of)
+      (%~) SCV SCK = Disproved (\ x -> case x of)
+      (%~) SCV SCL = Disproved (\ x -> case x of)
+      (%~) SCV SCM = Disproved (\ x -> case x of)
+      (%~) SCV SCN = Disproved (\ x -> case x of)
+      (%~) SCV SCO = Disproved (\ x -> case x of)
+      (%~) SCV SCP = Disproved (\ x -> case x of)
+      (%~) SCV SCQ = Disproved (\ x -> case x of)
+      (%~) SCV SCR = Disproved (\ x -> case x of)
+      (%~) SCV SCS = Disproved (\ x -> case x of)
+      (%~) SCV SCT = Disproved (\ x -> case x of)
+      (%~) SCV SCU = Disproved (\ x -> case x of)
+      (%~) SCV SCV = Proved Refl
+      (%~) SCV SCW = Disproved (\ x -> case x of)
+      (%~) SCV SCX = Disproved (\ x -> case x of)
+      (%~) SCV SCY = Disproved (\ x -> case x of)
+      (%~) SCV SCZ = Disproved (\ x -> case x of)
+      (%~) SCW SCA = Disproved (\ x -> case x of)
+      (%~) SCW SCB = Disproved (\ x -> case x of)
+      (%~) SCW SCC = Disproved (\ x -> case x of)
+      (%~) SCW SCD = Disproved (\ x -> case x of)
+      (%~) SCW SCE = Disproved (\ x -> case x of)
+      (%~) SCW SCF = Disproved (\ x -> case x of)
+      (%~) SCW SCG = Disproved (\ x -> case x of)
+      (%~) SCW SCH = Disproved (\ x -> case x of)
+      (%~) SCW SCI = Disproved (\ x -> case x of)
+      (%~) SCW SCJ = Disproved (\ x -> case x of)
+      (%~) SCW SCK = Disproved (\ x -> case x of)
+      (%~) SCW SCL = Disproved (\ x -> case x of)
+      (%~) SCW SCM = Disproved (\ x -> case x of)
+      (%~) SCW SCN = Disproved (\ x -> case x of)
+      (%~) SCW SCO = Disproved (\ x -> case x of)
+      (%~) SCW SCP = Disproved (\ x -> case x of)
+      (%~) SCW SCQ = Disproved (\ x -> case x of)
+      (%~) SCW SCR = Disproved (\ x -> case x of)
+      (%~) SCW SCS = Disproved (\ x -> case x of)
+      (%~) SCW SCT = Disproved (\ x -> case x of)
+      (%~) SCW SCU = Disproved (\ x -> case x of)
+      (%~) SCW SCV = Disproved (\ x -> case x of)
+      (%~) SCW SCW = Proved Refl
+      (%~) SCW SCX = Disproved (\ x -> case x of)
+      (%~) SCW SCY = Disproved (\ x -> case x of)
+      (%~) SCW SCZ = Disproved (\ x -> case x of)
+      (%~) SCX SCA = Disproved (\ x -> case x of)
+      (%~) SCX SCB = Disproved (\ x -> case x of)
+      (%~) SCX SCC = Disproved (\ x -> case x of)
+      (%~) SCX SCD = Disproved (\ x -> case x of)
+      (%~) SCX SCE = Disproved (\ x -> case x of)
+      (%~) SCX SCF = Disproved (\ x -> case x of)
+      (%~) SCX SCG = Disproved (\ x -> case x of)
+      (%~) SCX SCH = Disproved (\ x -> case x of)
+      (%~) SCX SCI = Disproved (\ x -> case x of)
+      (%~) SCX SCJ = Disproved (\ x -> case x of)
+      (%~) SCX SCK = Disproved (\ x -> case x of)
+      (%~) SCX SCL = Disproved (\ x -> case x of)
+      (%~) SCX SCM = Disproved (\ x -> case x of)
+      (%~) SCX SCN = Disproved (\ x -> case x of)
+      (%~) SCX SCO = Disproved (\ x -> case x of)
+      (%~) SCX SCP = Disproved (\ x -> case x of)
+      (%~) SCX SCQ = Disproved (\ x -> case x of)
+      (%~) SCX SCR = Disproved (\ x -> case x of)
+      (%~) SCX SCS = Disproved (\ x -> case x of)
+      (%~) SCX SCT = Disproved (\ x -> case x of)
+      (%~) SCX SCU = Disproved (\ x -> case x of)
+      (%~) SCX SCV = Disproved (\ x -> case x of)
+      (%~) SCX SCW = Disproved (\ x -> case x of)
+      (%~) SCX SCX = Proved Refl
+      (%~) SCX SCY = Disproved (\ x -> case x of)
+      (%~) SCX SCZ = Disproved (\ x -> case x of)
+      (%~) SCY SCA = Disproved (\ x -> case x of)
+      (%~) SCY SCB = Disproved (\ x -> case x of)
+      (%~) SCY SCC = Disproved (\ x -> case x of)
+      (%~) SCY SCD = Disproved (\ x -> case x of)
+      (%~) SCY SCE = Disproved (\ x -> case x of)
+      (%~) SCY SCF = Disproved (\ x -> case x of)
+      (%~) SCY SCG = Disproved (\ x -> case x of)
+      (%~) SCY SCH = Disproved (\ x -> case x of)
+      (%~) SCY SCI = Disproved (\ x -> case x of)
+      (%~) SCY SCJ = Disproved (\ x -> case x of)
+      (%~) SCY SCK = Disproved (\ x -> case x of)
+      (%~) SCY SCL = Disproved (\ x -> case x of)
+      (%~) SCY SCM = Disproved (\ x -> case x of)
+      (%~) SCY SCN = Disproved (\ x -> case x of)
+      (%~) SCY SCO = Disproved (\ x -> case x of)
+      (%~) SCY SCP = Disproved (\ x -> case x of)
+      (%~) SCY SCQ = Disproved (\ x -> case x of)
+      (%~) SCY SCR = Disproved (\ x -> case x of)
+      (%~) SCY SCS = Disproved (\ x -> case x of)
+      (%~) SCY SCT = Disproved (\ x -> case x of)
+      (%~) SCY SCU = Disproved (\ x -> case x of)
+      (%~) SCY SCV = Disproved (\ x -> case x of)
+      (%~) SCY SCW = Disproved (\ x -> case x of)
+      (%~) SCY SCX = Disproved (\ x -> case x of)
+      (%~) SCY SCY = Proved Refl
+      (%~) SCY SCZ = Disproved (\ x -> case x of)
+      (%~) SCZ SCA = Disproved (\ x -> case x of)
+      (%~) SCZ SCB = Disproved (\ x -> case x of)
+      (%~) SCZ SCC = Disproved (\ x -> case x of)
+      (%~) SCZ SCD = Disproved (\ x -> case x of)
+      (%~) SCZ SCE = Disproved (\ x -> case x of)
+      (%~) SCZ SCF = Disproved (\ x -> case x of)
+      (%~) SCZ SCG = Disproved (\ x -> case x of)
+      (%~) SCZ SCH = Disproved (\ x -> case x of)
+      (%~) SCZ SCI = Disproved (\ x -> case x of)
+      (%~) SCZ SCJ = Disproved (\ x -> case x of)
+      (%~) SCZ SCK = Disproved (\ x -> case x of)
+      (%~) SCZ SCL = Disproved (\ x -> case x of)
+      (%~) SCZ SCM = Disproved (\ x -> case x of)
+      (%~) SCZ SCN = Disproved (\ x -> case x of)
+      (%~) SCZ SCO = Disproved (\ x -> case x of)
+      (%~) SCZ SCP = Disproved (\ x -> case x of)
+      (%~) SCZ SCQ = Disproved (\ x -> case x of)
+      (%~) SCZ SCR = Disproved (\ x -> case x of)
+      (%~) SCZ SCS = Disproved (\ x -> case x of)
+      (%~) SCZ SCT = Disproved (\ x -> case x of)
+      (%~) SCZ SCU = Disproved (\ x -> case x of)
+      (%~) SCZ SCV = Disproved (\ x -> case x of)
+      (%~) SCZ SCW = Disproved (\ x -> case x of)
+      (%~) SCZ SCX = Disproved (\ x -> case x of)
+      (%~) SCZ SCY = Disproved (\ x -> case x of)
+      (%~) SCZ SCZ = Proved Refl
+    instance Data.Type.Equality.TestEquality (SAChar :: AChar
+                                                        -> Type) where
+      Data.Type.Equality.testEquality
+        = Data.Singletons.Decide.decideEquality
+    instance Data.Type.Coercion.TestCoercion (SAChar :: AChar
+                                                        -> Type) where
+      Data.Type.Coercion.testCoercion
+        = Data.Singletons.Decide.decideCoercion
+    instance (Data.Singletons.ShowSing.ShowSing U,
+              Data.Singletons.ShowSing.ShowSing Nat) =>
+             Show (SU (z :: U)) where
+      showsPrec _ SBOOL = showString "SBOOL"
+      showsPrec _ SSTRING = showString "SSTRING"
+      showsPrec _ SNAT = showString "SNAT"
+      showsPrec
+        p_0123456789876543210
+        (SVEC (arg_0123456789876543210 :: Sing argTy_0123456789876543210)
+              (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
+        = (showParen (((>) p_0123456789876543210) 10))
+            (((.) (showString "SVEC "))
+               (((.) ((showsPrec 11) arg_0123456789876543210))
+                  (((.) GHC.Show.showSpace)
+                     ((showsPrec 11) arg_0123456789876543210)))) ::
+            (Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210,
+             Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210) =>
+            ShowS
+    instance Show (SAChar (z :: AChar)) where
+      showsPrec _ SCA = showString "SCA"
+      showsPrec _ SCB = showString "SCB"
+      showsPrec _ SCC = showString "SCC"
+      showsPrec _ SCD = showString "SCD"
+      showsPrec _ SCE = showString "SCE"
+      showsPrec _ SCF = showString "SCF"
+      showsPrec _ SCG = showString "SCG"
+      showsPrec _ SCH = showString "SCH"
+      showsPrec _ SCI = showString "SCI"
+      showsPrec _ SCJ = showString "SCJ"
+      showsPrec _ SCK = showString "SCK"
+      showsPrec _ SCL = showString "SCL"
+      showsPrec _ SCM = showString "SCM"
+      showsPrec _ SCN = showString "SCN"
+      showsPrec _ SCO = showString "SCO"
+      showsPrec _ SCP = showString "SCP"
+      showsPrec _ SCQ = showString "SCQ"
+      showsPrec _ SCR = showString "SCR"
+      showsPrec _ SCS = showString "SCS"
+      showsPrec _ SCT = showString "SCT"
+      showsPrec _ SCU = showString "SCU"
+      showsPrec _ SCV = showString "SCV"
+      showsPrec _ SCW = showString "SCW"
+      showsPrec _ SCX = showString "SCX"
+      showsPrec _ SCY = showString "SCY"
+      showsPrec _ SCZ = showString "SCZ"
+    instance SingI BOOL where
+      sing = SBOOL
+    instance SingI STRING where
+      sing = SSTRING
+    instance SingI NAT where
+      sing = SNAT
+    instance (SingI n, SingI n) =>
+             SingI (VEC (n :: U) (n :: Nat)) where
+      sing = (SVEC sing) sing
+    instance SingI (VECSym0 :: (~>) U ((~>) Nat U)) where
+      sing = (singFun2 @VECSym0) SVEC
+    instance SingI d => SingI (VECSym1 (d :: U) :: (~>) Nat U) where
+      sing = (singFun1 @(VECSym1 (d :: U))) (SVEC (sing @d))
+    instance SingI CA where
+      sing = SCA
+    instance SingI CB where
+      sing = SCB
+    instance SingI CC where
+      sing = SCC
+    instance SingI CD where
+      sing = SCD
+    instance SingI CE where
+      sing = SCE
+    instance SingI CF where
+      sing = SCF
+    instance SingI CG where
+      sing = SCG
+    instance SingI CH where
+      sing = SCH
+    instance SingI CI where
+      sing = SCI
+    instance SingI CJ where
+      sing = SCJ
+    instance SingI CK where
+      sing = SCK
+    instance SingI CL where
+      sing = SCL
+    instance SingI CM where
+      sing = SCM
+    instance SingI CN where
+      sing = SCN
+    instance SingI CO where
+      sing = SCO
+    instance SingI CP where
+      sing = SCP
+    instance SingI CQ where
+      sing = SCQ
+    instance SingI CR where
+      sing = SCR
+    instance SingI CS where
+      sing = SCS
+    instance SingI CT where
+      sing = SCT
+    instance SingI CU where
+      sing = SCU
+    instance SingI CV where
+      sing = SCV
+    instance SingI CW where
+      sing = SCW
+    instance SingI CX where
+      sing = SCX
+    instance SingI CY where
+      sing = SCY
+    instance SingI CZ where
+      sing = SCZ
+    instance (SingI n, SingI n) =>
+             SingI (Attr (n :: [AChar]) (n :: U)) where
+      sing = (SAttr sing) sing
+    instance SingI (AttrSym0 :: (~>) [AChar] ((~>) U Attribute)) where
+      sing = (singFun2 @AttrSym0) SAttr
+    instance SingI d =>
+             SingI (AttrSym1 (d :: [AChar]) :: (~>) U Attribute) where
+      sing = (singFun1 @(AttrSym1 (d :: [AChar]))) (SAttr (sing @d))
+    instance SingI n => SingI (Sch (n :: [Attribute])) where
+      sing = SSch sing
+    instance SingI (SchSym0 :: (~>) [Attribute] Schema) where
+      sing = (singFun1 @SchSym0) SSch
+GradingClient/Database.hs:0:0:: Splicing declarations
+    return [] ======>
+GradingClient/Database.hs:(0,0)-(0,0): Splicing expression
+    cases ''Row [| r |] [| changeId (n ++ (getId r)) r |]
+  ======>
+    case r of
+      EmptyRow _ -> (changeId (((++) n) (getId r))) r
+      ConsRow _ _ -> (changeId (((++) n) (getId r))) r
diff --git a/tests/compile-and-dump/GradingClient/Main.ghc88.template b/tests/compile-and-dump/GradingClient/Main.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/GradingClient/Main.ghc88.template
+++ /dev/null
@@ -1,123 +0,0 @@
-GradingClient/Main.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| lastName, firstName, yearName, gradeName, majorName :: [AChar]
-          lastName = [CL, CA, CS, CT]
-          firstName = [CF, CI, CR, CS, CT]
-          yearName = [CY, CE, CA, CR]
-          gradeName = [CG, CR, CA, CD, CE]
-          majorName = [CM, CA, CJ, CO, CR]
-          gradingSchema :: Schema
-          gradingSchema
-            = Sch
-                [Attr lastName STRING, Attr firstName STRING, Attr yearName NAT,
-                 Attr gradeName NAT, Attr majorName BOOL]
-          names :: Schema
-          names = Sch [Attr firstName STRING, Attr lastName STRING] |]
-  ======>
-    lastName :: [AChar]
-    firstName :: [AChar]
-    yearName :: [AChar]
-    gradeName :: [AChar]
-    majorName :: [AChar]
-    lastName = [CL, CA, CS, CT]
-    firstName = [CF, CI, CR, CS, CT]
-    yearName = [CY, CE, CA, CR]
-    gradeName = [CG, CR, CA, CD, CE]
-    majorName = [CM, CA, CJ, CO, CR]
-    gradingSchema :: Schema
-    gradingSchema
-      = Sch
-          [(Attr lastName) STRING, (Attr firstName) STRING,
-           (Attr yearName) NAT, (Attr gradeName) NAT, (Attr majorName) BOOL]
-    names :: Schema
-    names = Sch [(Attr firstName) STRING, (Attr lastName) STRING]
-    type NamesSym0 = Names
-    type GradingSchemaSym0 = GradingSchema
-    type MajorNameSym0 = MajorName
-    type GradeNameSym0 = GradeName
-    type YearNameSym0 = YearName
-    type FirstNameSym0 = FirstName
-    type LastNameSym0 = LastName
-    type family Names :: Schema where
-      Names = Apply SchSym0 (Apply (Apply (:@#@$) (Apply (Apply AttrSym0 FirstNameSym0) STRINGSym0)) (Apply (Apply (:@#@$) (Apply (Apply AttrSym0 LastNameSym0) STRINGSym0)) '[]))
-    type family GradingSchema :: Schema where
-      GradingSchema = Apply SchSym0 (Apply (Apply (:@#@$) (Apply (Apply AttrSym0 LastNameSym0) STRINGSym0)) (Apply (Apply (:@#@$) (Apply (Apply AttrSym0 FirstNameSym0) STRINGSym0)) (Apply (Apply (:@#@$) (Apply (Apply AttrSym0 YearNameSym0) NATSym0)) (Apply (Apply (:@#@$) (Apply (Apply AttrSym0 GradeNameSym0) NATSym0)) (Apply (Apply (:@#@$) (Apply (Apply AttrSym0 MajorNameSym0) BOOLSym0)) '[])))))
-    type family MajorName :: [AChar] where
-      MajorName = Apply (Apply (:@#@$) CMSym0) (Apply (Apply (:@#@$) CASym0) (Apply (Apply (:@#@$) CJSym0) (Apply (Apply (:@#@$) COSym0) (Apply (Apply (:@#@$) CRSym0) '[]))))
-    type family GradeName :: [AChar] where
-      GradeName = Apply (Apply (:@#@$) CGSym0) (Apply (Apply (:@#@$) CRSym0) (Apply (Apply (:@#@$) CASym0) (Apply (Apply (:@#@$) CDSym0) (Apply (Apply (:@#@$) CESym0) '[]))))
-    type family YearName :: [AChar] where
-      YearName = Apply (Apply (:@#@$) CYSym0) (Apply (Apply (:@#@$) CESym0) (Apply (Apply (:@#@$) CASym0) (Apply (Apply (:@#@$) CRSym0) '[])))
-    type family FirstName :: [AChar] where
-      FirstName = Apply (Apply (:@#@$) CFSym0) (Apply (Apply (:@#@$) CISym0) (Apply (Apply (:@#@$) CRSym0) (Apply (Apply (:@#@$) CSSym0) (Apply (Apply (:@#@$) CTSym0) '[]))))
-    type family LastName :: [AChar] where
-      LastName = Apply (Apply (:@#@$) CLSym0) (Apply (Apply (:@#@$) CASym0) (Apply (Apply (:@#@$) CSSym0) (Apply (Apply (:@#@$) CTSym0) '[])))
-    sNames :: Sing (NamesSym0 :: Schema)
-    sGradingSchema :: Sing (GradingSchemaSym0 :: Schema)
-    sMajorName :: Sing (MajorNameSym0 :: [AChar])
-    sGradeName :: Sing (GradeNameSym0 :: [AChar])
-    sYearName :: Sing (YearNameSym0 :: [AChar])
-    sFirstName :: Sing (FirstNameSym0 :: [AChar])
-    sLastName :: Sing (LastNameSym0 :: [AChar])
-    sNames
-      = (applySing ((singFun1 @SchSym0) SSch))
-          ((applySing
-              ((applySing ((singFun2 @(:@#@$)) SCons))
-                 ((applySing ((applySing ((singFun2 @AttrSym0) SAttr)) sFirstName))
-                    SSTRING)))
-             ((applySing
-                 ((applySing ((singFun2 @(:@#@$)) SCons))
-                    ((applySing ((applySing ((singFun2 @AttrSym0) SAttr)) sLastName))
-                       SSTRING)))
-                SNil))
-    sGradingSchema
-      = (applySing ((singFun1 @SchSym0) SSch))
-          ((applySing
-              ((applySing ((singFun2 @(:@#@$)) SCons))
-                 ((applySing ((applySing ((singFun2 @AttrSym0) SAttr)) sLastName))
-                    SSTRING)))
-             ((applySing
-                 ((applySing ((singFun2 @(:@#@$)) SCons))
-                    ((applySing ((applySing ((singFun2 @AttrSym0) SAttr)) sFirstName))
-                       SSTRING)))
-                ((applySing
-                    ((applySing ((singFun2 @(:@#@$)) SCons))
-                       ((applySing ((applySing ((singFun2 @AttrSym0) SAttr)) sYearName))
-                          SNAT)))
-                   ((applySing
-                       ((applySing ((singFun2 @(:@#@$)) SCons))
-                          ((applySing ((applySing ((singFun2 @AttrSym0) SAttr)) sGradeName))
-                             SNAT)))
-                      ((applySing
-                          ((applySing ((singFun2 @(:@#@$)) SCons))
-                             ((applySing ((applySing ((singFun2 @AttrSym0) SAttr)) sMajorName))
-                                SBOOL)))
-                         SNil)))))
-    sMajorName
-      = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCM))
-          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCA))
-             ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCJ))
-                ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCO))
-                   ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCR)) SNil))))
-    sGradeName
-      = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCG))
-          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCR))
-             ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCA))
-                ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCD))
-                   ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCE)) SNil))))
-    sYearName
-      = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCY))
-          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCE))
-             ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCA))
-                ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCR)) SNil)))
-    sFirstName
-      = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCF))
-          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCI))
-             ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCR))
-                ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCS))
-                   ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCT)) SNil))))
-    sLastName
-      = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCL))
-          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCA))
-             ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCS))
-                ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCT)) SNil)))
diff --git a/tests/compile-and-dump/GradingClient/Main.golden b/tests/compile-and-dump/GradingClient/Main.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/GradingClient/Main.golden
@@ -0,0 +1,130 @@
+GradingClient/Main.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| lastName, firstName, yearName, gradeName, majorName :: [AChar]
+          lastName = [CL, CA, CS, CT]
+          firstName = [CF, CI, CR, CS, CT]
+          yearName = [CY, CE, CA, CR]
+          gradeName = [CG, CR, CA, CD, CE]
+          majorName = [CM, CA, CJ, CO, CR]
+          gradingSchema :: Schema
+          gradingSchema
+            = Sch
+                [Attr lastName STRING, Attr firstName STRING, Attr yearName NAT,
+                 Attr gradeName NAT, Attr majorName BOOL]
+          names :: Schema
+          names = Sch [Attr firstName STRING, Attr lastName STRING] |]
+  ======>
+    lastName :: [AChar]
+    firstName :: [AChar]
+    yearName :: [AChar]
+    gradeName :: [AChar]
+    majorName :: [AChar]
+    lastName = [CL, CA, CS, CT]
+    firstName = [CF, CI, CR, CS, CT]
+    yearName = [CY, CE, CA, CR]
+    gradeName = [CG, CR, CA, CD, CE]
+    majorName = [CM, CA, CJ, CO, CR]
+    gradingSchema :: Schema
+    gradingSchema
+      = Sch
+          [(Attr lastName) STRING, (Attr firstName) STRING,
+           (Attr yearName) NAT, (Attr gradeName) NAT, (Attr majorName) BOOL]
+    names :: Schema
+    names = Sch [(Attr firstName) STRING, (Attr lastName) STRING]
+    type NamesSym0 = Names :: Schema
+    type GradingSchemaSym0 = GradingSchema :: Schema
+    type MajorNameSym0 = MajorName :: [AChar]
+    type GradeNameSym0 = GradeName :: [AChar]
+    type YearNameSym0 = YearName :: [AChar]
+    type FirstNameSym0 = FirstName :: [AChar]
+    type LastNameSym0 = LastName :: [AChar]
+    type Names :: Schema
+    type family Names where
+      Names = Apply SchSym0 (Apply (Apply (:@#@$) (Apply (Apply AttrSym0 FirstNameSym0) STRINGSym0)) (Apply (Apply (:@#@$) (Apply (Apply AttrSym0 LastNameSym0) STRINGSym0)) NilSym0))
+    type GradingSchema :: Schema
+    type family GradingSchema where
+      GradingSchema = Apply SchSym0 (Apply (Apply (:@#@$) (Apply (Apply AttrSym0 LastNameSym0) STRINGSym0)) (Apply (Apply (:@#@$) (Apply (Apply AttrSym0 FirstNameSym0) STRINGSym0)) (Apply (Apply (:@#@$) (Apply (Apply AttrSym0 YearNameSym0) NATSym0)) (Apply (Apply (:@#@$) (Apply (Apply AttrSym0 GradeNameSym0) NATSym0)) (Apply (Apply (:@#@$) (Apply (Apply AttrSym0 MajorNameSym0) BOOLSym0)) NilSym0)))))
+    type MajorName :: [AChar]
+    type family MajorName where
+      MajorName = Apply (Apply (:@#@$) CMSym0) (Apply (Apply (:@#@$) CASym0) (Apply (Apply (:@#@$) CJSym0) (Apply (Apply (:@#@$) COSym0) (Apply (Apply (:@#@$) CRSym0) NilSym0))))
+    type GradeName :: [AChar]
+    type family GradeName where
+      GradeName = Apply (Apply (:@#@$) CGSym0) (Apply (Apply (:@#@$) CRSym0) (Apply (Apply (:@#@$) CASym0) (Apply (Apply (:@#@$) CDSym0) (Apply (Apply (:@#@$) CESym0) NilSym0))))
+    type YearName :: [AChar]
+    type family YearName where
+      YearName = Apply (Apply (:@#@$) CYSym0) (Apply (Apply (:@#@$) CESym0) (Apply (Apply (:@#@$) CASym0) (Apply (Apply (:@#@$) CRSym0) NilSym0)))
+    type FirstName :: [AChar]
+    type family FirstName where
+      FirstName = Apply (Apply (:@#@$) CFSym0) (Apply (Apply (:@#@$) CISym0) (Apply (Apply (:@#@$) CRSym0) (Apply (Apply (:@#@$) CSSym0) (Apply (Apply (:@#@$) CTSym0) NilSym0))))
+    type LastName :: [AChar]
+    type family LastName where
+      LastName = Apply (Apply (:@#@$) CLSym0) (Apply (Apply (:@#@$) CASym0) (Apply (Apply (:@#@$) CSSym0) (Apply (Apply (:@#@$) CTSym0) NilSym0)))
+    sNames :: Sing (NamesSym0 :: Schema)
+    sGradingSchema :: Sing (GradingSchemaSym0 :: Schema)
+    sMajorName :: Sing (MajorNameSym0 :: [AChar])
+    sGradeName :: Sing (GradeNameSym0 :: [AChar])
+    sYearName :: Sing (YearNameSym0 :: [AChar])
+    sFirstName :: Sing (FirstNameSym0 :: [AChar])
+    sLastName :: Sing (LastNameSym0 :: [AChar])
+    sNames
+      = (applySing ((singFun1 @SchSym0) SSch))
+          ((applySing
+              ((applySing ((singFun2 @(:@#@$)) SCons))
+                 ((applySing ((applySing ((singFun2 @AttrSym0) SAttr)) sFirstName))
+                    SSTRING)))
+             ((applySing
+                 ((applySing ((singFun2 @(:@#@$)) SCons))
+                    ((applySing ((applySing ((singFun2 @AttrSym0) SAttr)) sLastName))
+                       SSTRING)))
+                SNil))
+    sGradingSchema
+      = (applySing ((singFun1 @SchSym0) SSch))
+          ((applySing
+              ((applySing ((singFun2 @(:@#@$)) SCons))
+                 ((applySing ((applySing ((singFun2 @AttrSym0) SAttr)) sLastName))
+                    SSTRING)))
+             ((applySing
+                 ((applySing ((singFun2 @(:@#@$)) SCons))
+                    ((applySing ((applySing ((singFun2 @AttrSym0) SAttr)) sFirstName))
+                       SSTRING)))
+                ((applySing
+                    ((applySing ((singFun2 @(:@#@$)) SCons))
+                       ((applySing ((applySing ((singFun2 @AttrSym0) SAttr)) sYearName))
+                          SNAT)))
+                   ((applySing
+                       ((applySing ((singFun2 @(:@#@$)) SCons))
+                          ((applySing ((applySing ((singFun2 @AttrSym0) SAttr)) sGradeName))
+                             SNAT)))
+                      ((applySing
+                          ((applySing ((singFun2 @(:@#@$)) SCons))
+                             ((applySing ((applySing ((singFun2 @AttrSym0) SAttr)) sMajorName))
+                                SBOOL)))
+                         SNil)))))
+    sMajorName
+      = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCM))
+          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCA))
+             ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCJ))
+                ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCO))
+                   ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCR)) SNil))))
+    sGradeName
+      = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCG))
+          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCR))
+             ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCA))
+                ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCD))
+                   ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCE)) SNil))))
+    sYearName
+      = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCY))
+          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCE))
+             ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCA))
+                ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCR)) SNil)))
+    sFirstName
+      = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCF))
+          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCI))
+             ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCR))
+                ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCS))
+                   ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCT)) SNil))))
+    sLastName
+      = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCL))
+          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCA))
+             ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCS))
+                ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SCT)) SNil)))
diff --git a/tests/compile-and-dump/InsertionSort/InsertionSortImp.ghc88.template b/tests/compile-and-dump/InsertionSort/InsertionSortImp.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/InsertionSort/InsertionSortImp.ghc88.template
+++ /dev/null
@@ -1,211 +0,0 @@
-InsertionSort/InsertionSortImp.hs:(0,0)-(0,0): Splicing declarations
-    singletons [d| data Nat = Zero | Succ Nat |]
-  ======>
-    data Nat = Zero | Succ Nat
-    type ZeroSym0 = Zero
-    type SuccSym1 (t0123456789876543210 :: Nat) =
-        Succ t0123456789876543210
-    instance SuppressUnusedWarnings SuccSym0 where
-      suppressUnusedWarnings = snd (((,) SuccSym0KindInference) ())
-    data SuccSym0 :: (~>) Nat Nat
-      where
-        SuccSym0KindInference :: forall t0123456789876543210
-                                        arg. SameKind (Apply SuccSym0 arg) (SuccSym1 arg) =>
-                                 SuccSym0 t0123456789876543210
-    type instance Apply SuccSym0 t0123456789876543210 = Succ t0123456789876543210
-    data SNat :: Nat -> Type
-      where
-        SZero :: SNat Zero
-        SSucc :: forall (n :: Nat). (Sing (n :: Nat)) -> SNat (Succ n)
-    type instance Sing @Nat = SNat
-    instance SingKind Nat where
-      type Demote Nat = Nat
-      fromSing SZero = Zero
-      fromSing (SSucc b) = Succ (fromSing b)
-      toSing Zero = SomeSing SZero
-      toSing (Succ (b :: Demote Nat))
-        = case toSing b :: SomeSing Nat of {
-            SomeSing c -> SomeSing (SSucc c) }
-    instance SingI Zero where
-      sing = SZero
-    instance SingI n => SingI (Succ (n :: Nat)) where
-      sing = SSucc sing
-    instance SingI (SuccSym0 :: (~>) Nat Nat) where
-      sing = (singFun1 @SuccSym0) SSucc
-InsertionSort/InsertionSortImp.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| leq :: Nat -> Nat -> Bool
-          leq Zero _ = True
-          leq (Succ _) Zero = False
-          leq (Succ a) (Succ b) = leq a b
-          insert :: Nat -> [Nat] -> [Nat]
-          insert n [] = [n]
-          insert n (h : t)
-            = if leq n h then (n : h : t) else h : (insert n t)
-          insertionSort :: [Nat] -> [Nat]
-          insertionSort [] = []
-          insertionSort (h : t) = insert h (insertionSort t) |]
-  ======>
-    leq :: Nat -> Nat -> Bool
-    leq Zero _ = True
-    leq (Succ _) Zero = False
-    leq (Succ a) (Succ b) = (leq a) b
-    insert :: Nat -> [Nat] -> [Nat]
-    insert n [] = [n]
-    insert n (h : t)
-      = if (leq n) h then (n : (h : t)) else (h : (insert n) t)
-    insertionSort :: [Nat] -> [Nat]
-    insertionSort [] = []
-    insertionSort (h : t) = (insert h) (insertionSort t)
-    type Let0123456789876543210Scrutinee_0123456789876543210Sym3 n0123456789876543210 h0123456789876543210 t0123456789876543210 =
-        Let0123456789876543210Scrutinee_0123456789876543210 n0123456789876543210 h0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210Scrutinee_0123456789876543210Sym2 h0123456789876543210 n0123456789876543210) where
-      suppressUnusedWarnings
-        = snd
-            (((,)
-                Let0123456789876543210Scrutinee_0123456789876543210Sym2KindInference)
-               ())
-    data Let0123456789876543210Scrutinee_0123456789876543210Sym2 n0123456789876543210 h0123456789876543210 t0123456789876543210
-      where
-        Let0123456789876543210Scrutinee_0123456789876543210Sym2KindInference :: forall n0123456789876543210
-                                                                                       h0123456789876543210
-                                                                                       t0123456789876543210
-                                                                                       arg. SameKind (Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym2 n0123456789876543210 h0123456789876543210) arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym3 n0123456789876543210 h0123456789876543210 arg) =>
-                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym2 n0123456789876543210 h0123456789876543210 t0123456789876543210
-    type instance Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym2 h0123456789876543210 n0123456789876543210) t0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210 h0123456789876543210 n0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210Scrutinee_0123456789876543210Sym1 n0123456789876543210) where
-      suppressUnusedWarnings
-        = snd
-            (((,)
-                Let0123456789876543210Scrutinee_0123456789876543210Sym1KindInference)
-               ())
-    data Let0123456789876543210Scrutinee_0123456789876543210Sym1 n0123456789876543210 h0123456789876543210
-      where
-        Let0123456789876543210Scrutinee_0123456789876543210Sym1KindInference :: forall n0123456789876543210
-                                                                                       h0123456789876543210
-                                                                                       arg. SameKind (Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym1 n0123456789876543210) arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym2 n0123456789876543210 arg) =>
-                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym1 n0123456789876543210 h0123456789876543210
-    type instance Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym1 n0123456789876543210) h0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym2 n0123456789876543210 h0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210Scrutinee_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd
-            (((,)
-                Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference)
-               ())
-    data Let0123456789876543210Scrutinee_0123456789876543210Sym0 n0123456789876543210
-      where
-        Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference :: forall n0123456789876543210
-                                                                                       arg. SameKind (Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym1 arg) =>
-                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym0 n0123456789876543210
-    type instance Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 n0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym1 n0123456789876543210
-    type family Let0123456789876543210Scrutinee_0123456789876543210 n h t where
-      Let0123456789876543210Scrutinee_0123456789876543210 n h t = Apply (Apply LeqSym0 n) h
-    type family Case_0123456789876543210 n h t t where
-      Case_0123456789876543210 n h t 'True = Apply (Apply (:@#@$) n) (Apply (Apply (:@#@$) h) t)
-      Case_0123456789876543210 n h t 'False = Apply (Apply (:@#@$) h) (Apply (Apply InsertSym0 n) t)
-    type InsertionSortSym1 (a0123456789876543210 :: [Nat]) =
-        InsertionSort a0123456789876543210
-    instance SuppressUnusedWarnings InsertionSortSym0 where
-      suppressUnusedWarnings
-        = snd (((,) InsertionSortSym0KindInference) ())
-    data InsertionSortSym0 :: (~>) [Nat] [Nat]
-      where
-        InsertionSortSym0KindInference :: forall a0123456789876543210
-                                                 arg. SameKind (Apply InsertionSortSym0 arg) (InsertionSortSym1 arg) =>
-                                          InsertionSortSym0 a0123456789876543210
-    type instance Apply InsertionSortSym0 a0123456789876543210 = InsertionSort a0123456789876543210
-    type InsertSym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: [Nat]) =
-        Insert a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (InsertSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) InsertSym1KindInference) ())
-    data InsertSym1 (a0123456789876543210 :: Nat) :: (~>) [Nat] [Nat]
-      where
-        InsertSym1KindInference :: forall a0123456789876543210
-                                          a0123456789876543210
-                                          arg. SameKind (Apply (InsertSym1 a0123456789876543210) arg) (InsertSym2 a0123456789876543210 arg) =>
-                                   InsertSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (InsertSym1 a0123456789876543210) a0123456789876543210 = Insert a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings InsertSym0 where
-      suppressUnusedWarnings = snd (((,) InsertSym0KindInference) ())
-    data InsertSym0 :: (~>) Nat ((~>) [Nat] [Nat])
-      where
-        InsertSym0KindInference :: forall a0123456789876543210
-                                          arg. SameKind (Apply InsertSym0 arg) (InsertSym1 arg) =>
-                                   InsertSym0 a0123456789876543210
-    type instance Apply InsertSym0 a0123456789876543210 = InsertSym1 a0123456789876543210
-    type LeqSym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
-        Leq a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (LeqSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) LeqSym1KindInference) ())
-    data LeqSym1 (a0123456789876543210 :: Nat) :: (~>) Nat Bool
-      where
-        LeqSym1KindInference :: forall a0123456789876543210
-                                       a0123456789876543210
-                                       arg. SameKind (Apply (LeqSym1 a0123456789876543210) arg) (LeqSym2 a0123456789876543210 arg) =>
-                                LeqSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (LeqSym1 a0123456789876543210) a0123456789876543210 = Leq a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings LeqSym0 where
-      suppressUnusedWarnings = snd (((,) LeqSym0KindInference) ())
-    data LeqSym0 :: (~>) Nat ((~>) Nat Bool)
-      where
-        LeqSym0KindInference :: forall a0123456789876543210
-                                       arg. SameKind (Apply LeqSym0 arg) (LeqSym1 arg) =>
-                                LeqSym0 a0123456789876543210
-    type instance Apply LeqSym0 a0123456789876543210 = LeqSym1 a0123456789876543210
-    type family InsertionSort (a :: [Nat]) :: [Nat] where
-      InsertionSort '[] = '[]
-      InsertionSort ('(:) h t) = Apply (Apply InsertSym0 h) (Apply InsertionSortSym0 t)
-    type family Insert (a :: Nat) (a :: [Nat]) :: [Nat] where
-      Insert n '[] = Apply (Apply (:@#@$) n) '[]
-      Insert n ('(:) h t) = Case_0123456789876543210 n h t (Let0123456789876543210Scrutinee_0123456789876543210Sym3 n h t)
-    type family Leq (a :: Nat) (a :: Nat) :: Bool where
-      Leq 'Zero _ = TrueSym0
-      Leq ('Succ _) 'Zero = FalseSym0
-      Leq ('Succ a) ('Succ b) = Apply (Apply LeqSym0 a) b
-    sInsertionSort ::
-      forall (t :: [Nat]).
-      Sing t -> Sing (Apply InsertionSortSym0 t :: [Nat])
-    sInsert ::
-      forall (t :: Nat) (t :: [Nat]).
-      Sing t -> Sing t -> Sing (Apply (Apply InsertSym0 t) t :: [Nat])
-    sLeq ::
-      forall (t :: Nat) (t :: Nat).
-      Sing t -> Sing t -> Sing (Apply (Apply LeqSym0 t) t :: Bool)
-    sInsertionSort SNil = SNil
-    sInsertionSort (SCons (sH :: Sing h) (sT :: Sing t))
-      = (applySing ((applySing ((singFun2 @InsertSym0) sInsert)) sH))
-          ((applySing ((singFun1 @InsertionSortSym0) sInsertionSort)) sT)
-    sInsert (sN :: Sing n) SNil
-      = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) sN)) SNil
-    sInsert (sN :: Sing n) (SCons (sH :: Sing h) (sT :: Sing t))
-      = let
-          sScrutinee_0123456789876543210 ::
-            Sing (Let0123456789876543210Scrutinee_0123456789876543210Sym3 n h t)
-          sScrutinee_0123456789876543210
-            = (applySing ((applySing ((singFun2 @LeqSym0) sLeq)) sN)) sH
-        in
-          (id
-             @(Sing (Case_0123456789876543210 n h t (Let0123456789876543210Scrutinee_0123456789876543210Sym3 n h t) :: [Nat])))
-            (case sScrutinee_0123456789876543210 of
-               STrue
-                 -> (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) sN))
-                      ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) sH)) sT)
-               SFalse
-                 -> (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) sH))
-                      ((applySing ((applySing ((singFun2 @InsertSym0) sInsert)) sN)) sT))
-    sLeq SZero _ = STrue
-    sLeq (SSucc _) SZero = SFalse
-    sLeq (SSucc (sA :: Sing a)) (SSucc (sB :: Sing b))
-      = (applySing ((applySing ((singFun2 @LeqSym0) sLeq)) sA)) sB
-    instance SingI (InsertionSortSym0 :: (~>) [Nat] [Nat]) where
-      sing = (singFun1 @InsertionSortSym0) sInsertionSort
-    instance SingI (InsertSym0 :: (~>) Nat ((~>) [Nat] [Nat])) where
-      sing = (singFun2 @InsertSym0) sInsert
-    instance SingI d =>
-             SingI (InsertSym1 (d :: Nat) :: (~>) [Nat] [Nat]) where
-      sing = (singFun1 @(InsertSym1 (d :: Nat))) (sInsert (sing @d))
-    instance SingI (LeqSym0 :: (~>) Nat ((~>) Nat Bool)) where
-      sing = (singFun2 @LeqSym0) sLeq
-    instance SingI d =>
-             SingI (LeqSym1 (d :: Nat) :: (~>) Nat Bool) where
-      sing = (singFun1 @(LeqSym1 (d :: Nat))) (sLeq (sing @d))
diff --git a/tests/compile-and-dump/InsertionSort/InsertionSortImp.golden b/tests/compile-and-dump/InsertionSort/InsertionSortImp.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/InsertionSort/InsertionSortImp.golden
@@ -0,0 +1,206 @@
+InsertionSort/InsertionSortImp.hs:(0,0)-(0,0): Splicing declarations
+    singletons [d| data Nat = Zero | Succ Nat |]
+  ======>
+    data Nat = Zero | Succ Nat
+    type ZeroSym0 = Zero :: Nat
+    type SuccSym0 :: (~>) Nat Nat
+    data SuccSym0 a0123456789876543210
+      where
+        SuccSym0KindInference :: SameKind (Apply SuccSym0 arg) (SuccSym1 arg) =>
+                                 SuccSym0 a0123456789876543210
+    type instance Apply SuccSym0 a0123456789876543210 = SuccSym1 a0123456789876543210
+    instance SuppressUnusedWarnings SuccSym0 where
+      suppressUnusedWarnings = snd (((,) SuccSym0KindInference) ())
+    type SuccSym1 (a0123456789876543210 :: Nat) =
+        Succ a0123456789876543210 :: Nat
+    data SNat :: Nat -> Type
+      where
+        SZero :: SNat (Zero :: Nat)
+        SSucc :: forall (n :: Nat). (Sing n) -> SNat (Succ n :: Nat)
+    type instance Sing @Nat = SNat
+    instance SingKind Nat where
+      type Demote Nat = Nat
+      fromSing SZero = Zero
+      fromSing (SSucc b) = Succ (fromSing b)
+      toSing Zero = SomeSing SZero
+      toSing (Succ (b :: Demote Nat))
+        = case toSing b :: SomeSing Nat of {
+            SomeSing c -> SomeSing (SSucc c) }
+    instance SingI Zero where
+      sing = SZero
+    instance SingI n => SingI (Succ (n :: Nat)) where
+      sing = SSucc sing
+    instance SingI (SuccSym0 :: (~>) Nat Nat) where
+      sing = (singFun1 @SuccSym0) SSucc
+InsertionSort/InsertionSortImp.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| leq :: Nat -> Nat -> Bool
+          leq Zero _ = True
+          leq (Succ _) Zero = False
+          leq (Succ a) (Succ b) = leq a b
+          insert :: Nat -> [Nat] -> [Nat]
+          insert n [] = [n]
+          insert n (h : t)
+            = if leq n h then (n : h : t) else h : (insert n t)
+          insertionSort :: [Nat] -> [Nat]
+          insertionSort [] = []
+          insertionSort (h : t) = insert h (insertionSort t) |]
+  ======>
+    leq :: Nat -> Nat -> Bool
+    leq Zero _ = True
+    leq (Succ _) Zero = False
+    leq (Succ a) (Succ b) = (leq a) b
+    insert :: Nat -> [Nat] -> [Nat]
+    insert n [] = [n]
+    insert n (h : t)
+      = if (leq n) h then (n : (h : t)) else (h : (insert n) t)
+    insertionSort :: [Nat] -> [Nat]
+    insertionSort [] = []
+    insertionSort (h : t) = (insert h) (insertionSort t)
+    data Let0123456789876543210Scrutinee_0123456789876543210Sym0 n0123456789876543210
+      where
+        Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference :: SameKind (Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym1 arg) =>
+                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym0 n0123456789876543210
+    type instance Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 n0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym1 n0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210Scrutinee_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd
+            (((,)
+                Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference)
+               ())
+    data Let0123456789876543210Scrutinee_0123456789876543210Sym1 n0123456789876543210 h0123456789876543210
+      where
+        Let0123456789876543210Scrutinee_0123456789876543210Sym1KindInference :: SameKind (Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym1 n0123456789876543210) arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym2 n0123456789876543210 arg) =>
+                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym1 n0123456789876543210 h0123456789876543210
+    type instance Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym1 n0123456789876543210) h0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym2 n0123456789876543210 h0123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210Scrutinee_0123456789876543210Sym1 n0123456789876543210) where
+      suppressUnusedWarnings
+        = snd
+            (((,)
+                Let0123456789876543210Scrutinee_0123456789876543210Sym1KindInference)
+               ())
+    data Let0123456789876543210Scrutinee_0123456789876543210Sym2 n0123456789876543210 h0123456789876543210 t0123456789876543210
+      where
+        Let0123456789876543210Scrutinee_0123456789876543210Sym2KindInference :: SameKind (Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym2 n0123456789876543210 h0123456789876543210) arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym3 n0123456789876543210 h0123456789876543210 arg) =>
+                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym2 n0123456789876543210 h0123456789876543210 t0123456789876543210
+    type instance Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym2 n0123456789876543210 h0123456789876543210) t0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym3 n0123456789876543210 h0123456789876543210 t0123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210Scrutinee_0123456789876543210Sym2 n0123456789876543210 h0123456789876543210) where
+      suppressUnusedWarnings
+        = snd
+            (((,)
+                Let0123456789876543210Scrutinee_0123456789876543210Sym2KindInference)
+               ())
+    type Let0123456789876543210Scrutinee_0123456789876543210Sym3 n0123456789876543210 h0123456789876543210 t0123456789876543210 =
+        Let0123456789876543210Scrutinee_0123456789876543210 n0123456789876543210 h0123456789876543210 t0123456789876543210
+    type family Let0123456789876543210Scrutinee_0123456789876543210 n h t where
+      Let0123456789876543210Scrutinee_0123456789876543210 n h t = Apply (Apply LeqSym0 n) h
+    type family Case_0123456789876543210 n h t t where
+      Case_0123456789876543210 n h t 'True = Apply (Apply (:@#@$) n) (Apply (Apply (:@#@$) h) t)
+      Case_0123456789876543210 n h t 'False = Apply (Apply (:@#@$) h) (Apply (Apply InsertSym0 n) t)
+    type InsertionSortSym0 :: (~>) [Nat] [Nat]
+    data InsertionSortSym0 a0123456789876543210
+      where
+        InsertionSortSym0KindInference :: SameKind (Apply InsertionSortSym0 arg) (InsertionSortSym1 arg) =>
+                                          InsertionSortSym0 a0123456789876543210
+    type instance Apply InsertionSortSym0 a0123456789876543210 = InsertionSortSym1 a0123456789876543210
+    instance SuppressUnusedWarnings InsertionSortSym0 where
+      suppressUnusedWarnings
+        = snd (((,) InsertionSortSym0KindInference) ())
+    type InsertionSortSym1 (a0123456789876543210 :: [Nat]) =
+        InsertionSort a0123456789876543210 :: [Nat]
+    type InsertSym0 :: (~>) Nat ((~>) [Nat] [Nat])
+    data InsertSym0 a0123456789876543210
+      where
+        InsertSym0KindInference :: SameKind (Apply InsertSym0 arg) (InsertSym1 arg) =>
+                                   InsertSym0 a0123456789876543210
+    type instance Apply InsertSym0 a0123456789876543210 = InsertSym1 a0123456789876543210
+    instance SuppressUnusedWarnings InsertSym0 where
+      suppressUnusedWarnings = snd (((,) InsertSym0KindInference) ())
+    type InsertSym1 :: Nat -> (~>) [Nat] [Nat]
+    data InsertSym1 a0123456789876543210 a0123456789876543210
+      where
+        InsertSym1KindInference :: SameKind (Apply (InsertSym1 a0123456789876543210) arg) (InsertSym2 a0123456789876543210 arg) =>
+                                   InsertSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (InsertSym1 a0123456789876543210) a0123456789876543210 = InsertSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (InsertSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) InsertSym1KindInference) ())
+    type InsertSym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: [Nat]) =
+        Insert a0123456789876543210 a0123456789876543210 :: [Nat]
+    type LeqSym0 :: (~>) Nat ((~>) Nat Bool)
+    data LeqSym0 a0123456789876543210
+      where
+        LeqSym0KindInference :: SameKind (Apply LeqSym0 arg) (LeqSym1 arg) =>
+                                LeqSym0 a0123456789876543210
+    type instance Apply LeqSym0 a0123456789876543210 = LeqSym1 a0123456789876543210
+    instance SuppressUnusedWarnings LeqSym0 where
+      suppressUnusedWarnings = snd (((,) LeqSym0KindInference) ())
+    type LeqSym1 :: Nat -> (~>) Nat Bool
+    data LeqSym1 a0123456789876543210 a0123456789876543210
+      where
+        LeqSym1KindInference :: SameKind (Apply (LeqSym1 a0123456789876543210) arg) (LeqSym2 a0123456789876543210 arg) =>
+                                LeqSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (LeqSym1 a0123456789876543210) a0123456789876543210 = LeqSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (LeqSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) LeqSym1KindInference) ())
+    type LeqSym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
+        Leq a0123456789876543210 a0123456789876543210 :: Bool
+    type InsertionSort :: [Nat] -> [Nat]
+    type family InsertionSort a where
+      InsertionSort '[] = NilSym0
+      InsertionSort ('(:) h t) = Apply (Apply InsertSym0 h) (Apply InsertionSortSym0 t)
+    type Insert :: Nat -> [Nat] -> [Nat]
+    type family Insert a a where
+      Insert n '[] = Apply (Apply (:@#@$) n) NilSym0
+      Insert n ('(:) h t) = Case_0123456789876543210 n h t (Let0123456789876543210Scrutinee_0123456789876543210Sym3 n h t)
+    type Leq :: Nat -> Nat -> Bool
+    type family Leq a a where
+      Leq 'Zero _ = TrueSym0
+      Leq ('Succ _) 'Zero = FalseSym0
+      Leq ('Succ a) ('Succ b) = Apply (Apply LeqSym0 a) b
+    sInsertionSort ::
+      forall (t :: [Nat]).
+      Sing t -> Sing (Apply InsertionSortSym0 t :: [Nat])
+    sInsert ::
+      forall (t :: Nat) (t :: [Nat]).
+      Sing t -> Sing t -> Sing (Apply (Apply InsertSym0 t) t :: [Nat])
+    sLeq ::
+      forall (t :: Nat) (t :: Nat).
+      Sing t -> Sing t -> Sing (Apply (Apply LeqSym0 t) t :: Bool)
+    sInsertionSort SNil = SNil
+    sInsertionSort (SCons (sH :: Sing h) (sT :: Sing t))
+      = (applySing ((applySing ((singFun2 @InsertSym0) sInsert)) sH))
+          ((applySing ((singFun1 @InsertionSortSym0) sInsertionSort)) sT)
+    sInsert (sN :: Sing n) SNil
+      = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) sN)) SNil
+    sInsert (sN :: Sing n) (SCons (sH :: Sing h) (sT :: Sing t))
+      = let
+          sScrutinee_0123456789876543210 ::
+            Sing @_ (Let0123456789876543210Scrutinee_0123456789876543210Sym3 n h t)
+          sScrutinee_0123456789876543210
+            = (applySing ((applySing ((singFun2 @LeqSym0) sLeq)) sN)) sH
+        in
+          (id
+             @(Sing (Case_0123456789876543210 n h t (Let0123456789876543210Scrutinee_0123456789876543210Sym3 n h t) :: [Nat])))
+            (case sScrutinee_0123456789876543210 of
+               STrue
+                 -> (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) sN))
+                      ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) sH)) sT)
+               SFalse
+                 -> (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) sH))
+                      ((applySing ((applySing ((singFun2 @InsertSym0) sInsert)) sN)) sT))
+    sLeq SZero _ = STrue
+    sLeq (SSucc _) SZero = SFalse
+    sLeq (SSucc (sA :: Sing a)) (SSucc (sB :: Sing b))
+      = (applySing ((applySing ((singFun2 @LeqSym0) sLeq)) sA)) sB
+    instance SingI (InsertionSortSym0 :: (~>) [Nat] [Nat]) where
+      sing = (singFun1 @InsertionSortSym0) sInsertionSort
+    instance SingI (InsertSym0 :: (~>) Nat ((~>) [Nat] [Nat])) where
+      sing = (singFun2 @InsertSym0) sInsert
+    instance SingI d =>
+             SingI (InsertSym1 (d :: Nat) :: (~>) [Nat] [Nat]) where
+      sing = (singFun1 @(InsertSym1 (d :: Nat))) (sInsert (sing @d))
+    instance SingI (LeqSym0 :: (~>) Nat ((~>) Nat Bool)) where
+      sing = (singFun2 @LeqSym0) sLeq
+    instance SingI d =>
+             SingI (LeqSym1 (d :: Nat) :: (~>) Nat Bool) where
+      sing = (singFun1 @(LeqSym1 (d :: Nat))) (sLeq (sing @d))
diff --git a/tests/compile-and-dump/Promote/Constructors.ghc88.template b/tests/compile-and-dump/Promote/Constructors.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Promote/Constructors.ghc88.template
+++ /dev/null
@@ -1,79 +0,0 @@
-Promote/Constructors.hs:(0,0)-(0,0): Splicing declarations
-    promote
-      [d| data Foo = Foo | Foo :+ Foo
-          data Bar = Bar Bar Bar Bar Bar Foo |]
-  ======>
-    data Foo = Foo | Foo :+ Foo
-    data Bar = Bar Bar Bar Bar Bar Foo
-    type FooSym0 = Foo
-    type (:+@#@$$$) (t0123456789876543210 :: Foo) (t0123456789876543210 :: Foo) =
-        (:+) t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings ((:+@#@$$) t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (::+@#@$$###)) ())
-    data (:+@#@$$) (t0123456789876543210 :: Foo) :: (~>) Foo Foo
-      where
-        (::+@#@$$###) :: forall t0123456789876543210
-                                t0123456789876543210
-                                arg. SameKind (Apply ((:+@#@$$) t0123456789876543210) arg) ((:+@#@$$$) t0123456789876543210 arg) =>
-                         (:+@#@$$) t0123456789876543210 t0123456789876543210
-    type instance Apply ((:+@#@$$) t0123456789876543210) t0123456789876543210 = (:+) t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (:+@#@$) where
-      suppressUnusedWarnings = snd (((,) (::+@#@$###)) ())
-    data (:+@#@$) :: (~>) Foo ((~>) Foo Foo)
-      where
-        (::+@#@$###) :: forall t0123456789876543210
-                               arg. SameKind (Apply (:+@#@$) arg) ((:+@#@$$) arg) =>
-                        (:+@#@$) t0123456789876543210
-    type instance Apply (:+@#@$) t0123456789876543210 = (:+@#@$$) t0123456789876543210
-    type BarSym5 (t0123456789876543210 :: Bar) (t0123456789876543210 :: Bar) (t0123456789876543210 :: Bar) (t0123456789876543210 :: Bar) (t0123456789876543210 :: Foo) =
-        Bar t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (BarSym4 t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) BarSym4KindInference) ())
-    data BarSym4 (t0123456789876543210 :: Bar) (t0123456789876543210 :: Bar) (t0123456789876543210 :: Bar) (t0123456789876543210 :: Bar) :: (~>) Foo Bar
-      where
-        BarSym4KindInference :: forall t0123456789876543210
-                                       t0123456789876543210
-                                       t0123456789876543210
-                                       t0123456789876543210
-                                       t0123456789876543210
-                                       arg. SameKind (Apply (BarSym4 t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210) arg) (BarSym5 t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210 arg) =>
-                                BarSym4 t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (BarSym4 t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210) t0123456789876543210 = Bar t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (BarSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) BarSym3KindInference) ())
-    data BarSym3 (t0123456789876543210 :: Bar) (t0123456789876543210 :: Bar) (t0123456789876543210 :: Bar) :: (~>) Bar ((~>) Foo Bar)
-      where
-        BarSym3KindInference :: forall t0123456789876543210
-                                       t0123456789876543210
-                                       t0123456789876543210
-                                       t0123456789876543210
-                                       arg. SameKind (Apply (BarSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) arg) (BarSym4 t0123456789876543210 t0123456789876543210 t0123456789876543210 arg) =>
-                                BarSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (BarSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) t0123456789876543210 = BarSym4 t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (BarSym2 t0123456789876543210 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) BarSym2KindInference) ())
-    data BarSym2 (t0123456789876543210 :: Bar) (t0123456789876543210 :: Bar) :: (~>) Bar ((~>) Bar ((~>) Foo Bar))
-      where
-        BarSym2KindInference :: forall t0123456789876543210
-                                       t0123456789876543210
-                                       t0123456789876543210
-                                       arg. SameKind (Apply (BarSym2 t0123456789876543210 t0123456789876543210) arg) (BarSym3 t0123456789876543210 t0123456789876543210 arg) =>
-                                BarSym2 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (BarSym2 t0123456789876543210 t0123456789876543210) t0123456789876543210 = BarSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (BarSym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) BarSym1KindInference) ())
-    data BarSym1 (t0123456789876543210 :: Bar) :: (~>) Bar ((~>) Bar ((~>) Bar ((~>) Foo Bar)))
-      where
-        BarSym1KindInference :: forall t0123456789876543210
-                                       t0123456789876543210
-                                       arg. SameKind (Apply (BarSym1 t0123456789876543210) arg) (BarSym2 t0123456789876543210 arg) =>
-                                BarSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (BarSym1 t0123456789876543210) t0123456789876543210 = BarSym2 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings BarSym0 where
-      suppressUnusedWarnings = snd (((,) BarSym0KindInference) ())
-    data BarSym0 :: (~>) Bar ((~>) Bar ((~>) Bar ((~>) Bar ((~>) Foo Bar))))
-      where
-        BarSym0KindInference :: forall t0123456789876543210
-                                       arg. SameKind (Apply BarSym0 arg) (BarSym1 arg) =>
-                                BarSym0 t0123456789876543210
-    type instance Apply BarSym0 t0123456789876543210 = BarSym1 t0123456789876543210
diff --git a/tests/compile-and-dump/Promote/Constructors.golden b/tests/compile-and-dump/Promote/Constructors.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Promote/Constructors.golden
@@ -0,0 +1,69 @@
+Promote/Constructors.hs:(0,0)-(0,0): Splicing declarations
+    promote
+      [d| data Foo = Foo | Foo :+ Foo
+          data Bar = Bar Bar Bar Bar Bar Foo |]
+  ======>
+    data Foo = Foo | Foo :+ Foo
+    data Bar = Bar Bar Bar Bar Bar Foo
+    type FooSym0 = Foo :: Foo
+    type (:+@#@$) :: (~>) Foo ((~>) Foo Foo)
+    data (:+@#@$) a0123456789876543210
+      where
+        (::+@#@$###) :: SameKind (Apply (:+@#@$) arg) ((:+@#@$$) arg) =>
+                        (:+@#@$) a0123456789876543210
+    type instance Apply (:+@#@$) a0123456789876543210 = (:+@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (:+@#@$) where
+      suppressUnusedWarnings = snd (((,) (::+@#@$###)) ())
+    type (:+@#@$$) :: Foo -> (~>) Foo Foo
+    data (:+@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (::+@#@$$###) :: SameKind (Apply ((:+@#@$$) a0123456789876543210) arg) ((:+@#@$$$) a0123456789876543210 arg) =>
+                         (:+@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((:+@#@$$) a0123456789876543210) a0123456789876543210 = (:+@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((:+@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (::+@#@$$###)) ())
+    type (:+@#@$$$) (a0123456789876543210 :: Foo) (a0123456789876543210 :: Foo) =
+        (:+) a0123456789876543210 a0123456789876543210 :: Foo
+    type BarSym0 :: (~>) Bar ((~>) Bar ((~>) Bar ((~>) Bar ((~>) Foo Bar))))
+    data BarSym0 a0123456789876543210
+      where
+        BarSym0KindInference :: SameKind (Apply BarSym0 arg) (BarSym1 arg) =>
+                                BarSym0 a0123456789876543210
+    type instance Apply BarSym0 a0123456789876543210 = BarSym1 a0123456789876543210
+    instance SuppressUnusedWarnings BarSym0 where
+      suppressUnusedWarnings = snd (((,) BarSym0KindInference) ())
+    type BarSym1 :: Bar
+                    -> (~>) Bar ((~>) Bar ((~>) Bar ((~>) Foo Bar)))
+    data BarSym1 a0123456789876543210 a0123456789876543210
+      where
+        BarSym1KindInference :: SameKind (Apply (BarSym1 a0123456789876543210) arg) (BarSym2 a0123456789876543210 arg) =>
+                                BarSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (BarSym1 a0123456789876543210) a0123456789876543210 = BarSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (BarSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) BarSym1KindInference) ())
+    type BarSym2 :: Bar -> Bar -> (~>) Bar ((~>) Bar ((~>) Foo Bar))
+    data BarSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        BarSym2KindInference :: SameKind (Apply (BarSym2 a0123456789876543210 a0123456789876543210) arg) (BarSym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                BarSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (BarSym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = BarSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (BarSym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) BarSym2KindInference) ())
+    type BarSym3 :: Bar -> Bar -> Bar -> (~>) Bar ((~>) Foo Bar)
+    data BarSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        BarSym3KindInference :: SameKind (Apply (BarSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) arg) (BarSym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 arg) =>
+                                BarSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (BarSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) a0123456789876543210 = BarSym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (BarSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) BarSym3KindInference) ())
+    type BarSym4 :: Bar -> Bar -> Bar -> Bar -> (~>) Foo Bar
+    data BarSym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        BarSym4KindInference :: SameKind (Apply (BarSym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210) arg) (BarSym5 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 arg) =>
+                                BarSym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (BarSym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210) a0123456789876543210 = BarSym5 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (BarSym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) BarSym4KindInference) ())
+    type BarSym5 (a0123456789876543210 :: Bar) (a0123456789876543210 :: Bar) (a0123456789876543210 :: Bar) (a0123456789876543210 :: Bar) (a0123456789876543210 :: Foo) =
+        Bar a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Bar
diff --git a/tests/compile-and-dump/Promote/GenDefunSymbols.ghc88.template b/tests/compile-and-dump/Promote/GenDefunSymbols.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Promote/GenDefunSymbols.ghc88.template
+++ /dev/null
@@ -1,54 +0,0 @@
-Promote/GenDefunSymbols.hs:0:0:: Splicing declarations
-    genDefunSymbols [''LiftMaybe, ''NatT, ''(:+)]
-  ======>
-    type LiftMaybeSym2 (f0123456789876543210 :: (~>) a0123456789876543210 b0123456789876543210) (x0123456789876543210 :: Maybe a0123456789876543210) =
-        LiftMaybe f0123456789876543210 x0123456789876543210
-    instance SuppressUnusedWarnings (LiftMaybeSym1 f0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) LiftMaybeSym1KindInference) ())
-    data LiftMaybeSym1 (f0123456789876543210 :: (~>) a0123456789876543210 b0123456789876543210) :: (~>) (Maybe a0123456789876543210) (Maybe b0123456789876543210)
-      where
-        LiftMaybeSym1KindInference :: forall f0123456789876543210
-                                             x0123456789876543210
-                                             arg. Data.Singletons.Internal.SameKind (Apply (LiftMaybeSym1 f0123456789876543210) arg) (LiftMaybeSym2 f0123456789876543210 arg) =>
-                                      LiftMaybeSym1 f0123456789876543210 x0123456789876543210
-    type instance Apply (LiftMaybeSym1 f0123456789876543210) x0123456789876543210 = LiftMaybe f0123456789876543210 x0123456789876543210
-    instance SuppressUnusedWarnings LiftMaybeSym0 where
-      suppressUnusedWarnings = snd (((,) LiftMaybeSym0KindInference) ())
-    data LiftMaybeSym0 :: forall a0123456789876543210
-                                 b0123456789876543210.
-                          (~>) ((~>) a0123456789876543210 b0123456789876543210) ((~>) (Maybe a0123456789876543210) (Maybe b0123456789876543210))
-      where
-        LiftMaybeSym0KindInference :: forall f0123456789876543210
-                                             arg. Data.Singletons.Internal.SameKind (Apply LiftMaybeSym0 arg) (LiftMaybeSym1 arg) =>
-                                      LiftMaybeSym0 f0123456789876543210
-    type instance Apply LiftMaybeSym0 f0123456789876543210 = LiftMaybeSym1 f0123456789876543210
-    type ZeroSym0 = 'Zero
-    type SuccSym1 (t0123456789876543210 :: NatT) =
-        'Succ t0123456789876543210
-    instance SuppressUnusedWarnings SuccSym0 where
-      suppressUnusedWarnings = snd (((,) SuccSym0KindInference) ())
-    data SuccSym0 :: (~>) NatT NatT
-      where
-        SuccSym0KindInference :: forall t0123456789876543210
-                                        arg. Data.Singletons.Internal.SameKind (Apply SuccSym0 arg) (SuccSym1 arg) =>
-                                 SuccSym0 t0123456789876543210
-    type instance Apply SuccSym0 t0123456789876543210 = 'Succ t0123456789876543210
-    type (:+@#@$$$) (a0123456789876543210 :: Nat) (b0123456789876543210 :: Nat) =
-        (:+) a0123456789876543210 b0123456789876543210
-    instance SuppressUnusedWarnings ((:+@#@$$) a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (::+@#@$$###)) ())
-    data (:+@#@$$) (a0123456789876543210 :: Nat) b0123456789876543210
-      where
-        (::+@#@$$###) :: forall a0123456789876543210
-                                b0123456789876543210
-                                arg. Data.Singletons.Internal.SameKind (Apply ((:+@#@$$) a0123456789876543210) arg) ((:+@#@$$$) a0123456789876543210 arg) =>
-                         (:+@#@$$) a0123456789876543210 b0123456789876543210
-    type instance Apply ((:+@#@$$) a0123456789876543210) b0123456789876543210 = (:+) a0123456789876543210 b0123456789876543210
-    instance SuppressUnusedWarnings (:+@#@$) where
-      suppressUnusedWarnings = snd (((,) (::+@#@$###)) ())
-    data (:+@#@$) a0123456789876543210
-      where
-        (::+@#@$###) :: forall a0123456789876543210
-                               arg. Data.Singletons.Internal.SameKind (Apply (:+@#@$) arg) ((:+@#@$$) arg) =>
-                        (:+@#@$) a0123456789876543210
-    type instance Apply (:+@#@$) a0123456789876543210 = (:+@#@$$) a0123456789876543210
diff --git a/tests/compile-and-dump/Promote/GenDefunSymbols.golden b/tests/compile-and-dump/Promote/GenDefunSymbols.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Promote/GenDefunSymbols.golden
@@ -0,0 +1,52 @@
+Promote/GenDefunSymbols.hs:0:0:: Splicing declarations
+    genDefunSymbols [''LiftMaybe, ''NatT, ''(:+)]
+  ======>
+    type LiftMaybeSym0 :: forall (a :: Type) (b :: Type).
+                          (~>) ((~>) a b) ((~>) (Maybe a) (Maybe b))
+    data LiftMaybeSym0 a0123456789876543210
+      where
+        LiftMaybeSym0KindInference :: Data.Singletons.Internal.SameKind (Apply LiftMaybeSym0 arg) (LiftMaybeSym1 arg) =>
+                                      LiftMaybeSym0 a0123456789876543210
+    type instance Apply LiftMaybeSym0 a0123456789876543210 = LiftMaybeSym1 a0123456789876543210
+    instance SuppressUnusedWarnings LiftMaybeSym0 where
+      suppressUnusedWarnings = snd (((,) LiftMaybeSym0KindInference) ())
+    type LiftMaybeSym1 :: forall (a :: Type) (b :: Type).
+                          (~>) a b -> (~>) (Maybe a) (Maybe b)
+    data LiftMaybeSym1 a0123456789876543210 a0123456789876543210
+      where
+        LiftMaybeSym1KindInference :: Data.Singletons.Internal.SameKind (Apply (LiftMaybeSym1 a0123456789876543210) arg) (LiftMaybeSym2 a0123456789876543210 arg) =>
+                                      LiftMaybeSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (LiftMaybeSym1 a0123456789876543210) a0123456789876543210 = LiftMaybeSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (LiftMaybeSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) LiftMaybeSym1KindInference) ())
+    type LiftMaybeSym2 (a0123456789876543210 :: (~>) a b) (a0123456789876543210 :: Maybe a) =
+        LiftMaybe a0123456789876543210 a0123456789876543210 :: Maybe b
+    type ZeroSym0 = 'Zero :: NatT
+    type SuccSym0 :: (~>) NatT NatT
+    data SuccSym0 a0123456789876543210
+      where
+        SuccSym0KindInference :: Data.Singletons.Internal.SameKind (Apply SuccSym0 arg) (SuccSym1 arg) =>
+                                 SuccSym0 a0123456789876543210
+    type instance Apply SuccSym0 a0123456789876543210 = SuccSym1 a0123456789876543210
+    instance SuppressUnusedWarnings SuccSym0 where
+      suppressUnusedWarnings = snd (((,) SuccSym0KindInference) ())
+    type SuccSym1 (a0123456789876543210 :: NatT) =
+        'Succ a0123456789876543210 :: NatT
+    type (:+@#@$) :: (~>) Nat ((~>) Nat Nat)
+    data (:+@#@$) a0123456789876543210
+      where
+        (::+@#@$###) :: Data.Singletons.Internal.SameKind (Apply (:+@#@$) arg) ((:+@#@$$) arg) =>
+                        (:+@#@$) a0123456789876543210
+    type instance Apply (:+@#@$) a0123456789876543210 = (:+@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (:+@#@$) where
+      suppressUnusedWarnings = snd (((,) (::+@#@$###)) ())
+    type (:+@#@$$) :: Nat -> (~>) Nat Nat
+    data (:+@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (::+@#@$$###) :: Data.Singletons.Internal.SameKind (Apply ((:+@#@$$) a0123456789876543210) arg) ((:+@#@$$$) a0123456789876543210 arg) =>
+                         (:+@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((:+@#@$$) a0123456789876543210) a0123456789876543210 = (:+@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((:+@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (::+@#@$$###)) ())
+    type (:+@#@$$$) (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
+        (:+) a0123456789876543210 a0123456789876543210 :: Nat
diff --git a/tests/compile-and-dump/Promote/Newtypes.ghc88.template b/tests/compile-and-dump/Promote/Newtypes.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Promote/Newtypes.ghc88.template
+++ /dev/null
@@ -1,48 +0,0 @@
-Promote/Newtypes.hs:(0,0)-(0,0): Splicing declarations
-    promote
-      [d| newtype Foo
-            = Foo Nat
-            deriving Eq
-          newtype Bar = Bar {unBar :: Nat} |]
-  ======>
-    newtype Foo
-      = Foo Nat
-      deriving Eq
-    newtype Bar = Bar {unBar :: Nat}
-    type family Equals_0123456789876543210 (a :: Foo) (b :: Foo) :: Bool where
-      Equals_0123456789876543210 (Foo a) (Foo b) = (==) a b
-      Equals_0123456789876543210 (_ :: Foo) (_ :: Foo) = FalseSym0
-    instance PEq Foo where
-      type (==) a b = Equals_0123456789876543210 a b
-    type UnBarSym1 (a0123456789876543210 :: Bar) =
-        UnBar a0123456789876543210
-    instance SuppressUnusedWarnings UnBarSym0 where
-      suppressUnusedWarnings = snd (((,) UnBarSym0KindInference) ())
-    data UnBarSym0 :: (~>) Bar Nat
-      where
-        UnBarSym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply UnBarSym0 arg) (UnBarSym1 arg) =>
-                                  UnBarSym0 a0123456789876543210
-    type instance Apply UnBarSym0 a0123456789876543210 = UnBar a0123456789876543210
-    type family UnBar (a :: Bar) :: Nat where
-      UnBar (Bar field) = field
-    type FooSym1 (t0123456789876543210 :: Nat) =
-        Foo t0123456789876543210
-    instance SuppressUnusedWarnings FooSym0 where
-      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
-    data FooSym0 :: (~>) Nat Foo
-      where
-        FooSym0KindInference :: forall t0123456789876543210
-                                       arg. SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
-                                FooSym0 t0123456789876543210
-    type instance Apply FooSym0 t0123456789876543210 = Foo t0123456789876543210
-    type BarSym1 (t0123456789876543210 :: Nat) =
-        Bar t0123456789876543210
-    instance SuppressUnusedWarnings BarSym0 where
-      suppressUnusedWarnings = snd (((,) BarSym0KindInference) ())
-    data BarSym0 :: (~>) Nat Bar
-      where
-        BarSym0KindInference :: forall t0123456789876543210
-                                       arg. SameKind (Apply BarSym0 arg) (BarSym1 arg) =>
-                                BarSym0 t0123456789876543210
-    type instance Apply BarSym0 t0123456789876543210 = Bar t0123456789876543210
diff --git a/tests/compile-and-dump/Promote/Newtypes.golden b/tests/compile-and-dump/Promote/Newtypes.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Promote/Newtypes.golden
@@ -0,0 +1,50 @@
+Promote/Newtypes.hs:(0,0)-(0,0): Splicing declarations
+    promote
+      [d| newtype Foo
+            = Foo Nat
+            deriving Eq
+          newtype Bar = Bar {unBar :: Nat} |]
+  ======>
+    newtype Foo
+      = Foo Nat
+      deriving Eq
+    newtype Bar = Bar {unBar :: Nat}
+    type FooSym0 :: (~>) Nat Foo
+    data FooSym0 a0123456789876543210
+      where
+        FooSym0KindInference :: SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
+                                FooSym0 a0123456789876543210
+    type instance Apply FooSym0 a0123456789876543210 = FooSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FooSym0 where
+      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
+    type FooSym1 (a0123456789876543210 :: Nat) =
+        Foo a0123456789876543210 :: Foo
+    type BarSym0 :: (~>) Nat Bar
+    data BarSym0 a0123456789876543210
+      where
+        BarSym0KindInference :: SameKind (Apply BarSym0 arg) (BarSym1 arg) =>
+                                BarSym0 a0123456789876543210
+    type instance Apply BarSym0 a0123456789876543210 = BarSym1 a0123456789876543210
+    instance SuppressUnusedWarnings BarSym0 where
+      suppressUnusedWarnings = snd (((,) BarSym0KindInference) ())
+    type BarSym1 (a0123456789876543210 :: Nat) =
+        Bar a0123456789876543210 :: Bar
+    type UnBarSym0 :: (~>) Bar Nat
+    data UnBarSym0 a0123456789876543210
+      where
+        UnBarSym0KindInference :: SameKind (Apply UnBarSym0 arg) (UnBarSym1 arg) =>
+                                  UnBarSym0 a0123456789876543210
+    type instance Apply UnBarSym0 a0123456789876543210 = UnBarSym1 a0123456789876543210
+    instance SuppressUnusedWarnings UnBarSym0 where
+      suppressUnusedWarnings = snd (((,) UnBarSym0KindInference) ())
+    type UnBarSym1 (a0123456789876543210 :: Bar) =
+        UnBar a0123456789876543210 :: Nat
+    type UnBar :: Bar -> Nat
+    type family UnBar a where
+      UnBar (Bar field) = field
+    type Equals_0123456789876543210 :: Foo -> Foo -> Bool
+    type family Equals_0123456789876543210 a b where
+      Equals_0123456789876543210 (Foo a) (Foo b) = (==) a b
+      Equals_0123456789876543210 (_ :: Foo) (_ :: Foo) = FalseSym0
+    instance PEq Foo where
+      type (==) a b = Equals_0123456789876543210 a b
diff --git a/tests/compile-and-dump/Promote/Pragmas.ghc88.template b/tests/compile-and-dump/Promote/Pragmas.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Promote/Pragmas.ghc88.template
+++ /dev/null
@@ -1,12 +0,0 @@
-Promote/Pragmas.hs:(0,0)-(0,0): Splicing declarations
-    promote
-      [d| {-# INLINE foo #-}
-          foo :: Bool
-          foo = True |]
-  ======>
-    {-# INLINE foo #-}
-    foo :: Bool
-    foo = True
-    type FooSym0 = Foo
-    type family Foo :: Bool where
-      Foo = TrueSym0
diff --git a/tests/compile-and-dump/Promote/Pragmas.golden b/tests/compile-and-dump/Promote/Pragmas.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Promote/Pragmas.golden
@@ -0,0 +1,13 @@
+Promote/Pragmas.hs:(0,0)-(0,0): Splicing declarations
+    promote
+      [d| {-# INLINE foo #-}
+          foo :: Bool
+          foo = True |]
+  ======>
+    {-# INLINE foo #-}
+    foo :: Bool
+    foo = True
+    type FooSym0 = Foo :: Bool
+    type Foo :: Bool
+    type family Foo where
+      Foo = TrueSym0
diff --git a/tests/compile-and-dump/Promote/Prelude.ghc88.template b/tests/compile-and-dump/Promote/Prelude.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Promote/Prelude.ghc88.template
+++ /dev/null
@@ -1,19 +0,0 @@
-Promote/Prelude.hs:(0,0)-(0,0): Splicing declarations
-    promoteOnly
-      [d| odd :: Nat -> Bool
-          odd 0 = False
-          odd n = not . odd $ n - 1 |]
-  ======>
-    type OddSym1 (a0123456789876543210 :: Nat) =
-        Odd a0123456789876543210
-    instance SuppressUnusedWarnings OddSym0 where
-      suppressUnusedWarnings = snd (((,) OddSym0KindInference) ())
-    data OddSym0 :: (~>) Nat Bool
-      where
-        OddSym0KindInference :: forall a0123456789876543210
-                                       arg. SameKind (Apply OddSym0 arg) (OddSym1 arg) =>
-                                OddSym0 a0123456789876543210
-    type instance Apply OddSym0 a0123456789876543210 = Odd a0123456789876543210
-    type family Odd (a :: Nat) :: Bool where
-      Odd 0 = FalseSym0
-      Odd n = Apply (Apply ($@#@$) (Apply (Apply (.@#@$) NotSym0) OddSym0)) (Apply (Apply (-@#@$) n) (FromInteger 1))
diff --git a/tests/compile-and-dump/Promote/Prelude.golden b/tests/compile-and-dump/Promote/Prelude.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Promote/Prelude.golden
@@ -0,0 +1,20 @@
+Promote/Prelude.hs:(0,0)-(0,0): Splicing declarations
+    promoteOnly
+      [d| odd :: Nat -> Bool
+          odd 0 = False
+          odd n = not . odd $ n - 1 |]
+  ======>
+    type OddSym0 :: (~>) Nat Bool
+    data OddSym0 a0123456789876543210
+      where
+        OddSym0KindInference :: SameKind (Apply OddSym0 arg) (OddSym1 arg) =>
+                                OddSym0 a0123456789876543210
+    type instance Apply OddSym0 a0123456789876543210 = OddSym1 a0123456789876543210
+    instance SuppressUnusedWarnings OddSym0 where
+      suppressUnusedWarnings = snd (((,) OddSym0KindInference) ())
+    type OddSym1 (a0123456789876543210 :: Nat) =
+        Odd a0123456789876543210 :: Bool
+    type Odd :: Nat -> Bool
+    type family Odd a where
+      Odd 0 = FalseSym0
+      Odd n = Apply (Apply ($@#@$) (Apply (Apply (.@#@$) NotSym0) OddSym0)) (Apply (Apply (-@#@$) n) (FromInteger 1))
diff --git a/tests/compile-and-dump/Promote/T180.ghc88.template b/tests/compile-and-dump/Promote/T180.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Promote/T180.ghc88.template
+++ /dev/null
@@ -1,54 +0,0 @@
-Promote/T180.hs:(0,0)-(0,0): Splicing declarations
-    promote
-      [d| z (X1 x) = x
-          z (X2 x) = x
-          
-          data X = X1 {y :: Symbol} | X2 {y :: Symbol} |]
-  ======>
-    data X = X1 {y :: Symbol} | X2 {y :: Symbol}
-    z (X1 x) = x
-    z (X2 x) = x
-    type ZSym1 a0123456789876543210 = Z a0123456789876543210
-    instance SuppressUnusedWarnings ZSym0 where
-      suppressUnusedWarnings = snd (((,) ZSym0KindInference) ())
-    data ZSym0 a0123456789876543210
-      where
-        ZSym0KindInference :: forall a0123456789876543210
-                                     arg. SameKind (Apply ZSym0 arg) (ZSym1 arg) =>
-                              ZSym0 a0123456789876543210
-    type instance Apply ZSym0 a0123456789876543210 = Z a0123456789876543210
-    type family Z a where
-      Z (X1 x) = x
-      Z (X2 x) = x
-    type YSym1 (a0123456789876543210 :: X) = Y a0123456789876543210
-    instance SuppressUnusedWarnings YSym0 where
-      suppressUnusedWarnings = snd (((,) YSym0KindInference) ())
-    data YSym0 :: (~>) X Symbol
-      where
-        YSym0KindInference :: forall a0123456789876543210
-                                     arg. SameKind (Apply YSym0 arg) (YSym1 arg) =>
-                              YSym0 a0123456789876543210
-    type instance Apply YSym0 a0123456789876543210 = Y a0123456789876543210
-    type family Y (a :: X) :: Symbol where
-      Y (X1 field) = field
-      Y (X2 field) = field
-    type X1Sym1 (t0123456789876543210 :: Symbol) =
-        X1 t0123456789876543210
-    instance SuppressUnusedWarnings X1Sym0 where
-      suppressUnusedWarnings = snd (((,) X1Sym0KindInference) ())
-    data X1Sym0 :: (~>) Symbol X
-      where
-        X1Sym0KindInference :: forall t0123456789876543210
-                                      arg. SameKind (Apply X1Sym0 arg) (X1Sym1 arg) =>
-                               X1Sym0 t0123456789876543210
-    type instance Apply X1Sym0 t0123456789876543210 = X1 t0123456789876543210
-    type X2Sym1 (t0123456789876543210 :: Symbol) =
-        X2 t0123456789876543210
-    instance SuppressUnusedWarnings X2Sym0 where
-      suppressUnusedWarnings = snd (((,) X2Sym0KindInference) ())
-    data X2Sym0 :: (~>) Symbol X
-      where
-        X2Sym0KindInference :: forall t0123456789876543210
-                                      arg. SameKind (Apply X2Sym0 arg) (X2Sym1 arg) =>
-                               X2Sym0 t0123456789876543210
-    type instance Apply X2Sym0 t0123456789876543210 = X2 t0123456789876543210
diff --git a/tests/compile-and-dump/Promote/T180.golden b/tests/compile-and-dump/Promote/T180.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Promote/T180.golden
@@ -0,0 +1,55 @@
+Promote/T180.hs:(0,0)-(0,0): Splicing declarations
+    promote
+      [d| z (X1 x) = x
+          z (X2 x) = x
+          
+          data X = X1 {y :: Symbol} | X2 {y :: Symbol} |]
+  ======>
+    data X = X1 {y :: Symbol} | X2 {y :: Symbol}
+    z (X1 x) = x
+    z (X2 x) = x
+    type X1Sym0 :: (~>) Symbol X
+    data X1Sym0 a0123456789876543210
+      where
+        X1Sym0KindInference :: SameKind (Apply X1Sym0 arg) (X1Sym1 arg) =>
+                               X1Sym0 a0123456789876543210
+    type instance Apply X1Sym0 a0123456789876543210 = X1Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings X1Sym0 where
+      suppressUnusedWarnings = snd (((,) X1Sym0KindInference) ())
+    type X1Sym1 (a0123456789876543210 :: Symbol) =
+        X1 a0123456789876543210 :: X
+    type X2Sym0 :: (~>) Symbol X
+    data X2Sym0 a0123456789876543210
+      where
+        X2Sym0KindInference :: SameKind (Apply X2Sym0 arg) (X2Sym1 arg) =>
+                               X2Sym0 a0123456789876543210
+    type instance Apply X2Sym0 a0123456789876543210 = X2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings X2Sym0 where
+      suppressUnusedWarnings = snd (((,) X2Sym0KindInference) ())
+    type X2Sym1 (a0123456789876543210 :: Symbol) =
+        X2 a0123456789876543210 :: X
+    data ZSym0 a0123456789876543210
+      where
+        ZSym0KindInference :: SameKind (Apply ZSym0 arg) (ZSym1 arg) =>
+                              ZSym0 a0123456789876543210
+    type instance Apply ZSym0 a0123456789876543210 = ZSym1 a0123456789876543210
+    instance SuppressUnusedWarnings ZSym0 where
+      suppressUnusedWarnings = snd (((,) ZSym0KindInference) ())
+    type ZSym1 a0123456789876543210 = Z a0123456789876543210
+    type YSym0 :: (~>) X Symbol
+    data YSym0 a0123456789876543210
+      where
+        YSym0KindInference :: SameKind (Apply YSym0 arg) (YSym1 arg) =>
+                              YSym0 a0123456789876543210
+    type instance Apply YSym0 a0123456789876543210 = YSym1 a0123456789876543210
+    instance SuppressUnusedWarnings YSym0 where
+      suppressUnusedWarnings = snd (((,) YSym0KindInference) ())
+    type YSym1 (a0123456789876543210 :: X) =
+        Y a0123456789876543210 :: Symbol
+    type family Z a where
+      Z (X1 x) = x
+      Z (X2 x) = x
+    type Y :: X -> Symbol
+    type family Y a where
+      Y (X1 field) = field
+      Y (X2 field) = field
diff --git a/tests/compile-and-dump/Promote/T361.ghc88.template b/tests/compile-and-dump/Promote/T361.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Promote/T361.ghc88.template
+++ /dev/null
@@ -1,21 +0,0 @@
-Promote/T361.hs:0:0:: Splicing declarations
-    genDefunSymbols [''Proxy] ======> type ProxySym0 = 'Proxy
-Promote/T361.hs:(0,0)-(0,0): Splicing declarations
-    promote
-      [d| f :: Proxy 1 -> Proxy 2
-          f Proxy = Proxy |]
-  ======>
-    f :: Proxy 1 -> Proxy 2
-    f Proxy = Proxy
-    type FSym1 (a0123456789876543210 :: Proxy 1) =
-        F a0123456789876543210
-    instance SuppressUnusedWarnings FSym0 where
-      suppressUnusedWarnings = snd (((,) FSym0KindInference) ())
-    data FSym0 :: (~>) (Proxy 1) (Proxy 2)
-      where
-        FSym0KindInference :: forall a0123456789876543210
-                                     arg. SameKind (Apply FSym0 arg) (FSym1 arg) =>
-                              FSym0 a0123456789876543210
-    type instance Apply FSym0 a0123456789876543210 = F a0123456789876543210
-    type family F (a :: Proxy 1) :: Proxy 2 where
-      F 'Proxy = ProxySym0
diff --git a/tests/compile-and-dump/Promote/T361.golden b/tests/compile-and-dump/Promote/T361.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Promote/T361.golden
@@ -0,0 +1,24 @@
+Promote/T361.hs:0:0:: Splicing declarations
+    genDefunSymbols [''Proxy]
+  ======>
+    type ProxySym0 = 'Proxy :: Proxy (t :: k)
+Promote/T361.hs:(0,0)-(0,0): Splicing declarations
+    promote
+      [d| f :: Proxy 1 -> Proxy 2
+          f Proxy = Proxy |]
+  ======>
+    f :: Proxy 1 -> Proxy 2
+    f Proxy = Proxy
+    type FSym0 :: (~>) (Proxy 1) (Proxy 2)
+    data FSym0 a0123456789876543210
+      where
+        FSym0KindInference :: SameKind (Apply FSym0 arg) (FSym1 arg) =>
+                              FSym0 a0123456789876543210
+    type instance Apply FSym0 a0123456789876543210 = FSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FSym0 where
+      suppressUnusedWarnings = snd (((,) FSym0KindInference) ())
+    type FSym1 (a0123456789876543210 :: Proxy 1) =
+        F a0123456789876543210 :: Proxy 2
+    type F :: Proxy 1 -> Proxy 2
+    type family F a where
+      F 'Proxy = ProxySym0
diff --git a/tests/compile-and-dump/Singletons/AsPattern.ghc88.template b/tests/compile-and-dump/Singletons/AsPattern.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/AsPattern.ghc88.template
+++ /dev/null
@@ -1,395 +0,0 @@
-Singletons/AsPattern.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| maybePlus :: Maybe Nat -> Maybe Nat
-          maybePlus (Just n) = Just (plus (Succ Zero) n)
-          maybePlus p@Nothing = p
-          bar :: Maybe Nat -> Maybe Nat
-          bar x@(Just _) = x
-          bar Nothing = Nothing
-          baz_ :: Maybe Baz -> Maybe Baz
-          baz_ p@Nothing = p
-          baz_ p@(Just (Baz _ _ _)) = p
-          tup :: (Nat, Nat) -> (Nat, Nat)
-          tup p@(_, _) = p
-          foo :: [Nat] -> [Nat]
-          foo p@[] = p
-          foo p@[_] = p
-          foo p@(_ : _ : _) = p
-          
-          data Baz = Baz Nat Nat Nat |]
-  ======>
-    maybePlus :: Maybe Nat -> Maybe Nat
-    maybePlus (Just n) = Just ((plus (Succ Zero)) n)
-    maybePlus p@Nothing = p
-    bar :: Maybe Nat -> Maybe Nat
-    bar x@(Just _) = x
-    bar Nothing = Nothing
-    data Baz = Baz Nat Nat Nat
-    baz_ :: Maybe Baz -> Maybe Baz
-    baz_ p@Nothing = p
-    baz_ p@(Just (Baz _ _ _)) = p
-    tup :: (Nat, Nat) -> (Nat, Nat)
-    tup p@(_, _) = p
-    foo :: [Nat] -> [Nat]
-    foo p@[] = p
-    foo p@[_] = p
-    foo p@(_ : (_ : _)) = p
-    type BazSym3 (t0123456789876543210 :: Nat) (t0123456789876543210 :: Nat) (t0123456789876543210 :: Nat) =
-        Baz t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (BazSym2 t0123456789876543210 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) BazSym2KindInference) ())
-    data BazSym2 (t0123456789876543210 :: Nat) (t0123456789876543210 :: Nat) :: (~>) Nat Baz
-      where
-        BazSym2KindInference :: forall t0123456789876543210
-                                       t0123456789876543210
-                                       t0123456789876543210
-                                       arg. SameKind (Apply (BazSym2 t0123456789876543210 t0123456789876543210) arg) (BazSym3 t0123456789876543210 t0123456789876543210 arg) =>
-                                BazSym2 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (BazSym2 t0123456789876543210 t0123456789876543210) t0123456789876543210 = Baz t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (BazSym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) BazSym1KindInference) ())
-    data BazSym1 (t0123456789876543210 :: Nat) :: (~>) Nat ((~>) Nat Baz)
-      where
-        BazSym1KindInference :: forall t0123456789876543210
-                                       t0123456789876543210
-                                       arg. SameKind (Apply (BazSym1 t0123456789876543210) arg) (BazSym2 t0123456789876543210 arg) =>
-                                BazSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (BazSym1 t0123456789876543210) t0123456789876543210 = BazSym2 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings BazSym0 where
-      suppressUnusedWarnings = snd (((,) BazSym0KindInference) ())
-    data BazSym0 :: (~>) Nat ((~>) Nat ((~>) Nat Baz))
-      where
-        BazSym0KindInference :: forall t0123456789876543210
-                                       arg. SameKind (Apply BazSym0 arg) (BazSym1 arg) =>
-                                BazSym0 t0123456789876543210
-    type instance Apply BazSym0 t0123456789876543210 = BazSym1 t0123456789876543210
-    type Let0123456789876543210PSym0 = Let0123456789876543210P
-    type family Let0123456789876543210P where
-      Let0123456789876543210P = '[]
-    type Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210 =
-        Let0123456789876543210P wild_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210PSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210PSym0KindInference) ())
-    data Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210
-      where
-        Let0123456789876543210PSym0KindInference :: forall wild_01234567898765432100123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210PSym0 arg) (Let0123456789876543210PSym1 arg) =>
-                                                    Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210
-    type instance Apply Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210 = Let0123456789876543210P wild_01234567898765432100123456789876543210
-    type family Let0123456789876543210P wild_0123456789876543210 where
-      Let0123456789876543210P wild_0123456789876543210 = Apply (Apply (:@#@$) wild_0123456789876543210) '[]
-    type Let0123456789876543210PSym3 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 =
-        Let0123456789876543210P wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210PSym2KindInference) ())
-    data Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
-      where
-        Let0123456789876543210PSym2KindInference :: forall wild_01234567898765432100123456789876543210
-                                                           wild_01234567898765432100123456789876543210
-                                                           wild_01234567898765432100123456789876543210
-                                                           arg. SameKind (Apply (Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210) arg) (Let0123456789876543210PSym3 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 arg) =>
-                                                    Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
-    type instance Apply (Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210) wild_01234567898765432100123456789876543210 = Let0123456789876543210P wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210PSym1KindInference) ())
-    data Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
-      where
-        Let0123456789876543210PSym1KindInference :: forall wild_01234567898765432100123456789876543210
-                                                           wild_01234567898765432100123456789876543210
-                                                           arg. SameKind (Apply (Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210) arg) (Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 arg) =>
-                                                    Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
-    type instance Apply (Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210) wild_01234567898765432100123456789876543210 = Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210PSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210PSym0KindInference) ())
-    data Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210
-      where
-        Let0123456789876543210PSym0KindInference :: forall wild_01234567898765432100123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210PSym0 arg) (Let0123456789876543210PSym1 arg) =>
-                                                    Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210
-    type instance Apply Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210 = Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210
-    type family Let0123456789876543210P wild_0123456789876543210 wild_0123456789876543210 wild_0123456789876543210 where
-      Let0123456789876543210P wild_0123456789876543210 wild_0123456789876543210 wild_0123456789876543210 = Apply (Apply (:@#@$) wild_0123456789876543210) (Apply (Apply (:@#@$) wild_0123456789876543210) wild_0123456789876543210)
-    type Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 =
-        Let0123456789876543210P wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210PSym1KindInference) ())
-    data Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
-      where
-        Let0123456789876543210PSym1KindInference :: forall wild_01234567898765432100123456789876543210
-                                                           wild_01234567898765432100123456789876543210
-                                                           arg. SameKind (Apply (Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210) arg) (Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 arg) =>
-                                                    Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
-    type instance Apply (Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210) wild_01234567898765432100123456789876543210 = Let0123456789876543210P wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210PSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210PSym0KindInference) ())
-    data Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210
-      where
-        Let0123456789876543210PSym0KindInference :: forall wild_01234567898765432100123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210PSym0 arg) (Let0123456789876543210PSym1 arg) =>
-                                                    Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210
-    type instance Apply Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210 = Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210
-    type family Let0123456789876543210P wild_0123456789876543210 wild_0123456789876543210 where
-      Let0123456789876543210P wild_0123456789876543210 wild_0123456789876543210 = Apply (Apply Tuple2Sym0 wild_0123456789876543210) wild_0123456789876543210
-    type Let0123456789876543210PSym0 = Let0123456789876543210P
-    type family Let0123456789876543210P where
-      Let0123456789876543210P = NothingSym0
-    type Let0123456789876543210PSym3 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 =
-        Let0123456789876543210P wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210PSym2KindInference) ())
-    data Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
-      where
-        Let0123456789876543210PSym2KindInference :: forall wild_01234567898765432100123456789876543210
-                                                           wild_01234567898765432100123456789876543210
-                                                           wild_01234567898765432100123456789876543210
-                                                           arg. SameKind (Apply (Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210) arg) (Let0123456789876543210PSym3 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 arg) =>
-                                                    Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
-    type instance Apply (Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210) wild_01234567898765432100123456789876543210 = Let0123456789876543210P wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210PSym1KindInference) ())
-    data Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
-      where
-        Let0123456789876543210PSym1KindInference :: forall wild_01234567898765432100123456789876543210
-                                                           wild_01234567898765432100123456789876543210
-                                                           arg. SameKind (Apply (Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210) arg) (Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 arg) =>
-                                                    Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
-    type instance Apply (Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210) wild_01234567898765432100123456789876543210 = Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210PSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210PSym0KindInference) ())
-    data Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210
-      where
-        Let0123456789876543210PSym0KindInference :: forall wild_01234567898765432100123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210PSym0 arg) (Let0123456789876543210PSym1 arg) =>
-                                                    Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210
-    type instance Apply Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210 = Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210
-    type family Let0123456789876543210P wild_0123456789876543210 wild_0123456789876543210 wild_0123456789876543210 where
-      Let0123456789876543210P wild_0123456789876543210 wild_0123456789876543210 wild_0123456789876543210 = Apply JustSym0 (Apply (Apply (Apply BazSym0 wild_0123456789876543210) wild_0123456789876543210) wild_0123456789876543210)
-    type Let0123456789876543210XSym1 wild_01234567898765432100123456789876543210 =
-        Let0123456789876543210X wild_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210XSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210XSym0KindInference) ())
-    data Let0123456789876543210XSym0 wild_01234567898765432100123456789876543210
-      where
-        Let0123456789876543210XSym0KindInference :: forall wild_01234567898765432100123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210XSym0 arg) (Let0123456789876543210XSym1 arg) =>
-                                                    Let0123456789876543210XSym0 wild_01234567898765432100123456789876543210
-    type instance Apply Let0123456789876543210XSym0 wild_01234567898765432100123456789876543210 = Let0123456789876543210X wild_01234567898765432100123456789876543210
-    type family Let0123456789876543210X wild_0123456789876543210 where
-      Let0123456789876543210X wild_0123456789876543210 = Apply JustSym0 wild_0123456789876543210
-    type Let0123456789876543210PSym0 = Let0123456789876543210P
-    type family Let0123456789876543210P where
-      Let0123456789876543210P = NothingSym0
-    type FooSym1 (a0123456789876543210 :: [Nat]) =
-        Foo a0123456789876543210
-    instance SuppressUnusedWarnings FooSym0 where
-      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
-    data FooSym0 :: (~>) [Nat] [Nat]
-      where
-        FooSym0KindInference :: forall a0123456789876543210
-                                       arg. SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
-                                FooSym0 a0123456789876543210
-    type instance Apply FooSym0 a0123456789876543210 = Foo a0123456789876543210
-    type TupSym1 (a0123456789876543210 :: (Nat, Nat)) =
-        Tup a0123456789876543210
-    instance SuppressUnusedWarnings TupSym0 where
-      suppressUnusedWarnings = snd (((,) TupSym0KindInference) ())
-    data TupSym0 :: (~>) (Nat, Nat) (Nat, Nat)
-      where
-        TupSym0KindInference :: forall a0123456789876543210
-                                       arg. SameKind (Apply TupSym0 arg) (TupSym1 arg) =>
-                                TupSym0 a0123456789876543210
-    type instance Apply TupSym0 a0123456789876543210 = Tup a0123456789876543210
-    type Baz_Sym1 (a0123456789876543210 :: Maybe Baz) =
-        Baz_ a0123456789876543210
-    instance SuppressUnusedWarnings Baz_Sym0 where
-      suppressUnusedWarnings = snd (((,) Baz_Sym0KindInference) ())
-    data Baz_Sym0 :: (~>) (Maybe Baz) (Maybe Baz)
-      where
-        Baz_Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Baz_Sym0 arg) (Baz_Sym1 arg) =>
-                                 Baz_Sym0 a0123456789876543210
-    type instance Apply Baz_Sym0 a0123456789876543210 = Baz_ a0123456789876543210
-    type BarSym1 (a0123456789876543210 :: Maybe Nat) =
-        Bar a0123456789876543210
-    instance SuppressUnusedWarnings BarSym0 where
-      suppressUnusedWarnings = snd (((,) BarSym0KindInference) ())
-    data BarSym0 :: (~>) (Maybe Nat) (Maybe Nat)
-      where
-        BarSym0KindInference :: forall a0123456789876543210
-                                       arg. SameKind (Apply BarSym0 arg) (BarSym1 arg) =>
-                                BarSym0 a0123456789876543210
-    type instance Apply BarSym0 a0123456789876543210 = Bar a0123456789876543210
-    type MaybePlusSym1 (a0123456789876543210 :: Maybe Nat) =
-        MaybePlus a0123456789876543210
-    instance SuppressUnusedWarnings MaybePlusSym0 where
-      suppressUnusedWarnings = snd (((,) MaybePlusSym0KindInference) ())
-    data MaybePlusSym0 :: (~>) (Maybe Nat) (Maybe Nat)
-      where
-        MaybePlusSym0KindInference :: forall a0123456789876543210
-                                             arg. SameKind (Apply MaybePlusSym0 arg) (MaybePlusSym1 arg) =>
-                                      MaybePlusSym0 a0123456789876543210
-    type instance Apply MaybePlusSym0 a0123456789876543210 = MaybePlus a0123456789876543210
-    type family Foo (a :: [Nat]) :: [Nat] where
-      Foo '[] = Let0123456789876543210PSym0
-      Foo '[wild_0123456789876543210] = Let0123456789876543210PSym1 wild_0123456789876543210
-      Foo ('(:) wild_0123456789876543210 ('(:) wild_0123456789876543210 wild_0123456789876543210)) = Let0123456789876543210PSym3 wild_0123456789876543210 wild_0123456789876543210 wild_0123456789876543210
-    type family Tup (a :: (Nat, Nat)) :: (Nat, Nat) where
-      Tup '(wild_0123456789876543210,
-            wild_0123456789876543210) = Let0123456789876543210PSym2 wild_0123456789876543210 wild_0123456789876543210
-    type family Baz_ (a :: Maybe Baz) :: Maybe Baz where
-      Baz_ 'Nothing = Let0123456789876543210PSym0
-      Baz_ ('Just (Baz wild_0123456789876543210 wild_0123456789876543210 wild_0123456789876543210)) = Let0123456789876543210PSym3 wild_0123456789876543210 wild_0123456789876543210 wild_0123456789876543210
-    type family Bar (a :: Maybe Nat) :: Maybe Nat where
-      Bar ('Just wild_0123456789876543210) = Let0123456789876543210XSym1 wild_0123456789876543210
-      Bar 'Nothing = NothingSym0
-    type family MaybePlus (a :: Maybe Nat) :: Maybe Nat where
-      MaybePlus ('Just n) = Apply JustSym0 (Apply (Apply PlusSym0 (Apply SuccSym0 ZeroSym0)) n)
-      MaybePlus 'Nothing = Let0123456789876543210PSym0
-    sFoo ::
-      forall (t :: [Nat]). Sing t -> Sing (Apply FooSym0 t :: [Nat])
-    sTup ::
-      forall (t :: (Nat, Nat)).
-      Sing t -> Sing (Apply TupSym0 t :: (Nat, Nat))
-    sBaz_ ::
-      forall (t :: Maybe Baz).
-      Sing t -> Sing (Apply Baz_Sym0 t :: Maybe Baz)
-    sBar ::
-      forall (t :: Maybe Nat).
-      Sing t -> Sing (Apply BarSym0 t :: Maybe Nat)
-    sMaybePlus ::
-      forall (t :: Maybe Nat).
-      Sing t -> Sing (Apply MaybePlusSym0 t :: Maybe Nat)
-    sFoo SNil
-      = let
-          sP :: Sing Let0123456789876543210PSym0
-          sP = SNil
-        in sP
-    sFoo
-      (SCons (sWild_0123456789876543210 :: Sing wild_0123456789876543210)
-             SNil)
-      = let
-          sP :: Sing (Let0123456789876543210PSym1 wild_0123456789876543210)
-          sP
-            = (applySing
-                 ((applySing ((singFun2 @(:@#@$)) SCons))
-                    sWild_0123456789876543210))
-                SNil
-        in sP
-    sFoo
-      (SCons (sWild_0123456789876543210 :: Sing wild_0123456789876543210)
-             (SCons (sWild_0123456789876543210 :: Sing wild_0123456789876543210)
-                    (sWild_0123456789876543210 :: Sing wild_0123456789876543210)))
-      = let
-          sP ::
-            Sing (Let0123456789876543210PSym3 wild_0123456789876543210 wild_0123456789876543210 wild_0123456789876543210)
-          sP
-            = (applySing
-                 ((applySing ((singFun2 @(:@#@$)) SCons))
-                    sWild_0123456789876543210))
-                ((applySing
-                    ((applySing ((singFun2 @(:@#@$)) SCons))
-                       sWild_0123456789876543210))
-                   sWild_0123456789876543210)
-        in sP
-    sTup
-      (STuple2 (sWild_0123456789876543210 :: Sing wild_0123456789876543210)
-               (sWild_0123456789876543210 :: Sing wild_0123456789876543210))
-      = let
-          sP ::
-            Sing (Let0123456789876543210PSym2 wild_0123456789876543210 wild_0123456789876543210)
-          sP
-            = (applySing
-                 ((applySing ((singFun2 @Tuple2Sym0) STuple2))
-                    sWild_0123456789876543210))
-                sWild_0123456789876543210
-        in sP
-    sBaz_ SNothing
-      = let
-          sP :: Sing Let0123456789876543210PSym0
-          sP = SNothing
-        in sP
-    sBaz_
-      (SJust (SBaz (sWild_0123456789876543210 :: Sing wild_0123456789876543210)
-                   (sWild_0123456789876543210 :: Sing wild_0123456789876543210)
-                   (sWild_0123456789876543210 :: Sing wild_0123456789876543210)))
-      = let
-          sP ::
-            Sing (Let0123456789876543210PSym3 wild_0123456789876543210 wild_0123456789876543210 wild_0123456789876543210)
-          sP
-            = (applySing ((singFun1 @JustSym0) SJust))
-                ((applySing
-                    ((applySing
-                        ((applySing ((singFun3 @BazSym0) SBaz)) sWild_0123456789876543210))
-                       sWild_0123456789876543210))
-                   sWild_0123456789876543210)
-        in sP
-    sBar
-      (SJust (sWild_0123456789876543210 :: Sing wild_0123456789876543210))
-      = let
-          sX :: Sing (Let0123456789876543210XSym1 wild_0123456789876543210)
-          sX
-            = (applySing ((singFun1 @JustSym0) SJust))
-                sWild_0123456789876543210
-        in sX
-    sBar SNothing = SNothing
-    sMaybePlus (SJust (sN :: Sing n))
-      = (applySing ((singFun1 @JustSym0) SJust))
-          ((applySing
-              ((applySing ((singFun2 @PlusSym0) sPlus))
-                 ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
-             sN)
-    sMaybePlus SNothing
-      = let
-          sP :: Sing Let0123456789876543210PSym0
-          sP = SNothing
-        in sP
-    instance SingI (FooSym0 :: (~>) [Nat] [Nat]) where
-      sing = (singFun1 @FooSym0) sFoo
-    instance SingI (TupSym0 :: (~>) (Nat, Nat) (Nat, Nat)) where
-      sing = (singFun1 @TupSym0) sTup
-    instance SingI (Baz_Sym0 :: (~>) (Maybe Baz) (Maybe Baz)) where
-      sing = (singFun1 @Baz_Sym0) sBaz_
-    instance SingI (BarSym0 :: (~>) (Maybe Nat) (Maybe Nat)) where
-      sing = (singFun1 @BarSym0) sBar
-    instance SingI (MaybePlusSym0 :: (~>) (Maybe Nat) (Maybe Nat)) where
-      sing = (singFun1 @MaybePlusSym0) sMaybePlus
-    data SBaz :: Baz -> GHC.Types.Type
-      where
-        SBaz :: forall (n :: Nat) (n :: Nat) (n :: Nat).
-                (Sing (n :: Nat))
-                -> (Sing (n :: Nat)) -> (Sing (n :: Nat)) -> SBaz (Baz n n n)
-    type instance Sing @Baz = SBaz
-    instance SingKind Baz where
-      type Demote Baz = Baz
-      fromSing (SBaz b b b)
-        = ((Baz (fromSing b)) (fromSing b)) (fromSing b)
-      toSing (Baz (b :: Demote Nat) (b :: Demote Nat) (b :: Demote Nat))
-        = case
-              (((,,) (toSing b :: SomeSing Nat)) (toSing b :: SomeSing Nat))
-                (toSing b :: SomeSing Nat)
-          of {
-            (,,) (SomeSing c) (SomeSing c) (SomeSing c)
-              -> SomeSing (((SBaz c) c) c) }
-    instance (SingI n, SingI n, SingI n) =>
-             SingI (Baz (n :: Nat) (n :: Nat) (n :: Nat)) where
-      sing = ((SBaz sing) sing) sing
-    instance SingI (BazSym0 :: (~>) Nat ((~>) Nat ((~>) Nat Baz))) where
-      sing = (singFun3 @BazSym0) SBaz
-    instance SingI d =>
-             SingI (BazSym1 (d :: Nat) :: (~>) Nat ((~>) Nat Baz)) where
-      sing = (singFun2 @(BazSym1 (d :: Nat))) (SBaz (sing @d))
-    instance (SingI d, SingI d) =>
-             SingI (BazSym2 (d :: Nat) (d :: Nat) :: (~>) Nat Baz) where
-      sing
-        = (singFun1 @(BazSym2 (d :: Nat) (d :: Nat)))
-            ((SBaz (sing @d)) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/AsPattern.golden b/tests/compile-and-dump/Singletons/AsPattern.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/AsPattern.golden
@@ -0,0 +1,381 @@
+Singletons/AsPattern.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| maybePlus :: Maybe Nat -> Maybe Nat
+          maybePlus (Just n) = Just (plus (Succ Zero) n)
+          maybePlus p@Nothing = p
+          bar :: Maybe Nat -> Maybe Nat
+          bar x@(Just _) = x
+          bar Nothing = Nothing
+          baz_ :: Maybe Baz -> Maybe Baz
+          baz_ p@Nothing = p
+          baz_ p@(Just (Baz _ _ _)) = p
+          tup :: (Nat, Nat) -> (Nat, Nat)
+          tup p@(_, _) = p
+          foo :: [Nat] -> [Nat]
+          foo p@[] = p
+          foo p@[_] = p
+          foo p@(_ : _ : _) = p
+          
+          data Baz = Baz Nat Nat Nat |]
+  ======>
+    maybePlus :: Maybe Nat -> Maybe Nat
+    maybePlus (Just n) = Just ((plus (Succ Zero)) n)
+    maybePlus p@Nothing = p
+    bar :: Maybe Nat -> Maybe Nat
+    bar x@(Just _) = x
+    bar Nothing = Nothing
+    data Baz = Baz Nat Nat Nat
+    baz_ :: Maybe Baz -> Maybe Baz
+    baz_ p@Nothing = p
+    baz_ p@(Just (Baz _ _ _)) = p
+    tup :: (Nat, Nat) -> (Nat, Nat)
+    tup p@(_, _) = p
+    foo :: [Nat] -> [Nat]
+    foo p@[] = p
+    foo p@[_] = p
+    foo p@(_ : (_ : _)) = p
+    type BazSym0 :: (~>) Nat ((~>) Nat ((~>) Nat Baz))
+    data BazSym0 a0123456789876543210
+      where
+        BazSym0KindInference :: SameKind (Apply BazSym0 arg) (BazSym1 arg) =>
+                                BazSym0 a0123456789876543210
+    type instance Apply BazSym0 a0123456789876543210 = BazSym1 a0123456789876543210
+    instance SuppressUnusedWarnings BazSym0 where
+      suppressUnusedWarnings = snd (((,) BazSym0KindInference) ())
+    type BazSym1 :: Nat -> (~>) Nat ((~>) Nat Baz)
+    data BazSym1 a0123456789876543210 a0123456789876543210
+      where
+        BazSym1KindInference :: SameKind (Apply (BazSym1 a0123456789876543210) arg) (BazSym2 a0123456789876543210 arg) =>
+                                BazSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (BazSym1 a0123456789876543210) a0123456789876543210 = BazSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (BazSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) BazSym1KindInference) ())
+    type BazSym2 :: Nat -> Nat -> (~>) Nat Baz
+    data BazSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        BazSym2KindInference :: SameKind (Apply (BazSym2 a0123456789876543210 a0123456789876543210) arg) (BazSym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                BazSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (BazSym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = BazSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (BazSym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) BazSym2KindInference) ())
+    type BazSym3 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
+        Baz a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Baz
+    type Let0123456789876543210PSym0 = Let0123456789876543210P
+    type family Let0123456789876543210P where
+      Let0123456789876543210P = NilSym0
+    data Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210
+      where
+        Let0123456789876543210PSym0KindInference :: SameKind (Apply Let0123456789876543210PSym0 arg) (Let0123456789876543210PSym1 arg) =>
+                                                    Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210
+    type instance Apply Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210 = Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210PSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210PSym0KindInference) ())
+    type Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210 =
+        Let0123456789876543210P wild_01234567898765432100123456789876543210
+    type family Let0123456789876543210P wild_0123456789876543210 where
+      Let0123456789876543210P wild_0123456789876543210 = Apply (Apply (:@#@$) wild_0123456789876543210) NilSym0
+    data Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210
+      where
+        Let0123456789876543210PSym0KindInference :: SameKind (Apply Let0123456789876543210PSym0 arg) (Let0123456789876543210PSym1 arg) =>
+                                                    Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210
+    type instance Apply Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210 = Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210PSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210PSym0KindInference) ())
+    data Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
+      where
+        Let0123456789876543210PSym1KindInference :: SameKind (Apply (Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210) arg) (Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 arg) =>
+                                                    Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
+    type instance Apply (Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210) wild_01234567898765432100123456789876543210 = Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210PSym1KindInference) ())
+    data Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
+      where
+        Let0123456789876543210PSym2KindInference :: SameKind (Apply (Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210) arg) (Let0123456789876543210PSym3 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 arg) =>
+                                                    Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
+    type instance Apply (Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210) wild_01234567898765432100123456789876543210 = Let0123456789876543210PSym3 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210PSym2KindInference) ())
+    type Let0123456789876543210PSym3 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 =
+        Let0123456789876543210P wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
+    type family Let0123456789876543210P wild_0123456789876543210 wild_0123456789876543210 wild_0123456789876543210 where
+      Let0123456789876543210P wild_0123456789876543210 wild_0123456789876543210 wild_0123456789876543210 = Apply (Apply (:@#@$) wild_0123456789876543210) (Apply (Apply (:@#@$) wild_0123456789876543210) wild_0123456789876543210)
+    data Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210
+      where
+        Let0123456789876543210PSym0KindInference :: SameKind (Apply Let0123456789876543210PSym0 arg) (Let0123456789876543210PSym1 arg) =>
+                                                    Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210
+    type instance Apply Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210 = Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210PSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210PSym0KindInference) ())
+    data Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
+      where
+        Let0123456789876543210PSym1KindInference :: SameKind (Apply (Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210) arg) (Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 arg) =>
+                                                    Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
+    type instance Apply (Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210) wild_01234567898765432100123456789876543210 = Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210PSym1KindInference) ())
+    type Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 =
+        Let0123456789876543210P wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
+    type family Let0123456789876543210P wild_0123456789876543210 wild_0123456789876543210 where
+      Let0123456789876543210P wild_0123456789876543210 wild_0123456789876543210 = Apply (Apply Tuple2Sym0 wild_0123456789876543210) wild_0123456789876543210
+    type Let0123456789876543210PSym0 = Let0123456789876543210P
+    type family Let0123456789876543210P where
+      Let0123456789876543210P = NothingSym0
+    data Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210
+      where
+        Let0123456789876543210PSym0KindInference :: SameKind (Apply Let0123456789876543210PSym0 arg) (Let0123456789876543210PSym1 arg) =>
+                                                    Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210
+    type instance Apply Let0123456789876543210PSym0 wild_01234567898765432100123456789876543210 = Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210PSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210PSym0KindInference) ())
+    data Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
+      where
+        Let0123456789876543210PSym1KindInference :: SameKind (Apply (Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210) arg) (Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 arg) =>
+                                                    Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
+    type instance Apply (Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210) wild_01234567898765432100123456789876543210 = Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210PSym1 wild_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210PSym1KindInference) ())
+    data Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
+      where
+        Let0123456789876543210PSym2KindInference :: SameKind (Apply (Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210) arg) (Let0123456789876543210PSym3 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 arg) =>
+                                                    Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
+    type instance Apply (Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210) wild_01234567898765432100123456789876543210 = Let0123456789876543210PSym3 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210PSym2 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210PSym2KindInference) ())
+    type Let0123456789876543210PSym3 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 =
+        Let0123456789876543210P wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210 wild_01234567898765432100123456789876543210
+    type family Let0123456789876543210P wild_0123456789876543210 wild_0123456789876543210 wild_0123456789876543210 where
+      Let0123456789876543210P wild_0123456789876543210 wild_0123456789876543210 wild_0123456789876543210 = Apply JustSym0 (Apply (Apply (Apply BazSym0 wild_0123456789876543210) wild_0123456789876543210) wild_0123456789876543210)
+    data Let0123456789876543210XSym0 wild_01234567898765432100123456789876543210
+      where
+        Let0123456789876543210XSym0KindInference :: SameKind (Apply Let0123456789876543210XSym0 arg) (Let0123456789876543210XSym1 arg) =>
+                                                    Let0123456789876543210XSym0 wild_01234567898765432100123456789876543210
+    type instance Apply Let0123456789876543210XSym0 wild_01234567898765432100123456789876543210 = Let0123456789876543210XSym1 wild_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210XSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210XSym0KindInference) ())
+    type Let0123456789876543210XSym1 wild_01234567898765432100123456789876543210 =
+        Let0123456789876543210X wild_01234567898765432100123456789876543210
+    type family Let0123456789876543210X wild_0123456789876543210 where
+      Let0123456789876543210X wild_0123456789876543210 = Apply JustSym0 wild_0123456789876543210
+    type Let0123456789876543210PSym0 = Let0123456789876543210P
+    type family Let0123456789876543210P where
+      Let0123456789876543210P = NothingSym0
+    type FooSym0 :: (~>) [Nat] [Nat]
+    data FooSym0 a0123456789876543210
+      where
+        FooSym0KindInference :: SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
+                                FooSym0 a0123456789876543210
+    type instance Apply FooSym0 a0123456789876543210 = FooSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FooSym0 where
+      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
+    type FooSym1 (a0123456789876543210 :: [Nat]) =
+        Foo a0123456789876543210 :: [Nat]
+    type TupSym0 :: (~>) (Nat, Nat) (Nat, Nat)
+    data TupSym0 a0123456789876543210
+      where
+        TupSym0KindInference :: SameKind (Apply TupSym0 arg) (TupSym1 arg) =>
+                                TupSym0 a0123456789876543210
+    type instance Apply TupSym0 a0123456789876543210 = TupSym1 a0123456789876543210
+    instance SuppressUnusedWarnings TupSym0 where
+      suppressUnusedWarnings = snd (((,) TupSym0KindInference) ())
+    type TupSym1 (a0123456789876543210 :: (Nat, Nat)) =
+        Tup a0123456789876543210 :: (Nat, Nat)
+    type Baz_Sym0 :: (~>) (Maybe Baz) (Maybe Baz)
+    data Baz_Sym0 a0123456789876543210
+      where
+        Baz_Sym0KindInference :: SameKind (Apply Baz_Sym0 arg) (Baz_Sym1 arg) =>
+                                 Baz_Sym0 a0123456789876543210
+    type instance Apply Baz_Sym0 a0123456789876543210 = Baz_Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Baz_Sym0 where
+      suppressUnusedWarnings = snd (((,) Baz_Sym0KindInference) ())
+    type Baz_Sym1 (a0123456789876543210 :: Maybe Baz) =
+        Baz_ a0123456789876543210 :: Maybe Baz
+    type BarSym0 :: (~>) (Maybe Nat) (Maybe Nat)
+    data BarSym0 a0123456789876543210
+      where
+        BarSym0KindInference :: SameKind (Apply BarSym0 arg) (BarSym1 arg) =>
+                                BarSym0 a0123456789876543210
+    type instance Apply BarSym0 a0123456789876543210 = BarSym1 a0123456789876543210
+    instance SuppressUnusedWarnings BarSym0 where
+      suppressUnusedWarnings = snd (((,) BarSym0KindInference) ())
+    type BarSym1 (a0123456789876543210 :: Maybe Nat) =
+        Bar a0123456789876543210 :: Maybe Nat
+    type MaybePlusSym0 :: (~>) (Maybe Nat) (Maybe Nat)
+    data MaybePlusSym0 a0123456789876543210
+      where
+        MaybePlusSym0KindInference :: SameKind (Apply MaybePlusSym0 arg) (MaybePlusSym1 arg) =>
+                                      MaybePlusSym0 a0123456789876543210
+    type instance Apply MaybePlusSym0 a0123456789876543210 = MaybePlusSym1 a0123456789876543210
+    instance SuppressUnusedWarnings MaybePlusSym0 where
+      suppressUnusedWarnings = snd (((,) MaybePlusSym0KindInference) ())
+    type MaybePlusSym1 (a0123456789876543210 :: Maybe Nat) =
+        MaybePlus a0123456789876543210 :: Maybe Nat
+    type Foo :: [Nat] -> [Nat]
+    type family Foo a where
+      Foo '[] = Let0123456789876543210PSym0
+      Foo '[wild_0123456789876543210] = Let0123456789876543210PSym1 wild_0123456789876543210
+      Foo ('(:) wild_0123456789876543210 ('(:) wild_0123456789876543210 wild_0123456789876543210)) = Let0123456789876543210PSym3 wild_0123456789876543210 wild_0123456789876543210 wild_0123456789876543210
+    type Tup :: (Nat, Nat) -> (Nat, Nat)
+    type family Tup a where
+      Tup '(wild_0123456789876543210,
+            wild_0123456789876543210) = Let0123456789876543210PSym2 wild_0123456789876543210 wild_0123456789876543210
+    type Baz_ :: Maybe Baz -> Maybe Baz
+    type family Baz_ a where
+      Baz_ 'Nothing = Let0123456789876543210PSym0
+      Baz_ ('Just (Baz wild_0123456789876543210 wild_0123456789876543210 wild_0123456789876543210)) = Let0123456789876543210PSym3 wild_0123456789876543210 wild_0123456789876543210 wild_0123456789876543210
+    type Bar :: Maybe Nat -> Maybe Nat
+    type family Bar a where
+      Bar ('Just wild_0123456789876543210) = Let0123456789876543210XSym1 wild_0123456789876543210
+      Bar 'Nothing = NothingSym0
+    type MaybePlus :: Maybe Nat -> Maybe Nat
+    type family MaybePlus a where
+      MaybePlus ('Just n) = Apply JustSym0 (Apply (Apply PlusSym0 (Apply SuccSym0 ZeroSym0)) n)
+      MaybePlus 'Nothing = Let0123456789876543210PSym0
+    sFoo ::
+      forall (t :: [Nat]). Sing t -> Sing (Apply FooSym0 t :: [Nat])
+    sTup ::
+      forall (t :: (Nat, Nat)).
+      Sing t -> Sing (Apply TupSym0 t :: (Nat, Nat))
+    sBaz_ ::
+      forall (t :: Maybe Baz).
+      Sing t -> Sing (Apply Baz_Sym0 t :: Maybe Baz)
+    sBar ::
+      forall (t :: Maybe Nat).
+      Sing t -> Sing (Apply BarSym0 t :: Maybe Nat)
+    sMaybePlus ::
+      forall (t :: Maybe Nat).
+      Sing t -> Sing (Apply MaybePlusSym0 t :: Maybe Nat)
+    sFoo SNil
+      = let
+          sP :: Sing @_ Let0123456789876543210PSym0
+          sP = SNil
+        in sP
+    sFoo
+      (SCons (sWild_0123456789876543210 :: Sing wild_0123456789876543210)
+             SNil)
+      = let
+          sP ::
+            Sing @_ (Let0123456789876543210PSym1 wild_0123456789876543210)
+          sP
+            = (applySing
+                 ((applySing ((singFun2 @(:@#@$)) SCons))
+                    sWild_0123456789876543210))
+                SNil
+        in sP
+    sFoo
+      (SCons (sWild_0123456789876543210 :: Sing wild_0123456789876543210)
+             (SCons (sWild_0123456789876543210 :: Sing wild_0123456789876543210)
+                    (sWild_0123456789876543210 :: Sing wild_0123456789876543210)))
+      = let
+          sP ::
+            Sing @_ (Let0123456789876543210PSym3 wild_0123456789876543210 wild_0123456789876543210 wild_0123456789876543210)
+          sP
+            = (applySing
+                 ((applySing ((singFun2 @(:@#@$)) SCons))
+                    sWild_0123456789876543210))
+                ((applySing
+                    ((applySing ((singFun2 @(:@#@$)) SCons))
+                       sWild_0123456789876543210))
+                   sWild_0123456789876543210)
+        in sP
+    sTup
+      (STuple2 (sWild_0123456789876543210 :: Sing wild_0123456789876543210)
+               (sWild_0123456789876543210 :: Sing wild_0123456789876543210))
+      = let
+          sP ::
+            Sing @_ (Let0123456789876543210PSym2 wild_0123456789876543210 wild_0123456789876543210)
+          sP
+            = (applySing
+                 ((applySing ((singFun2 @Tuple2Sym0) STuple2))
+                    sWild_0123456789876543210))
+                sWild_0123456789876543210
+        in sP
+    sBaz_ SNothing
+      = let
+          sP :: Sing @_ Let0123456789876543210PSym0
+          sP = SNothing
+        in sP
+    sBaz_
+      (SJust (SBaz (sWild_0123456789876543210 :: Sing wild_0123456789876543210)
+                   (sWild_0123456789876543210 :: Sing wild_0123456789876543210)
+                   (sWild_0123456789876543210 :: Sing wild_0123456789876543210)))
+      = let
+          sP ::
+            Sing @_ (Let0123456789876543210PSym3 wild_0123456789876543210 wild_0123456789876543210 wild_0123456789876543210)
+          sP
+            = (applySing ((singFun1 @JustSym0) SJust))
+                ((applySing
+                    ((applySing
+                        ((applySing ((singFun3 @BazSym0) SBaz)) sWild_0123456789876543210))
+                       sWild_0123456789876543210))
+                   sWild_0123456789876543210)
+        in sP
+    sBar
+      (SJust (sWild_0123456789876543210 :: Sing wild_0123456789876543210))
+      = let
+          sX ::
+            Sing @_ (Let0123456789876543210XSym1 wild_0123456789876543210)
+          sX
+            = (applySing ((singFun1 @JustSym0) SJust))
+                sWild_0123456789876543210
+        in sX
+    sBar SNothing = SNothing
+    sMaybePlus (SJust (sN :: Sing n))
+      = (applySing ((singFun1 @JustSym0) SJust))
+          ((applySing
+              ((applySing ((singFun2 @PlusSym0) sPlus))
+                 ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
+             sN)
+    sMaybePlus SNothing
+      = let
+          sP :: Sing @_ Let0123456789876543210PSym0
+          sP = SNothing
+        in sP
+    instance SingI (FooSym0 :: (~>) [Nat] [Nat]) where
+      sing = (singFun1 @FooSym0) sFoo
+    instance SingI (TupSym0 :: (~>) (Nat, Nat) (Nat, Nat)) where
+      sing = (singFun1 @TupSym0) sTup
+    instance SingI (Baz_Sym0 :: (~>) (Maybe Baz) (Maybe Baz)) where
+      sing = (singFun1 @Baz_Sym0) sBaz_
+    instance SingI (BarSym0 :: (~>) (Maybe Nat) (Maybe Nat)) where
+      sing = (singFun1 @BarSym0) sBar
+    instance SingI (MaybePlusSym0 :: (~>) (Maybe Nat) (Maybe Nat)) where
+      sing = (singFun1 @MaybePlusSym0) sMaybePlus
+    data SBaz :: Baz -> GHC.Types.Type
+      where
+        SBaz :: forall (n :: Nat) (n :: Nat) (n :: Nat).
+                (Sing n) -> (Sing n) -> (Sing n) -> SBaz (Baz n n n :: Baz)
+    type instance Sing @Baz = SBaz
+    instance SingKind Baz where
+      type Demote Baz = Baz
+      fromSing (SBaz b b b)
+        = ((Baz (fromSing b)) (fromSing b)) (fromSing b)
+      toSing (Baz (b :: Demote Nat) (b :: Demote Nat) (b :: Demote Nat))
+        = case
+              (((,,) (toSing b :: SomeSing Nat)) (toSing b :: SomeSing Nat))
+                (toSing b :: SomeSing Nat)
+          of {
+            (,,) (SomeSing c) (SomeSing c) (SomeSing c)
+              -> SomeSing (((SBaz c) c) c) }
+    instance (SingI n, SingI n, SingI n) =>
+             SingI (Baz (n :: Nat) (n :: Nat) (n :: Nat)) where
+      sing = ((SBaz sing) sing) sing
+    instance SingI (BazSym0 :: (~>) Nat ((~>) Nat ((~>) Nat Baz))) where
+      sing = (singFun3 @BazSym0) SBaz
+    instance SingI d =>
+             SingI (BazSym1 (d :: Nat) :: (~>) Nat ((~>) Nat Baz)) where
+      sing = (singFun2 @(BazSym1 (d :: Nat))) (SBaz (sing @d))
+    instance (SingI d, SingI d) =>
+             SingI (BazSym2 (d :: Nat) (d :: Nat) :: (~>) Nat Baz) where
+      sing
+        = (singFun1 @(BazSym2 (d :: Nat) (d :: Nat)))
+            ((SBaz (sing @d)) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/BadBoundedDeriving.ghc88.template b/tests/compile-and-dump/Singletons/BadBoundedDeriving.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/BadBoundedDeriving.ghc88.template
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Singletons/BadBoundedDeriving.hs:0:0: error:
-    Can't derive Bounded instance for Foo_0 a_1.
-  |
-5 | $(singletons [d|
-  |   ^^^^^^^^^^^^^^...
diff --git a/tests/compile-and-dump/Singletons/BadBoundedDeriving.golden b/tests/compile-and-dump/Singletons/BadBoundedDeriving.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/BadBoundedDeriving.golden
@@ -0,0 +1,6 @@
+
+Singletons/BadBoundedDeriving.hs:0:0: error:
+    Can't derive Bounded instance for Foo_0 a_1.
+  |
+5 | $(singletons [d|
+  |   ^^^^^^^^^^^^^^...
diff --git a/tests/compile-and-dump/Singletons/BadEnumDeriving.ghc88.template b/tests/compile-and-dump/Singletons/BadEnumDeriving.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/BadEnumDeriving.ghc88.template
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Singletons/BadEnumDeriving.hs:0:0: error:
-    Can't derive Enum instance for Foo_0 a_1.
-  |
-5 | $(singletons [d|
-  |   ^^^^^^^^^^^^^^...
diff --git a/tests/compile-and-dump/Singletons/BadEnumDeriving.golden b/tests/compile-and-dump/Singletons/BadEnumDeriving.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/BadEnumDeriving.golden
@@ -0,0 +1,6 @@
+
+Singletons/BadEnumDeriving.hs:0:0: error:
+    Can't derive Enum instance for Foo_0 a_1.
+  |
+5 | $(singletons [d|
+  |   ^^^^^^^^^^^^^^...
diff --git a/tests/compile-and-dump/Singletons/BoundedDeriving.ghc88.template b/tests/compile-and-dump/Singletons/BoundedDeriving.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/BoundedDeriving.ghc88.template
+++ /dev/null
@@ -1,242 +0,0 @@
-Singletons/BoundedDeriving.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| data Foo1
-            = Foo1
-            deriving Bounded
-          data Foo2
-            = A | B | C | D | E
-            deriving Bounded
-          data Foo3 a
-            = Foo3 a
-            deriving Bounded
-          data Foo4 (a :: Type) (b :: Type)
-            = Foo41 | Foo42
-            deriving Bounded
-          data Pair
-            = Pair Bool Bool
-            deriving Bounded |]
-  ======>
-    data Foo1
-      = Foo1
-      deriving Bounded
-    data Foo2
-      = A | B | C | D | E
-      deriving Bounded
-    data Foo3 a
-      = Foo3 a
-      deriving Bounded
-    data Foo4 (a :: Type) (b :: Type)
-      = Foo41 | Foo42
-      deriving Bounded
-    data Pair
-      = Pair Bool Bool
-      deriving Bounded
-    type Foo1Sym0 = Foo1
-    type ASym0 = A
-    type BSym0 = B
-    type CSym0 = C
-    type DSym0 = D
-    type ESym0 = E
-    type Foo3Sym1 (t0123456789876543210 :: a0123456789876543210) =
-        Foo3 t0123456789876543210
-    instance SuppressUnusedWarnings Foo3Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo3Sym0KindInference) ())
-    data Foo3Sym0 :: forall a0123456789876543210.
-                     (~>) a0123456789876543210 (Foo3 a0123456789876543210)
-      where
-        Foo3Sym0KindInference :: forall t0123456789876543210
-                                        arg. SameKind (Apply Foo3Sym0 arg) (Foo3Sym1 arg) =>
-                                 Foo3Sym0 t0123456789876543210
-    type instance Apply Foo3Sym0 t0123456789876543210 = Foo3 t0123456789876543210
-    type Foo41Sym0 = Foo41
-    type Foo42Sym0 = Foo42
-    type PairSym2 (t0123456789876543210 :: Bool) (t0123456789876543210 :: Bool) =
-        Pair t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (PairSym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) PairSym1KindInference) ())
-    data PairSym1 (t0123456789876543210 :: Bool) :: (~>) Bool Pair
-      where
-        PairSym1KindInference :: forall t0123456789876543210
-                                        t0123456789876543210
-                                        arg. SameKind (Apply (PairSym1 t0123456789876543210) arg) (PairSym2 t0123456789876543210 arg) =>
-                                 PairSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (PairSym1 t0123456789876543210) t0123456789876543210 = Pair t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings PairSym0 where
-      suppressUnusedWarnings = snd (((,) PairSym0KindInference) ())
-    data PairSym0 :: (~>) Bool ((~>) Bool Pair)
-      where
-        PairSym0KindInference :: forall t0123456789876543210
-                                        arg. SameKind (Apply PairSym0 arg) (PairSym1 arg) =>
-                                 PairSym0 t0123456789876543210
-    type instance Apply PairSym0 t0123456789876543210 = PairSym1 t0123456789876543210
-    type family MinBound_0123456789876543210 :: Foo1 where
-      MinBound_0123456789876543210 = Foo1Sym0
-    type MinBound_0123456789876543210Sym0 =
-        MinBound_0123456789876543210
-    type family MaxBound_0123456789876543210 :: Foo1 where
-      MaxBound_0123456789876543210 = Foo1Sym0
-    type MaxBound_0123456789876543210Sym0 =
-        MaxBound_0123456789876543210
-    instance PBounded Foo1 where
-      type MinBound = MinBound_0123456789876543210Sym0
-      type MaxBound = MaxBound_0123456789876543210Sym0
-    type family MinBound_0123456789876543210 :: Foo2 where
-      MinBound_0123456789876543210 = ASym0
-    type MinBound_0123456789876543210Sym0 =
-        MinBound_0123456789876543210
-    type family MaxBound_0123456789876543210 :: Foo2 where
-      MaxBound_0123456789876543210 = ESym0
-    type MaxBound_0123456789876543210Sym0 =
-        MaxBound_0123456789876543210
-    instance PBounded Foo2 where
-      type MinBound = MinBound_0123456789876543210Sym0
-      type MaxBound = MaxBound_0123456789876543210Sym0
-    type family MinBound_0123456789876543210 :: Foo3 a where
-      MinBound_0123456789876543210 = Apply Foo3Sym0 MinBoundSym0
-    type MinBound_0123456789876543210Sym0 =
-        MinBound_0123456789876543210
-    type family MaxBound_0123456789876543210 :: Foo3 a where
-      MaxBound_0123456789876543210 = Apply Foo3Sym0 MaxBoundSym0
-    type MaxBound_0123456789876543210Sym0 =
-        MaxBound_0123456789876543210
-    instance PBounded (Foo3 a) where
-      type MinBound = MinBound_0123456789876543210Sym0
-      type MaxBound = MaxBound_0123456789876543210Sym0
-    type family MinBound_0123456789876543210 :: Foo4 a b where
-      MinBound_0123456789876543210 = Foo41Sym0
-    type MinBound_0123456789876543210Sym0 =
-        MinBound_0123456789876543210
-    type family MaxBound_0123456789876543210 :: Foo4 a b where
-      MaxBound_0123456789876543210 = Foo42Sym0
-    type MaxBound_0123456789876543210Sym0 =
-        MaxBound_0123456789876543210
-    instance PBounded (Foo4 a b) where
-      type MinBound = MinBound_0123456789876543210Sym0
-      type MaxBound = MaxBound_0123456789876543210Sym0
-    type family MinBound_0123456789876543210 :: Pair where
-      MinBound_0123456789876543210 = Apply (Apply PairSym0 MinBoundSym0) MinBoundSym0
-    type MinBound_0123456789876543210Sym0 =
-        MinBound_0123456789876543210
-    type family MaxBound_0123456789876543210 :: Pair where
-      MaxBound_0123456789876543210 = Apply (Apply PairSym0 MaxBoundSym0) MaxBoundSym0
-    type MaxBound_0123456789876543210Sym0 =
-        MaxBound_0123456789876543210
-    instance PBounded Pair where
-      type MinBound = MinBound_0123456789876543210Sym0
-      type MaxBound = MaxBound_0123456789876543210Sym0
-    data SFoo1 :: Foo1 -> Type where SFoo1 :: SFoo1 Foo1
-    type instance Sing @Foo1 = SFoo1
-    instance SingKind Foo1 where
-      type Demote Foo1 = Foo1
-      fromSing SFoo1 = Foo1
-      toSing Foo1 = SomeSing SFoo1
-    data SFoo2 :: Foo2 -> Type
-      where
-        SA :: SFoo2 A
-        SB :: SFoo2 B
-        SC :: SFoo2 C
-        SD :: SFoo2 D
-        SE :: SFoo2 E
-    type instance Sing @Foo2 = SFoo2
-    instance SingKind Foo2 where
-      type Demote Foo2 = Foo2
-      fromSing SA = A
-      fromSing SB = B
-      fromSing SC = C
-      fromSing SD = D
-      fromSing SE = E
-      toSing A = SomeSing SA
-      toSing B = SomeSing SB
-      toSing C = SomeSing SC
-      toSing D = SomeSing SD
-      toSing E = SomeSing SE
-    data SFoo3 :: forall a. Foo3 a -> Type
-      where SFoo3 :: forall a (n :: a). (Sing (n :: a)) -> SFoo3 (Foo3 n)
-    type instance Sing @(Foo3 a) = SFoo3
-    instance SingKind a => SingKind (Foo3 a) where
-      type Demote (Foo3 a) = Foo3 (Demote a)
-      fromSing (SFoo3 b) = Foo3 (fromSing b)
-      toSing (Foo3 (b :: Demote a))
-        = case toSing b :: SomeSing a of {
-            SomeSing c -> SomeSing (SFoo3 c) }
-    data SFoo4 :: forall a b. Foo4 a b -> Type
-      where
-        SFoo41 :: SFoo4 Foo41
-        SFoo42 :: SFoo4 Foo42
-    type instance Sing @(Foo4 a b) = SFoo4
-    instance (SingKind a, SingKind b) => SingKind (Foo4 a b) where
-      type Demote (Foo4 a b) = Foo4 (Demote a) (Demote b)
-      fromSing SFoo41 = Foo41
-      fromSing SFoo42 = Foo42
-      toSing Foo41 = SomeSing SFoo41
-      toSing Foo42 = SomeSing SFoo42
-    data SPair :: Pair -> Type
-      where
-        SPair :: forall (n :: Bool) (n :: Bool).
-                 (Sing (n :: Bool)) -> (Sing (n :: Bool)) -> SPair (Pair n n)
-    type instance Sing @Pair = SPair
-    instance SingKind Pair where
-      type Demote Pair = Pair
-      fromSing (SPair b b) = (Pair (fromSing b)) (fromSing b)
-      toSing (Pair (b :: Demote Bool) (b :: Demote Bool))
-        = case
-              ((,) (toSing b :: SomeSing Bool)) (toSing b :: SomeSing Bool)
-          of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SPair c) c) }
-    instance SBounded Foo1 where
-      sMinBound :: Sing (MinBoundSym0 :: Foo1)
-      sMaxBound :: Sing (MaxBoundSym0 :: Foo1)
-      sMinBound = SFoo1
-      sMaxBound = SFoo1
-    instance SBounded Foo2 where
-      sMinBound :: Sing (MinBoundSym0 :: Foo2)
-      sMaxBound :: Sing (MaxBoundSym0 :: Foo2)
-      sMinBound = SA
-      sMaxBound = SE
-    instance SBounded a => SBounded (Foo3 a) where
-      sMinBound :: Sing (MinBoundSym0 :: Foo3 a)
-      sMaxBound :: Sing (MaxBoundSym0 :: Foo3 a)
-      sMinBound = (applySing ((singFun1 @Foo3Sym0) SFoo3)) sMinBound
-      sMaxBound = (applySing ((singFun1 @Foo3Sym0) SFoo3)) sMaxBound
-    instance SBounded (Foo4 a b) where
-      sMinBound :: Sing (MinBoundSym0 :: Foo4 a b)
-      sMaxBound :: Sing (MaxBoundSym0 :: Foo4 a b)
-      sMinBound = SFoo41
-      sMaxBound = SFoo42
-    instance SBounded Bool => SBounded Pair where
-      sMinBound :: Sing (MinBoundSym0 :: Pair)
-      sMaxBound :: Sing (MaxBoundSym0 :: Pair)
-      sMinBound
-        = (applySing ((applySing ((singFun2 @PairSym0) SPair)) sMinBound))
-            sMinBound
-      sMaxBound
-        = (applySing ((applySing ((singFun2 @PairSym0) SPair)) sMaxBound))
-            sMaxBound
-    instance SingI Foo1 where
-      sing = SFoo1
-    instance SingI A where
-      sing = SA
-    instance SingI B where
-      sing = SB
-    instance SingI C where
-      sing = SC
-    instance SingI D where
-      sing = SD
-    instance SingI E where
-      sing = SE
-    instance SingI n => SingI (Foo3 (n :: a)) where
-      sing = SFoo3 sing
-    instance SingI (Foo3Sym0 :: (~>) a (Foo3 a)) where
-      sing = (singFun1 @Foo3Sym0) SFoo3
-    instance SingI Foo41 where
-      sing = SFoo41
-    instance SingI Foo42 where
-      sing = SFoo42
-    instance (SingI n, SingI n) =>
-             SingI (Pair (n :: Bool) (n :: Bool)) where
-      sing = (SPair sing) sing
-    instance SingI (PairSym0 :: (~>) Bool ((~>) Bool Pair)) where
-      sing = (singFun2 @PairSym0) SPair
-    instance SingI d =>
-             SingI (PairSym1 (d :: Bool) :: (~>) Bool Pair) where
-      sing = (singFun1 @(PairSym1 (d :: Bool))) (SPair (sing @d))
diff --git a/tests/compile-and-dump/Singletons/BoundedDeriving.golden b/tests/compile-and-dump/Singletons/BoundedDeriving.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/BoundedDeriving.golden
@@ -0,0 +1,253 @@
+Singletons/BoundedDeriving.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| data Foo1
+            = Foo1
+            deriving Bounded
+          data Foo2
+            = A | B | C | D | E
+            deriving Bounded
+          data Foo3 a
+            = Foo3 a
+            deriving Bounded
+          data Foo4 (a :: Type) (b :: Type)
+            = Foo41 | Foo42
+            deriving Bounded
+          data Pair
+            = Pair Bool Bool
+            deriving Bounded |]
+  ======>
+    data Foo1
+      = Foo1
+      deriving Bounded
+    data Foo2
+      = A | B | C | D | E
+      deriving Bounded
+    data Foo3 a
+      = Foo3 a
+      deriving Bounded
+    data Foo4 (a :: Type) (b :: Type)
+      = Foo41 | Foo42
+      deriving Bounded
+    data Pair
+      = Pair Bool Bool
+      deriving Bounded
+    type Foo1Sym0 = Foo1 :: Foo1
+    type ASym0 = A :: Foo2
+    type BSym0 = B :: Foo2
+    type CSym0 = C :: Foo2
+    type DSym0 = D :: Foo2
+    type ESym0 = E :: Foo2
+    type Foo3Sym0 :: forall a. (~>) a (Foo3 a)
+    data Foo3Sym0 a0123456789876543210
+      where
+        Foo3Sym0KindInference :: SameKind (Apply Foo3Sym0 arg) (Foo3Sym1 arg) =>
+                                 Foo3Sym0 a0123456789876543210
+    type instance Apply Foo3Sym0 a0123456789876543210 = Foo3Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo3Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo3Sym0KindInference) ())
+    type Foo3Sym1 (a0123456789876543210 :: a) =
+        Foo3 a0123456789876543210 :: Foo3 a
+    type Foo41Sym0 = Foo41 :: Foo4 (a :: Type) (b :: Type)
+    type Foo42Sym0 = Foo42 :: Foo4 (a :: Type) (b :: Type)
+    type PairSym0 :: (~>) Bool ((~>) Bool Pair)
+    data PairSym0 a0123456789876543210
+      where
+        PairSym0KindInference :: SameKind (Apply PairSym0 arg) (PairSym1 arg) =>
+                                 PairSym0 a0123456789876543210
+    type instance Apply PairSym0 a0123456789876543210 = PairSym1 a0123456789876543210
+    instance SuppressUnusedWarnings PairSym0 where
+      suppressUnusedWarnings = snd (((,) PairSym0KindInference) ())
+    type PairSym1 :: Bool -> (~>) Bool Pair
+    data PairSym1 a0123456789876543210 a0123456789876543210
+      where
+        PairSym1KindInference :: SameKind (Apply (PairSym1 a0123456789876543210) arg) (PairSym2 a0123456789876543210 arg) =>
+                                 PairSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (PairSym1 a0123456789876543210) a0123456789876543210 = PairSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (PairSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) PairSym1KindInference) ())
+    type PairSym2 (a0123456789876543210 :: Bool) (a0123456789876543210 :: Bool) =
+        Pair a0123456789876543210 a0123456789876543210 :: Pair
+    type MinBound_0123456789876543210 :: Foo1
+    type family MinBound_0123456789876543210 where
+      MinBound_0123456789876543210 = Foo1Sym0
+    type MinBound_0123456789876543210Sym0 =
+        MinBound_0123456789876543210 :: Foo1
+    type MaxBound_0123456789876543210 :: Foo1
+    type family MaxBound_0123456789876543210 where
+      MaxBound_0123456789876543210 = Foo1Sym0
+    type MaxBound_0123456789876543210Sym0 =
+        MaxBound_0123456789876543210 :: Foo1
+    instance PBounded Foo1 where
+      type MinBound = MinBound_0123456789876543210Sym0
+      type MaxBound = MaxBound_0123456789876543210Sym0
+    type MinBound_0123456789876543210 :: Foo2
+    type family MinBound_0123456789876543210 where
+      MinBound_0123456789876543210 = ASym0
+    type MinBound_0123456789876543210Sym0 =
+        MinBound_0123456789876543210 :: Foo2
+    type MaxBound_0123456789876543210 :: Foo2
+    type family MaxBound_0123456789876543210 where
+      MaxBound_0123456789876543210 = ESym0
+    type MaxBound_0123456789876543210Sym0 =
+        MaxBound_0123456789876543210 :: Foo2
+    instance PBounded Foo2 where
+      type MinBound = MinBound_0123456789876543210Sym0
+      type MaxBound = MaxBound_0123456789876543210Sym0
+    type MinBound_0123456789876543210 :: Foo3 a
+    type family MinBound_0123456789876543210 where
+      MinBound_0123456789876543210 = Apply Foo3Sym0 MinBoundSym0
+    type MinBound_0123456789876543210Sym0 =
+        MinBound_0123456789876543210 :: Foo3 a
+    type MaxBound_0123456789876543210 :: Foo3 a
+    type family MaxBound_0123456789876543210 where
+      MaxBound_0123456789876543210 = Apply Foo3Sym0 MaxBoundSym0
+    type MaxBound_0123456789876543210Sym0 =
+        MaxBound_0123456789876543210 :: Foo3 a
+    instance PBounded (Foo3 a) where
+      type MinBound = MinBound_0123456789876543210Sym0
+      type MaxBound = MaxBound_0123456789876543210Sym0
+    type MinBound_0123456789876543210 :: Foo4 a b
+    type family MinBound_0123456789876543210 where
+      MinBound_0123456789876543210 = Foo41Sym0
+    type MinBound_0123456789876543210Sym0 =
+        MinBound_0123456789876543210 :: Foo4 a b
+    type MaxBound_0123456789876543210 :: Foo4 a b
+    type family MaxBound_0123456789876543210 where
+      MaxBound_0123456789876543210 = Foo42Sym0
+    type MaxBound_0123456789876543210Sym0 =
+        MaxBound_0123456789876543210 :: Foo4 a b
+    instance PBounded (Foo4 a b) where
+      type MinBound = MinBound_0123456789876543210Sym0
+      type MaxBound = MaxBound_0123456789876543210Sym0
+    type MinBound_0123456789876543210 :: Pair
+    type family MinBound_0123456789876543210 where
+      MinBound_0123456789876543210 = Apply (Apply PairSym0 MinBoundSym0) MinBoundSym0
+    type MinBound_0123456789876543210Sym0 =
+        MinBound_0123456789876543210 :: Pair
+    type MaxBound_0123456789876543210 :: Pair
+    type family MaxBound_0123456789876543210 where
+      MaxBound_0123456789876543210 = Apply (Apply PairSym0 MaxBoundSym0) MaxBoundSym0
+    type MaxBound_0123456789876543210Sym0 =
+        MaxBound_0123456789876543210 :: Pair
+    instance PBounded Pair where
+      type MinBound = MinBound_0123456789876543210Sym0
+      type MaxBound = MaxBound_0123456789876543210Sym0
+    data SFoo1 :: Foo1 -> Type where SFoo1 :: SFoo1 (Foo1 :: Foo1)
+    type instance Sing @Foo1 = SFoo1
+    instance SingKind Foo1 where
+      type Demote Foo1 = Foo1
+      fromSing SFoo1 = Foo1
+      toSing Foo1 = SomeSing SFoo1
+    data SFoo2 :: Foo2 -> Type
+      where
+        SA :: SFoo2 (A :: Foo2)
+        SB :: SFoo2 (B :: Foo2)
+        SC :: SFoo2 (C :: Foo2)
+        SD :: SFoo2 (D :: Foo2)
+        SE :: SFoo2 (E :: Foo2)
+    type instance Sing @Foo2 = SFoo2
+    instance SingKind Foo2 where
+      type Demote Foo2 = Foo2
+      fromSing SA = A
+      fromSing SB = B
+      fromSing SC = C
+      fromSing SD = D
+      fromSing SE = E
+      toSing A = SomeSing SA
+      toSing B = SomeSing SB
+      toSing C = SomeSing SC
+      toSing D = SomeSing SD
+      toSing E = SomeSing SE
+    data SFoo3 :: forall a. Foo3 a -> Type
+      where
+        SFoo3 :: forall a (n :: a). (Sing n) -> SFoo3 (Foo3 n :: Foo3 a)
+    type instance Sing @(Foo3 a) = SFoo3
+    instance SingKind a => SingKind (Foo3 a) where
+      type Demote (Foo3 a) = Foo3 (Demote a)
+      fromSing (SFoo3 b) = Foo3 (fromSing b)
+      toSing (Foo3 (b :: Demote a))
+        = case toSing b :: SomeSing a of {
+            SomeSing c -> SomeSing (SFoo3 c) }
+    data SFoo4 :: forall a b. Foo4 (a :: Type) (b :: Type) -> Type
+      where
+        SFoo41 :: forall (a :: Type) (b :: Type).
+                  SFoo4 (Foo41 :: Foo4 (a :: Type) (b :: Type))
+        SFoo42 :: forall (a :: Type) (b :: Type).
+                  SFoo4 (Foo42 :: Foo4 (a :: Type) (b :: Type))
+    type instance Sing @(Foo4 a b) = SFoo4
+    instance (SingKind a, SingKind b) => SingKind (Foo4 a b) where
+      type Demote (Foo4 a b) = Foo4 (Demote a) (Demote b)
+      fromSing SFoo41 = Foo41
+      fromSing SFoo42 = Foo42
+      toSing Foo41 = SomeSing SFoo41
+      toSing Foo42 = SomeSing SFoo42
+    data SPair :: Pair -> Type
+      where
+        SPair :: forall (n :: Bool) (n :: Bool).
+                 (Sing n) -> (Sing n) -> SPair (Pair n n :: Pair)
+    type instance Sing @Pair = SPair
+    instance SingKind Pair where
+      type Demote Pair = Pair
+      fromSing (SPair b b) = (Pair (fromSing b)) (fromSing b)
+      toSing (Pair (b :: Demote Bool) (b :: Demote Bool))
+        = case
+              ((,) (toSing b :: SomeSing Bool)) (toSing b :: SomeSing Bool)
+          of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SPair c) c) }
+    instance SBounded Foo1 where
+      sMinBound :: Sing (MinBoundSym0 :: Foo1)
+      sMaxBound :: Sing (MaxBoundSym0 :: Foo1)
+      sMinBound = SFoo1
+      sMaxBound = SFoo1
+    instance SBounded Foo2 where
+      sMinBound :: Sing (MinBoundSym0 :: Foo2)
+      sMaxBound :: Sing (MaxBoundSym0 :: Foo2)
+      sMinBound = SA
+      sMaxBound = SE
+    instance SBounded a => SBounded (Foo3 a) where
+      sMinBound :: Sing (MinBoundSym0 :: Foo3 a)
+      sMaxBound :: Sing (MaxBoundSym0 :: Foo3 a)
+      sMinBound = (applySing ((singFun1 @Foo3Sym0) SFoo3)) sMinBound
+      sMaxBound = (applySing ((singFun1 @Foo3Sym0) SFoo3)) sMaxBound
+    instance SBounded (Foo4 a b) where
+      sMinBound :: Sing (MinBoundSym0 :: Foo4 a b)
+      sMaxBound :: Sing (MaxBoundSym0 :: Foo4 a b)
+      sMinBound = SFoo41
+      sMaxBound = SFoo42
+    instance SBounded Bool => SBounded Pair where
+      sMinBound :: Sing (MinBoundSym0 :: Pair)
+      sMaxBound :: Sing (MaxBoundSym0 :: Pair)
+      sMinBound
+        = (applySing ((applySing ((singFun2 @PairSym0) SPair)) sMinBound))
+            sMinBound
+      sMaxBound
+        = (applySing ((applySing ((singFun2 @PairSym0) SPair)) sMaxBound))
+            sMaxBound
+    instance SingI Foo1 where
+      sing = SFoo1
+    instance SingI A where
+      sing = SA
+    instance SingI B where
+      sing = SB
+    instance SingI C where
+      sing = SC
+    instance SingI D where
+      sing = SD
+    instance SingI E where
+      sing = SE
+    instance SingI n => SingI (Foo3 (n :: a)) where
+      sing = SFoo3 sing
+    instance SingI (Foo3Sym0 :: (~>) a (Foo3 a)) where
+      sing = (singFun1 @Foo3Sym0) SFoo3
+    instance SingI Foo41 where
+      sing = SFoo41
+    instance SingI Foo42 where
+      sing = SFoo42
+    instance (SingI n, SingI n) =>
+             SingI (Pair (n :: Bool) (n :: Bool)) where
+      sing = (SPair sing) sing
+    instance SingI (PairSym0 :: (~>) Bool ((~>) Bool Pair)) where
+      sing = (singFun2 @PairSym0) SPair
+    instance SingI d =>
+             SingI (PairSym1 (d :: Bool) :: (~>) Bool Pair) where
+      sing = (singFun1 @(PairSym1 (d :: Bool))) (SPair (sing @d))
diff --git a/tests/compile-and-dump/Singletons/BoxUnBox.ghc88.template b/tests/compile-and-dump/Singletons/BoxUnBox.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/BoxUnBox.ghc88.template
+++ /dev/null
@@ -1,52 +0,0 @@
-Singletons/BoxUnBox.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| unBox :: Box a -> a
-          unBox (FBox a) = a
-          
-          data Box a = FBox a |]
-  ======>
-    data Box a = FBox a
-    unBox :: Box a -> a
-    unBox (FBox a) = a
-    type FBoxSym1 (t0123456789876543210 :: a0123456789876543210) =
-        FBox t0123456789876543210
-    instance SuppressUnusedWarnings FBoxSym0 where
-      suppressUnusedWarnings = snd (((,) FBoxSym0KindInference) ())
-    data FBoxSym0 :: forall a0123456789876543210.
-                     (~>) a0123456789876543210 (Box a0123456789876543210)
-      where
-        FBoxSym0KindInference :: forall t0123456789876543210
-                                        arg. SameKind (Apply FBoxSym0 arg) (FBoxSym1 arg) =>
-                                 FBoxSym0 t0123456789876543210
-    type instance Apply FBoxSym0 t0123456789876543210 = FBox t0123456789876543210
-    type UnBoxSym1 (a0123456789876543210 :: Box a0123456789876543210) =
-        UnBox a0123456789876543210
-    instance SuppressUnusedWarnings UnBoxSym0 where
-      suppressUnusedWarnings = snd (((,) UnBoxSym0KindInference) ())
-    data UnBoxSym0 :: forall a0123456789876543210.
-                      (~>) (Box a0123456789876543210) a0123456789876543210
-      where
-        UnBoxSym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply UnBoxSym0 arg) (UnBoxSym1 arg) =>
-                                  UnBoxSym0 a0123456789876543210
-    type instance Apply UnBoxSym0 a0123456789876543210 = UnBox a0123456789876543210
-    type family UnBox (a :: Box a) :: a where
-      UnBox (FBox a) = a
-    sUnBox ::
-      forall a (t :: Box a). Sing t -> Sing (Apply UnBoxSym0 t :: a)
-    sUnBox (SFBox (sA :: Sing a)) = sA
-    instance SingI (UnBoxSym0 :: (~>) (Box a) a) where
-      sing = (singFun1 @UnBoxSym0) sUnBox
-    data SBox :: forall a. Box a -> GHC.Types.Type
-      where SFBox :: forall a (n :: a). (Sing (n :: a)) -> SBox (FBox n)
-    type instance Sing @(Box a) = SBox
-    instance SingKind a => SingKind (Box a) where
-      type Demote (Box a) = Box (Demote a)
-      fromSing (SFBox b) = FBox (fromSing b)
-      toSing (FBox (b :: Demote a))
-        = case toSing b :: SomeSing a of {
-            SomeSing c -> SomeSing (SFBox c) }
-    instance SingI n => SingI (FBox (n :: a)) where
-      sing = SFBox sing
-    instance SingI (FBoxSym0 :: (~>) a (Box a)) where
-      sing = (singFun1 @FBoxSym0) SFBox
diff --git a/tests/compile-and-dump/Singletons/BoxUnBox.golden b/tests/compile-and-dump/Singletons/BoxUnBox.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/BoxUnBox.golden
@@ -0,0 +1,52 @@
+Singletons/BoxUnBox.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| unBox :: Box a -> a
+          unBox (FBox a) = a
+          
+          data Box a = FBox a |]
+  ======>
+    data Box a = FBox a
+    unBox :: Box a -> a
+    unBox (FBox a) = a
+    type FBoxSym0 :: forall a. (~>) a (Box a)
+    data FBoxSym0 a0123456789876543210
+      where
+        FBoxSym0KindInference :: SameKind (Apply FBoxSym0 arg) (FBoxSym1 arg) =>
+                                 FBoxSym0 a0123456789876543210
+    type instance Apply FBoxSym0 a0123456789876543210 = FBoxSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FBoxSym0 where
+      suppressUnusedWarnings = snd (((,) FBoxSym0KindInference) ())
+    type FBoxSym1 (a0123456789876543210 :: a) =
+        FBox a0123456789876543210 :: Box a
+    type UnBoxSym0 :: (~>) (Box a) a
+    data UnBoxSym0 a0123456789876543210
+      where
+        UnBoxSym0KindInference :: SameKind (Apply UnBoxSym0 arg) (UnBoxSym1 arg) =>
+                                  UnBoxSym0 a0123456789876543210
+    type instance Apply UnBoxSym0 a0123456789876543210 = UnBoxSym1 a0123456789876543210
+    instance SuppressUnusedWarnings UnBoxSym0 where
+      suppressUnusedWarnings = snd (((,) UnBoxSym0KindInference) ())
+    type UnBoxSym1 (a0123456789876543210 :: Box a) =
+        UnBox a0123456789876543210 :: a
+    type UnBox :: Box a -> a
+    type family UnBox a where
+      UnBox (FBox a) = a
+    sUnBox ::
+      forall a (t :: Box a). Sing t -> Sing (Apply UnBoxSym0 t :: a)
+    sUnBox (SFBox (sA :: Sing a)) = sA
+    instance SingI (UnBoxSym0 :: (~>) (Box a) a) where
+      sing = (singFun1 @UnBoxSym0) sUnBox
+    data SBox :: forall a. Box a -> GHC.Types.Type
+      where
+        SFBox :: forall a (n :: a). (Sing n) -> SBox (FBox n :: Box a)
+    type instance Sing @(Box a) = SBox
+    instance SingKind a => SingKind (Box a) where
+      type Demote (Box a) = Box (Demote a)
+      fromSing (SFBox b) = FBox (fromSing b)
+      toSing (FBox (b :: Demote a))
+        = case toSing b :: SomeSing a of {
+            SomeSing c -> SomeSing (SFBox c) }
+    instance SingI n => SingI (FBox (n :: a)) where
+      sing = SFBox sing
+    instance SingI (FBoxSym0 :: (~>) a (Box a)) where
+      sing = (singFun1 @FBoxSym0) SFBox
diff --git a/tests/compile-and-dump/Singletons/CaseExpressions.ghc88.template b/tests/compile-and-dump/Singletons/CaseExpressions.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/CaseExpressions.ghc88.template
+++ /dev/null
@@ -1,324 +0,0 @@
-Singletons/CaseExpressions.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| foo1 :: a -> Maybe a -> a
-          foo1 d x
-            = case x of
-                Just y -> y
-                Nothing -> d
-          foo2 :: a -> Maybe a -> a
-          foo2 d _ = case (Just d) of { Just y -> y }
-          foo3 :: a -> b -> a
-          foo3 a b = case (a, b) of { (p, _) -> p }
-          foo4 :: forall a. a -> a
-          foo4 x
-            = case x of {
-                y -> let
-                       z :: a
-                       z = y
-                     in z }
-          foo5 :: a -> a
-          foo5 x = case x of { y -> (\ _ -> x) y } |]
-  ======>
-    foo1 :: a -> Maybe a -> a
-    foo1 d x
-      = case x of
-          Just y -> y
-          Nothing -> d
-    foo2 :: a -> Maybe a -> a
-    foo2 d _ = case Just d of { Just y -> y }
-    foo3 :: a -> b -> a
-    foo3 a b = case (a, b) of { (p, _) -> p }
-    foo4 :: forall a. a -> a
-    foo4 x
-      = case x of {
-          y -> let
-                 z :: a
-                 z = y
-               in z }
-    foo5 :: a -> a
-    foo5 x = case x of { y -> (\ _ -> x) y }
-    type family Case_0123456789876543210 arg_0123456789876543210 y x t where
-      Case_0123456789876543210 arg_0123456789876543210 y x _ = x
-    type family Lambda_0123456789876543210 y x t where
-      Lambda_0123456789876543210 y x arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 y x arg_0123456789876543210
-    type Lambda_0123456789876543210Sym3 y0123456789876543210 x0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 y0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall y0123456789876543210
-                                                              x0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210) arg) (Lambda_0123456789876543210Sym3 y0123456789876543210 x0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 x0123456789876543210 y0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 y0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 y0123456789876543210 x0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall y0123456789876543210
-                                                              x0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 y0123456789876543210) arg) (Lambda_0123456789876543210Sym2 y0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 y0123456789876543210 x0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 y0123456789876543210) x0123456789876543210 = Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 y0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall y0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 y0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 y0123456789876543210 = Lambda_0123456789876543210Sym1 y0123456789876543210
-    type family Case_0123456789876543210 x t where
-      Case_0123456789876543210 x y = Apply (Apply (Apply Lambda_0123456789876543210Sym0 y) x) y
-    type Let0123456789876543210ZSym2 y0123456789876543210 x0123456789876543210 =
-        Let0123456789876543210Z y0123456789876543210 x0123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210ZSym1 y0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210ZSym1KindInference) ())
-    data Let0123456789876543210ZSym1 y0123456789876543210 x0123456789876543210
-      where
-        Let0123456789876543210ZSym1KindInference :: forall y0123456789876543210
-                                                           x0123456789876543210
-                                                           arg. SameKind (Apply (Let0123456789876543210ZSym1 y0123456789876543210) arg) (Let0123456789876543210ZSym2 y0123456789876543210 arg) =>
-                                                    Let0123456789876543210ZSym1 y0123456789876543210 x0123456789876543210
-    type instance Apply (Let0123456789876543210ZSym1 y0123456789876543210) x0123456789876543210 = Let0123456789876543210Z y0123456789876543210 x0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210ZSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210ZSym0KindInference) ())
-    data Let0123456789876543210ZSym0 y0123456789876543210
-      where
-        Let0123456789876543210ZSym0KindInference :: forall y0123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210ZSym0 arg) (Let0123456789876543210ZSym1 arg) =>
-                                                    Let0123456789876543210ZSym0 y0123456789876543210
-    type instance Apply Let0123456789876543210ZSym0 y0123456789876543210 = Let0123456789876543210ZSym1 y0123456789876543210
-    type family Let0123456789876543210Z y x :: a where
-      Let0123456789876543210Z y x = y
-    type family Case_0123456789876543210 x t where
-      Case_0123456789876543210 x y = Let0123456789876543210ZSym2 y x
-    type Let0123456789876543210Scrutinee_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210 =
-        Let0123456789876543210Scrutinee_0123456789876543210 a0123456789876543210 b0123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210Scrutinee_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd
-            (((,)
-                Let0123456789876543210Scrutinee_0123456789876543210Sym1KindInference)
-               ())
-    data Let0123456789876543210Scrutinee_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210
-      where
-        Let0123456789876543210Scrutinee_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                                       b0123456789876543210
-                                                                                       arg. SameKind (Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym1 a0123456789876543210) arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210
-    type instance Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym1 a0123456789876543210) b0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210 a0123456789876543210 b0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210Scrutinee_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd
-            (((,)
-                Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference)
-               ())
-    data Let0123456789876543210Scrutinee_0123456789876543210Sym0 a0123456789876543210
-      where
-        Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                                       arg. SameKind (Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym1 arg) =>
-                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 a0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym1 a0123456789876543210
-    type family Let0123456789876543210Scrutinee_0123456789876543210 a b where
-      Let0123456789876543210Scrutinee_0123456789876543210 a b = Apply (Apply Tuple2Sym0 a) b
-    type family Case_0123456789876543210 a b t where
-      Case_0123456789876543210 a b '(p, _) = p
-    type Let0123456789876543210Scrutinee_0123456789876543210Sym1 d0123456789876543210 =
-        Let0123456789876543210Scrutinee_0123456789876543210 d0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210Scrutinee_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd
-            (((,)
-                Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference)
-               ())
-    data Let0123456789876543210Scrutinee_0123456789876543210Sym0 d0123456789876543210
-      where
-        Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference :: forall d0123456789876543210
-                                                                                       arg. SameKind (Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym1 arg) =>
-                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym0 d0123456789876543210
-    type instance Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 d0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210 d0123456789876543210
-    type family Let0123456789876543210Scrutinee_0123456789876543210 d where
-      Let0123456789876543210Scrutinee_0123456789876543210 d = Apply JustSym0 d
-    type family Case_0123456789876543210 d t where
-      Case_0123456789876543210 d ('Just y) = y
-    type family Case_0123456789876543210 d x t where
-      Case_0123456789876543210 d x ('Just y) = y
-      Case_0123456789876543210 d x 'Nothing = d
-    type Foo5Sym1 (a0123456789876543210 :: a0123456789876543210) =
-        Foo5 a0123456789876543210
-    instance SuppressUnusedWarnings Foo5Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo5Sym0KindInference) ())
-    data Foo5Sym0 :: forall a0123456789876543210.
-                     (~>) a0123456789876543210 a0123456789876543210
-      where
-        Foo5Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo5Sym0 arg) (Foo5Sym1 arg) =>
-                                 Foo5Sym0 a0123456789876543210
-    type instance Apply Foo5Sym0 a0123456789876543210 = Foo5 a0123456789876543210
-    type Foo4Sym1 (a0123456789876543210 :: a0123456789876543210) =
-        Foo4 a0123456789876543210
-    instance SuppressUnusedWarnings Foo4Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo4Sym0KindInference) ())
-    data Foo4Sym0 :: forall a0123456789876543210.
-                     (~>) a0123456789876543210 a0123456789876543210
-      where
-        Foo4Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo4Sym0 arg) (Foo4Sym1 arg) =>
-                                 Foo4Sym0 a0123456789876543210
-    type instance Apply Foo4Sym0 a0123456789876543210 = Foo4 a0123456789876543210
-    type Foo3Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: b0123456789876543210) =
-        Foo3 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Foo3Sym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) Foo3Sym1KindInference) ())
-    data Foo3Sym1 (a0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                    (~>) b0123456789876543210 a0123456789876543210
-      where
-        Foo3Sym1KindInference :: forall a0123456789876543210
-                                        a0123456789876543210
-                                        arg. SameKind (Apply (Foo3Sym1 a0123456789876543210) arg) (Foo3Sym2 a0123456789876543210 arg) =>
-                                 Foo3Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Foo3Sym1 a0123456789876543210) a0123456789876543210 = Foo3 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Foo3Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo3Sym0KindInference) ())
-    data Foo3Sym0 :: forall a0123456789876543210 b0123456789876543210.
-                     (~>) a0123456789876543210 ((~>) b0123456789876543210 a0123456789876543210)
-      where
-        Foo3Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo3Sym0 arg) (Foo3Sym1 arg) =>
-                                 Foo3Sym0 a0123456789876543210
-    type instance Apply Foo3Sym0 a0123456789876543210 = Foo3Sym1 a0123456789876543210
-    type Foo2Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: Maybe a0123456789876543210) =
-        Foo2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Foo2Sym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) Foo2Sym1KindInference) ())
-    data Foo2Sym1 (a0123456789876543210 :: a0123456789876543210) :: (~>) (Maybe a0123456789876543210) a0123456789876543210
-      where
-        Foo2Sym1KindInference :: forall a0123456789876543210
-                                        a0123456789876543210
-                                        arg. SameKind (Apply (Foo2Sym1 a0123456789876543210) arg) (Foo2Sym2 a0123456789876543210 arg) =>
-                                 Foo2Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Foo2Sym1 a0123456789876543210) a0123456789876543210 = Foo2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Foo2Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo2Sym0KindInference) ())
-    data Foo2Sym0 :: forall a0123456789876543210.
-                     (~>) a0123456789876543210 ((~>) (Maybe a0123456789876543210) a0123456789876543210)
-      where
-        Foo2Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo2Sym0 arg) (Foo2Sym1 arg) =>
-                                 Foo2Sym0 a0123456789876543210
-    type instance Apply Foo2Sym0 a0123456789876543210 = Foo2Sym1 a0123456789876543210
-    type Foo1Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: Maybe a0123456789876543210) =
-        Foo1 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Foo1Sym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) Foo1Sym1KindInference) ())
-    data Foo1Sym1 (a0123456789876543210 :: a0123456789876543210) :: (~>) (Maybe a0123456789876543210) a0123456789876543210
-      where
-        Foo1Sym1KindInference :: forall a0123456789876543210
-                                        a0123456789876543210
-                                        arg. SameKind (Apply (Foo1Sym1 a0123456789876543210) arg) (Foo1Sym2 a0123456789876543210 arg) =>
-                                 Foo1Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Foo1Sym1 a0123456789876543210) a0123456789876543210 = Foo1 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Foo1Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo1Sym0KindInference) ())
-    data Foo1Sym0 :: forall a0123456789876543210.
-                     (~>) a0123456789876543210 ((~>) (Maybe a0123456789876543210) a0123456789876543210)
-      where
-        Foo1Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo1Sym0 arg) (Foo1Sym1 arg) =>
-                                 Foo1Sym0 a0123456789876543210
-    type instance Apply Foo1Sym0 a0123456789876543210 = Foo1Sym1 a0123456789876543210
-    type family Foo5 (a :: a) :: a where
-      Foo5 x = Case_0123456789876543210 x x
-    type family Foo4 (a :: a) :: a where
-      Foo4 x = Case_0123456789876543210 x x
-    type family Foo3 (a :: a) (a :: b) :: a where
-      Foo3 a b = Case_0123456789876543210 a b (Let0123456789876543210Scrutinee_0123456789876543210Sym2 a b)
-    type family Foo2 (a :: a) (a :: Maybe a) :: a where
-      Foo2 d _ = Case_0123456789876543210 d (Let0123456789876543210Scrutinee_0123456789876543210Sym1 d)
-    type family Foo1 (a :: a) (a :: Maybe a) :: a where
-      Foo1 d x = Case_0123456789876543210 d x x
-    sFoo5 :: forall a (t :: a). Sing t -> Sing (Apply Foo5Sym0 t :: a)
-    sFoo4 :: forall a (t :: a). Sing t -> Sing (Apply Foo4Sym0 t :: a)
-    sFoo3 ::
-      forall a b (t :: a) (t :: b).
-      Sing t -> Sing t -> Sing (Apply (Apply Foo3Sym0 t) t :: a)
-    sFoo2 ::
-      forall a (t :: a) (t :: Maybe a).
-      Sing t -> Sing t -> Sing (Apply (Apply Foo2Sym0 t) t :: a)
-    sFoo1 ::
-      forall a (t :: a) (t :: Maybe a).
-      Sing t -> Sing t -> Sing (Apply (Apply Foo1Sym0 t) t :: a)
-    sFoo5 (sX :: Sing x)
-      = (id @(Sing (Case_0123456789876543210 x x :: a)))
-          (case sX of {
-             (sY :: Sing y)
-               -> (applySing
-                     ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 y) x))
-                        (\ sArg_0123456789876543210
-                           -> case sArg_0123456789876543210 of {
-                                (_ :: Sing arg_0123456789876543210)
-                                  -> (id
-                                        @(Sing (Case_0123456789876543210 arg_0123456789876543210 y x arg_0123456789876543210)))
-                                       (case sArg_0123456789876543210 of { _ -> sX }) })))
-                    sY })
-    sFoo4 (sX :: Sing x)
-      = (id @(Sing (Case_0123456789876543210 x x :: a)))
-          (case sX of {
-             (sY :: Sing y)
-               -> let
-                    sZ :: Sing (Let0123456789876543210ZSym2 y x :: a)
-                    sZ = sY
-                  in sZ })
-    sFoo3 (sA :: Sing a) (sB :: Sing b)
-      = let
-          sScrutinee_0123456789876543210 ::
-            Sing (Let0123456789876543210Scrutinee_0123456789876543210Sym2 a b)
-          sScrutinee_0123456789876543210
-            = (applySing ((applySing ((singFun2 @Tuple2Sym0) STuple2)) sA)) sB
-        in
-          (id
-             @(Sing (Case_0123456789876543210 a b (Let0123456789876543210Scrutinee_0123456789876543210Sym2 a b) :: a)))
-            (case sScrutinee_0123456789876543210 of {
-               STuple2 (sP :: Sing p) _ -> sP })
-    sFoo2 (sD :: Sing d) _
-      = let
-          sScrutinee_0123456789876543210 ::
-            Sing (Let0123456789876543210Scrutinee_0123456789876543210Sym1 d)
-          sScrutinee_0123456789876543210
-            = (applySing ((singFun1 @JustSym0) SJust)) sD
-        in
-          (id
-             @(Sing (Case_0123456789876543210 d (Let0123456789876543210Scrutinee_0123456789876543210Sym1 d) :: a)))
-            (case sScrutinee_0123456789876543210 of {
-               SJust (sY :: Sing y) -> sY })
-    sFoo1 (sD :: Sing d) (sX :: Sing x)
-      = (id @(Sing (Case_0123456789876543210 d x x :: a)))
-          (case sX of
-             SJust (sY :: Sing y) -> sY
-             SNothing -> sD)
-    instance SingI (Foo5Sym0 :: (~>) a a) where
-      sing = (singFun1 @Foo5Sym0) sFoo5
-    instance SingI (Foo4Sym0 :: (~>) a a) where
-      sing = (singFun1 @Foo4Sym0) sFoo4
-    instance SingI (Foo3Sym0 :: (~>) a ((~>) b a)) where
-      sing = (singFun2 @Foo3Sym0) sFoo3
-    instance SingI d => SingI (Foo3Sym1 (d :: a) :: (~>) b a) where
-      sing = (singFun1 @(Foo3Sym1 (d :: a))) (sFoo3 (sing @d))
-    instance SingI (Foo2Sym0 :: (~>) a ((~>) (Maybe a) a)) where
-      sing = (singFun2 @Foo2Sym0) sFoo2
-    instance SingI d =>
-             SingI (Foo2Sym1 (d :: a) :: (~>) (Maybe a) a) where
-      sing = (singFun1 @(Foo2Sym1 (d :: a))) (sFoo2 (sing @d))
-    instance SingI (Foo1Sym0 :: (~>) a ((~>) (Maybe a) a)) where
-      sing = (singFun2 @Foo1Sym0) sFoo1
-    instance SingI d =>
-             SingI (Foo1Sym1 (d :: a) :: (~>) (Maybe a) a) where
-      sing = (singFun1 @(Foo1Sym1 (d :: a))) (sFoo1 (sing @d))
diff --git a/tests/compile-and-dump/Singletons/CaseExpressions.golden b/tests/compile-and-dump/Singletons/CaseExpressions.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/CaseExpressions.golden
@@ -0,0 +1,307 @@
+Singletons/CaseExpressions.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| foo1 :: a -> Maybe a -> a
+          foo1 d x
+            = case x of
+                Just y -> y
+                Nothing -> d
+          foo2 :: a -> Maybe a -> a
+          foo2 d _ = case (Just d) of { Just y -> y }
+          foo3 :: a -> b -> a
+          foo3 a b = case (a, b) of { (p, _) -> p }
+          foo4 :: forall a. a -> a
+          foo4 x
+            = case x of {
+                y -> let
+                       z :: a
+                       z = y
+                     in z }
+          foo5 :: a -> a
+          foo5 x = case x of { y -> (\ _ -> x) y } |]
+  ======>
+    foo1 :: a -> Maybe a -> a
+    foo1 d x
+      = case x of
+          Just y -> y
+          Nothing -> d
+    foo2 :: a -> Maybe a -> a
+    foo2 d _ = case Just d of { Just y -> y }
+    foo3 :: a -> b -> a
+    foo3 a b = case (a, b) of { (p, _) -> p }
+    foo4 :: forall a. a -> a
+    foo4 x
+      = case x of {
+          y -> let
+                 z :: a
+                 z = y
+               in z }
+    foo5 :: a -> a
+    foo5 x = case x of { y -> (\ _ -> x) y }
+    type family Case_0123456789876543210 arg_0123456789876543210 y x t where
+      Case_0123456789876543210 arg_0123456789876543210 y x _ = x
+    type family Lambda_0123456789876543210 y x arg_0123456789876543210 where
+      Lambda_0123456789876543210 y x arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 y x arg_0123456789876543210
+    data Lambda_0123456789876543210Sym0 y0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 y0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 y0123456789876543210 = Lambda_0123456789876543210Sym1 y0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 y0123456789876543210 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 y0123456789876543210) arg) (Lambda_0123456789876543210Sym2 y0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 y0123456789876543210 x0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 y0123456789876543210) x0123456789876543210 = Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 y0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210 arg_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210) arg) (Lambda_0123456789876543210Sym3 y0123456789876543210 x0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210 arg_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210) arg_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 y0123456789876543210 x0123456789876543210 arg_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    type Lambda_0123456789876543210Sym3 y0123456789876543210 x0123456789876543210 arg_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 y0123456789876543210 x0123456789876543210 arg_01234567898765432100123456789876543210
+    type family Case_0123456789876543210 x t where
+      Case_0123456789876543210 x y = Apply (Apply (Apply Lambda_0123456789876543210Sym0 y) x) y
+    data Let0123456789876543210ZSym0 y0123456789876543210
+      where
+        Let0123456789876543210ZSym0KindInference :: SameKind (Apply Let0123456789876543210ZSym0 arg) (Let0123456789876543210ZSym1 arg) =>
+                                                    Let0123456789876543210ZSym0 y0123456789876543210
+    type instance Apply Let0123456789876543210ZSym0 y0123456789876543210 = Let0123456789876543210ZSym1 y0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210ZSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210ZSym0KindInference) ())
+    data Let0123456789876543210ZSym1 y0123456789876543210 x0123456789876543210
+      where
+        Let0123456789876543210ZSym1KindInference :: SameKind (Apply (Let0123456789876543210ZSym1 y0123456789876543210) arg) (Let0123456789876543210ZSym2 y0123456789876543210 arg) =>
+                                                    Let0123456789876543210ZSym1 y0123456789876543210 x0123456789876543210
+    type instance Apply (Let0123456789876543210ZSym1 y0123456789876543210) x0123456789876543210 = Let0123456789876543210ZSym2 y0123456789876543210 x0123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210ZSym1 y0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210ZSym1KindInference) ())
+    type Let0123456789876543210ZSym2 y0123456789876543210 x0123456789876543210 =
+        Let0123456789876543210Z y0123456789876543210 x0123456789876543210 :: a0123456789876543210
+    type family Let0123456789876543210Z y x :: a where
+      Let0123456789876543210Z y x = y
+    type family Case_0123456789876543210 x t where
+      Case_0123456789876543210 x y = Let0123456789876543210ZSym2 y x
+    data Let0123456789876543210Scrutinee_0123456789876543210Sym0 a0123456789876543210
+      where
+        Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference :: SameKind (Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym1 arg) =>
+                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 a0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210Scrutinee_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd
+            (((,)
+                Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference)
+               ())
+    data Let0123456789876543210Scrutinee_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210
+      where
+        Let0123456789876543210Scrutinee_0123456789876543210Sym1KindInference :: SameKind (Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym1 a0123456789876543210) arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210
+    type instance Apply (Let0123456789876543210Scrutinee_0123456789876543210Sym1 a0123456789876543210) b0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210Scrutinee_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd
+            (((,)
+                Let0123456789876543210Scrutinee_0123456789876543210Sym1KindInference)
+               ())
+    type Let0123456789876543210Scrutinee_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210 =
+        Let0123456789876543210Scrutinee_0123456789876543210 a0123456789876543210 b0123456789876543210
+    type family Let0123456789876543210Scrutinee_0123456789876543210 a b where
+      Let0123456789876543210Scrutinee_0123456789876543210 a b = Apply (Apply Tuple2Sym0 a) b
+    type family Case_0123456789876543210 a b t where
+      Case_0123456789876543210 a b '(p, _) = p
+    data Let0123456789876543210Scrutinee_0123456789876543210Sym0 d0123456789876543210
+      where
+        Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference :: SameKind (Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym1 arg) =>
+                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym0 d0123456789876543210
+    type instance Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 d0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym1 d0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210Scrutinee_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd
+            (((,)
+                Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference)
+               ())
+    type Let0123456789876543210Scrutinee_0123456789876543210Sym1 d0123456789876543210 =
+        Let0123456789876543210Scrutinee_0123456789876543210 d0123456789876543210
+    type family Let0123456789876543210Scrutinee_0123456789876543210 d where
+      Let0123456789876543210Scrutinee_0123456789876543210 d = Apply JustSym0 d
+    type family Case_0123456789876543210 d t where
+      Case_0123456789876543210 d ('Just y) = y
+    type family Case_0123456789876543210 d x t where
+      Case_0123456789876543210 d x ('Just y) = y
+      Case_0123456789876543210 d x 'Nothing = d
+    type Foo5Sym0 :: (~>) a a
+    data Foo5Sym0 a0123456789876543210
+      where
+        Foo5Sym0KindInference :: SameKind (Apply Foo5Sym0 arg) (Foo5Sym1 arg) =>
+                                 Foo5Sym0 a0123456789876543210
+    type instance Apply Foo5Sym0 a0123456789876543210 = Foo5Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo5Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo5Sym0KindInference) ())
+    type Foo5Sym1 (a0123456789876543210 :: a) =
+        Foo5 a0123456789876543210 :: a
+    type Foo4Sym0 :: forall a. (~>) a a
+    data Foo4Sym0 a0123456789876543210
+      where
+        Foo4Sym0KindInference :: SameKind (Apply Foo4Sym0 arg) (Foo4Sym1 arg) =>
+                                 Foo4Sym0 a0123456789876543210
+    type instance Apply Foo4Sym0 a0123456789876543210 = Foo4Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo4Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo4Sym0KindInference) ())
+    type Foo4Sym1 (a0123456789876543210 :: a) =
+        Foo4 a0123456789876543210 :: a
+    type Foo3Sym0 :: (~>) a ((~>) b a)
+    data Foo3Sym0 a0123456789876543210
+      where
+        Foo3Sym0KindInference :: SameKind (Apply Foo3Sym0 arg) (Foo3Sym1 arg) =>
+                                 Foo3Sym0 a0123456789876543210
+    type instance Apply Foo3Sym0 a0123456789876543210 = Foo3Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo3Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo3Sym0KindInference) ())
+    type Foo3Sym1 :: a -> (~>) b a
+    data Foo3Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Foo3Sym1KindInference :: SameKind (Apply (Foo3Sym1 a0123456789876543210) arg) (Foo3Sym2 a0123456789876543210 arg) =>
+                                 Foo3Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Foo3Sym1 a0123456789876543210) a0123456789876543210 = Foo3Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Foo3Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) Foo3Sym1KindInference) ())
+    type Foo3Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        Foo3 a0123456789876543210 a0123456789876543210 :: a
+    type Foo2Sym0 :: (~>) a ((~>) (Maybe a) a)
+    data Foo2Sym0 a0123456789876543210
+      where
+        Foo2Sym0KindInference :: SameKind (Apply Foo2Sym0 arg) (Foo2Sym1 arg) =>
+                                 Foo2Sym0 a0123456789876543210
+    type instance Apply Foo2Sym0 a0123456789876543210 = Foo2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo2Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo2Sym0KindInference) ())
+    type Foo2Sym1 :: a -> (~>) (Maybe a) a
+    data Foo2Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Foo2Sym1KindInference :: SameKind (Apply (Foo2Sym1 a0123456789876543210) arg) (Foo2Sym2 a0123456789876543210 arg) =>
+                                 Foo2Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Foo2Sym1 a0123456789876543210) a0123456789876543210 = Foo2Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Foo2Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) Foo2Sym1KindInference) ())
+    type Foo2Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: Maybe a) =
+        Foo2 a0123456789876543210 a0123456789876543210 :: a
+    type Foo1Sym0 :: (~>) a ((~>) (Maybe a) a)
+    data Foo1Sym0 a0123456789876543210
+      where
+        Foo1Sym0KindInference :: SameKind (Apply Foo1Sym0 arg) (Foo1Sym1 arg) =>
+                                 Foo1Sym0 a0123456789876543210
+    type instance Apply Foo1Sym0 a0123456789876543210 = Foo1Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo1Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo1Sym0KindInference) ())
+    type Foo1Sym1 :: a -> (~>) (Maybe a) a
+    data Foo1Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Foo1Sym1KindInference :: SameKind (Apply (Foo1Sym1 a0123456789876543210) arg) (Foo1Sym2 a0123456789876543210 arg) =>
+                                 Foo1Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Foo1Sym1 a0123456789876543210) a0123456789876543210 = Foo1Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Foo1Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) Foo1Sym1KindInference) ())
+    type Foo1Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: Maybe a) =
+        Foo1 a0123456789876543210 a0123456789876543210 :: a
+    type Foo5 :: a -> a
+    type family Foo5 a where
+      Foo5 x = Case_0123456789876543210 x x
+    type Foo4 :: forall a. a -> a
+    type family Foo4 a where
+      Foo4 x = Case_0123456789876543210 x x
+    type Foo3 :: a -> b -> a
+    type family Foo3 a a where
+      Foo3 a b = Case_0123456789876543210 a b (Let0123456789876543210Scrutinee_0123456789876543210Sym2 a b)
+    type Foo2 :: a -> Maybe a -> a
+    type family Foo2 a a where
+      Foo2 d _ = Case_0123456789876543210 d (Let0123456789876543210Scrutinee_0123456789876543210Sym1 d)
+    type Foo1 :: a -> Maybe a -> a
+    type family Foo1 a a where
+      Foo1 d x = Case_0123456789876543210 d x x
+    sFoo5 :: forall a (t :: a). Sing t -> Sing (Apply Foo5Sym0 t :: a)
+    sFoo4 :: forall a (t :: a). Sing t -> Sing (Apply Foo4Sym0 t :: a)
+    sFoo3 ::
+      forall a b (t :: a) (t :: b).
+      Sing t -> Sing t -> Sing (Apply (Apply Foo3Sym0 t) t :: a)
+    sFoo2 ::
+      forall a (t :: a) (t :: Maybe a).
+      Sing t -> Sing t -> Sing (Apply (Apply Foo2Sym0 t) t :: a)
+    sFoo1 ::
+      forall a (t :: a) (t :: Maybe a).
+      Sing t -> Sing t -> Sing (Apply (Apply Foo1Sym0 t) t :: a)
+    sFoo5 (sX :: Sing x)
+      = (id @(Sing (Case_0123456789876543210 x x :: a)))
+          (case sX of {
+             (sY :: Sing y)
+               -> (applySing
+                     ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 y) x))
+                        (\ sArg_0123456789876543210
+                           -> case sArg_0123456789876543210 of {
+                                (_ :: Sing arg_0123456789876543210)
+                                  -> (id
+                                        @(Sing (Case_0123456789876543210 arg_0123456789876543210 y x arg_0123456789876543210)))
+                                       (case sArg_0123456789876543210 of { _ -> sX }) })))
+                    sY })
+    sFoo4 (sX :: Sing x)
+      = (id @(Sing (Case_0123456789876543210 x x :: a)))
+          (case sX of {
+             (sY :: Sing y)
+               -> let
+                    sZ :: Sing (Let0123456789876543210ZSym2 y x :: a)
+                    sZ = sY
+                  in sZ })
+    sFoo3 (sA :: Sing a) (sB :: Sing b)
+      = let
+          sScrutinee_0123456789876543210 ::
+            Sing @_ (Let0123456789876543210Scrutinee_0123456789876543210Sym2 a b)
+          sScrutinee_0123456789876543210
+            = (applySing ((applySing ((singFun2 @Tuple2Sym0) STuple2)) sA)) sB
+        in
+          (id
+             @(Sing (Case_0123456789876543210 a b (Let0123456789876543210Scrutinee_0123456789876543210Sym2 a b) :: a)))
+            (case sScrutinee_0123456789876543210 of {
+               STuple2 (sP :: Sing p) _ -> sP })
+    sFoo2 (sD :: Sing d) _
+      = let
+          sScrutinee_0123456789876543210 ::
+            Sing @_ (Let0123456789876543210Scrutinee_0123456789876543210Sym1 d)
+          sScrutinee_0123456789876543210
+            = (applySing ((singFun1 @JustSym0) SJust)) sD
+        in
+          (id
+             @(Sing (Case_0123456789876543210 d (Let0123456789876543210Scrutinee_0123456789876543210Sym1 d) :: a)))
+            (case sScrutinee_0123456789876543210 of {
+               SJust (sY :: Sing y) -> sY })
+    sFoo1 (sD :: Sing d) (sX :: Sing x)
+      = (id @(Sing (Case_0123456789876543210 d x x :: a)))
+          (case sX of
+             SJust (sY :: Sing y) -> sY
+             SNothing -> sD)
+    instance SingI (Foo5Sym0 :: (~>) a a) where
+      sing = (singFun1 @Foo5Sym0) sFoo5
+    instance SingI (Foo4Sym0 :: (~>) a a) where
+      sing = (singFun1 @Foo4Sym0) sFoo4
+    instance SingI (Foo3Sym0 :: (~>) a ((~>) b a)) where
+      sing = (singFun2 @Foo3Sym0) sFoo3
+    instance SingI d => SingI (Foo3Sym1 (d :: a) :: (~>) b a) where
+      sing = (singFun1 @(Foo3Sym1 (d :: a))) (sFoo3 (sing @d))
+    instance SingI (Foo2Sym0 :: (~>) a ((~>) (Maybe a) a)) where
+      sing = (singFun2 @Foo2Sym0) sFoo2
+    instance SingI d =>
+             SingI (Foo2Sym1 (d :: a) :: (~>) (Maybe a) a) where
+      sing = (singFun1 @(Foo2Sym1 (d :: a))) (sFoo2 (sing @d))
+    instance SingI (Foo1Sym0 :: (~>) a ((~>) (Maybe a) a)) where
+      sing = (singFun2 @Foo1Sym0) sFoo1
+    instance SingI d =>
+             SingI (Foo1Sym1 (d :: a) :: (~>) (Maybe a) a) where
+      sing = (singFun1 @(Foo1Sym1 (d :: a))) (sFoo1 (sing @d))
diff --git a/tests/compile-and-dump/Singletons/Classes.ghc88.template b/tests/compile-and-dump/Singletons/Classes.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/Classes.ghc88.template
+++ /dev/null
@@ -1,575 +0,0 @@
-Singletons/Classes.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| infix 4 <=>
-          
-          const :: a -> b -> a
-          const x _ = x
-          fooCompare :: Foo -> Foo -> Ordering
-          fooCompare A A = EQ
-          fooCompare A B = LT
-          fooCompare B B = GT
-          fooCompare B A = EQ
-          
-          class MyOrd a where
-            mycompare :: a -> a -> Ordering
-            (<=>) :: a -> a -> Ordering
-            (<=>) = mycompare
-            infix 4 <=>
-          data Foo = A | B
-          data Foo2 = F | G
-          
-          instance MyOrd () where
-            mycompare _ = const EQ
-          instance MyOrd Nat where
-            Zero `mycompare` Zero = EQ
-            Zero `mycompare` (Succ _) = LT
-            (Succ _) `mycompare` Zero = GT
-            (Succ n) `mycompare` (Succ m) = m `mycompare` n
-          instance MyOrd Foo where
-            mycompare = fooCompare
-          instance Eq Foo2 where
-            F == F = True
-            G == G = True
-            F == G = False
-            G == F = False |]
-  ======>
-    const :: a -> b -> a
-    const x _ = x
-    class MyOrd a where
-      mycompare :: a -> a -> Ordering
-      (<=>) :: a -> a -> Ordering
-      (<=>) = mycompare
-    infix 4 <=>
-    instance MyOrd Nat where
-      mycompare Zero Zero = EQ
-      mycompare Zero (Succ _) = LT
-      mycompare (Succ _) Zero = GT
-      mycompare (Succ n) (Succ m) = (m `mycompare` n)
-    instance MyOrd () where
-      mycompare _ = const EQ
-    data Foo = A | B
-    fooCompare :: Foo -> Foo -> Ordering
-    fooCompare A A = EQ
-    fooCompare A B = LT
-    fooCompare B B = GT
-    fooCompare B A = EQ
-    instance MyOrd Foo where
-      mycompare = fooCompare
-    data Foo2 = F | G
-    instance Eq Foo2 where
-      (==) F F = True
-      (==) G G = True
-      (==) F G = False
-      (==) G F = False
-    type ASym0 = A
-    type BSym0 = B
-    type FSym0 = F
-    type GSym0 = G
-    type FooCompareSym2 (a0123456789876543210 :: Foo) (a0123456789876543210 :: Foo) =
-        FooCompare a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (FooCompareSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) FooCompareSym1KindInference) ())
-    data FooCompareSym1 (a0123456789876543210 :: Foo) :: (~>) Foo Ordering
-      where
-        FooCompareSym1KindInference :: forall a0123456789876543210
-                                              a0123456789876543210
-                                              arg. SameKind (Apply (FooCompareSym1 a0123456789876543210) arg) (FooCompareSym2 a0123456789876543210 arg) =>
-                                       FooCompareSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (FooCompareSym1 a0123456789876543210) a0123456789876543210 = FooCompare a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings FooCompareSym0 where
-      suppressUnusedWarnings = snd (((,) FooCompareSym0KindInference) ())
-    data FooCompareSym0 :: (~>) Foo ((~>) Foo Ordering)
-      where
-        FooCompareSym0KindInference :: forall a0123456789876543210
-                                              arg. SameKind (Apply FooCompareSym0 arg) (FooCompareSym1 arg) =>
-                                       FooCompareSym0 a0123456789876543210
-    type instance Apply FooCompareSym0 a0123456789876543210 = FooCompareSym1 a0123456789876543210
-    type ConstSym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: b0123456789876543210) =
-        Const a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ConstSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) ConstSym1KindInference) ())
-    data ConstSym1 (a0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                     (~>) b0123456789876543210 a0123456789876543210
-      where
-        ConstSym1KindInference :: forall a0123456789876543210
-                                         a0123456789876543210
-                                         arg. SameKind (Apply (ConstSym1 a0123456789876543210) arg) (ConstSym2 a0123456789876543210 arg) =>
-                                  ConstSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ConstSym1 a0123456789876543210) a0123456789876543210 = Const a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ConstSym0 where
-      suppressUnusedWarnings = snd (((,) ConstSym0KindInference) ())
-    data ConstSym0 :: forall a0123456789876543210 b0123456789876543210.
-                      (~>) a0123456789876543210 ((~>) b0123456789876543210 a0123456789876543210)
-      where
-        ConstSym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply ConstSym0 arg) (ConstSym1 arg) =>
-                                  ConstSym0 a0123456789876543210
-    type instance Apply ConstSym0 a0123456789876543210 = ConstSym1 a0123456789876543210
-    type family FooCompare (a :: Foo) (a :: Foo) :: Ordering where
-      FooCompare A A = EQSym0
-      FooCompare A B = LTSym0
-      FooCompare B B = GTSym0
-      FooCompare B A = EQSym0
-    type family Const (a :: a) (a :: b) :: a where
-      Const x _ = x
-    type MycompareSym2 (arg0123456789876543210 :: a0123456789876543210) (arg0123456789876543210 :: a0123456789876543210) =
-        Mycompare arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings (MycompareSym1 arg0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) MycompareSym1KindInference) ())
-    data MycompareSym1 (arg0123456789876543210 :: a0123456789876543210) :: (~>) a0123456789876543210 Ordering
-      where
-        MycompareSym1KindInference :: forall arg0123456789876543210
-                                             arg0123456789876543210
-                                             arg. SameKind (Apply (MycompareSym1 arg0123456789876543210) arg) (MycompareSym2 arg0123456789876543210 arg) =>
-                                      MycompareSym1 arg0123456789876543210 arg0123456789876543210
-    type instance Apply (MycompareSym1 arg0123456789876543210) arg0123456789876543210 = Mycompare arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings MycompareSym0 where
-      suppressUnusedWarnings = snd (((,) MycompareSym0KindInference) ())
-    data MycompareSym0 :: forall a0123456789876543210.
-                          (~>) a0123456789876543210 ((~>) a0123456789876543210 Ordering)
-      where
-        MycompareSym0KindInference :: forall arg0123456789876543210
-                                             arg. SameKind (Apply MycompareSym0 arg) (MycompareSym1 arg) =>
-                                      MycompareSym0 arg0123456789876543210
-    type instance Apply MycompareSym0 arg0123456789876543210 = MycompareSym1 arg0123456789876543210
-    type (<=>@#@$$$) (arg0123456789876543210 :: a0123456789876543210) (arg0123456789876543210 :: a0123456789876543210) =
-        (<=>) arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings ((<=>@#@$$) arg0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (:<=>@#@$$###)) ())
-    data (<=>@#@$$) (arg0123456789876543210 :: a0123456789876543210) :: (~>) a0123456789876543210 Ordering
-      where
-        (:<=>@#@$$###) :: forall arg0123456789876543210
-                                 arg0123456789876543210
-                                 arg. SameKind (Apply ((<=>@#@$$) arg0123456789876543210) arg) ((<=>@#@$$$) arg0123456789876543210 arg) =>
-                          (<=>@#@$$) arg0123456789876543210 arg0123456789876543210
-    type instance Apply ((<=>@#@$$) arg0123456789876543210) arg0123456789876543210 = (<=>) arg0123456789876543210 arg0123456789876543210
-    infix 4 <=>@#@$$
-    instance SuppressUnusedWarnings (<=>@#@$) where
-      suppressUnusedWarnings = snd (((,) (:<=>@#@$###)) ())
-    data (<=>@#@$) :: forall a0123456789876543210.
-                      (~>) a0123456789876543210 ((~>) a0123456789876543210 Ordering)
-      where
-        (:<=>@#@$###) :: forall arg0123456789876543210
-                                arg. SameKind (Apply (<=>@#@$) arg) ((<=>@#@$$) arg) =>
-                         (<=>@#@$) arg0123456789876543210
-    type instance Apply (<=>@#@$) arg0123456789876543210 = (<=>@#@$$) arg0123456789876543210
-    infix 4 <=>@#@$
-    type family TFHelper_0123456789876543210 (a :: a) (a :: a) :: Ordering where
-      TFHelper_0123456789876543210 a_0123456789876543210 a_0123456789876543210 = Apply (Apply MycompareSym0 a_0123456789876543210) a_0123456789876543210
-    type TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: a0123456789876543210) =
-        TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) TFHelper_0123456789876543210Sym1KindInference) ())
-    data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: a0123456789876543210) :: (~>) a0123456789876543210 Ordering
-      where
-        TFHelper_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                a0123456789876543210
-                                                                arg. SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                         TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) TFHelper_0123456789876543210Sym0KindInference) ())
-    data TFHelper_0123456789876543210Sym0 :: forall a0123456789876543210.
-                                             (~>) a0123456789876543210 ((~>) a0123456789876543210 Ordering)
-      where
-        TFHelper_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                arg. SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) =>
-                                                         TFHelper_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210
-    class PMyOrd (a :: GHC.Types.Type) where
-      type Mycompare (arg :: a) (arg :: a) :: Ordering
-      type (<=>) (arg :: a) (arg :: a) :: Ordering
-      type (<=>) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a
-    type family Mycompare_0123456789876543210 (a :: Nat) (a :: Nat) :: Ordering where
-      Mycompare_0123456789876543210 'Zero 'Zero = EQSym0
-      Mycompare_0123456789876543210 'Zero ('Succ _) = LTSym0
-      Mycompare_0123456789876543210 ('Succ _) 'Zero = GTSym0
-      Mycompare_0123456789876543210 ('Succ n) ('Succ m) = Apply (Apply MycompareSym0 m) n
-    type Mycompare_0123456789876543210Sym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
-        Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Mycompare_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Mycompare_0123456789876543210Sym1KindInference) ())
-    data Mycompare_0123456789876543210Sym1 (a0123456789876543210 :: Nat) :: (~>) Nat Ordering
-      where
-        Mycompare_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) arg) (Mycompare_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Mycompare_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Mycompare_0123456789876543210Sym0KindInference) ())
-    data Mycompare_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Ordering)
-      where
-        Mycompare_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply Mycompare_0123456789876543210Sym0 arg) (Mycompare_0123456789876543210Sym1 arg) =>
-                                                          Mycompare_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Mycompare_0123456789876543210Sym0 a0123456789876543210 = Mycompare_0123456789876543210Sym1 a0123456789876543210
-    instance PMyOrd Nat where
-      type Mycompare a a = Apply (Apply Mycompare_0123456789876543210Sym0 a) a
-    type family Mycompare_0123456789876543210 (a :: ()) (a :: ()) :: Ordering where
-      Mycompare_0123456789876543210 _ a_0123456789876543210 = Apply (Apply ConstSym0 EQSym0) a_0123456789876543210
-    type Mycompare_0123456789876543210Sym2 (a0123456789876543210 :: ()) (a0123456789876543210 :: ()) =
-        Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Mycompare_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Mycompare_0123456789876543210Sym1KindInference) ())
-    data Mycompare_0123456789876543210Sym1 (a0123456789876543210 :: ()) :: (~>) () Ordering
-      where
-        Mycompare_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) arg) (Mycompare_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Mycompare_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Mycompare_0123456789876543210Sym0KindInference) ())
-    data Mycompare_0123456789876543210Sym0 :: (~>) () ((~>) () Ordering)
-      where
-        Mycompare_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply Mycompare_0123456789876543210Sym0 arg) (Mycompare_0123456789876543210Sym1 arg) =>
-                                                          Mycompare_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Mycompare_0123456789876543210Sym0 a0123456789876543210 = Mycompare_0123456789876543210Sym1 a0123456789876543210
-    instance PMyOrd () where
-      type Mycompare a a = Apply (Apply Mycompare_0123456789876543210Sym0 a) a
-    type family Mycompare_0123456789876543210 (a :: Foo) (a :: Foo) :: Ordering where
-      Mycompare_0123456789876543210 a_0123456789876543210 a_0123456789876543210 = Apply (Apply FooCompareSym0 a_0123456789876543210) a_0123456789876543210
-    type Mycompare_0123456789876543210Sym2 (a0123456789876543210 :: Foo) (a0123456789876543210 :: Foo) =
-        Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Mycompare_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Mycompare_0123456789876543210Sym1KindInference) ())
-    data Mycompare_0123456789876543210Sym1 (a0123456789876543210 :: Foo) :: (~>) Foo Ordering
-      where
-        Mycompare_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) arg) (Mycompare_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Mycompare_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Mycompare_0123456789876543210Sym0KindInference) ())
-    data Mycompare_0123456789876543210Sym0 :: (~>) Foo ((~>) Foo Ordering)
-      where
-        Mycompare_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply Mycompare_0123456789876543210Sym0 arg) (Mycompare_0123456789876543210Sym1 arg) =>
-                                                          Mycompare_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Mycompare_0123456789876543210Sym0 a0123456789876543210 = Mycompare_0123456789876543210Sym1 a0123456789876543210
-    instance PMyOrd Foo where
-      type Mycompare a a = Apply (Apply Mycompare_0123456789876543210Sym0 a) a
-    type family TFHelper_0123456789876543210 (a :: Foo2) (a :: Foo2) :: Bool where
-      TFHelper_0123456789876543210 F F = TrueSym0
-      TFHelper_0123456789876543210 G G = TrueSym0
-      TFHelper_0123456789876543210 F G = FalseSym0
-      TFHelper_0123456789876543210 G F = FalseSym0
-    type TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: Foo2) (a0123456789876543210 :: Foo2) =
-        TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) TFHelper_0123456789876543210Sym1KindInference) ())
-    data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: Foo2) :: (~>) Foo2 Bool
-      where
-        TFHelper_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                a0123456789876543210
-                                                                arg. SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                         TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) TFHelper_0123456789876543210Sym0KindInference) ())
-    data TFHelper_0123456789876543210Sym0 :: (~>) Foo2 ((~>) Foo2 Bool)
-      where
-        TFHelper_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                arg. SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) =>
-                                                         TFHelper_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210
-    instance PEq Foo2 where
-      type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a
-    infix 4 %<=>
-    sFooCompare ::
-      forall (t :: Foo) (t :: Foo).
-      Sing t
-      -> Sing t -> Sing (Apply (Apply FooCompareSym0 t) t :: Ordering)
-    sConst ::
-      forall a b (t :: a) (t :: b).
-      Sing t -> Sing t -> Sing (Apply (Apply ConstSym0 t) t :: a)
-    sFooCompare SA SA = SEQ
-    sFooCompare SA SB = SLT
-    sFooCompare SB SB = SGT
-    sFooCompare SB SA = SEQ
-    sConst (sX :: Sing x) _ = sX
-    instance SingI (FooCompareSym0 :: (~>) Foo ((~>) Foo Ordering)) where
-      sing = (singFun2 @FooCompareSym0) sFooCompare
-    instance SingI d =>
-             SingI (FooCompareSym1 (d :: Foo) :: (~>) Foo Ordering) where
-      sing
-        = (singFun1 @(FooCompareSym1 (d :: Foo))) (sFooCompare (sing @d))
-    instance SingI (ConstSym0 :: (~>) a ((~>) b a)) where
-      sing = (singFun2 @ConstSym0) sConst
-    instance SingI d => SingI (ConstSym1 (d :: a) :: (~>) b a) where
-      sing = (singFun1 @(ConstSym1 (d :: a))) (sConst (sing @d))
-    data SFoo :: Foo -> GHC.Types.Type
-      where
-        SA :: SFoo A
-        SB :: SFoo B
-    type instance Sing @Foo = SFoo
-    instance SingKind Foo where
-      type Demote Foo = Foo
-      fromSing SA = A
-      fromSing SB = B
-      toSing A = SomeSing SA
-      toSing B = SomeSing SB
-    data SFoo2 :: Foo2 -> GHC.Types.Type
-      where
-        SF :: SFoo2 F
-        SG :: SFoo2 G
-    type instance Sing @Foo2 = SFoo2
-    instance SingKind Foo2 where
-      type Demote Foo2 = Foo2
-      fromSing SF = F
-      fromSing SG = G
-      toSing F = SomeSing SF
-      toSing G = SomeSing SG
-    class SMyOrd a where
-      sMycompare ::
-        forall (t :: a) (t :: a).
-        Sing t
-        -> Sing t -> Sing (Apply (Apply MycompareSym0 t) t :: Ordering)
-      (%<=>) ::
-        forall (t :: a) (t :: a).
-        Sing t -> Sing t -> Sing (Apply (Apply (<=>@#@$) t) t :: Ordering)
-      default (%<=>) ::
-                forall (t :: a) (t :: a).
-                ((Apply (Apply (<=>@#@$) t) t :: Ordering)
-                 ~ Apply (Apply TFHelper_0123456789876543210Sym0 t) t) =>
-                Sing t -> Sing t -> Sing (Apply (Apply (<=>@#@$) t) t :: Ordering)
-      (%<=>)
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @MycompareSym0) sMycompare))
-                sA_0123456789876543210))
-            sA_0123456789876543210
-    instance SMyOrd Nat where
-      sMycompare ::
-        forall (t :: Nat) (t :: Nat).
-        Sing t
-        -> Sing t -> Sing (Apply (Apply MycompareSym0 t) t :: Ordering)
-      sMycompare SZero SZero = SEQ
-      sMycompare SZero (SSucc _) = SLT
-      sMycompare (SSucc _) SZero = SGT
-      sMycompare (SSucc (sN :: Sing n)) (SSucc (sM :: Sing m))
-        = (applySing
-             ((applySing ((singFun2 @MycompareSym0) sMycompare)) sM))
-            sN
-    instance SMyOrd () where
-      sMycompare ::
-        forall (t :: ()) (t :: ()).
-        Sing t
-        -> Sing t -> Sing (Apply (Apply MycompareSym0 t) t :: Ordering)
-      sMycompare _ (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing ((applySing ((singFun2 @ConstSym0) sConst)) SEQ))
-            sA_0123456789876543210
-    instance SMyOrd Foo where
-      sMycompare ::
-        forall (t :: Foo) (t :: Foo).
-        Sing t
-        -> Sing t -> Sing (Apply (Apply MycompareSym0 t) t :: Ordering)
-      sMycompare
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @FooCompareSym0) sFooCompare))
-                sA_0123456789876543210))
-            sA_0123456789876543210
-    instance SEq Foo2 where
-      (%==) ::
-        forall (a :: Foo2) (b :: Foo2). Sing a -> Sing b -> Sing ((==) a b)
-      (%==) SF SF = STrue
-      (%==) SG SG = STrue
-      (%==) SF SG = SFalse
-      (%==) SG SF = SFalse
-    instance SingI A where
-      sing = SA
-    instance SingI B where
-      sing = SB
-    instance SingI F where
-      sing = SF
-    instance SingI G where
-      sing = SG
-    instance SMyOrd a =>
-             SingI (MycompareSym0 :: (~>) a ((~>) a Ordering)) where
-      sing = (singFun2 @MycompareSym0) sMycompare
-    instance (SMyOrd a, SingI d) =>
-             SingI (MycompareSym1 (d :: a) :: (~>) a Ordering) where
-      sing = (singFun1 @(MycompareSym1 (d :: a))) (sMycompare (sing @d))
-    instance SMyOrd a =>
-             SingI ((<=>@#@$) :: (~>) a ((~>) a Ordering)) where
-      sing = (singFun2 @(<=>@#@$)) (%<=>)
-    instance (SMyOrd a, SingI d) =>
-             SingI ((<=>@#@$$) (d :: a) :: (~>) a Ordering) where
-      sing = (singFun1 @((<=>@#@$$) (d :: a))) ((%<=>) (sing @d))
-Singletons/Classes.hs:(0,0)-(0,0): Splicing declarations
-    promote
-      [d| instance Ord Foo2 where
-            F `compare` F = EQ
-            F `compare` _ = LT
-            _ `compare` _ = GT
-          instance MyOrd Foo2 where
-            F `mycompare` F = EQ
-            F `mycompare` _ = LT
-            _ `mycompare` _ = GT |]
-  ======>
-    instance MyOrd Foo2 where
-      mycompare F F = EQ
-      mycompare F _ = LT
-      mycompare _ _ = GT
-    instance Ord Foo2 where
-      compare F F = EQ
-      compare F _ = LT
-      compare _ _ = GT
-    type family Mycompare_0123456789876543210 (a :: Foo2) (a :: Foo2) :: Ordering where
-      Mycompare_0123456789876543210 'F 'F = EQSym0
-      Mycompare_0123456789876543210 'F _ = LTSym0
-      Mycompare_0123456789876543210 _ _ = GTSym0
-    type Mycompare_0123456789876543210Sym2 (a0123456789876543210 :: Foo2) (a0123456789876543210 :: Foo2) =
-        Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Mycompare_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Mycompare_0123456789876543210Sym1KindInference) ())
-    data Mycompare_0123456789876543210Sym1 (a0123456789876543210 :: Foo2) :: (~>) Foo2 Ordering
-      where
-        Mycompare_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) arg) (Mycompare_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Mycompare_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Mycompare_0123456789876543210Sym0KindInference) ())
-    data Mycompare_0123456789876543210Sym0 :: (~>) Foo2 ((~>) Foo2 Ordering)
-      where
-        Mycompare_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply Mycompare_0123456789876543210Sym0 arg) (Mycompare_0123456789876543210Sym1 arg) =>
-                                                          Mycompare_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Mycompare_0123456789876543210Sym0 a0123456789876543210 = Mycompare_0123456789876543210Sym1 a0123456789876543210
-    instance PMyOrd Foo2 where
-      type Mycompare a a = Apply (Apply Mycompare_0123456789876543210Sym0 a) a
-    type family Compare_0123456789876543210 (a :: Foo2) (a :: Foo2) :: Ordering where
-      Compare_0123456789876543210 'F 'F = EQSym0
-      Compare_0123456789876543210 'F _ = LTSym0
-      Compare_0123456789876543210 _ _ = GTSym0
-    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Foo2) (a0123456789876543210 :: Foo2) =
-        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
-    data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Foo2) :: (~>) Foo2 Ordering
-      where
-        Compare_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                               a0123456789876543210
-                                                               arg. SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
-    data Compare_0123456789876543210Sym0 :: (~>) Foo2 ((~>) Foo2 Ordering)
-      where
-        Compare_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                               arg. SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
-                                                        Compare_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
-    instance POrd Foo2 where
-      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
-Singletons/Classes.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| data Nat' = Zero' | Succ' Nat'
-          
-          instance MyOrd Nat' where
-            Zero' `mycompare` Zero' = EQ
-            Zero' `mycompare` (Succ' _) = LT
-            (Succ' _) `mycompare` Zero' = GT
-            (Succ' n) `mycompare` (Succ' m) = m `mycompare` n |]
-  ======>
-    data Nat' = Zero' | Succ' Nat'
-    instance MyOrd Nat' where
-      mycompare Zero' Zero' = EQ
-      mycompare Zero' (Succ' _) = LT
-      mycompare (Succ' _) Zero' = GT
-      mycompare (Succ' n) (Succ' m) = (m `mycompare` n)
-    type Zero'Sym0 = Zero'
-    type Succ'Sym1 (t0123456789876543210 :: Nat') =
-        Succ' t0123456789876543210
-    instance SuppressUnusedWarnings Succ'Sym0 where
-      suppressUnusedWarnings = snd (((,) Succ'Sym0KindInference) ())
-    data Succ'Sym0 :: (~>) Nat' Nat'
-      where
-        Succ'Sym0KindInference :: forall t0123456789876543210
-                                         arg. SameKind (Apply Succ'Sym0 arg) (Succ'Sym1 arg) =>
-                                  Succ'Sym0 t0123456789876543210
-    type instance Apply Succ'Sym0 t0123456789876543210 = Succ' t0123456789876543210
-    type family Mycompare_0123456789876543210 (a :: Nat') (a :: Nat') :: Ordering where
-      Mycompare_0123456789876543210 Zero' Zero' = EQSym0
-      Mycompare_0123456789876543210 Zero' (Succ' _) = LTSym0
-      Mycompare_0123456789876543210 (Succ' _) Zero' = GTSym0
-      Mycompare_0123456789876543210 (Succ' n) (Succ' m) = Apply (Apply MycompareSym0 m) n
-    type Mycompare_0123456789876543210Sym2 (a0123456789876543210 :: Nat') (a0123456789876543210 :: Nat') =
-        Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Mycompare_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Mycompare_0123456789876543210Sym1KindInference) ())
-    data Mycompare_0123456789876543210Sym1 (a0123456789876543210 :: Nat') :: (~>) Nat' Ordering
-      where
-        Mycompare_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) arg) (Mycompare_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Mycompare_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Mycompare_0123456789876543210Sym0KindInference) ())
-    data Mycompare_0123456789876543210Sym0 :: (~>) Nat' ((~>) Nat' Ordering)
-      where
-        Mycompare_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply Mycompare_0123456789876543210Sym0 arg) (Mycompare_0123456789876543210Sym1 arg) =>
-                                                          Mycompare_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Mycompare_0123456789876543210Sym0 a0123456789876543210 = Mycompare_0123456789876543210Sym1 a0123456789876543210
-    instance PMyOrd Nat' where
-      type Mycompare a a = Apply (Apply Mycompare_0123456789876543210Sym0 a) a
-    data SNat' :: Nat' -> GHC.Types.Type
-      where
-        SZero' :: SNat' Zero'
-        SSucc' :: forall (n :: Nat'). (Sing (n :: Nat')) -> SNat' (Succ' n)
-    type instance Sing @Nat' = SNat'
-    instance SingKind Nat' where
-      type Demote Nat' = Nat'
-      fromSing SZero' = Zero'
-      fromSing (SSucc' b) = Succ' (fromSing b)
-      toSing Zero' = SomeSing SZero'
-      toSing (Succ' (b :: Demote Nat'))
-        = case toSing b :: SomeSing Nat' of {
-            SomeSing c -> SomeSing (SSucc' c) }
-    instance SMyOrd Nat' where
-      sMycompare ::
-        forall (t :: Nat') (t :: Nat').
-        Sing t
-        -> Sing t
-           -> Sing (Apply (Apply (MycompareSym0 :: TyFun Nat' ((~>) Nat' Ordering)
-                                                   -> GHC.Types.Type) t) t)
-      sMycompare SZero' SZero' = SEQ
-      sMycompare SZero' (SSucc' _) = SLT
-      sMycompare (SSucc' _) SZero' = SGT
-      sMycompare (SSucc' (sN :: Sing n)) (SSucc' (sM :: Sing m))
-        = (applySing
-             ((applySing ((singFun2 @MycompareSym0) sMycompare)) sM))
-            sN
-    instance SingI Zero' where
-      sing = SZero'
-    instance SingI n => SingI (Succ' (n :: Nat')) where
-      sing = SSucc' sing
-    instance SingI (Succ'Sym0 :: (~>) Nat' Nat') where
-      sing = (singFun1 @Succ'Sym0) SSucc'
diff --git a/tests/compile-and-dump/Singletons/Classes.golden b/tests/compile-and-dump/Singletons/Classes.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/Classes.golden
@@ -0,0 +1,571 @@
+Singletons/Classes.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| infix 4 <=>
+          
+          const :: a -> b -> a
+          const x _ = x
+          fooCompare :: Foo -> Foo -> Ordering
+          fooCompare A A = EQ
+          fooCompare A B = LT
+          fooCompare B B = GT
+          fooCompare B A = EQ
+          
+          class MyOrd a where
+            mycompare :: a -> a -> Ordering
+            (<=>) :: a -> a -> Ordering
+            (<=>) = mycompare
+            infix 4 <=>
+          data Foo = A | B
+          data Foo2 = F | G
+          
+          instance MyOrd () where
+            mycompare _ = const EQ
+          instance MyOrd Nat where
+            Zero `mycompare` Zero = EQ
+            Zero `mycompare` (Succ _) = LT
+            (Succ _) `mycompare` Zero = GT
+            (Succ n) `mycompare` (Succ m) = m `mycompare` n
+          instance MyOrd Foo where
+            mycompare = fooCompare
+          instance Eq Foo2 where
+            F == F = True
+            G == G = True
+            F == G = False
+            G == F = False |]
+  ======>
+    const :: a -> b -> a
+    const x _ = x
+    class MyOrd a where
+      mycompare :: a -> a -> Ordering
+      (<=>) :: a -> a -> Ordering
+      (<=>) = mycompare
+    infix 4 <=>
+    instance MyOrd Nat where
+      mycompare Zero Zero = EQ
+      mycompare Zero (Succ _) = LT
+      mycompare (Succ _) Zero = GT
+      mycompare (Succ n) (Succ m) = (m `mycompare` n)
+    instance MyOrd () where
+      mycompare _ = const EQ
+    data Foo = A | B
+    fooCompare :: Foo -> Foo -> Ordering
+    fooCompare A A = EQ
+    fooCompare A B = LT
+    fooCompare B B = GT
+    fooCompare B A = EQ
+    instance MyOrd Foo where
+      mycompare = fooCompare
+    data Foo2 = F | G
+    instance Eq Foo2 where
+      (==) F F = True
+      (==) G G = True
+      (==) F G = False
+      (==) G F = False
+    type ASym0 = A :: Foo
+    type BSym0 = B :: Foo
+    type FSym0 = F :: Foo2
+    type GSym0 = G :: Foo2
+    type FooCompareSym0 :: (~>) Foo ((~>) Foo Ordering)
+    data FooCompareSym0 a0123456789876543210
+      where
+        FooCompareSym0KindInference :: SameKind (Apply FooCompareSym0 arg) (FooCompareSym1 arg) =>
+                                       FooCompareSym0 a0123456789876543210
+    type instance Apply FooCompareSym0 a0123456789876543210 = FooCompareSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FooCompareSym0 where
+      suppressUnusedWarnings = snd (((,) FooCompareSym0KindInference) ())
+    type FooCompareSym1 :: Foo -> (~>) Foo Ordering
+    data FooCompareSym1 a0123456789876543210 a0123456789876543210
+      where
+        FooCompareSym1KindInference :: SameKind (Apply (FooCompareSym1 a0123456789876543210) arg) (FooCompareSym2 a0123456789876543210 arg) =>
+                                       FooCompareSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (FooCompareSym1 a0123456789876543210) a0123456789876543210 = FooCompareSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (FooCompareSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) FooCompareSym1KindInference) ())
+    type FooCompareSym2 (a0123456789876543210 :: Foo) (a0123456789876543210 :: Foo) =
+        FooCompare a0123456789876543210 a0123456789876543210 :: Ordering
+    type ConstSym0 :: (~>) a ((~>) b a)
+    data ConstSym0 a0123456789876543210
+      where
+        ConstSym0KindInference :: SameKind (Apply ConstSym0 arg) (ConstSym1 arg) =>
+                                  ConstSym0 a0123456789876543210
+    type instance Apply ConstSym0 a0123456789876543210 = ConstSym1 a0123456789876543210
+    instance SuppressUnusedWarnings ConstSym0 where
+      suppressUnusedWarnings = snd (((,) ConstSym0KindInference) ())
+    type ConstSym1 :: a -> (~>) b a
+    data ConstSym1 a0123456789876543210 a0123456789876543210
+      where
+        ConstSym1KindInference :: SameKind (Apply (ConstSym1 a0123456789876543210) arg) (ConstSym2 a0123456789876543210 arg) =>
+                                  ConstSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ConstSym1 a0123456789876543210) a0123456789876543210 = ConstSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ConstSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) ConstSym1KindInference) ())
+    type ConstSym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        Const a0123456789876543210 a0123456789876543210 :: a
+    type FooCompare :: Foo -> Foo -> Ordering
+    type family FooCompare a a where
+      FooCompare A A = EQSym0
+      FooCompare A B = LTSym0
+      FooCompare B B = GTSym0
+      FooCompare B A = EQSym0
+    type Const :: a -> b -> a
+    type family Const a a where
+      Const x _ = x
+    type MycompareSym0 :: forall a. (~>) a ((~>) a Ordering)
+    data MycompareSym0 a0123456789876543210
+      where
+        MycompareSym0KindInference :: SameKind (Apply MycompareSym0 arg) (MycompareSym1 arg) =>
+                                      MycompareSym0 a0123456789876543210
+    type instance Apply MycompareSym0 a0123456789876543210 = MycompareSym1 a0123456789876543210
+    instance SuppressUnusedWarnings MycompareSym0 where
+      suppressUnusedWarnings = snd (((,) MycompareSym0KindInference) ())
+    type MycompareSym1 :: forall a. a -> (~>) a Ordering
+    data MycompareSym1 a0123456789876543210 a0123456789876543210
+      where
+        MycompareSym1KindInference :: SameKind (Apply (MycompareSym1 a0123456789876543210) arg) (MycompareSym2 a0123456789876543210 arg) =>
+                                      MycompareSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (MycompareSym1 a0123456789876543210) a0123456789876543210 = MycompareSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (MycompareSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) MycompareSym1KindInference) ())
+    type MycompareSym2 (a0123456789876543210 :: a) (a0123456789876543210 :: a) =
+        Mycompare a0123456789876543210 a0123456789876543210 :: Ordering
+    type (<=>@#@$) :: forall a. (~>) a ((~>) a Ordering)
+    data (<=>@#@$) a0123456789876543210
+      where
+        (:<=>@#@$###) :: SameKind (Apply (<=>@#@$) arg) ((<=>@#@$$) arg) =>
+                         (<=>@#@$) a0123456789876543210
+    type instance Apply (<=>@#@$) a0123456789876543210 = (<=>@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (<=>@#@$) where
+      suppressUnusedWarnings = snd (((,) (:<=>@#@$###)) ())
+    infix 4 <=>@#@$
+    type (<=>@#@$$) :: forall a. a -> (~>) a Ordering
+    data (<=>@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (:<=>@#@$$###) :: SameKind (Apply ((<=>@#@$$) a0123456789876543210) arg) ((<=>@#@$$$) a0123456789876543210 arg) =>
+                          (<=>@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((<=>@#@$$) a0123456789876543210) a0123456789876543210 = (<=>@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((<=>@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (:<=>@#@$$###)) ())
+    infix 4 <=>@#@$$
+    type (<=>@#@$$$) (a0123456789876543210 :: a) (a0123456789876543210 :: a) =
+        (<=>) a0123456789876543210 a0123456789876543210 :: Ordering
+    infix 4 <=>@#@$$$
+    type TFHelper_0123456789876543210 :: a -> a -> Ordering
+    type family TFHelper_0123456789876543210 a a where
+      TFHelper_0123456789876543210 a_0123456789876543210 a_0123456789876543210 = Apply (Apply MycompareSym0 a_0123456789876543210) a_0123456789876543210
+    type TFHelper_0123456789876543210Sym0 :: (~>) a ((~>) a Ordering)
+    data TFHelper_0123456789876543210Sym0 a0123456789876543210
+      where
+        TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) =>
+                                                         TFHelper_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) TFHelper_0123456789876543210Sym0KindInference) ())
+    type TFHelper_0123456789876543210Sym1 :: a -> (~>) a Ordering
+    data TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                         TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) TFHelper_0123456789876543210Sym1KindInference) ())
+    type TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: a) =
+        TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    class PMyOrd a where
+      type Mycompare (arg :: a) (arg :: a) :: Ordering
+      type (<=>) (arg :: a) (arg :: a) :: Ordering
+      type (<=>) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a
+    type Mycompare_0123456789876543210 :: Nat -> Nat -> Ordering
+    type family Mycompare_0123456789876543210 a a where
+      Mycompare_0123456789876543210 'Zero 'Zero = EQSym0
+      Mycompare_0123456789876543210 'Zero ('Succ _) = LTSym0
+      Mycompare_0123456789876543210 ('Succ _) 'Zero = GTSym0
+      Mycompare_0123456789876543210 ('Succ n) ('Succ m) = Apply (Apply MycompareSym0 m) n
+    type Mycompare_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Ordering)
+    data Mycompare_0123456789876543210Sym0 a0123456789876543210
+      where
+        Mycompare_0123456789876543210Sym0KindInference :: SameKind (Apply Mycompare_0123456789876543210Sym0 arg) (Mycompare_0123456789876543210Sym1 arg) =>
+                                                          Mycompare_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Mycompare_0123456789876543210Sym0 a0123456789876543210 = Mycompare_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Mycompare_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Mycompare_0123456789876543210Sym0KindInference) ())
+    type Mycompare_0123456789876543210Sym1 :: Nat -> (~>) Nat Ordering
+    data Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Mycompare_0123456789876543210Sym1KindInference :: SameKind (Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) arg) (Mycompare_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Mycompare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Mycompare_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Mycompare_0123456789876543210Sym1KindInference) ())
+    type Mycompare_0123456789876543210Sym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
+        Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    instance PMyOrd Nat where
+      type Mycompare a a = Apply (Apply Mycompare_0123456789876543210Sym0 a) a
+    type Mycompare_0123456789876543210 :: () -> () -> Ordering
+    type family Mycompare_0123456789876543210 a a where
+      Mycompare_0123456789876543210 _ a_0123456789876543210 = Apply (Apply ConstSym0 EQSym0) a_0123456789876543210
+    type Mycompare_0123456789876543210Sym0 :: (~>) () ((~>) () Ordering)
+    data Mycompare_0123456789876543210Sym0 a0123456789876543210
+      where
+        Mycompare_0123456789876543210Sym0KindInference :: SameKind (Apply Mycompare_0123456789876543210Sym0 arg) (Mycompare_0123456789876543210Sym1 arg) =>
+                                                          Mycompare_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Mycompare_0123456789876543210Sym0 a0123456789876543210 = Mycompare_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Mycompare_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Mycompare_0123456789876543210Sym0KindInference) ())
+    type Mycompare_0123456789876543210Sym1 :: () -> (~>) () Ordering
+    data Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Mycompare_0123456789876543210Sym1KindInference :: SameKind (Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) arg) (Mycompare_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Mycompare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Mycompare_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Mycompare_0123456789876543210Sym1KindInference) ())
+    type Mycompare_0123456789876543210Sym2 (a0123456789876543210 :: ()) (a0123456789876543210 :: ()) =
+        Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    instance PMyOrd () where
+      type Mycompare a a = Apply (Apply Mycompare_0123456789876543210Sym0 a) a
+    type Mycompare_0123456789876543210 :: Foo -> Foo -> Ordering
+    type family Mycompare_0123456789876543210 a a where
+      Mycompare_0123456789876543210 a_0123456789876543210 a_0123456789876543210 = Apply (Apply FooCompareSym0 a_0123456789876543210) a_0123456789876543210
+    type Mycompare_0123456789876543210Sym0 :: (~>) Foo ((~>) Foo Ordering)
+    data Mycompare_0123456789876543210Sym0 a0123456789876543210
+      where
+        Mycompare_0123456789876543210Sym0KindInference :: SameKind (Apply Mycompare_0123456789876543210Sym0 arg) (Mycompare_0123456789876543210Sym1 arg) =>
+                                                          Mycompare_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Mycompare_0123456789876543210Sym0 a0123456789876543210 = Mycompare_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Mycompare_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Mycompare_0123456789876543210Sym0KindInference) ())
+    type Mycompare_0123456789876543210Sym1 :: Foo -> (~>) Foo Ordering
+    data Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Mycompare_0123456789876543210Sym1KindInference :: SameKind (Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) arg) (Mycompare_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Mycompare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Mycompare_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Mycompare_0123456789876543210Sym1KindInference) ())
+    type Mycompare_0123456789876543210Sym2 (a0123456789876543210 :: Foo) (a0123456789876543210 :: Foo) =
+        Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    instance PMyOrd Foo where
+      type Mycompare a a = Apply (Apply Mycompare_0123456789876543210Sym0 a) a
+    type TFHelper_0123456789876543210 :: Foo2 -> Foo2 -> Bool
+    type family TFHelper_0123456789876543210 a a where
+      TFHelper_0123456789876543210 F F = TrueSym0
+      TFHelper_0123456789876543210 G G = TrueSym0
+      TFHelper_0123456789876543210 F G = FalseSym0
+      TFHelper_0123456789876543210 G F = FalseSym0
+    type TFHelper_0123456789876543210Sym0 :: (~>) Foo2 ((~>) Foo2 Bool)
+    data TFHelper_0123456789876543210Sym0 a0123456789876543210
+      where
+        TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) =>
+                                                         TFHelper_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) TFHelper_0123456789876543210Sym0KindInference) ())
+    type TFHelper_0123456789876543210Sym1 :: Foo2 -> (~>) Foo2 Bool
+    data TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                         TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) TFHelper_0123456789876543210Sym1KindInference) ())
+    type TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: Foo2) (a0123456789876543210 :: Foo2) =
+        TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Bool
+    instance PEq Foo2 where
+      type (==) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a
+    infix 4 %<=>
+    sFooCompare ::
+      forall (t :: Foo) (t :: Foo).
+      Sing t
+      -> Sing t -> Sing (Apply (Apply FooCompareSym0 t) t :: Ordering)
+    sConst ::
+      forall a b (t :: a) (t :: b).
+      Sing t -> Sing t -> Sing (Apply (Apply ConstSym0 t) t :: a)
+    sFooCompare SA SA = SEQ
+    sFooCompare SA SB = SLT
+    sFooCompare SB SB = SGT
+    sFooCompare SB SA = SEQ
+    sConst (sX :: Sing x) _ = sX
+    instance SingI (FooCompareSym0 :: (~>) Foo ((~>) Foo Ordering)) where
+      sing = (singFun2 @FooCompareSym0) sFooCompare
+    instance SingI d =>
+             SingI (FooCompareSym1 (d :: Foo) :: (~>) Foo Ordering) where
+      sing
+        = (singFun1 @(FooCompareSym1 (d :: Foo))) (sFooCompare (sing @d))
+    instance SingI (ConstSym0 :: (~>) a ((~>) b a)) where
+      sing = (singFun2 @ConstSym0) sConst
+    instance SingI d => SingI (ConstSym1 (d :: a) :: (~>) b a) where
+      sing = (singFun1 @(ConstSym1 (d :: a))) (sConst (sing @d))
+    data SFoo :: Foo -> GHC.Types.Type
+      where
+        SA :: SFoo (A :: Foo)
+        SB :: SFoo (B :: Foo)
+    type instance Sing @Foo = SFoo
+    instance SingKind Foo where
+      type Demote Foo = Foo
+      fromSing SA = A
+      fromSing SB = B
+      toSing A = SomeSing SA
+      toSing B = SomeSing SB
+    data SFoo2 :: Foo2 -> GHC.Types.Type
+      where
+        SF :: SFoo2 (F :: Foo2)
+        SG :: SFoo2 (G :: Foo2)
+    type instance Sing @Foo2 = SFoo2
+    instance SingKind Foo2 where
+      type Demote Foo2 = Foo2
+      fromSing SF = F
+      fromSing SG = G
+      toSing F = SomeSing SF
+      toSing G = SomeSing SG
+    class SMyOrd a where
+      sMycompare ::
+        forall (t :: a) (t :: a).
+        Sing t
+        -> Sing t -> Sing (Apply (Apply MycompareSym0 t) t :: Ordering)
+      (%<=>) ::
+        forall (t :: a) (t :: a).
+        Sing t -> Sing t -> Sing (Apply (Apply (<=>@#@$) t) t :: Ordering)
+      default (%<=>) ::
+                forall (t :: a) (t :: a).
+                ((Apply (Apply (<=>@#@$) t) t :: Ordering)
+                 ~ Apply (Apply TFHelper_0123456789876543210Sym0 t) t) =>
+                Sing t -> Sing t -> Sing (Apply (Apply (<=>@#@$) t) t :: Ordering)
+      (%<=>)
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @MycompareSym0) sMycompare))
+                sA_0123456789876543210))
+            sA_0123456789876543210
+    instance SMyOrd Nat where
+      sMycompare ::
+        forall (t :: Nat) (t :: Nat).
+        Sing t
+        -> Sing t -> Sing (Apply (Apply MycompareSym0 t) t :: Ordering)
+      sMycompare SZero SZero = SEQ
+      sMycompare SZero (SSucc _) = SLT
+      sMycompare (SSucc _) SZero = SGT
+      sMycompare (SSucc (sN :: Sing n)) (SSucc (sM :: Sing m))
+        = (applySing
+             ((applySing ((singFun2 @MycompareSym0) sMycompare)) sM))
+            sN
+    instance SMyOrd () where
+      sMycompare ::
+        forall (t :: ()) (t :: ()).
+        Sing t
+        -> Sing t -> Sing (Apply (Apply MycompareSym0 t) t :: Ordering)
+      sMycompare _ (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing ((applySing ((singFun2 @ConstSym0) sConst)) SEQ))
+            sA_0123456789876543210
+    instance SMyOrd Foo where
+      sMycompare ::
+        forall (t :: Foo) (t :: Foo).
+        Sing t
+        -> Sing t -> Sing (Apply (Apply MycompareSym0 t) t :: Ordering)
+      sMycompare
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @FooCompareSym0) sFooCompare))
+                sA_0123456789876543210))
+            sA_0123456789876543210
+    instance SEq Foo2 where
+      (%==) ::
+        forall (a :: Foo2) (b :: Foo2). Sing a -> Sing b -> Sing ((==) a b)
+      (%==) SF SF = STrue
+      (%==) SG SG = STrue
+      (%==) SF SG = SFalse
+      (%==) SG SF = SFalse
+    instance SingI A where
+      sing = SA
+    instance SingI B where
+      sing = SB
+    instance SingI F where
+      sing = SF
+    instance SingI G where
+      sing = SG
+    instance SMyOrd a =>
+             SingI (MycompareSym0 :: (~>) a ((~>) a Ordering)) where
+      sing = (singFun2 @MycompareSym0) sMycompare
+    instance (SMyOrd a, SingI d) =>
+             SingI (MycompareSym1 (d :: a) :: (~>) a Ordering) where
+      sing = (singFun1 @(MycompareSym1 (d :: a))) (sMycompare (sing @d))
+    instance SMyOrd a =>
+             SingI ((<=>@#@$) :: (~>) a ((~>) a Ordering)) where
+      sing = (singFun2 @(<=>@#@$)) (%<=>)
+    instance (SMyOrd a, SingI d) =>
+             SingI ((<=>@#@$$) (d :: a) :: (~>) a Ordering) where
+      sing = (singFun1 @((<=>@#@$$) (d :: a))) ((%<=>) (sing @d))
+Singletons/Classes.hs:(0,0)-(0,0): Splicing declarations
+    promote
+      [d| instance Ord Foo2 where
+            F `compare` F = EQ
+            F `compare` _ = LT
+            _ `compare` _ = GT
+          instance MyOrd Foo2 where
+            F `mycompare` F = EQ
+            F `mycompare` _ = LT
+            _ `mycompare` _ = GT |]
+  ======>
+    instance MyOrd Foo2 where
+      mycompare F F = EQ
+      mycompare F _ = LT
+      mycompare _ _ = GT
+    instance Ord Foo2 where
+      compare F F = EQ
+      compare F _ = LT
+      compare _ _ = GT
+    type Mycompare_0123456789876543210 :: Foo2 -> Foo2 -> Ordering
+    type family Mycompare_0123456789876543210 a a where
+      Mycompare_0123456789876543210 'F 'F = EQSym0
+      Mycompare_0123456789876543210 'F _ = LTSym0
+      Mycompare_0123456789876543210 _ _ = GTSym0
+    type Mycompare_0123456789876543210Sym0 :: (~>) Foo2 ((~>) Foo2 Ordering)
+    data Mycompare_0123456789876543210Sym0 a0123456789876543210
+      where
+        Mycompare_0123456789876543210Sym0KindInference :: SameKind (Apply Mycompare_0123456789876543210Sym0 arg) (Mycompare_0123456789876543210Sym1 arg) =>
+                                                          Mycompare_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Mycompare_0123456789876543210Sym0 a0123456789876543210 = Mycompare_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Mycompare_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Mycompare_0123456789876543210Sym0KindInference) ())
+    type Mycompare_0123456789876543210Sym1 :: Foo2
+                                              -> (~>) Foo2 Ordering
+    data Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Mycompare_0123456789876543210Sym1KindInference :: SameKind (Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) arg) (Mycompare_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Mycompare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Mycompare_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Mycompare_0123456789876543210Sym1KindInference) ())
+    type Mycompare_0123456789876543210Sym2 (a0123456789876543210 :: Foo2) (a0123456789876543210 :: Foo2) =
+        Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    instance PMyOrd Foo2 where
+      type Mycompare a a = Apply (Apply Mycompare_0123456789876543210Sym0 a) a
+    type Compare_0123456789876543210 :: Foo2 -> Foo2 -> Ordering
+    type family Compare_0123456789876543210 a a where
+      Compare_0123456789876543210 'F 'F = EQSym0
+      Compare_0123456789876543210 'F _ = LTSym0
+      Compare_0123456789876543210 _ _ = GTSym0
+    type Compare_0123456789876543210Sym0 :: (~>) Foo2 ((~>) Foo2 Ordering)
+    data Compare_0123456789876543210Sym0 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
+                                                        Compare_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
+    type Compare_0123456789876543210Sym1 :: Foo2 -> (~>) Foo2 Ordering
+    data Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
+    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Foo2) (a0123456789876543210 :: Foo2) =
+        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    instance POrd Foo2 where
+      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
+Singletons/Classes.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| data Nat' = Zero' | Succ' Nat'
+          
+          instance MyOrd Nat' where
+            Zero' `mycompare` Zero' = EQ
+            Zero' `mycompare` (Succ' _) = LT
+            (Succ' _) `mycompare` Zero' = GT
+            (Succ' n) `mycompare` (Succ' m) = m `mycompare` n |]
+  ======>
+    data Nat' = Zero' | Succ' Nat'
+    instance MyOrd Nat' where
+      mycompare Zero' Zero' = EQ
+      mycompare Zero' (Succ' _) = LT
+      mycompare (Succ' _) Zero' = GT
+      mycompare (Succ' n) (Succ' m) = (m `mycompare` n)
+    type Zero'Sym0 = Zero' :: Nat'
+    type Succ'Sym0 :: (~>) Nat' Nat'
+    data Succ'Sym0 a0123456789876543210
+      where
+        Succ'Sym0KindInference :: SameKind (Apply Succ'Sym0 arg) (Succ'Sym1 arg) =>
+                                  Succ'Sym0 a0123456789876543210
+    type instance Apply Succ'Sym0 a0123456789876543210 = Succ'Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Succ'Sym0 where
+      suppressUnusedWarnings = snd (((,) Succ'Sym0KindInference) ())
+    type Succ'Sym1 (a0123456789876543210 :: Nat') =
+        Succ' a0123456789876543210 :: Nat'
+    type Mycompare_0123456789876543210 :: Nat' -> Nat' -> Ordering
+    type family Mycompare_0123456789876543210 a a where
+      Mycompare_0123456789876543210 Zero' Zero' = EQSym0
+      Mycompare_0123456789876543210 Zero' (Succ' _) = LTSym0
+      Mycompare_0123456789876543210 (Succ' _) Zero' = GTSym0
+      Mycompare_0123456789876543210 (Succ' n) (Succ' m) = Apply (Apply MycompareSym0 m) n
+    type Mycompare_0123456789876543210Sym0 :: (~>) Nat' ((~>) Nat' Ordering)
+    data Mycompare_0123456789876543210Sym0 a0123456789876543210
+      where
+        Mycompare_0123456789876543210Sym0KindInference :: SameKind (Apply Mycompare_0123456789876543210Sym0 arg) (Mycompare_0123456789876543210Sym1 arg) =>
+                                                          Mycompare_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Mycompare_0123456789876543210Sym0 a0123456789876543210 = Mycompare_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Mycompare_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Mycompare_0123456789876543210Sym0KindInference) ())
+    type Mycompare_0123456789876543210Sym1 :: Nat'
+                                              -> (~>) Nat' Ordering
+    data Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Mycompare_0123456789876543210Sym1KindInference :: SameKind (Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) arg) (Mycompare_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Mycompare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Mycompare_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Mycompare_0123456789876543210Sym1KindInference) ())
+    type Mycompare_0123456789876543210Sym2 (a0123456789876543210 :: Nat') (a0123456789876543210 :: Nat') =
+        Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    instance PMyOrd Nat' where
+      type Mycompare a a = Apply (Apply Mycompare_0123456789876543210Sym0 a) a
+    data SNat' :: Nat' -> GHC.Types.Type
+      where
+        SZero' :: SNat' (Zero' :: Nat')
+        SSucc' :: forall (n :: Nat'). (Sing n) -> SNat' (Succ' n :: Nat')
+    type instance Sing @Nat' = SNat'
+    instance SingKind Nat' where
+      type Demote Nat' = Nat'
+      fromSing SZero' = Zero'
+      fromSing (SSucc' b) = Succ' (fromSing b)
+      toSing Zero' = SomeSing SZero'
+      toSing (Succ' (b :: Demote Nat'))
+        = case toSing b :: SomeSing Nat' of {
+            SomeSing c -> SomeSing (SSucc' c) }
+    instance SMyOrd Nat' where
+      sMycompare ::
+        forall (t :: Nat') (t :: Nat').
+        Sing t
+        -> Sing t
+           -> Sing (Apply (Apply (MycompareSym0 :: TyFun Nat' ((~>) Nat' Ordering)
+                                                   -> GHC.Types.Type) t) t)
+      sMycompare SZero' SZero' = SEQ
+      sMycompare SZero' (SSucc' _) = SLT
+      sMycompare (SSucc' _) SZero' = SGT
+      sMycompare (SSucc' (sN :: Sing n)) (SSucc' (sM :: Sing m))
+        = (applySing
+             ((applySing ((singFun2 @MycompareSym0) sMycompare)) sM))
+            sN
+    instance SingI Zero' where
+      sing = SZero'
+    instance SingI n => SingI (Succ' (n :: Nat')) where
+      sing = SSucc' sing
+    instance SingI (Succ'Sym0 :: (~>) Nat' Nat') where
+      sing = (singFun1 @Succ'Sym0) SSucc'
diff --git a/tests/compile-and-dump/Singletons/Classes2.ghc88.template b/tests/compile-and-dump/Singletons/Classes2.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/Classes2.ghc88.template
+++ /dev/null
@@ -1,89 +0,0 @@
-Singletons/Classes2.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| data NatFoo = ZeroFoo | SuccFoo NatFoo
-          
-          instance MyOrd NatFoo where
-            ZeroFoo `mycompare` ZeroFoo = EQ
-            ZeroFoo `mycompare` (SuccFoo _) = LT
-            (SuccFoo _) `mycompare` ZeroFoo = GT
-            (SuccFoo n) `mycompare` (SuccFoo m) = m `mycompare` n |]
-  ======>
-    data NatFoo = ZeroFoo | SuccFoo NatFoo
-    instance MyOrd NatFoo where
-      mycompare ZeroFoo ZeroFoo = EQ
-      mycompare ZeroFoo (SuccFoo _) = LT
-      mycompare (SuccFoo _) ZeroFoo = GT
-      mycompare (SuccFoo n) (SuccFoo m) = (m `mycompare` n)
-    type ZeroFooSym0 = ZeroFoo
-    type SuccFooSym1 (t0123456789876543210 :: NatFoo) =
-        SuccFoo t0123456789876543210
-    instance SuppressUnusedWarnings SuccFooSym0 where
-      suppressUnusedWarnings = snd (((,) SuccFooSym0KindInference) ())
-    data SuccFooSym0 :: (~>) NatFoo NatFoo
-      where
-        SuccFooSym0KindInference :: forall t0123456789876543210
-                                           arg. SameKind (Apply SuccFooSym0 arg) (SuccFooSym1 arg) =>
-                                    SuccFooSym0 t0123456789876543210
-    type instance Apply SuccFooSym0 t0123456789876543210 = SuccFoo t0123456789876543210
-    type family Mycompare_0123456789876543210 (a :: NatFoo) (a :: NatFoo) :: Ordering where
-      Mycompare_0123456789876543210 ZeroFoo ZeroFoo = EQSym0
-      Mycompare_0123456789876543210 ZeroFoo (SuccFoo _) = LTSym0
-      Mycompare_0123456789876543210 (SuccFoo _) ZeroFoo = GTSym0
-      Mycompare_0123456789876543210 (SuccFoo n) (SuccFoo m) = Apply (Apply MycompareSym0 m) n
-    type Mycompare_0123456789876543210Sym2 (a0123456789876543210 :: NatFoo) (a0123456789876543210 :: NatFoo) =
-        Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Mycompare_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Mycompare_0123456789876543210Sym1KindInference) ())
-    data Mycompare_0123456789876543210Sym1 (a0123456789876543210 :: NatFoo) :: (~>) NatFoo Ordering
-      where
-        Mycompare_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) arg) (Mycompare_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Mycompare_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Mycompare_0123456789876543210Sym0KindInference) ())
-    data Mycompare_0123456789876543210Sym0 :: (~>) NatFoo ((~>) NatFoo Ordering)
-      where
-        Mycompare_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply Mycompare_0123456789876543210Sym0 arg) (Mycompare_0123456789876543210Sym1 arg) =>
-                                                          Mycompare_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Mycompare_0123456789876543210Sym0 a0123456789876543210 = Mycompare_0123456789876543210Sym1 a0123456789876543210
-    instance PMyOrd NatFoo where
-      type Mycompare a a = Apply (Apply Mycompare_0123456789876543210Sym0 a) a
-    data SNatFoo :: NatFoo -> GHC.Types.Type
-      where
-        SZeroFoo :: SNatFoo ZeroFoo
-        SSuccFoo :: forall (n :: NatFoo).
-                    (Sing (n :: NatFoo)) -> SNatFoo (SuccFoo n)
-    type instance Sing @NatFoo = SNatFoo
-    instance SingKind NatFoo where
-      type Demote NatFoo = NatFoo
-      fromSing SZeroFoo = ZeroFoo
-      fromSing (SSuccFoo b) = SuccFoo (fromSing b)
-      toSing ZeroFoo = SomeSing SZeroFoo
-      toSing (SuccFoo (b :: Demote NatFoo))
-        = case toSing b :: SomeSing NatFoo of {
-            SomeSing c -> SomeSing (SSuccFoo c) }
-    instance SMyOrd NatFoo where
-      sMycompare ::
-        forall (t1 :: NatFoo) (t2 :: NatFoo).
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply (MycompareSym0 :: TyFun NatFoo ((~>) NatFoo Ordering)
-                                                   -> GHC.Types.Type) t1) t2)
-      sMycompare SZeroFoo SZeroFoo = SEQ
-      sMycompare SZeroFoo (SSuccFoo _) = SLT
-      sMycompare (SSuccFoo _) SZeroFoo = SGT
-      sMycompare (SSuccFoo (sN :: Sing n)) (SSuccFoo (sM :: Sing m))
-        = (applySing
-             ((applySing ((singFun2 @MycompareSym0) sMycompare)) sM))
-            sN
-    instance SingI ZeroFoo where
-      sing = SZeroFoo
-    instance SingI n => SingI (SuccFoo (n :: NatFoo)) where
-      sing = SSuccFoo sing
-    instance SingI (SuccFooSym0 :: (~>) NatFoo NatFoo) where
-      sing = (singFun1 @SuccFooSym0) SSuccFoo
diff --git a/tests/compile-and-dump/Singletons/Classes2.golden b/tests/compile-and-dump/Singletons/Classes2.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/Classes2.golden
@@ -0,0 +1,90 @@
+Singletons/Classes2.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| data NatFoo = ZeroFoo | SuccFoo NatFoo
+          
+          instance MyOrd NatFoo where
+            ZeroFoo `mycompare` ZeroFoo = EQ
+            ZeroFoo `mycompare` (SuccFoo _) = LT
+            (SuccFoo _) `mycompare` ZeroFoo = GT
+            (SuccFoo n) `mycompare` (SuccFoo m) = m `mycompare` n |]
+  ======>
+    data NatFoo = ZeroFoo | SuccFoo NatFoo
+    instance MyOrd NatFoo where
+      mycompare ZeroFoo ZeroFoo = EQ
+      mycompare ZeroFoo (SuccFoo _) = LT
+      mycompare (SuccFoo _) ZeroFoo = GT
+      mycompare (SuccFoo n) (SuccFoo m) = (m `mycompare` n)
+    type ZeroFooSym0 = ZeroFoo :: NatFoo
+    type SuccFooSym0 :: (~>) NatFoo NatFoo
+    data SuccFooSym0 a0123456789876543210
+      where
+        SuccFooSym0KindInference :: SameKind (Apply SuccFooSym0 arg) (SuccFooSym1 arg) =>
+                                    SuccFooSym0 a0123456789876543210
+    type instance Apply SuccFooSym0 a0123456789876543210 = SuccFooSym1 a0123456789876543210
+    instance SuppressUnusedWarnings SuccFooSym0 where
+      suppressUnusedWarnings = snd (((,) SuccFooSym0KindInference) ())
+    type SuccFooSym1 (a0123456789876543210 :: NatFoo) =
+        SuccFoo a0123456789876543210 :: NatFoo
+    type Mycompare_0123456789876543210 :: NatFoo -> NatFoo -> Ordering
+    type family Mycompare_0123456789876543210 a a where
+      Mycompare_0123456789876543210 ZeroFoo ZeroFoo = EQSym0
+      Mycompare_0123456789876543210 ZeroFoo (SuccFoo _) = LTSym0
+      Mycompare_0123456789876543210 (SuccFoo _) ZeroFoo = GTSym0
+      Mycompare_0123456789876543210 (SuccFoo n) (SuccFoo m) = Apply (Apply MycompareSym0 m) n
+    type Mycompare_0123456789876543210Sym0 :: (~>) NatFoo ((~>) NatFoo Ordering)
+    data Mycompare_0123456789876543210Sym0 a0123456789876543210
+      where
+        Mycompare_0123456789876543210Sym0KindInference :: SameKind (Apply Mycompare_0123456789876543210Sym0 arg) (Mycompare_0123456789876543210Sym1 arg) =>
+                                                          Mycompare_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Mycompare_0123456789876543210Sym0 a0123456789876543210 = Mycompare_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Mycompare_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Mycompare_0123456789876543210Sym0KindInference) ())
+    type Mycompare_0123456789876543210Sym1 :: NatFoo
+                                              -> (~>) NatFoo Ordering
+    data Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Mycompare_0123456789876543210Sym1KindInference :: SameKind (Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) arg) (Mycompare_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          Mycompare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Mycompare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Mycompare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Mycompare_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Mycompare_0123456789876543210Sym1KindInference) ())
+    type Mycompare_0123456789876543210Sym2 (a0123456789876543210 :: NatFoo) (a0123456789876543210 :: NatFoo) =
+        Mycompare_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    instance PMyOrd NatFoo where
+      type Mycompare a a = Apply (Apply Mycompare_0123456789876543210Sym0 a) a
+    data SNatFoo :: NatFoo -> GHC.Types.Type
+      where
+        SZeroFoo :: SNatFoo (ZeroFoo :: NatFoo)
+        SSuccFoo :: forall (n :: NatFoo).
+                    (Sing n) -> SNatFoo (SuccFoo n :: NatFoo)
+    type instance Sing @NatFoo = SNatFoo
+    instance SingKind NatFoo where
+      type Demote NatFoo = NatFoo
+      fromSing SZeroFoo = ZeroFoo
+      fromSing (SSuccFoo b) = SuccFoo (fromSing b)
+      toSing ZeroFoo = SomeSing SZeroFoo
+      toSing (SuccFoo (b :: Demote NatFoo))
+        = case toSing b :: SomeSing NatFoo of {
+            SomeSing c -> SomeSing (SSuccFoo c) }
+    instance SMyOrd NatFoo where
+      sMycompare ::
+        forall (t1 :: NatFoo) (t2 :: NatFoo).
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply (MycompareSym0 :: TyFun NatFoo ((~>) NatFoo Ordering)
+                                                   -> GHC.Types.Type) t1) t2)
+      sMycompare SZeroFoo SZeroFoo = SEQ
+      sMycompare SZeroFoo (SSuccFoo _) = SLT
+      sMycompare (SSuccFoo _) SZeroFoo = SGT
+      sMycompare (SSuccFoo (sN :: Sing n)) (SSuccFoo (sM :: Sing m))
+        = (applySing
+             ((applySing ((singFun2 @MycompareSym0) sMycompare)) sM))
+            sN
+    instance SingI ZeroFoo where
+      sing = SZeroFoo
+    instance SingI n => SingI (SuccFoo (n :: NatFoo)) where
+      sing = SSuccFoo sing
+    instance SingI (SuccFooSym0 :: (~>) NatFoo NatFoo) where
+      sing = (singFun1 @SuccFooSym0) SSuccFoo
diff --git a/tests/compile-and-dump/Singletons/Contains.ghc88.template b/tests/compile-and-dump/Singletons/Contains.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/Contains.ghc88.template
+++ /dev/null
@@ -1,50 +0,0 @@
-Singletons/Contains.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| contains :: Eq a => a -> [a] -> Bool
-          contains _ [] = False
-          contains elt (h : t) = (elt == h) || (contains elt t) |]
-  ======>
-    contains :: Eq a => a -> [a] -> Bool
-    contains _ [] = False
-    contains elt (h : t) = ((elt == h) || (contains elt) t)
-    type ContainsSym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: [a0123456789876543210]) =
-        Contains a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ContainsSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) ContainsSym1KindInference) ())
-    data ContainsSym1 (a0123456789876543210 :: a0123456789876543210) :: (~>) [a0123456789876543210] Bool
-      where
-        ContainsSym1KindInference :: forall a0123456789876543210
-                                            a0123456789876543210
-                                            arg. SameKind (Apply (ContainsSym1 a0123456789876543210) arg) (ContainsSym2 a0123456789876543210 arg) =>
-                                     ContainsSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ContainsSym1 a0123456789876543210) a0123456789876543210 = Contains a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ContainsSym0 where
-      suppressUnusedWarnings = snd (((,) ContainsSym0KindInference) ())
-    data ContainsSym0 :: forall a0123456789876543210.
-                         (~>) a0123456789876543210 ((~>) [a0123456789876543210] Bool)
-      where
-        ContainsSym0KindInference :: forall a0123456789876543210
-                                            arg. SameKind (Apply ContainsSym0 arg) (ContainsSym1 arg) =>
-                                     ContainsSym0 a0123456789876543210
-    type instance Apply ContainsSym0 a0123456789876543210 = ContainsSym1 a0123456789876543210
-    type family Contains (a :: a) (a :: [a]) :: Bool where
-      Contains _ '[] = FalseSym0
-      Contains elt ('(:) h t) = Apply (Apply (||@#@$) (Apply (Apply (==@#@$) elt) h)) (Apply (Apply ContainsSym0 elt) t)
-    sContains ::
-      forall a (t :: a) (t :: [a]).
-      SEq a =>
-      Sing t -> Sing t -> Sing (Apply (Apply ContainsSym0 t) t :: Bool)
-    sContains _ SNil = SFalse
-    sContains (sElt :: Sing elt) (SCons (sH :: Sing h) (sT :: Sing t))
-      = (applySing
-           ((applySing ((singFun2 @(||@#@$)) (%||)))
-              ((applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sElt)) sH)))
-          ((applySing
-              ((applySing ((singFun2 @ContainsSym0) sContains)) sElt))
-             sT)
-    instance SEq a =>
-             SingI (ContainsSym0 :: (~>) a ((~>) [a] Bool)) where
-      sing = (singFun2 @ContainsSym0) sContains
-    instance (SEq a, SingI d) =>
-             SingI (ContainsSym1 (d :: a) :: (~>) [a] Bool) where
-      sing = (singFun1 @(ContainsSym1 (d :: a))) (sContains (sing @d))
diff --git a/tests/compile-and-dump/Singletons/Contains.golden b/tests/compile-and-dump/Singletons/Contains.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/Contains.golden
@@ -0,0 +1,49 @@
+Singletons/Contains.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| contains :: Eq a => a -> [a] -> Bool
+          contains _ [] = False
+          contains elt (h : t) = (elt == h) || (contains elt t) |]
+  ======>
+    contains :: Eq a => a -> [a] -> Bool
+    contains _ [] = False
+    contains elt (h : t) = ((elt == h) || (contains elt) t)
+    type ContainsSym0 :: (~>) a ((~>) [a] Bool)
+    data ContainsSym0 a0123456789876543210
+      where
+        ContainsSym0KindInference :: SameKind (Apply ContainsSym0 arg) (ContainsSym1 arg) =>
+                                     ContainsSym0 a0123456789876543210
+    type instance Apply ContainsSym0 a0123456789876543210 = ContainsSym1 a0123456789876543210
+    instance SuppressUnusedWarnings ContainsSym0 where
+      suppressUnusedWarnings = snd (((,) ContainsSym0KindInference) ())
+    type ContainsSym1 :: a -> (~>) [a] Bool
+    data ContainsSym1 a0123456789876543210 a0123456789876543210
+      where
+        ContainsSym1KindInference :: SameKind (Apply (ContainsSym1 a0123456789876543210) arg) (ContainsSym2 a0123456789876543210 arg) =>
+                                     ContainsSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ContainsSym1 a0123456789876543210) a0123456789876543210 = ContainsSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ContainsSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) ContainsSym1KindInference) ())
+    type ContainsSym2 (a0123456789876543210 :: a) (a0123456789876543210 :: [a]) =
+        Contains a0123456789876543210 a0123456789876543210 :: Bool
+    type Contains :: a -> [a] -> Bool
+    type family Contains a a where
+      Contains _ '[] = FalseSym0
+      Contains elt ('(:) h t) = Apply (Apply (||@#@$) (Apply (Apply (==@#@$) elt) h)) (Apply (Apply ContainsSym0 elt) t)
+    sContains ::
+      forall a (t :: a) (t :: [a]).
+      SEq a =>
+      Sing t -> Sing t -> Sing (Apply (Apply ContainsSym0 t) t :: Bool)
+    sContains _ SNil = SFalse
+    sContains (sElt :: Sing elt) (SCons (sH :: Sing h) (sT :: Sing t))
+      = (applySing
+           ((applySing ((singFun2 @(||@#@$)) (%||)))
+              ((applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sElt)) sH)))
+          ((applySing
+              ((applySing ((singFun2 @ContainsSym0) sContains)) sElt))
+             sT)
+    instance SEq a =>
+             SingI (ContainsSym0 :: (~>) a ((~>) [a] Bool)) where
+      sing = (singFun2 @ContainsSym0) sContains
+    instance (SEq a, SingI d) =>
+             SingI (ContainsSym1 (d :: a) :: (~>) [a] Bool) where
+      sing = (singFun1 @(ContainsSym1 (d :: a))) (sContains (sing @d))
diff --git a/tests/compile-and-dump/Singletons/DataValues.ghc88.template b/tests/compile-and-dump/Singletons/DataValues.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/DataValues.ghc88.template
+++ /dev/null
@@ -1,193 +0,0 @@
-Singletons/DataValues.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| pr = Pair (Succ Zero) ([Zero])
-          complex = Pair (Pair (Just Zero) Zero) False
-          tuple = (False, Just Zero, True)
-          aList = [Zero, Succ Zero, Succ (Succ Zero)]
-          
-          data Pair a b
-            = Pair a b
-            deriving Show |]
-  ======>
-    data Pair a b
-      = Pair a b
-      deriving Show
-    pr = (Pair (Succ Zero)) [Zero]
-    complex = (Pair ((Pair (Just Zero)) Zero)) False
-    tuple = (False, Just Zero, True)
-    aList = [Zero, Succ Zero, Succ (Succ Zero)]
-    type PairSym2 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) =
-        Pair t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (PairSym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) PairSym1KindInference) ())
-    data PairSym1 (t0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                    (~>) b0123456789876543210 (Pair a0123456789876543210 b0123456789876543210)
-      where
-        PairSym1KindInference :: forall t0123456789876543210
-                                        t0123456789876543210
-                                        arg. SameKind (Apply (PairSym1 t0123456789876543210) arg) (PairSym2 t0123456789876543210 arg) =>
-                                 PairSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (PairSym1 t0123456789876543210) t0123456789876543210 = Pair t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings PairSym0 where
-      suppressUnusedWarnings = snd (((,) PairSym0KindInference) ())
-    data PairSym0 :: forall a0123456789876543210 b0123456789876543210.
-                     (~>) a0123456789876543210 ((~>) b0123456789876543210 (Pair a0123456789876543210 b0123456789876543210))
-      where
-        PairSym0KindInference :: forall t0123456789876543210
-                                        arg. SameKind (Apply PairSym0 arg) (PairSym1 arg) =>
-                                 PairSym0 t0123456789876543210
-    type instance Apply PairSym0 t0123456789876543210 = PairSym1 t0123456789876543210
-    type AListSym0 = AList
-    type TupleSym0 = Tuple
-    type ComplexSym0 = Complex
-    type PrSym0 = Pr
-    type family AList where
-      AList = Apply (Apply (:@#@$) ZeroSym0) (Apply (Apply (:@#@$) (Apply SuccSym0 ZeroSym0)) (Apply (Apply (:@#@$) (Apply SuccSym0 (Apply SuccSym0 ZeroSym0))) '[]))
-    type family Tuple where
-      Tuple = Apply (Apply (Apply Tuple3Sym0 FalseSym0) (Apply JustSym0 ZeroSym0)) TrueSym0
-    type family Complex where
-      Complex = Apply (Apply PairSym0 (Apply (Apply PairSym0 (Apply JustSym0 ZeroSym0)) ZeroSym0)) FalseSym0
-    type family Pr where
-      Pr = Apply (Apply PairSym0 (Apply SuccSym0 ZeroSym0)) (Apply (Apply (:@#@$) ZeroSym0) '[])
-    type family ShowsPrec_0123456789876543210 (a :: GHC.Types.Nat) (a :: Pair a b) (a :: Symbol) :: Symbol where
-      ShowsPrec_0123456789876543210 p_0123456789876543210 (Pair arg_0123456789876543210 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Pair ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowSpaceSym0) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))))) a_0123456789876543210
-    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Pair a0123456789876543210 b0123456789876543210) (a0123456789876543210 :: Symbol) =
-        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
-    data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Pair a0123456789876543210 b0123456789876543210) :: (~>) Symbol Symbol
-      where
-        ShowsPrec_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
-    data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) :: forall a0123456789876543210
-                                                                                             b0123456789876543210.
-                                                                                      (~>) (Pair a0123456789876543210 b0123456789876543210) ((~>) Symbol Symbol)
-      where
-        ShowsPrec_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
-    data ShowsPrec_0123456789876543210Sym0 :: forall a0123456789876543210
-                                                     b0123456789876543210.
-                                              (~>) GHC.Types.Nat ((~>) (Pair a0123456789876543210 b0123456789876543210) ((~>) Symbol Symbol))
-      where
-        ShowsPrec_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
-    instance PShow (Pair a b) where
-      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
-    sAList :: Sing AListSym0
-    sTuple :: Sing TupleSym0
-    sComplex :: Sing ComplexSym0
-    sPr :: Sing PrSym0
-    sAList
-      = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SZero))
-          ((applySing
-              ((applySing ((singFun2 @(:@#@$)) SCons))
-                 ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
-             ((applySing
-                 ((applySing ((singFun2 @(:@#@$)) SCons))
-                    ((applySing ((singFun1 @SuccSym0) SSucc))
-                       ((applySing ((singFun1 @SuccSym0) SSucc)) SZero))))
-                SNil))
-    sTuple
-      = (applySing
-           ((applySing ((applySing ((singFun3 @Tuple3Sym0) STuple3)) SFalse))
-              ((applySing ((singFun1 @JustSym0) SJust)) SZero)))
-          STrue
-    sComplex
-      = (applySing
-           ((applySing ((singFun2 @PairSym0) SPair))
-              ((applySing
-                  ((applySing ((singFun2 @PairSym0) SPair))
-                     ((applySing ((singFun1 @JustSym0) SJust)) SZero)))
-                 SZero)))
-          SFalse
-    sPr
-      = (applySing
-           ((applySing ((singFun2 @PairSym0) SPair))
-              ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
-          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SZero)) SNil)
-    data SPair :: forall a b. Pair a b -> GHC.Types.Type
-      where
-        SPair :: forall a b (n :: a) (n :: b).
-                 (Sing (n :: a)) -> (Sing (n :: b)) -> SPair (Pair n n)
-    type instance Sing @(Pair a b) = SPair
-    instance (SingKind a, SingKind b) => SingKind (Pair a b) where
-      type Demote (Pair a b) = Pair (Demote a) (Demote b)
-      fromSing (SPair b b) = (Pair (fromSing b)) (fromSing b)
-      toSing (Pair (b :: Demote a) (b :: Demote b))
-        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b) of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SPair c) c) }
-    instance (SShow a, SShow b) => SShow (Pair a b) where
-      sShowsPrec ::
-        forall (t1 :: GHC.Types.Nat) (t2 :: Pair a b) (t3 :: Symbol).
-        Sing t1
-        -> Sing t2
-           -> Sing t3
-              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) (Pair a b) ((~>) Symbol Symbol))
-                                                             -> GHC.Types.Type) t1) t2) t3)
-      sShowsPrec
-        (sP_0123456789876543210 :: Sing p_0123456789876543210)
-        (SPair (sArg_0123456789876543210 :: Sing arg_0123456789876543210)
-               (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
-                    ((applySing
-                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
-                       (sFromInteger (sing :: Sing 10)))))
-                ((applySing
-                    ((applySing ((singFun3 @(.@#@$)) (%.)))
-                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                          (sing :: Sing "Pair "))))
-                   ((applySing
-                       ((applySing ((singFun3 @(.@#@$)) (%.)))
-                          ((applySing
-                              ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                                 (sFromInteger (sing :: Sing 11))))
-                             sArg_0123456789876543210)))
-                      ((applySing
-                          ((applySing ((singFun3 @(.@#@$)) (%.)))
-                             ((singFun1 @ShowSpaceSym0) sShowSpace)))
-                         ((applySing
-                             ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                                (sFromInteger (sing :: Sing 11))))
-                            sArg_0123456789876543210))))))
-            sA_0123456789876543210
-    instance (Data.Singletons.ShowSing.ShowSing a,
-              Data.Singletons.ShowSing.ShowSing b) =>
-             Show (SPair (z :: Pair a b)) where
-      showsPrec
-        p_0123456789876543210
-        (SPair (arg_0123456789876543210 :: Sing argTy_0123456789876543210)
-               (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
-        = (showParen (((>) p_0123456789876543210) 10))
-            (((.) (showString "SPair "))
-               (((.) ((showsPrec 11) arg_0123456789876543210))
-                  (((.) GHC.Show.showSpace)
-                     ((showsPrec 11) arg_0123456789876543210)))) ::
-            (Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210,
-             Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210) =>
-            ShowS
-    instance (SingI n, SingI n) => SingI (Pair (n :: a) (n :: b)) where
-      sing = (SPair sing) sing
-    instance SingI (PairSym0 :: (~>) a ((~>) b (Pair a b))) where
-      sing = (singFun2 @PairSym0) SPair
-    instance SingI d =>
-             SingI (PairSym1 (d :: a) :: (~>) b (Pair a b)) where
-      sing = (singFun1 @(PairSym1 (d :: a))) (SPair (sing @d))
diff --git a/tests/compile-and-dump/Singletons/DataValues.golden b/tests/compile-and-dump/Singletons/DataValues.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/DataValues.golden
@@ -0,0 +1,187 @@
+Singletons/DataValues.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| pr = Pair (Succ Zero) ([Zero])
+          complex = Pair (Pair (Just Zero) Zero) False
+          tuple = (False, Just Zero, True)
+          aList = [Zero, Succ Zero, Succ (Succ Zero)]
+          
+          data Pair a b
+            = Pair a b
+            deriving Show |]
+  ======>
+    data Pair a b
+      = Pair a b
+      deriving Show
+    pr = (Pair (Succ Zero)) [Zero]
+    complex = (Pair ((Pair (Just Zero)) Zero)) False
+    tuple = (False, Just Zero, True)
+    aList = [Zero, Succ Zero, Succ (Succ Zero)]
+    type PairSym0 :: forall a b. (~>) a ((~>) b (Pair a b))
+    data PairSym0 a0123456789876543210
+      where
+        PairSym0KindInference :: SameKind (Apply PairSym0 arg) (PairSym1 arg) =>
+                                 PairSym0 a0123456789876543210
+    type instance Apply PairSym0 a0123456789876543210 = PairSym1 a0123456789876543210
+    instance SuppressUnusedWarnings PairSym0 where
+      suppressUnusedWarnings = snd (((,) PairSym0KindInference) ())
+    type PairSym1 :: forall a b. a -> (~>) b (Pair a b)
+    data PairSym1 a0123456789876543210 a0123456789876543210
+      where
+        PairSym1KindInference :: SameKind (Apply (PairSym1 a0123456789876543210) arg) (PairSym2 a0123456789876543210 arg) =>
+                                 PairSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (PairSym1 a0123456789876543210) a0123456789876543210 = PairSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (PairSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) PairSym1KindInference) ())
+    type PairSym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        Pair a0123456789876543210 a0123456789876543210 :: Pair a b
+    type AListSym0 = AList
+    type TupleSym0 = Tuple
+    type ComplexSym0 = Complex
+    type PrSym0 = Pr
+    type family AList where
+      AList = Apply (Apply (:@#@$) ZeroSym0) (Apply (Apply (:@#@$) (Apply SuccSym0 ZeroSym0)) (Apply (Apply (:@#@$) (Apply SuccSym0 (Apply SuccSym0 ZeroSym0))) NilSym0))
+    type family Tuple where
+      Tuple = Apply (Apply (Apply Tuple3Sym0 FalseSym0) (Apply JustSym0 ZeroSym0)) TrueSym0
+    type family Complex where
+      Complex = Apply (Apply PairSym0 (Apply (Apply PairSym0 (Apply JustSym0 ZeroSym0)) ZeroSym0)) FalseSym0
+    type family Pr where
+      Pr = Apply (Apply PairSym0 (Apply SuccSym0 ZeroSym0)) (Apply (Apply (:@#@$) ZeroSym0) NilSym0)
+    type ShowsPrec_0123456789876543210 :: GHC.Types.Nat
+                                          -> Pair a b -> Symbol -> Symbol
+    type family ShowsPrec_0123456789876543210 a a a where
+      ShowsPrec_0123456789876543210 p_0123456789876543210 (Pair arg_0123456789876543210 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Pair ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowSpaceSym0) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))))) a_0123456789876543210
+    type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) (Pair a b) ((~>) Symbol Symbol))
+    data ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
+    type ShowsPrec_0123456789876543210Sym1 :: GHC.Types.Nat
+                                              -> (~>) (Pair a b) ((~>) Symbol Symbol)
+    data ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
+    type ShowsPrec_0123456789876543210Sym2 :: GHC.Types.Nat
+                                              -> Pair a b -> (~>) Symbol Symbol
+    data ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
+    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Pair a b) (a0123456789876543210 :: Symbol) =
+        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Symbol
+    instance PShow (Pair a b) where
+      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
+    sAList :: Sing @_ AListSym0
+    sTuple :: Sing @_ TupleSym0
+    sComplex :: Sing @_ ComplexSym0
+    sPr :: Sing @_ PrSym0
+    sAList
+      = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SZero))
+          ((applySing
+              ((applySing ((singFun2 @(:@#@$)) SCons))
+                 ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
+             ((applySing
+                 ((applySing ((singFun2 @(:@#@$)) SCons))
+                    ((applySing ((singFun1 @SuccSym0) SSucc))
+                       ((applySing ((singFun1 @SuccSym0) SSucc)) SZero))))
+                SNil))
+    sTuple
+      = (applySing
+           ((applySing ((applySing ((singFun3 @Tuple3Sym0) STuple3)) SFalse))
+              ((applySing ((singFun1 @JustSym0) SJust)) SZero)))
+          STrue
+    sComplex
+      = (applySing
+           ((applySing ((singFun2 @PairSym0) SPair))
+              ((applySing
+                  ((applySing ((singFun2 @PairSym0) SPair))
+                     ((applySing ((singFun1 @JustSym0) SJust)) SZero)))
+                 SZero)))
+          SFalse
+    sPr
+      = (applySing
+           ((applySing ((singFun2 @PairSym0) SPair))
+              ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
+          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SZero)) SNil)
+    data SPair :: forall a b. Pair a b -> GHC.Types.Type
+      where
+        SPair :: forall a b (n :: a) (n :: b).
+                 (Sing n) -> (Sing n) -> SPair (Pair n n :: Pair a b)
+    type instance Sing @(Pair a b) = SPair
+    instance (SingKind a, SingKind b) => SingKind (Pair a b) where
+      type Demote (Pair a b) = Pair (Demote a) (Demote b)
+      fromSing (SPair b b) = (Pair (fromSing b)) (fromSing b)
+      toSing (Pair (b :: Demote a) (b :: Demote b))
+        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b) of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SPair c) c) }
+    instance (SShow a, SShow b) => SShow (Pair a b) where
+      sShowsPrec ::
+        forall (t1 :: GHC.Types.Nat) (t2 :: Pair a b) (t3 :: Symbol).
+        Sing t1
+        -> Sing t2
+           -> Sing t3
+              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) (Pair a b) ((~>) Symbol Symbol))
+                                                             -> GHC.Types.Type) t1) t2) t3)
+      sShowsPrec
+        (sP_0123456789876543210 :: Sing p_0123456789876543210)
+        (SPair (sArg_0123456789876543210 :: Sing arg_0123456789876543210)
+               (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
+                    ((applySing
+                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
+                       (sFromInteger (sing :: Sing 10)))))
+                ((applySing
+                    ((applySing ((singFun3 @(.@#@$)) (%.)))
+                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                          (sing :: Sing "Pair "))))
+                   ((applySing
+                       ((applySing ((singFun3 @(.@#@$)) (%.)))
+                          ((applySing
+                              ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                                 (sFromInteger (sing :: Sing 11))))
+                             sArg_0123456789876543210)))
+                      ((applySing
+                          ((applySing ((singFun3 @(.@#@$)) (%.)))
+                             ((singFun1 @ShowSpaceSym0) sShowSpace)))
+                         ((applySing
+                             ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                                (sFromInteger (sing :: Sing 11))))
+                            sArg_0123456789876543210))))))
+            sA_0123456789876543210
+    instance (Data.Singletons.ShowSing.ShowSing a,
+              Data.Singletons.ShowSing.ShowSing b) =>
+             Show (SPair (z :: Pair a b)) where
+      showsPrec
+        p_0123456789876543210
+        (SPair (arg_0123456789876543210 :: Sing argTy_0123456789876543210)
+               (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
+        = (showParen (((>) p_0123456789876543210) 10))
+            (((.) (showString "SPair "))
+               (((.) ((showsPrec 11) arg_0123456789876543210))
+                  (((.) GHC.Show.showSpace)
+                     ((showsPrec 11) arg_0123456789876543210)))) ::
+            (Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210,
+             Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210) =>
+            ShowS
+    instance (SingI n, SingI n) => SingI (Pair (n :: a) (n :: b)) where
+      sing = (SPair sing) sing
+    instance SingI (PairSym0 :: (~>) a ((~>) b (Pair a b))) where
+      sing = (singFun2 @PairSym0) SPair
+    instance SingI d =>
+             SingI (PairSym1 (d :: a) :: (~>) b (Pair a b)) where
+      sing = (singFun1 @(PairSym1 (d :: a))) (SPair (sing @d))
diff --git a/tests/compile-and-dump/Singletons/Empty.ghc88.template b/tests/compile-and-dump/Singletons/Empty.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/Empty.ghc88.template
+++ /dev/null
@@ -1,10 +0,0 @@
-Singletons/Empty.hs:(0,0)-(0,0): Splicing declarations
-    singletons [d| data Empty |]
-  ======>
-    data Empty
-    data SEmpty :: Empty -> GHC.Types.Type
-    type instance Sing @Empty = SEmpty
-    instance SingKind Empty where
-      type Demote Empty = Empty
-      fromSing x = case x of
-      toSing x = SomeSing (case x of)
diff --git a/tests/compile-and-dump/Singletons/Empty.golden b/tests/compile-and-dump/Singletons/Empty.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/Empty.golden
@@ -0,0 +1,10 @@
+Singletons/Empty.hs:(0,0)-(0,0): Splicing declarations
+    singletons [d| data Empty |]
+  ======>
+    data Empty
+    data SEmpty :: Empty -> GHC.Types.Type
+    type instance Sing @Empty = SEmpty
+    instance SingKind Empty where
+      type Demote Empty = Empty
+      fromSing x = case x of
+      toSing x = SomeSing (case x of)
diff --git a/tests/compile-and-dump/Singletons/EmptyShowDeriving.ghc88.template b/tests/compile-and-dump/Singletons/EmptyShowDeriving.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/EmptyShowDeriving.ghc88.template
+++ /dev/null
@@ -1,70 +0,0 @@
-Singletons/EmptyShowDeriving.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| data Foo
-          
-          deriving instance Show Foo |]
-  ======>
-    data Foo
-    deriving instance Show Foo
-    type family Case_0123456789876543210 v_0123456789876543210 a_0123456789876543210 t where
-    type family ShowsPrec_0123456789876543210 (a :: GHC.Types.Nat) (a :: Foo) (a :: GHC.Types.Symbol) :: GHC.Types.Symbol where
-      ShowsPrec_0123456789876543210 _ v_0123456789876543210 a_0123456789876543210 = Apply (Case_0123456789876543210 v_0123456789876543210 a_0123456789876543210 v_0123456789876543210) a_0123456789876543210
-    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Foo) (a0123456789876543210 :: GHC.Types.Symbol) =
-        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
-    data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Foo) :: (~>) GHC.Types.Symbol GHC.Types.Symbol
-      where
-        ShowsPrec_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
-    data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) :: (~>) Foo ((~>) GHC.Types.Symbol GHC.Types.Symbol)
-      where
-        ShowsPrec_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
-    data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) Foo ((~>) GHC.Types.Symbol GHC.Types.Symbol))
-      where
-        ShowsPrec_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
-    instance PShow Foo where
-      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
-    data SFoo :: Foo -> GHC.Types.Type
-    type instance Sing @Foo = SFoo
-    instance SingKind Foo where
-      type Demote Foo = Foo
-      fromSing x = case x of
-      toSing x = SomeSing (case x of)
-    instance SShow Foo where
-      sShowsPrec ::
-        forall (t1 :: GHC.Types.Nat) (t2 :: Foo) (t3 :: GHC.Types.Symbol).
-        Sing t1
-        -> Sing t2
-           -> Sing t3
-              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) Foo ((~>) GHC.Types.Symbol GHC.Types.Symbol))
-                                                             -> GHC.Types.Type) t1) t2) t3)
-      sShowsPrec
-        _
-        (sV_0123456789876543210 :: Sing v_0123456789876543210)
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((id
-                 @(Sing (Case_0123456789876543210 v_0123456789876543210 a_0123456789876543210 v_0123456789876543210)))
-                (case sV_0123456789876543210 of)))
-            sA_0123456789876543210
-    instance Show (SFoo (z :: Foo)) where
-      showsPrec _ v_0123456789876543210 = case v_0123456789876543210 of
diff --git a/tests/compile-and-dump/Singletons/EmptyShowDeriving.golden b/tests/compile-and-dump/Singletons/EmptyShowDeriving.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/EmptyShowDeriving.golden
@@ -0,0 +1,71 @@
+Singletons/EmptyShowDeriving.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| data Foo
+          
+          deriving instance Show Foo |]
+  ======>
+    data Foo
+    deriving instance Show Foo
+    type family Case_0123456789876543210 v_0123456789876543210 a_0123456789876543210 t where
+    type ShowsPrec_0123456789876543210 :: GHC.Types.Nat
+                                          -> Foo -> GHC.Types.Symbol -> GHC.Types.Symbol
+    type family ShowsPrec_0123456789876543210 a a a where
+      ShowsPrec_0123456789876543210 _ v_0123456789876543210 a_0123456789876543210 = Apply (Case_0123456789876543210 v_0123456789876543210 a_0123456789876543210 v_0123456789876543210) a_0123456789876543210
+    type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) Foo ((~>) GHC.Types.Symbol GHC.Types.Symbol))
+    data ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
+    type ShowsPrec_0123456789876543210Sym1 :: GHC.Types.Nat
+                                              -> (~>) Foo ((~>) GHC.Types.Symbol GHC.Types.Symbol)
+    data ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
+    type ShowsPrec_0123456789876543210Sym2 :: GHC.Types.Nat
+                                              -> Foo -> (~>) GHC.Types.Symbol GHC.Types.Symbol
+    data ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
+    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Foo) (a0123456789876543210 :: GHC.Types.Symbol) =
+        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: GHC.Types.Symbol
+    instance PShow Foo where
+      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
+    data SFoo :: Foo -> GHC.Types.Type
+    type instance Sing @Foo = SFoo
+    instance SingKind Foo where
+      type Demote Foo = Foo
+      fromSing x = case x of
+      toSing x = SomeSing (case x of)
+    instance SShow Foo where
+      sShowsPrec ::
+        forall (t1 :: GHC.Types.Nat) (t2 :: Foo) (t3 :: GHC.Types.Symbol).
+        Sing t1
+        -> Sing t2
+           -> Sing t3
+              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) Foo ((~>) GHC.Types.Symbol GHC.Types.Symbol))
+                                                             -> GHC.Types.Type) t1) t2) t3)
+      sShowsPrec
+        _
+        (sV_0123456789876543210 :: Sing v_0123456789876543210)
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((id
+                 @(Sing (Case_0123456789876543210 v_0123456789876543210 a_0123456789876543210 v_0123456789876543210)))
+                (case sV_0123456789876543210 of)))
+            sA_0123456789876543210
+    instance Show (SFoo (z :: Foo)) where
+      showsPrec _ v_0123456789876543210 = case v_0123456789876543210 of
diff --git a/tests/compile-and-dump/Singletons/EnumDeriving.ghc88.template b/tests/compile-and-dump/Singletons/EnumDeriving.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/EnumDeriving.ghc88.template
+++ /dev/null
@@ -1,204 +0,0 @@
-Singletons/EnumDeriving.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| data Foo
-            = Bar | Baz | Bum
-            deriving Enum
-          data Quux = Q1 | Q2 |]
-  ======>
-    data Foo
-      = Bar | Baz | Bum
-      deriving Enum
-    data Quux = Q1 | Q2
-    type BarSym0 = Bar
-    type BazSym0 = Baz
-    type BumSym0 = Bum
-    type Q1Sym0 = Q1
-    type Q2Sym0 = Q2
-    type family Case_0123456789876543210 n t where
-      Case_0123456789876543210 n 'True = BumSym0
-      Case_0123456789876543210 n 'False = Apply ErrorSym0 "toEnum: bad argument"
-    type family Case_0123456789876543210 n t where
-      Case_0123456789876543210 n 'True = BazSym0
-      Case_0123456789876543210 n 'False = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 2))
-    type family Case_0123456789876543210 n t where
-      Case_0123456789876543210 n 'True = BarSym0
-      Case_0123456789876543210 n 'False = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 1))
-    type family ToEnum_0123456789876543210 (a :: GHC.Types.Nat) :: Foo where
-      ToEnum_0123456789876543210 n = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 0))
-    type ToEnum_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) =
-        ToEnum_0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ToEnum_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ToEnum_0123456789876543210Sym0KindInference) ())
-    data ToEnum_0123456789876543210Sym0 :: (~>) GHC.Types.Nat Foo
-      where
-        ToEnum_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                              arg. SameKind (Apply ToEnum_0123456789876543210Sym0 arg) (ToEnum_0123456789876543210Sym1 arg) =>
-                                                       ToEnum_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ToEnum_0123456789876543210Sym0 a0123456789876543210 = ToEnum_0123456789876543210 a0123456789876543210
-    type family FromEnum_0123456789876543210 (a :: Foo) :: GHC.Types.Nat where
-      FromEnum_0123456789876543210 Bar = Data.Singletons.Prelude.Num.FromInteger 0
-      FromEnum_0123456789876543210 Baz = Data.Singletons.Prelude.Num.FromInteger 1
-      FromEnum_0123456789876543210 Bum = Data.Singletons.Prelude.Num.FromInteger 2
-    type FromEnum_0123456789876543210Sym1 (a0123456789876543210 :: Foo) =
-        FromEnum_0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings FromEnum_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) FromEnum_0123456789876543210Sym0KindInference) ())
-    data FromEnum_0123456789876543210Sym0 :: (~>) Foo GHC.Types.Nat
-      where
-        FromEnum_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                arg. SameKind (Apply FromEnum_0123456789876543210Sym0 arg) (FromEnum_0123456789876543210Sym1 arg) =>
-                                                         FromEnum_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply FromEnum_0123456789876543210Sym0 a0123456789876543210 = FromEnum_0123456789876543210 a0123456789876543210
-    instance PEnum Foo where
-      type ToEnum a = Apply ToEnum_0123456789876543210Sym0 a
-      type FromEnum a = Apply FromEnum_0123456789876543210Sym0 a
-    data SFoo :: Foo -> GHC.Types.Type
-      where
-        SBar :: SFoo Bar
-        SBaz :: SFoo Baz
-        SBum :: SFoo Bum
-    type instance Sing @Foo = SFoo
-    instance SingKind Foo where
-      type Demote Foo = Foo
-      fromSing SBar = Bar
-      fromSing SBaz = Baz
-      fromSing SBum = Bum
-      toSing Bar = SomeSing SBar
-      toSing Baz = SomeSing SBaz
-      toSing Bum = SomeSing SBum
-    data SQuux :: Quux -> GHC.Types.Type
-      where
-        SQ1 :: SQuux Q1
-        SQ2 :: SQuux Q2
-    type instance Sing @Quux = SQuux
-    instance SingKind Quux where
-      type Demote Quux = Quux
-      fromSing SQ1 = Q1
-      fromSing SQ2 = Q2
-      toSing Q1 = SomeSing SQ1
-      toSing Q2 = SomeSing SQ2
-    instance SEnum Foo where
-      sToEnum ::
-        forall (t :: GHC.Types.Nat).
-        Sing t
-        -> Sing (Apply (Data.Singletons.Prelude.Enum.ToEnumSym0 :: TyFun GHC.Types.Nat Foo
-                                                                   -> GHC.Types.Type) t)
-      sFromEnum ::
-        forall (t :: Foo).
-        Sing t
-        -> Sing (Apply (Data.Singletons.Prelude.Enum.FromEnumSym0 :: TyFun Foo GHC.Types.Nat
-                                                                     -> GHC.Types.Type) t)
-      sToEnum (sN :: Sing n)
-        = (id
-             @(Sing (Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 0)))))
-            (case
-                 (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sN))
-                   (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 0))
-             of
-               STrue -> SBar
-               SFalse
-                 -> (id
-                       @(Sing (Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 1)))))
-                      (case
-                           (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sN))
-                             (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 1))
-                       of
-                         STrue -> SBaz
-                         SFalse
-                           -> (id
-                                 @(Sing (Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 2)))))
-                                (case
-                                     (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sN))
-                                       (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 2))
-                                 of
-                                   STrue -> SBum
-                                   SFalse -> sError (sing :: Sing "toEnum: bad argument"))))
-      sFromEnum SBar
-        = Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 0)
-      sFromEnum SBaz
-        = Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 1)
-      sFromEnum SBum
-        = Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 2)
-    instance SingI Bar where
-      sing = SBar
-    instance SingI Baz where
-      sing = SBaz
-    instance SingI Bum where
-      sing = SBum
-    instance SingI Q1 where
-      sing = SQ1
-    instance SingI Q2 where
-      sing = SQ2
-Singletons/EnumDeriving.hs:0:0:: Splicing declarations
-    singEnumInstance ''Quux
-  ======>
-    type family Case_0123456789876543210 n t where
-      Case_0123456789876543210 n 'True = Q2Sym0
-      Case_0123456789876543210 n 'False = Apply ErrorSym0 "toEnum: bad argument"
-    type family Case_0123456789876543210 n t where
-      Case_0123456789876543210 n 'True = Q1Sym0
-      Case_0123456789876543210 n 'False = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 1))
-    type family ToEnum_0123456789876543210 (a :: GHC.Types.Nat) :: Quux where
-      ToEnum_0123456789876543210 n = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 0))
-    type ToEnum_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) =
-        ToEnum_0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ToEnum_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ToEnum_0123456789876543210Sym0KindInference) ())
-    data ToEnum_0123456789876543210Sym0 :: (~>) GHC.Types.Nat Quux
-      where
-        ToEnum_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                              arg. SameKind (Apply ToEnum_0123456789876543210Sym0 arg) (ToEnum_0123456789876543210Sym1 arg) =>
-                                                       ToEnum_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ToEnum_0123456789876543210Sym0 a0123456789876543210 = ToEnum_0123456789876543210 a0123456789876543210
-    type family FromEnum_0123456789876543210 (a :: Quux) :: GHC.Types.Nat where
-      FromEnum_0123456789876543210 'Q1 = Data.Singletons.Prelude.Num.FromInteger 0
-      FromEnum_0123456789876543210 'Q2 = Data.Singletons.Prelude.Num.FromInteger 1
-    type FromEnum_0123456789876543210Sym1 (a0123456789876543210 :: Quux) =
-        FromEnum_0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings FromEnum_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) FromEnum_0123456789876543210Sym0KindInference) ())
-    data FromEnum_0123456789876543210Sym0 :: (~>) Quux GHC.Types.Nat
-      where
-        FromEnum_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                arg. SameKind (Apply FromEnum_0123456789876543210Sym0 arg) (FromEnum_0123456789876543210Sym1 arg) =>
-                                                         FromEnum_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply FromEnum_0123456789876543210Sym0 a0123456789876543210 = FromEnum_0123456789876543210 a0123456789876543210
-    instance PEnum Quux where
-      type ToEnum a = Apply ToEnum_0123456789876543210Sym0 a
-      type FromEnum a = Apply FromEnum_0123456789876543210Sym0 a
-    instance SEnum Quux where
-      sToEnum ::
-        forall (t :: GHC.Types.Nat).
-        Sing t
-        -> Sing (Apply (Data.Singletons.Prelude.Enum.ToEnumSym0 :: TyFun GHC.Types.Nat Quux
-                                                                   -> GHC.Types.Type) t)
-      sFromEnum ::
-        forall (t :: Quux).
-        Sing t
-        -> Sing (Apply (Data.Singletons.Prelude.Enum.FromEnumSym0 :: TyFun Quux GHC.Types.Nat
-                                                                     -> GHC.Types.Type) t)
-      sToEnum (sN :: Sing n)
-        = (id
-             @(Sing (Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 0)))))
-            (case
-                 (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sN))
-                   (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 0))
-             of
-               STrue -> SQ1
-               SFalse
-                 -> (id
-                       @(Sing (Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 1)))))
-                      (case
-                           (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sN))
-                             (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 1))
-                       of
-                         STrue -> SQ2
-                         SFalse -> sError (sing :: Sing "toEnum: bad argument")))
-      sFromEnum SQ1
-        = Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 0)
-      sFromEnum SQ2
-        = Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 1)
diff --git a/tests/compile-and-dump/Singletons/EnumDeriving.golden b/tests/compile-and-dump/Singletons/EnumDeriving.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/EnumDeriving.golden
@@ -0,0 +1,208 @@
+Singletons/EnumDeriving.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| data Foo
+            = Bar | Baz | Bum
+            deriving Enum
+          data Quux = Q1 | Q2 |]
+  ======>
+    data Foo
+      = Bar | Baz | Bum
+      deriving Enum
+    data Quux = Q1 | Q2
+    type BarSym0 = Bar :: Foo
+    type BazSym0 = Baz :: Foo
+    type BumSym0 = Bum :: Foo
+    type Q1Sym0 = Q1 :: Quux
+    type Q2Sym0 = Q2 :: Quux
+    type family Case_0123456789876543210 n t where
+      Case_0123456789876543210 n 'True = BumSym0
+      Case_0123456789876543210 n 'False = Apply ErrorSym0 "toEnum: bad argument"
+    type family Case_0123456789876543210 n t where
+      Case_0123456789876543210 n 'True = BazSym0
+      Case_0123456789876543210 n 'False = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 2))
+    type family Case_0123456789876543210 n t where
+      Case_0123456789876543210 n 'True = BarSym0
+      Case_0123456789876543210 n 'False = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 1))
+    type ToEnum_0123456789876543210 :: GHC.Types.Nat -> Foo
+    type family ToEnum_0123456789876543210 a where
+      ToEnum_0123456789876543210 n = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 0))
+    type ToEnum_0123456789876543210Sym0 :: (~>) GHC.Types.Nat Foo
+    data ToEnum_0123456789876543210Sym0 a0123456789876543210
+      where
+        ToEnum_0123456789876543210Sym0KindInference :: SameKind (Apply ToEnum_0123456789876543210Sym0 arg) (ToEnum_0123456789876543210Sym1 arg) =>
+                                                       ToEnum_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ToEnum_0123456789876543210Sym0 a0123456789876543210 = ToEnum_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ToEnum_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ToEnum_0123456789876543210Sym0KindInference) ())
+    type ToEnum_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) =
+        ToEnum_0123456789876543210 a0123456789876543210 :: Foo
+    type FromEnum_0123456789876543210 :: Foo -> GHC.Types.Nat
+    type family FromEnum_0123456789876543210 a where
+      FromEnum_0123456789876543210 Bar = Data.Singletons.Prelude.Num.FromInteger 0
+      FromEnum_0123456789876543210 Baz = Data.Singletons.Prelude.Num.FromInteger 1
+      FromEnum_0123456789876543210 Bum = Data.Singletons.Prelude.Num.FromInteger 2
+    type FromEnum_0123456789876543210Sym0 :: (~>) Foo GHC.Types.Nat
+    data FromEnum_0123456789876543210Sym0 a0123456789876543210
+      where
+        FromEnum_0123456789876543210Sym0KindInference :: SameKind (Apply FromEnum_0123456789876543210Sym0 arg) (FromEnum_0123456789876543210Sym1 arg) =>
+                                                         FromEnum_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply FromEnum_0123456789876543210Sym0 a0123456789876543210 = FromEnum_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings FromEnum_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) FromEnum_0123456789876543210Sym0KindInference) ())
+    type FromEnum_0123456789876543210Sym1 (a0123456789876543210 :: Foo) =
+        FromEnum_0123456789876543210 a0123456789876543210 :: GHC.Types.Nat
+    instance PEnum Foo where
+      type ToEnum a = Apply ToEnum_0123456789876543210Sym0 a
+      type FromEnum a = Apply FromEnum_0123456789876543210Sym0 a
+    data SFoo :: Foo -> GHC.Types.Type
+      where
+        SBar :: SFoo (Bar :: Foo)
+        SBaz :: SFoo (Baz :: Foo)
+        SBum :: SFoo (Bum :: Foo)
+    type instance Sing @Foo = SFoo
+    instance SingKind Foo where
+      type Demote Foo = Foo
+      fromSing SBar = Bar
+      fromSing SBaz = Baz
+      fromSing SBum = Bum
+      toSing Bar = SomeSing SBar
+      toSing Baz = SomeSing SBaz
+      toSing Bum = SomeSing SBum
+    data SQuux :: Quux -> GHC.Types.Type
+      where
+        SQ1 :: SQuux (Q1 :: Quux)
+        SQ2 :: SQuux (Q2 :: Quux)
+    type instance Sing @Quux = SQuux
+    instance SingKind Quux where
+      type Demote Quux = Quux
+      fromSing SQ1 = Q1
+      fromSing SQ2 = Q2
+      toSing Q1 = SomeSing SQ1
+      toSing Q2 = SomeSing SQ2
+    instance SEnum Foo where
+      sToEnum ::
+        forall (t :: GHC.Types.Nat).
+        Sing t
+        -> Sing (Apply (Data.Singletons.Prelude.Enum.ToEnumSym0 :: TyFun GHC.Types.Nat Foo
+                                                                   -> GHC.Types.Type) t)
+      sFromEnum ::
+        forall (t :: Foo).
+        Sing t
+        -> Sing (Apply (Data.Singletons.Prelude.Enum.FromEnumSym0 :: TyFun Foo GHC.Types.Nat
+                                                                     -> GHC.Types.Type) t)
+      sToEnum (sN :: Sing n)
+        = (id
+             @(Sing (Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 0)))))
+            (case
+                 (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sN))
+                   (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 0))
+             of
+               STrue -> SBar
+               SFalse
+                 -> (id
+                       @(Sing (Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 1)))))
+                      (case
+                           (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sN))
+                             (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 1))
+                       of
+                         STrue -> SBaz
+                         SFalse
+                           -> (id
+                                 @(Sing (Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 2)))))
+                                (case
+                                     (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sN))
+                                       (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 2))
+                                 of
+                                   STrue -> SBum
+                                   SFalse -> sError (sing :: Sing "toEnum: bad argument"))))
+      sFromEnum SBar
+        = Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 0)
+      sFromEnum SBaz
+        = Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 1)
+      sFromEnum SBum
+        = Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 2)
+    instance SingI Bar where
+      sing = SBar
+    instance SingI Baz where
+      sing = SBaz
+    instance SingI Bum where
+      sing = SBum
+    instance SingI Q1 where
+      sing = SQ1
+    instance SingI Q2 where
+      sing = SQ2
+Singletons/EnumDeriving.hs:0:0:: Splicing declarations
+    singEnumInstance ''Quux
+  ======>
+    type family Case_0123456789876543210 n t where
+      Case_0123456789876543210 n 'True = Q2Sym0
+      Case_0123456789876543210 n 'False = Apply ErrorSym0 "toEnum: bad argument"
+    type family Case_0123456789876543210 n t where
+      Case_0123456789876543210 n 'True = Q1Sym0
+      Case_0123456789876543210 n 'False = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 1))
+    type ToEnum_0123456789876543210 :: GHC.Types.Nat -> Quux
+    type family ToEnum_0123456789876543210 a where
+      ToEnum_0123456789876543210 n = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 0))
+    type ToEnum_0123456789876543210Sym0 :: (~>) GHC.Types.Nat Quux
+    data ToEnum_0123456789876543210Sym0 a0123456789876543210
+      where
+        ToEnum_0123456789876543210Sym0KindInference :: SameKind (Apply ToEnum_0123456789876543210Sym0 arg) (ToEnum_0123456789876543210Sym1 arg) =>
+                                                       ToEnum_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ToEnum_0123456789876543210Sym0 a0123456789876543210 = ToEnum_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ToEnum_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ToEnum_0123456789876543210Sym0KindInference) ())
+    type ToEnum_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) =
+        ToEnum_0123456789876543210 a0123456789876543210 :: Quux
+    type FromEnum_0123456789876543210 :: Quux -> GHC.Types.Nat
+    type family FromEnum_0123456789876543210 a where
+      FromEnum_0123456789876543210 'Q1 = Data.Singletons.Prelude.Num.FromInteger 0
+      FromEnum_0123456789876543210 'Q2 = Data.Singletons.Prelude.Num.FromInteger 1
+    type FromEnum_0123456789876543210Sym0 :: (~>) Quux GHC.Types.Nat
+    data FromEnum_0123456789876543210Sym0 a0123456789876543210
+      where
+        FromEnum_0123456789876543210Sym0KindInference :: SameKind (Apply FromEnum_0123456789876543210Sym0 arg) (FromEnum_0123456789876543210Sym1 arg) =>
+                                                         FromEnum_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply FromEnum_0123456789876543210Sym0 a0123456789876543210 = FromEnum_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings FromEnum_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) FromEnum_0123456789876543210Sym0KindInference) ())
+    type FromEnum_0123456789876543210Sym1 (a0123456789876543210 :: Quux) =
+        FromEnum_0123456789876543210 a0123456789876543210 :: GHC.Types.Nat
+    instance PEnum Quux where
+      type ToEnum a = Apply ToEnum_0123456789876543210Sym0 a
+      type FromEnum a = Apply FromEnum_0123456789876543210Sym0 a
+    instance SEnum Quux where
+      sToEnum ::
+        forall (t :: GHC.Types.Nat).
+        Sing t
+        -> Sing (Apply (Data.Singletons.Prelude.Enum.ToEnumSym0 :: TyFun GHC.Types.Nat Quux
+                                                                   -> GHC.Types.Type) t)
+      sFromEnum ::
+        forall (t :: Quux).
+        Sing t
+        -> Sing (Apply (Data.Singletons.Prelude.Enum.FromEnumSym0 :: TyFun Quux GHC.Types.Nat
+                                                                     -> GHC.Types.Type) t)
+      sToEnum (sN :: Sing n)
+        = (id
+             @(Sing (Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 0)))))
+            (case
+                 (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sN))
+                   (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 0))
+             of
+               STrue -> SQ1
+               SFalse
+                 -> (id
+                       @(Sing (Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 1)))))
+                      (case
+                           (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sN))
+                             (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 1))
+                       of
+                         STrue -> SQ2
+                         SFalse -> sError (sing :: Sing "toEnum: bad argument")))
+      sFromEnum SQ1
+        = Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 0)
+      sFromEnum SQ2
+        = Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 1)
diff --git a/tests/compile-and-dump/Singletons/EqInstances.ghc88.template b/tests/compile-and-dump/Singletons/EqInstances.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/EqInstances.ghc88.template
+++ /dev/null
@@ -1,21 +0,0 @@
-Singletons/EqInstances.hs:0:0:: Splicing declarations
-    singEqInstances [''Foo, ''Empty]
-  ======>
-    instance SEq Foo => SEq Foo where
-      (%==) SFLeaf SFLeaf = STrue
-      (%==) SFLeaf ((:%+:) _ _) = SFalse
-      (%==) ((:%+:) _ _) SFLeaf = SFalse
-      (%==) ((:%+:) a a) ((:%+:) b b)
-        = ((%&&) (((%==) a) b)) (((%==) a) b)
-    type family Equals_0123456789876543210 (a :: Foo) (b :: Foo) :: Bool where
-      Equals_0123456789876543210 'FLeaf 'FLeaf = TrueSym0
-      Equals_0123456789876543210 ('(:+:) a a) ('(:+:) b b) = (&&) ((==) a b) ((==) a b)
-      Equals_0123456789876543210 (_ :: Foo) (_ :: Foo) = FalseSym0
-    instance PEq Foo where
-      type (==) a b = Equals_0123456789876543210 a b
-    instance SEq Empty where
-      (%==) _ _ = STrue
-    type family Equals_0123456789876543210 (a :: Empty) (b :: Empty) :: Bool where
-      Equals_0123456789876543210 (_ :: Empty) (_ :: Empty) = TrueSym0
-    instance PEq Empty where
-      type (==) a b = Equals_0123456789876543210 a b
diff --git a/tests/compile-and-dump/Singletons/EqInstances.golden b/tests/compile-and-dump/Singletons/EqInstances.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/EqInstances.golden
@@ -0,0 +1,23 @@
+Singletons/EqInstances.hs:0:0:: Splicing declarations
+    singEqInstances [''Foo, ''Empty]
+  ======>
+    instance SEq Foo => SEq Foo where
+      (%==) SFLeaf SFLeaf = STrue
+      (%==) SFLeaf ((:%+:) _ _) = SFalse
+      (%==) ((:%+:) _ _) SFLeaf = SFalse
+      (%==) ((:%+:) a a) ((:%+:) b b)
+        = ((%&&) (((%==) a) b)) (((%==) a) b)
+    type Equals_0123456789876543210 :: Foo -> Foo -> Bool
+    type family Equals_0123456789876543210 a b where
+      Equals_0123456789876543210 'FLeaf 'FLeaf = TrueSym0
+      Equals_0123456789876543210 ('(:+:) a a) ('(:+:) b b) = (&&) ((==) a b) ((==) a b)
+      Equals_0123456789876543210 (_ :: Foo) (_ :: Foo) = FalseSym0
+    instance PEq Foo where
+      type (==) a b = Equals_0123456789876543210 a b
+    instance SEq Empty where
+      (%==) _ _ = STrue
+    type Equals_0123456789876543210 :: Empty -> Empty -> Bool
+    type family Equals_0123456789876543210 a b where
+      Equals_0123456789876543210 (_ :: Empty) (_ :: Empty) = TrueSym0
+    instance PEq Empty where
+      type (==) a b = Equals_0123456789876543210 a b
diff --git a/tests/compile-and-dump/Singletons/Error.ghc88.template b/tests/compile-and-dump/Singletons/Error.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/Error.ghc88.template
+++ /dev/null
@@ -1,30 +0,0 @@
-Singletons/Error.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| head :: [a] -> a
-          head (a : _) = a
-          head [] = error "Data.Singletons.List.head: empty list" |]
-  ======>
-    head :: [a] -> a
-    head (a : _) = a
-    head [] = error "Data.Singletons.List.head: empty list"
-    type HeadSym1 (a0123456789876543210 :: [a0123456789876543210]) =
-        Head a0123456789876543210
-    instance SuppressUnusedWarnings HeadSym0 where
-      suppressUnusedWarnings = snd (((,) HeadSym0KindInference) ())
-    data HeadSym0 :: forall a0123456789876543210.
-                     (~>) [a0123456789876543210] a0123456789876543210
-      where
-        HeadSym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply HeadSym0 arg) (HeadSym1 arg) =>
-                                 HeadSym0 a0123456789876543210
-    type instance Apply HeadSym0 a0123456789876543210 = Head a0123456789876543210
-    type family Head (a :: [a]) :: a where
-      Head ('(:) a _) = a
-      Head '[] = Apply ErrorSym0 "Data.Singletons.List.head: empty list"
-    sHead ::
-      forall a (t :: [a]). Sing t -> Sing (Apply HeadSym0 t :: a)
-    sHead (SCons (sA :: Sing a) _) = sA
-    sHead SNil
-      = sError (sing :: Sing "Data.Singletons.List.head: empty list")
-    instance SingI (HeadSym0 :: (~>) [a] a) where
-      sing = (singFun1 @HeadSym0) sHead
diff --git a/tests/compile-and-dump/Singletons/Error.golden b/tests/compile-and-dump/Singletons/Error.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/Error.golden
@@ -0,0 +1,30 @@
+Singletons/Error.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| head :: [a] -> a
+          head (a : _) = a
+          head [] = error "Data.Singletons.List.head: empty list" |]
+  ======>
+    head :: [a] -> a
+    head (a : _) = a
+    head [] = error "Data.Singletons.List.head: empty list"
+    type HeadSym0 :: (~>) [a] a
+    data HeadSym0 a0123456789876543210
+      where
+        HeadSym0KindInference :: SameKind (Apply HeadSym0 arg) (HeadSym1 arg) =>
+                                 HeadSym0 a0123456789876543210
+    type instance Apply HeadSym0 a0123456789876543210 = HeadSym1 a0123456789876543210
+    instance SuppressUnusedWarnings HeadSym0 where
+      suppressUnusedWarnings = snd (((,) HeadSym0KindInference) ())
+    type HeadSym1 (a0123456789876543210 :: [a]) =
+        Head a0123456789876543210 :: a
+    type Head :: [a] -> a
+    type family Head a where
+      Head ('(:) a _) = a
+      Head '[] = Apply ErrorSym0 "Data.Singletons.List.head: empty list"
+    sHead ::
+      forall a (t :: [a]). Sing t -> Sing (Apply HeadSym0 t :: a)
+    sHead (SCons (sA :: Sing a) _) = sA
+    sHead SNil
+      = sError (sing :: Sing "Data.Singletons.List.head: empty list")
+    instance SingI (HeadSym0 :: (~>) [a] a) where
+      sing = (singFun1 @HeadSym0) sHead
diff --git a/tests/compile-and-dump/Singletons/Fixity.ghc88.template b/tests/compile-and-dump/Singletons/Fixity.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/Fixity.ghc88.template
+++ /dev/null
@@ -1,86 +0,0 @@
-Singletons/Fixity.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| infix 4 ====
-          infix 4 <=>
-          
-          (====) :: a -> a -> a
-          a ==== _ = a
-          
-          class MyOrd a where
-            (<=>) :: a -> a -> Ordering
-            infix 4 <=> |]
-  ======>
-    class MyOrd a where
-      (<=>) :: a -> a -> Ordering
-    infix 4 <=>
-    (====) :: a -> a -> a
-    (====) a _ = a
-    infix 4 ====
-    type (====@#@$$$) (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: a0123456789876543210) =
-        (====) a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ((====@#@$$) a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (:====@#@$$###)) ())
-    data (====@#@$$) (a0123456789876543210 :: a0123456789876543210) :: (~>) a0123456789876543210 a0123456789876543210
-      where
-        (:====@#@$$###) :: forall a0123456789876543210
-                                  a0123456789876543210
-                                  arg. SameKind (Apply ((====@#@$$) a0123456789876543210) arg) ((====@#@$$$) a0123456789876543210 arg) =>
-                           (====@#@$$) a0123456789876543210 a0123456789876543210
-    type instance Apply ((====@#@$$) a0123456789876543210) a0123456789876543210 = (====) a0123456789876543210 a0123456789876543210
-    infix 4 ====@#@$$
-    instance SuppressUnusedWarnings (====@#@$) where
-      suppressUnusedWarnings = snd (((,) (:====@#@$###)) ())
-    data (====@#@$) :: forall a0123456789876543210.
-                       (~>) a0123456789876543210 ((~>) a0123456789876543210 a0123456789876543210)
-      where
-        (:====@#@$###) :: forall a0123456789876543210
-                                 arg. SameKind (Apply (====@#@$) arg) ((====@#@$$) arg) =>
-                          (====@#@$) a0123456789876543210
-    type instance Apply (====@#@$) a0123456789876543210 = (====@#@$$) a0123456789876543210
-    infix 4 ====@#@$
-    type family (====) (a :: a) (a :: a) :: a where
-      (====) a _ = a
-    type (<=>@#@$$$) (arg0123456789876543210 :: a0123456789876543210) (arg0123456789876543210 :: a0123456789876543210) =
-        (<=>) arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings ((<=>@#@$$) arg0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (:<=>@#@$$###)) ())
-    data (<=>@#@$$) (arg0123456789876543210 :: a0123456789876543210) :: (~>) a0123456789876543210 Ordering
-      where
-        (:<=>@#@$$###) :: forall arg0123456789876543210
-                                 arg0123456789876543210
-                                 arg. SameKind (Apply ((<=>@#@$$) arg0123456789876543210) arg) ((<=>@#@$$$) arg0123456789876543210 arg) =>
-                          (<=>@#@$$) arg0123456789876543210 arg0123456789876543210
-    type instance Apply ((<=>@#@$$) arg0123456789876543210) arg0123456789876543210 = (<=>) arg0123456789876543210 arg0123456789876543210
-    infix 4 <=>@#@$$
-    instance SuppressUnusedWarnings (<=>@#@$) where
-      suppressUnusedWarnings = snd (((,) (:<=>@#@$###)) ())
-    data (<=>@#@$) :: forall a0123456789876543210.
-                      (~>) a0123456789876543210 ((~>) a0123456789876543210 Ordering)
-      where
-        (:<=>@#@$###) :: forall arg0123456789876543210
-                                arg. SameKind (Apply (<=>@#@$) arg) ((<=>@#@$$) arg) =>
-                         (<=>@#@$) arg0123456789876543210
-    type instance Apply (<=>@#@$) arg0123456789876543210 = (<=>@#@$$) arg0123456789876543210
-    infix 4 <=>@#@$
-    class PMyOrd (a :: GHC.Types.Type) where
-      type (<=>) (arg :: a) (arg :: a) :: Ordering
-    infix 4 %====
-    infix 4 %<=>
-    (%====) ::
-      forall a (t :: a) (t :: a).
-      Sing t -> Sing t -> Sing (Apply (Apply (====@#@$) t) t :: a)
-    (%====) (sA :: Sing a) _ = sA
-    instance SingI ((====@#@$) :: (~>) a ((~>) a a)) where
-      sing = (singFun2 @(====@#@$)) (%====)
-    instance SingI d => SingI ((====@#@$$) (d :: a) :: (~>) a a) where
-      sing = (singFun1 @((====@#@$$) (d :: a))) ((%====) (sing @d))
-    class SMyOrd a where
-      (%<=>) ::
-        forall (t :: a) (t :: a).
-        Sing t -> Sing t -> Sing (Apply (Apply (<=>@#@$) t) t :: Ordering)
-    instance SMyOrd a =>
-             SingI ((<=>@#@$) :: (~>) a ((~>) a Ordering)) where
-      sing = (singFun2 @(<=>@#@$)) (%<=>)
-    instance (SMyOrd a, SingI d) =>
-             SingI ((<=>@#@$$) (d :: a) :: (~>) a Ordering) where
-      sing = (singFun1 @((<=>@#@$$) (d :: a))) ((%<=>) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/Fixity.golden b/tests/compile-and-dump/Singletons/Fixity.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/Fixity.golden
@@ -0,0 +1,85 @@
+Singletons/Fixity.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| infix 4 ====
+          infix 4 <=>
+          
+          (====) :: a -> a -> a
+          a ==== _ = a
+          
+          class MyOrd a where
+            (<=>) :: a -> a -> Ordering
+            infix 4 <=> |]
+  ======>
+    class MyOrd a where
+      (<=>) :: a -> a -> Ordering
+    infix 4 <=>
+    (====) :: a -> a -> a
+    (====) a _ = a
+    infix 4 ====
+    type (====@#@$) :: (~>) a ((~>) a a)
+    data (====@#@$) a0123456789876543210
+      where
+        (:====@#@$###) :: SameKind (Apply (====@#@$) arg) ((====@#@$$) arg) =>
+                          (====@#@$) a0123456789876543210
+    type instance Apply (====@#@$) a0123456789876543210 = (====@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (====@#@$) where
+      suppressUnusedWarnings = snd (((,) (:====@#@$###)) ())
+    infix 4 ====@#@$
+    type (====@#@$$) :: a -> (~>) a a
+    data (====@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (:====@#@$$###) :: SameKind (Apply ((====@#@$$) a0123456789876543210) arg) ((====@#@$$$) a0123456789876543210 arg) =>
+                           (====@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((====@#@$$) a0123456789876543210) a0123456789876543210 = (====@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((====@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (:====@#@$$###)) ())
+    infix 4 ====@#@$$
+    type (====@#@$$$) (a0123456789876543210 :: a) (a0123456789876543210 :: a) =
+        (====) a0123456789876543210 a0123456789876543210 :: a
+    infix 4 ====@#@$$$
+    type (====) :: a -> a -> a
+    type family (====) a a where
+      (====) a _ = a
+    type (<=>@#@$) :: forall a. (~>) a ((~>) a Ordering)
+    data (<=>@#@$) a0123456789876543210
+      where
+        (:<=>@#@$###) :: SameKind (Apply (<=>@#@$) arg) ((<=>@#@$$) arg) =>
+                         (<=>@#@$) a0123456789876543210
+    type instance Apply (<=>@#@$) a0123456789876543210 = (<=>@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (<=>@#@$) where
+      suppressUnusedWarnings = snd (((,) (:<=>@#@$###)) ())
+    infix 4 <=>@#@$
+    type (<=>@#@$$) :: forall a. a -> (~>) a Ordering
+    data (<=>@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (:<=>@#@$$###) :: SameKind (Apply ((<=>@#@$$) a0123456789876543210) arg) ((<=>@#@$$$) a0123456789876543210 arg) =>
+                          (<=>@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((<=>@#@$$) a0123456789876543210) a0123456789876543210 = (<=>@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((<=>@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (:<=>@#@$$###)) ())
+    infix 4 <=>@#@$$
+    type (<=>@#@$$$) (a0123456789876543210 :: a) (a0123456789876543210 :: a) =
+        (<=>) a0123456789876543210 a0123456789876543210 :: Ordering
+    infix 4 <=>@#@$$$
+    class PMyOrd a where
+      type (<=>) (arg :: a) (arg :: a) :: Ordering
+    infix 4 %====
+    infix 4 %<=>
+    (%====) ::
+      forall a (t :: a) (t :: a).
+      Sing t -> Sing t -> Sing (Apply (Apply (====@#@$) t) t :: a)
+    (%====) (sA :: Sing a) _ = sA
+    instance SingI ((====@#@$) :: (~>) a ((~>) a a)) where
+      sing = (singFun2 @(====@#@$)) (%====)
+    instance SingI d => SingI ((====@#@$$) (d :: a) :: (~>) a a) where
+      sing = (singFun1 @((====@#@$$) (d :: a))) ((%====) (sing @d))
+    class SMyOrd a where
+      (%<=>) ::
+        forall (t :: a) (t :: a).
+        Sing t -> Sing t -> Sing (Apply (Apply (<=>@#@$) t) t :: Ordering)
+    instance SMyOrd a =>
+             SingI ((<=>@#@$) :: (~>) a ((~>) a Ordering)) where
+      sing = (singFun2 @(<=>@#@$)) (%<=>)
+    instance (SMyOrd a, SingI d) =>
+             SingI ((<=>@#@$$) (d :: a) :: (~>) a Ordering) where
+      sing = (singFun1 @((<=>@#@$$) (d :: a))) ((%<=>) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/FunDeps.ghc88.template b/tests/compile-and-dump/Singletons/FunDeps.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/FunDeps.ghc88.template
+++ /dev/null
@@ -1,96 +0,0 @@
-Singletons/FunDeps.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| t1 = meth True
-          
-          class FD a b | a -> b where
-            meth :: a -> a
-            l2r :: a -> b
-          
-          instance FD Bool Nat where
-            meth = not
-            l2r False = 0
-            l2r True = 1 |]
-  ======>
-    class FD a b | a -> b where
-      meth :: a -> a
-      l2r :: a -> b
-    instance FD Bool Nat where
-      meth = not
-      l2r False = 0
-      l2r True = 1
-    t1 = meth True
-    type T1Sym0 = T1
-    type family T1 where
-      T1 = Apply MethSym0 TrueSym0
-    type MethSym1 (arg0123456789876543210 :: a0123456789876543210) =
-        Meth arg0123456789876543210
-    instance SuppressUnusedWarnings MethSym0 where
-      suppressUnusedWarnings = snd (((,) MethSym0KindInference) ())
-    data MethSym0 :: forall a0123456789876543210.
-                     (~>) a0123456789876543210 a0123456789876543210
-      where
-        MethSym0KindInference :: forall arg0123456789876543210
-                                        arg. SameKind (Apply MethSym0 arg) (MethSym1 arg) =>
-                                 MethSym0 arg0123456789876543210
-    type instance Apply MethSym0 arg0123456789876543210 = Meth arg0123456789876543210
-    type L2rSym1 (arg0123456789876543210 :: a0123456789876543210) =
-        L2r arg0123456789876543210
-    instance SuppressUnusedWarnings L2rSym0 where
-      suppressUnusedWarnings = snd (((,) L2rSym0KindInference) ())
-    data L2rSym0 :: forall a0123456789876543210 b0123456789876543210.
-                    (~>) a0123456789876543210 b0123456789876543210
-      where
-        L2rSym0KindInference :: forall arg0123456789876543210
-                                       arg. SameKind (Apply L2rSym0 arg) (L2rSym1 arg) =>
-                                L2rSym0 arg0123456789876543210
-    type instance Apply L2rSym0 arg0123456789876543210 = L2r arg0123456789876543210
-    class PFD (a :: GHC.Types.Type) (b :: GHC.Types.Type) | a -> b where
-      type Meth (arg :: a) :: a
-      type L2r (arg :: a) :: b
-    type family Meth_0123456789876543210 (a :: Bool) :: Bool where
-      Meth_0123456789876543210 a_0123456789876543210 = Apply NotSym0 a_0123456789876543210
-    type Meth_0123456789876543210Sym1 (a0123456789876543210 :: Bool) =
-        Meth_0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Meth_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Meth_0123456789876543210Sym0KindInference) ())
-    data Meth_0123456789876543210Sym0 :: (~>) Bool Bool
-      where
-        Meth_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                            arg. SameKind (Apply Meth_0123456789876543210Sym0 arg) (Meth_0123456789876543210Sym1 arg) =>
-                                                     Meth_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Meth_0123456789876543210Sym0 a0123456789876543210 = Meth_0123456789876543210 a0123456789876543210
-    type family L2r_0123456789876543210 (a :: Bool) :: Nat where
-      L2r_0123456789876543210 'False = FromInteger 0
-      L2r_0123456789876543210 'True = FromInteger 1
-    type L2r_0123456789876543210Sym1 (a0123456789876543210 :: Bool) =
-        L2r_0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings L2r_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) L2r_0123456789876543210Sym0KindInference) ())
-    data L2r_0123456789876543210Sym0 :: (~>) Bool Nat
-      where
-        L2r_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                           arg. SameKind (Apply L2r_0123456789876543210Sym0 arg) (L2r_0123456789876543210Sym1 arg) =>
-                                                    L2r_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply L2r_0123456789876543210Sym0 a0123456789876543210 = L2r_0123456789876543210 a0123456789876543210
-    instance PFD Bool Nat where
-      type Meth a = Apply Meth_0123456789876543210Sym0 a
-      type L2r a = Apply L2r_0123456789876543210Sym0 a
-    sT1 :: Sing T1Sym0
-    sT1 = (applySing ((singFun1 @MethSym0) sMeth)) STrue
-    class SFD a b | a -> b where
-      sMeth :: forall (t :: a). Sing t -> Sing (Apply MethSym0 t :: a)
-      sL2r :: forall (t :: a). Sing t -> Sing (Apply L2rSym0 t :: b)
-    instance SFD Bool Nat where
-      sMeth ::
-        forall (t :: Bool). Sing t -> Sing (Apply MethSym0 t :: Bool)
-      sL2r :: forall (t :: Bool). Sing t -> Sing (Apply L2rSym0 t :: Nat)
-      sMeth (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing ((singFun1 @NotSym0) sNot)) sA_0123456789876543210
-      sL2r SFalse = sFromInteger (sing :: Sing 0)
-      sL2r STrue = sFromInteger (sing :: Sing 1)
-    instance SFD a b => SingI (MethSym0 :: (~>) a a) where
-      sing = (singFun1 @MethSym0) sMeth
-    instance SFD a b => SingI (L2rSym0 :: (~>) a b) where
-      sing = (singFun1 @L2rSym0) sL2r
diff --git a/tests/compile-and-dump/Singletons/FunDeps.golden b/tests/compile-and-dump/Singletons/FunDeps.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/FunDeps.golden
@@ -0,0 +1,96 @@
+Singletons/FunDeps.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| t1 = meth True
+          
+          class FD a b | a -> b where
+            meth :: a -> a
+            l2r :: a -> b
+          
+          instance FD Bool Nat where
+            meth = not
+            l2r False = 0
+            l2r True = 1 |]
+  ======>
+    class FD a b | a -> b where
+      meth :: a -> a
+      l2r :: a -> b
+    instance FD Bool Nat where
+      meth = not
+      l2r False = 0
+      l2r True = 1
+    t1 = meth True
+    type T1Sym0 = T1
+    type family T1 where
+      T1 = Apply MethSym0 TrueSym0
+    type MethSym0 :: forall a. (~>) a a
+    data MethSym0 a0123456789876543210
+      where
+        MethSym0KindInference :: SameKind (Apply MethSym0 arg) (MethSym1 arg) =>
+                                 MethSym0 a0123456789876543210
+    type instance Apply MethSym0 a0123456789876543210 = MethSym1 a0123456789876543210
+    instance SuppressUnusedWarnings MethSym0 where
+      suppressUnusedWarnings = snd (((,) MethSym0KindInference) ())
+    type MethSym1 (a0123456789876543210 :: a) =
+        Meth a0123456789876543210 :: a
+    type L2rSym0 :: forall a b. (~>) a b
+    data L2rSym0 a0123456789876543210
+      where
+        L2rSym0KindInference :: SameKind (Apply L2rSym0 arg) (L2rSym1 arg) =>
+                                L2rSym0 a0123456789876543210
+    type instance Apply L2rSym0 a0123456789876543210 = L2rSym1 a0123456789876543210
+    instance SuppressUnusedWarnings L2rSym0 where
+      suppressUnusedWarnings = snd (((,) L2rSym0KindInference) ())
+    type L2rSym1 (a0123456789876543210 :: a) =
+        L2r a0123456789876543210 :: b
+    class PFD a b | a -> b where
+      type Meth (arg :: a) :: a
+      type L2r (arg :: a) :: b
+    type Meth_0123456789876543210 :: Bool -> Bool
+    type family Meth_0123456789876543210 a where
+      Meth_0123456789876543210 a_0123456789876543210 = Apply NotSym0 a_0123456789876543210
+    type Meth_0123456789876543210Sym0 :: (~>) Bool Bool
+    data Meth_0123456789876543210Sym0 a0123456789876543210
+      where
+        Meth_0123456789876543210Sym0KindInference :: SameKind (Apply Meth_0123456789876543210Sym0 arg) (Meth_0123456789876543210Sym1 arg) =>
+                                                     Meth_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Meth_0123456789876543210Sym0 a0123456789876543210 = Meth_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Meth_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Meth_0123456789876543210Sym0KindInference) ())
+    type Meth_0123456789876543210Sym1 (a0123456789876543210 :: Bool) =
+        Meth_0123456789876543210 a0123456789876543210 :: Bool
+    type L2r_0123456789876543210 :: Bool -> Nat
+    type family L2r_0123456789876543210 a where
+      L2r_0123456789876543210 'False = FromInteger 0
+      L2r_0123456789876543210 'True = FromInteger 1
+    type L2r_0123456789876543210Sym0 :: (~>) Bool Nat
+    data L2r_0123456789876543210Sym0 a0123456789876543210
+      where
+        L2r_0123456789876543210Sym0KindInference :: SameKind (Apply L2r_0123456789876543210Sym0 arg) (L2r_0123456789876543210Sym1 arg) =>
+                                                    L2r_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply L2r_0123456789876543210Sym0 a0123456789876543210 = L2r_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings L2r_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) L2r_0123456789876543210Sym0KindInference) ())
+    type L2r_0123456789876543210Sym1 (a0123456789876543210 :: Bool) =
+        L2r_0123456789876543210 a0123456789876543210 :: Nat
+    instance PFD Bool Nat where
+      type Meth a = Apply Meth_0123456789876543210Sym0 a
+      type L2r a = Apply L2r_0123456789876543210Sym0 a
+    sT1 :: Sing @_ T1Sym0
+    sT1 = (applySing ((singFun1 @MethSym0) sMeth)) STrue
+    class SFD a b | a -> b where
+      sMeth :: forall (t :: a). Sing t -> Sing (Apply MethSym0 t :: a)
+      sL2r :: forall (t :: a). Sing t -> Sing (Apply L2rSym0 t :: b)
+    instance SFD Bool Nat where
+      sMeth ::
+        forall (t :: Bool). Sing t -> Sing (Apply MethSym0 t :: Bool)
+      sL2r :: forall (t :: Bool). Sing t -> Sing (Apply L2rSym0 t :: Nat)
+      sMeth (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing ((singFun1 @NotSym0) sNot)) sA_0123456789876543210
+      sL2r SFalse = sFromInteger (sing :: Sing 0)
+      sL2r STrue = sFromInteger (sing :: Sing 1)
+    instance SFD a b => SingI (MethSym0 :: (~>) a a) where
+      sing = (singFun1 @MethSym0) sMeth
+    instance SFD a b => SingI (L2rSym0 :: (~>) a b) where
+      sing = (singFun1 @L2rSym0) sL2r
diff --git a/tests/compile-and-dump/Singletons/FunctorLikeDeriving.ghc88.template b/tests/compile-and-dump/Singletons/FunctorLikeDeriving.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/FunctorLikeDeriving.ghc88.template
+++ /dev/null
@@ -1,1632 +0,0 @@
-Singletons/FunctorLikeDeriving.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| data T x a
-            = MkT1 x a (Maybe a) (Maybe (Maybe a)) | MkT2 (Maybe x)
-            deriving (Functor, Foldable, Traversable)
-          data Empty (a :: Type) deriving (Functor, Foldable, Traversable) |]
-  ======>
-    data T x a
-      = MkT1 x a (Maybe a) (Maybe (Maybe a)) | MkT2 (Maybe x)
-      deriving (Functor, Foldable, Traversable)
-    data Empty (a :: Type) deriving (Functor, Foldable, Traversable)
-    type MkT1Sym4 (t0123456789876543210 :: x0123456789876543210) (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: Maybe a0123456789876543210) (t0123456789876543210 :: Maybe (Maybe a0123456789876543210)) =
-        MkT1 t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (MkT1Sym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) MkT1Sym3KindInference) ())
-    data MkT1Sym3 (t0123456789876543210 :: x0123456789876543210) (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: Maybe a0123456789876543210) :: (~>) (Maybe (Maybe a0123456789876543210)) (T x0123456789876543210 a0123456789876543210)
-      where
-        MkT1Sym3KindInference :: forall t0123456789876543210
-                                        t0123456789876543210
-                                        t0123456789876543210
-                                        t0123456789876543210
-                                        arg. SameKind (Apply (MkT1Sym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) arg) (MkT1Sym4 t0123456789876543210 t0123456789876543210 t0123456789876543210 arg) =>
-                                 MkT1Sym3 t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (MkT1Sym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) t0123456789876543210 = MkT1 t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (MkT1Sym2 t0123456789876543210 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) MkT1Sym2KindInference) ())
-    data MkT1Sym2 (t0123456789876543210 :: x0123456789876543210) (t0123456789876543210 :: a0123456789876543210) :: (~>) (Maybe a0123456789876543210) ((~>) (Maybe (Maybe a0123456789876543210)) (T x0123456789876543210 a0123456789876543210))
-      where
-        MkT1Sym2KindInference :: forall t0123456789876543210
-                                        t0123456789876543210
-                                        t0123456789876543210
-                                        arg. SameKind (Apply (MkT1Sym2 t0123456789876543210 t0123456789876543210) arg) (MkT1Sym3 t0123456789876543210 t0123456789876543210 arg) =>
-                                 MkT1Sym2 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (MkT1Sym2 t0123456789876543210 t0123456789876543210) t0123456789876543210 = MkT1Sym3 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (MkT1Sym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) MkT1Sym1KindInference) ())
-    data MkT1Sym1 (t0123456789876543210 :: x0123456789876543210) :: forall a0123456789876543210.
-                                                                    (~>) a0123456789876543210 ((~>) (Maybe a0123456789876543210) ((~>) (Maybe (Maybe a0123456789876543210)) (T x0123456789876543210 a0123456789876543210)))
-      where
-        MkT1Sym1KindInference :: forall t0123456789876543210
-                                        t0123456789876543210
-                                        arg. SameKind (Apply (MkT1Sym1 t0123456789876543210) arg) (MkT1Sym2 t0123456789876543210 arg) =>
-                                 MkT1Sym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (MkT1Sym1 t0123456789876543210) t0123456789876543210 = MkT1Sym2 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings MkT1Sym0 where
-      suppressUnusedWarnings = snd (((,) MkT1Sym0KindInference) ())
-    data MkT1Sym0 :: forall x0123456789876543210 a0123456789876543210.
-                     (~>) x0123456789876543210 ((~>) a0123456789876543210 ((~>) (Maybe a0123456789876543210) ((~>) (Maybe (Maybe a0123456789876543210)) (T x0123456789876543210 a0123456789876543210))))
-      where
-        MkT1Sym0KindInference :: forall t0123456789876543210
-                                        arg. SameKind (Apply MkT1Sym0 arg) (MkT1Sym1 arg) =>
-                                 MkT1Sym0 t0123456789876543210
-    type instance Apply MkT1Sym0 t0123456789876543210 = MkT1Sym1 t0123456789876543210
-    type MkT2Sym1 (t0123456789876543210 :: Maybe x0123456789876543210) =
-        MkT2 t0123456789876543210
-    instance SuppressUnusedWarnings MkT2Sym0 where
-      suppressUnusedWarnings = snd (((,) MkT2Sym0KindInference) ())
-    data MkT2Sym0 :: forall x0123456789876543210 a0123456789876543210.
-                     (~>) (Maybe x0123456789876543210) (T x0123456789876543210 a0123456789876543210)
-      where
-        MkT2Sym0KindInference :: forall t0123456789876543210
-                                        arg. SameKind (Apply MkT2Sym0 arg) (MkT2Sym1 arg) =>
-                                 MkT2Sym0 t0123456789876543210
-    type instance Apply MkT2Sym0 t0123456789876543210 = MkT2 t0123456789876543210
-    type family Lambda_0123456789876543210 _f_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 t where
-      Lambda_0123456789876543210 _f_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n_0123456789876543210 = n_0123456789876543210
-    type Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym5KindInference) ())
-    data Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym5KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
-    data Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym4KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
-    data Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym3KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210
-    type family Lambda_0123456789876543210 _f_0123456789876543210 a_0123456789876543210 t where
-      Lambda_0123456789876543210 _f_0123456789876543210 a_0123456789876543210 n_0123456789876543210 = n_0123456789876543210
-    type Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210
-    type family Fmap_0123456789876543210 (a :: (~>) a0 b0) (a :: T x a0) :: T x b0 where
-      Fmap_0123456789876543210 _f_0123456789876543210 (MkT1 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) = Apply (Apply (Apply (Apply MkT1Sym0 (Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210)) (Apply _f_0123456789876543210 a_0123456789876543210)) (Apply (Apply FmapSym0 _f_0123456789876543210) a_0123456789876543210)) (Apply (Apply FmapSym0 (Apply FmapSym0 _f_0123456789876543210)) a_0123456789876543210)
-      Fmap_0123456789876543210 _f_0123456789876543210 (MkT2 a_0123456789876543210) = Apply MkT2Sym0 (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) a_0123456789876543210) a_0123456789876543210)
-    type Fmap_0123456789876543210Sym2 (a0123456789876543210 :: (~>) a01234567898765432100 b01234567898765432100) (a0123456789876543210 :: T x0123456789876543210 a01234567898765432100) =
-        Fmap_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Fmap_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Fmap_0123456789876543210Sym1KindInference) ())
-    data Fmap_0123456789876543210Sym1 (a0123456789876543210 :: (~>) a01234567898765432100 b01234567898765432100) :: forall x0123456789876543210.
-                                                                                                                    (~>) (T x0123456789876543210 a01234567898765432100) (T x0123456789876543210 b01234567898765432100)
-      where
-        Fmap_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                            a0123456789876543210
-                                                            arg. SameKind (Apply (Fmap_0123456789876543210Sym1 a0123456789876543210) arg) (Fmap_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                     Fmap_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Fmap_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Fmap_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Fmap_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Fmap_0123456789876543210Sym0KindInference) ())
-    data Fmap_0123456789876543210Sym0 :: forall a01234567898765432100
-                                                b01234567898765432100
-                                                x0123456789876543210.
-                                         (~>) ((~>) a01234567898765432100 b01234567898765432100) ((~>) (T x0123456789876543210 a01234567898765432100) (T x0123456789876543210 b01234567898765432100))
-      where
-        Fmap_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                            arg. SameKind (Apply Fmap_0123456789876543210Sym0 arg) (Fmap_0123456789876543210Sym1 arg) =>
-                                                     Fmap_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Fmap_0123456789876543210Sym0 a0123456789876543210 = Fmap_0123456789876543210Sym1 a0123456789876543210
-    type family Lambda_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 t where
-      Lambda_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n_0123456789876543210 = n_0123456789876543210
-    type Lambda_0123456789876543210Sym6 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym5KindInference) ())
-    data Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym5KindInference :: forall _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym6 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
-    data Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym4KindInference :: forall _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
-    data Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym3KindInference :: forall _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 _z_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall _z_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 _z_01234567898765432100123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 _z_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210
-    type family Lambda_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 t where
-      Lambda_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n_0123456789876543210 = _z_0123456789876543210
-    type Lambda_0123456789876543210Sym6 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym5KindInference) ())
-    data Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym5KindInference :: forall _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym6 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
-    data Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym4KindInference :: forall _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
-    data Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym3KindInference :: forall _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 _z_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall _z_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 _z_01234567898765432100123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 _z_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210
-    type family Lambda_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 t where
-      Lambda_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 n_0123456789876543210 = n_0123456789876543210
-    type Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 _z_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall _z_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 _z_01234567898765432100123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 _z_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210
-    type family TFHelper_0123456789876543210 (a :: a0) (a :: T x b0) :: T x a0 where
-      TFHelper_0123456789876543210 _z_0123456789876543210 (MkT1 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) = Apply (Apply (Apply (Apply MkT1Sym0 (Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210)) (Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210)) (Apply (Apply (<$@#@$) _z_0123456789876543210) a_0123456789876543210)) (Apply (Apply FmapSym0 (Apply (<$@#@$) _z_0123456789876543210)) a_0123456789876543210)
-      TFHelper_0123456789876543210 _z_0123456789876543210 (MkT2 a_0123456789876543210) = Apply MkT2Sym0 (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210)
-    type TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: a01234567898765432100) (a0123456789876543210 :: T x0123456789876543210 b01234567898765432100) =
-        TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) TFHelper_0123456789876543210Sym1KindInference) ())
-    data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: a01234567898765432100) :: forall x0123456789876543210
-                                                                                                    b01234567898765432100.
-                                                                                             (~>) (T x0123456789876543210 b01234567898765432100) (T x0123456789876543210 a01234567898765432100)
-      where
-        TFHelper_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                a0123456789876543210
-                                                                arg. SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                         TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) TFHelper_0123456789876543210Sym0KindInference) ())
-    data TFHelper_0123456789876543210Sym0 :: forall a01234567898765432100
-                                                    x0123456789876543210
-                                                    b01234567898765432100.
-                                             (~>) a01234567898765432100 ((~>) (T x0123456789876543210 b01234567898765432100) (T x0123456789876543210 a01234567898765432100))
-      where
-        TFHelper_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                arg. SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) =>
-                                                         TFHelper_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210
-    instance PFunctor (T x) where
-      type Fmap a a = Apply (Apply Fmap_0123456789876543210Sym0 a) a
-      type (<$) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a
-    type family Lambda_0123456789876543210 _f_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 t where
-      Lambda_0123456789876543210 _f_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n_0123456789876543210 = MemptySym0
-    type Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym5KindInference) ())
-    data Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym5KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
-    data Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym4KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
-    data Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym3KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210
-    type family Lambda_0123456789876543210 _f_0123456789876543210 a_0123456789876543210 t where
-      Lambda_0123456789876543210 _f_0123456789876543210 a_0123456789876543210 n_0123456789876543210 = MemptySym0
-    type Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 a_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210
-    type family FoldMap_0123456789876543210 (a :: (~>) a0 m0) (a :: T x a0) :: m0 where
-      FoldMap_0123456789876543210 _f_0123456789876543210 (MkT1 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) = Apply (Apply MappendSym0 (Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210)) (Apply (Apply MappendSym0 (Apply _f_0123456789876543210 a_0123456789876543210)) (Apply (Apply MappendSym0 (Apply (Apply FoldMapSym0 _f_0123456789876543210) a_0123456789876543210)) (Apply (Apply FoldMapSym0 (Apply FoldMapSym0 _f_0123456789876543210)) a_0123456789876543210)))
-      FoldMap_0123456789876543210 _f_0123456789876543210 (MkT2 a_0123456789876543210) = Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) a_0123456789876543210) a_0123456789876543210
-    type FoldMap_0123456789876543210Sym2 (a0123456789876543210 :: (~>) a01234567898765432100 m01234567898765432100) (a0123456789876543210 :: T x0123456789876543210 a01234567898765432100) =
-        FoldMap_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (FoldMap_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) FoldMap_0123456789876543210Sym1KindInference) ())
-    data FoldMap_0123456789876543210Sym1 (a0123456789876543210 :: (~>) a01234567898765432100 m01234567898765432100) :: forall x0123456789876543210.
-                                                                                                                       (~>) (T x0123456789876543210 a01234567898765432100) m01234567898765432100
-      where
-        FoldMap_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                               a0123456789876543210
-                                                               arg. SameKind (Apply (FoldMap_0123456789876543210Sym1 a0123456789876543210) arg) (FoldMap_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                        FoldMap_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (FoldMap_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = FoldMap_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings FoldMap_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) FoldMap_0123456789876543210Sym0KindInference) ())
-    data FoldMap_0123456789876543210Sym0 :: forall a01234567898765432100
-                                                   m01234567898765432100
-                                                   x0123456789876543210.
-                                            (~>) ((~>) a01234567898765432100 m01234567898765432100) ((~>) (T x0123456789876543210 a01234567898765432100) m01234567898765432100)
-      where
-        FoldMap_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                               arg. SameKind (Apply FoldMap_0123456789876543210Sym0 arg) (FoldMap_0123456789876543210Sym1 arg) =>
-                                                        FoldMap_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply FoldMap_0123456789876543210Sym0 a0123456789876543210 = FoldMap_0123456789876543210Sym1 a0123456789876543210
-    type family Lambda_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 t t where
-      Lambda_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 = n2_0123456789876543210
-    type Lambda_0123456789876543210Sym8 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym7 t0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym7KindInference) ())
-    data Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym7KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210) arg) (Lambda_0123456789876543210Sym8 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym7 t0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 t0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym6 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym6KindInference) ())
-    data Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym6KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym6 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210Sym7 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym5KindInference) ())
-    data Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym5KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym6 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
-    data Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym4KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
-    data Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym3KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) _z_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210
-    type family Lambda_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 t t where
-      Lambda_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 = Apply (Apply (Apply FoldrSym0 _f_0123456789876543210) n2_0123456789876543210) n1_0123456789876543210
-    type Lambda_0123456789876543210Sym8 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym7 t0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym7KindInference) ())
-    data Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym7KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210) arg) (Lambda_0123456789876543210Sym8 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym7 t0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 t0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym6 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym6KindInference) ())
-    data Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym6KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym6 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210Sym7 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym5KindInference) ())
-    data Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym5KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym6 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
-    data Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym4KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
-    data Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym3KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) _z_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210
-    type family Lambda_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 t t where
-      Lambda_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 = Apply (Apply (Apply FoldrSym0 _f_0123456789876543210) n2_0123456789876543210) n1_0123456789876543210
-    type Lambda_0123456789876543210Sym10 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym9 t0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym9KindInference) ())
-    data Lambda_0123456789876543210Sym9 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym9KindInference :: forall n1_01234567898765432100123456789876543210
-                                                              n2_01234567898765432100123456789876543210
-                                                              _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym9 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210) arg) (Lambda_0123456789876543210Sym10 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym9 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym9 t0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 t0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym8 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym8KindInference) ())
-    data Lambda_0123456789876543210Sym8 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym8KindInference :: forall n1_01234567898765432100123456789876543210
-                                                              n2_01234567898765432100123456789876543210
-                                                              _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym8 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym9 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym8 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym8 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210Sym9 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym7 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym7KindInference) ())
-    data Lambda_0123456789876543210Sym7 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym7KindInference :: forall n1_01234567898765432100123456789876543210
-                                                              n2_01234567898765432100123456789876543210
-                                                              _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym7 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym8 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym7 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym7 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym8 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym6 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym6KindInference) ())
-    data Lambda_0123456789876543210Sym6 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym6KindInference :: forall n1_01234567898765432100123456789876543210
-                                                              n2_01234567898765432100123456789876543210
-                                                              _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym6 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym7 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym6 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym6 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym7 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym5KindInference) ())
-    data Lambda_0123456789876543210Sym5 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym5KindInference :: forall n1_01234567898765432100123456789876543210
-                                                              n2_01234567898765432100123456789876543210
-                                                              _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym5 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym6 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym5 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym6 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
-    data Lambda_0123456789876543210Sym4 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym4KindInference :: forall n1_01234567898765432100123456789876543210
-                                                              n2_01234567898765432100123456789876543210
-                                                              _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym4 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym5 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym4 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
-    data Lambda_0123456789876543210Sym3 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym3KindInference :: forall n1_01234567898765432100123456789876543210
-                                                              n2_01234567898765432100123456789876543210
-                                                              _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym3 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym4 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym3 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) _z_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall n1_01234567898765432100123456789876543210
-                                                              n2_01234567898765432100123456789876543210
-                                                              _f_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) _f_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 n2_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 n1_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall n1_01234567898765432100123456789876543210
-                                                              n2_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 n1_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 n1_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 n1_01234567898765432100123456789876543210) n2_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 n1_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall n1_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 n1_01234567898765432100123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 n1_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 n1_01234567898765432100123456789876543210
-    type family Lambda_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 t t where
-      Lambda_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 = Apply (Apply (Apply FoldrSym0 (Apply (Apply (Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 n1_0123456789876543210) n2_0123456789876543210) _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210)) n2_0123456789876543210) n1_0123456789876543210
-    type Lambda_0123456789876543210Sym8 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym7 t0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym7KindInference) ())
-    data Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym7KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210) arg) (Lambda_0123456789876543210Sym8 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym7 t0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 t0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym6 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym6KindInference) ())
-    data Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym6KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym6 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210Sym7 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym5KindInference) ())
-    data Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym5KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym6 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
-    data Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym4KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym5 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
-    data Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym3KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) _z_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210
-    type family Lambda_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 t t where
-      Lambda_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 = n2_0123456789876543210
-    type Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 t0123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
-    data Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym4KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210) arg) (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym4 t0123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 t0123456789876543210 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
-    data Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym3KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              _z_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) _z_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall _f_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210
-    type family Foldr_0123456789876543210 (a :: (~>) a0 ((~>) b0 b0)) (a :: b0) (a :: T x a0) :: b0 where
-      Foldr_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 (MkT1 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) = Apply (Apply (Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) (Apply (Apply _f_0123456789876543210 a_0123456789876543210) (Apply (Apply (Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) (Apply (Apply (Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) _z_0123456789876543210)))
-      Foldr_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 (MkT2 a_0123456789876543210) = Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) _z_0123456789876543210
-    type Foldr_0123456789876543210Sym3 (a0123456789876543210 :: (~>) a01234567898765432100 ((~>) b01234567898765432100 b01234567898765432100)) (a0123456789876543210 :: b01234567898765432100) (a0123456789876543210 :: T x0123456789876543210 a01234567898765432100) =
-        Foldr_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Foldr_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Foldr_0123456789876543210Sym2KindInference) ())
-    data Foldr_0123456789876543210Sym2 (a0123456789876543210 :: (~>) a01234567898765432100 ((~>) b01234567898765432100 b01234567898765432100)) (a0123456789876543210 :: b01234567898765432100) :: forall x0123456789876543210.
-                                                                                                                                                                                                  (~>) (T x0123456789876543210 a01234567898765432100) b01234567898765432100
-      where
-        Foldr_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                             a0123456789876543210
-                                                             a0123456789876543210
-                                                             arg. SameKind (Apply (Foldr_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (Foldr_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                                      Foldr_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (Foldr_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = Foldr_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Foldr_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Foldr_0123456789876543210Sym1KindInference) ())
-    data Foldr_0123456789876543210Sym1 (a0123456789876543210 :: (~>) a01234567898765432100 ((~>) b01234567898765432100 b01234567898765432100)) :: forall x0123456789876543210.
-                                                                                                                                                  (~>) b01234567898765432100 ((~>) (T x0123456789876543210 a01234567898765432100) b01234567898765432100)
-      where
-        Foldr_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                             a0123456789876543210
-                                                             arg. SameKind (Apply (Foldr_0123456789876543210Sym1 a0123456789876543210) arg) (Foldr_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                      Foldr_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Foldr_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Foldr_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Foldr_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Foldr_0123456789876543210Sym0KindInference) ())
-    data Foldr_0123456789876543210Sym0 :: forall a01234567898765432100
-                                                 b01234567898765432100
-                                                 x0123456789876543210.
-                                          (~>) ((~>) a01234567898765432100 ((~>) b01234567898765432100 b01234567898765432100)) ((~>) b01234567898765432100 ((~>) (T x0123456789876543210 a01234567898765432100) b01234567898765432100))
-      where
-        Foldr_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                             arg. SameKind (Apply Foldr_0123456789876543210Sym0 arg) (Foldr_0123456789876543210Sym1 arg) =>
-                                                      Foldr_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Foldr_0123456789876543210Sym0 a0123456789876543210 = Foldr_0123456789876543210Sym1 a0123456789876543210
-    instance PFoldable (T x) where
-      type FoldMap a a = Apply (Apply FoldMap_0123456789876543210Sym0 a) a
-      type Foldr a a a = Apply (Apply (Apply Foldr_0123456789876543210Sym0 a) a) a
-    type family Traverse_0123456789876543210 (a :: (~>) a0 (f0 b0)) (a :: T x a0) :: f0 (T x b0) where
-      Traverse_0123456789876543210 _f_0123456789876543210 (MkT1 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) = Apply (Apply (<*>@#@$) (Apply (Apply (<*>@#@$) (Apply (Apply (Apply LiftA2Sym0 MkT1Sym0) (Apply PureSym0 a_0123456789876543210)) (Apply _f_0123456789876543210 a_0123456789876543210))) (Apply (Apply TraverseSym0 _f_0123456789876543210) a_0123456789876543210))) (Apply (Apply TraverseSym0 (Apply TraverseSym0 _f_0123456789876543210)) a_0123456789876543210)
-      Traverse_0123456789876543210 _f_0123456789876543210 (MkT2 a_0123456789876543210) = Apply (Apply FmapSym0 MkT2Sym0) (Apply PureSym0 a_0123456789876543210)
-    type Traverse_0123456789876543210Sym2 (a0123456789876543210 :: (~>) a01234567898765432100 (f01234567898765432100 b01234567898765432100)) (a0123456789876543210 :: T x0123456789876543210 a01234567898765432100) =
-        Traverse_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Traverse_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Traverse_0123456789876543210Sym1KindInference) ())
-    data Traverse_0123456789876543210Sym1 (a0123456789876543210 :: (~>) a01234567898765432100 (f01234567898765432100 b01234567898765432100)) :: forall x0123456789876543210.
-                                                                                                                                                (~>) (T x0123456789876543210 a01234567898765432100) (f01234567898765432100 (T x0123456789876543210 b01234567898765432100))
-      where
-        Traverse_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                a0123456789876543210
-                                                                arg. SameKind (Apply (Traverse_0123456789876543210Sym1 a0123456789876543210) arg) (Traverse_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                         Traverse_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Traverse_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Traverse_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Traverse_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Traverse_0123456789876543210Sym0KindInference) ())
-    data Traverse_0123456789876543210Sym0 :: forall a01234567898765432100
-                                                    f01234567898765432100
-                                                    b01234567898765432100
-                                                    x0123456789876543210.
-                                             (~>) ((~>) a01234567898765432100 (f01234567898765432100 b01234567898765432100)) ((~>) (T x0123456789876543210 a01234567898765432100) (f01234567898765432100 (T x0123456789876543210 b01234567898765432100)))
-      where
-        Traverse_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                arg. SameKind (Apply Traverse_0123456789876543210Sym0 arg) (Traverse_0123456789876543210Sym1 arg) =>
-                                                         Traverse_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Traverse_0123456789876543210Sym0 a0123456789876543210 = Traverse_0123456789876543210Sym1 a0123456789876543210
-    instance PTraversable (T x) where
-      type Traverse a a = Apply (Apply Traverse_0123456789876543210Sym0 a) a
-    type family Case_0123456789876543210 v_0123456789876543210 t where
-    type family Fmap_0123456789876543210 (a :: (~>) a0 b0) (a :: Empty a0) :: Empty b0 where
-      Fmap_0123456789876543210 _ v_0123456789876543210 = Case_0123456789876543210 v_0123456789876543210 v_0123456789876543210
-    type Fmap_0123456789876543210Sym2 (a0123456789876543210 :: (~>) a01234567898765432100 b01234567898765432100) (a0123456789876543210 :: Empty a01234567898765432100) =
-        Fmap_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Fmap_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Fmap_0123456789876543210Sym1KindInference) ())
-    data Fmap_0123456789876543210Sym1 (a0123456789876543210 :: (~>) a01234567898765432100 b01234567898765432100) :: (~>) (Empty a01234567898765432100) (Empty b01234567898765432100)
-      where
-        Fmap_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                            a0123456789876543210
-                                                            arg. SameKind (Apply (Fmap_0123456789876543210Sym1 a0123456789876543210) arg) (Fmap_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                     Fmap_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Fmap_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Fmap_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Fmap_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Fmap_0123456789876543210Sym0KindInference) ())
-    data Fmap_0123456789876543210Sym0 :: forall a01234567898765432100
-                                                b01234567898765432100.
-                                         (~>) ((~>) a01234567898765432100 b01234567898765432100) ((~>) (Empty a01234567898765432100) (Empty b01234567898765432100))
-      where
-        Fmap_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                            arg. SameKind (Apply Fmap_0123456789876543210Sym0 arg) (Fmap_0123456789876543210Sym1 arg) =>
-                                                     Fmap_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Fmap_0123456789876543210Sym0 a0123456789876543210 = Fmap_0123456789876543210Sym1 a0123456789876543210
-    type family Case_0123456789876543210 v_0123456789876543210 t where
-    type family TFHelper_0123456789876543210 (a :: a0) (a :: Empty b0) :: Empty a0 where
-      TFHelper_0123456789876543210 _ v_0123456789876543210 = Case_0123456789876543210 v_0123456789876543210 v_0123456789876543210
-    type TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: a01234567898765432100) (a0123456789876543210 :: Empty b01234567898765432100) =
-        TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) TFHelper_0123456789876543210Sym1KindInference) ())
-    data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: a01234567898765432100) :: forall b01234567898765432100.
-                                                                                             (~>) (Empty b01234567898765432100) (Empty a01234567898765432100)
-      where
-        TFHelper_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                a0123456789876543210
-                                                                arg. SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                         TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) TFHelper_0123456789876543210Sym0KindInference) ())
-    data TFHelper_0123456789876543210Sym0 :: forall a01234567898765432100
-                                                    b01234567898765432100.
-                                             (~>) a01234567898765432100 ((~>) (Empty b01234567898765432100) (Empty a01234567898765432100))
-      where
-        TFHelper_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                arg. SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) =>
-                                                         TFHelper_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210
-    instance PFunctor Empty where
-      type Fmap a a = Apply (Apply Fmap_0123456789876543210Sym0 a) a
-      type (<$) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a
-    type family FoldMap_0123456789876543210 (a :: (~>) a0 m0) (a :: Empty a0) :: m0 where
-      FoldMap_0123456789876543210 _ _ = MemptySym0
-    type FoldMap_0123456789876543210Sym2 (a0123456789876543210 :: (~>) a01234567898765432100 m01234567898765432100) (a0123456789876543210 :: Empty a01234567898765432100) =
-        FoldMap_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (FoldMap_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) FoldMap_0123456789876543210Sym1KindInference) ())
-    data FoldMap_0123456789876543210Sym1 (a0123456789876543210 :: (~>) a01234567898765432100 m01234567898765432100) :: (~>) (Empty a01234567898765432100) m01234567898765432100
-      where
-        FoldMap_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                               a0123456789876543210
-                                                               arg. SameKind (Apply (FoldMap_0123456789876543210Sym1 a0123456789876543210) arg) (FoldMap_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                        FoldMap_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (FoldMap_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = FoldMap_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings FoldMap_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) FoldMap_0123456789876543210Sym0KindInference) ())
-    data FoldMap_0123456789876543210Sym0 :: forall a01234567898765432100
-                                                   m01234567898765432100.
-                                            (~>) ((~>) a01234567898765432100 m01234567898765432100) ((~>) (Empty a01234567898765432100) m01234567898765432100)
-      where
-        FoldMap_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                               arg. SameKind (Apply FoldMap_0123456789876543210Sym0 arg) (FoldMap_0123456789876543210Sym1 arg) =>
-                                                        FoldMap_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply FoldMap_0123456789876543210Sym0 a0123456789876543210 = FoldMap_0123456789876543210Sym1 a0123456789876543210
-    instance PFoldable Empty where
-      type FoldMap a a = Apply (Apply FoldMap_0123456789876543210Sym0 a) a
-    type family Case_0123456789876543210 v_0123456789876543210 t where
-    type family Traverse_0123456789876543210 (a :: (~>) a0 (f0 b0)) (a :: Empty a0) :: f0 (Empty b0) where
-      Traverse_0123456789876543210 _ v_0123456789876543210 = Apply PureSym0 (Case_0123456789876543210 v_0123456789876543210 v_0123456789876543210)
-    type Traverse_0123456789876543210Sym2 (a0123456789876543210 :: (~>) a01234567898765432100 (f01234567898765432100 b01234567898765432100)) (a0123456789876543210 :: Empty a01234567898765432100) =
-        Traverse_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Traverse_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Traverse_0123456789876543210Sym1KindInference) ())
-    data Traverse_0123456789876543210Sym1 (a0123456789876543210 :: (~>) a01234567898765432100 (f01234567898765432100 b01234567898765432100)) :: (~>) (Empty a01234567898765432100) (f01234567898765432100 (Empty b01234567898765432100))
-      where
-        Traverse_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                a0123456789876543210
-                                                                arg. SameKind (Apply (Traverse_0123456789876543210Sym1 a0123456789876543210) arg) (Traverse_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                         Traverse_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Traverse_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Traverse_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Traverse_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Traverse_0123456789876543210Sym0KindInference) ())
-    data Traverse_0123456789876543210Sym0 :: forall a01234567898765432100
-                                                    f01234567898765432100
-                                                    b01234567898765432100.
-                                             (~>) ((~>) a01234567898765432100 (f01234567898765432100 b01234567898765432100)) ((~>) (Empty a01234567898765432100) (f01234567898765432100 (Empty b01234567898765432100)))
-      where
-        Traverse_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                arg. SameKind (Apply Traverse_0123456789876543210Sym0 arg) (Traverse_0123456789876543210Sym1 arg) =>
-                                                         Traverse_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Traverse_0123456789876543210Sym0 a0123456789876543210 = Traverse_0123456789876543210Sym1 a0123456789876543210
-    instance PTraversable Empty where
-      type Traverse a a = Apply (Apply Traverse_0123456789876543210Sym0 a) a
-    data ST :: forall x a. T x a -> Type
-      where
-        SMkT1 :: forall x
-                        a
-                        (n :: x)
-                        (n :: a)
-                        (n :: Maybe a)
-                        (n :: Maybe (Maybe a)).
-                 (Sing (n :: x))
-                 -> (Sing (n :: a))
-                    -> (Sing (n :: Maybe a))
-                       -> (Sing (n :: Maybe (Maybe a))) -> ST (MkT1 n n n n)
-        SMkT2 :: forall x (n :: Maybe x).
-                 (Sing (n :: Maybe x)) -> ST (MkT2 n)
-    type instance Sing @(T x a) = ST
-    instance (SingKind x, SingKind a) => SingKind (T x a) where
-      type Demote (T x a) = T (Demote x) (Demote a)
-      fromSing (SMkT1 b b b b)
-        = (((MkT1 (fromSing b)) (fromSing b)) (fromSing b)) (fromSing b)
-      fromSing (SMkT2 b) = MkT2 (fromSing b)
-      toSing
-        (MkT1 (b :: Demote x)
-              (b :: Demote a)
-              (b :: Demote (Maybe a))
-              (b :: Demote (Maybe (Maybe a))))
-        = case
-              ((((,,,) (toSing b :: SomeSing x)) (toSing b :: SomeSing a))
-                 (toSing b :: SomeSing (Maybe a)))
-                (toSing b :: SomeSing (Maybe (Maybe a)))
-          of {
-            (,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)
-              -> SomeSing ((((SMkT1 c) c) c) c) }
-      toSing (MkT2 (b :: Demote (Maybe x)))
-        = case toSing b :: SomeSing (Maybe x) of {
-            SomeSing c -> SomeSing (SMkT2 c) }
-    data SEmpty :: forall a. Empty a -> Type
-    type instance Sing @(Empty a) = SEmpty
-    instance SingKind a => SingKind (Empty a) where
-      type Demote (Empty a) = Empty (Demote a)
-      fromSing x = case x of
-      toSing x = SomeSing (case x of)
-    instance SFunctor (T x) where
-      sFmap ::
-        forall (a :: Type) (b :: Type) (t1 :: (~>) a b) (t2 :: T x a).
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply (FmapSym0 :: TyFun ((~>) a b) ((~>) (T x a) (T x b))
-                                              -> Type) t1) t2)
-      (%<$) ::
-        forall (a :: Type) (b :: Type) (t1 :: a) (t2 :: T x b).
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply ((<$@#@$) :: TyFun a ((~>) (T x b) (T x a))
-                                              -> Type) t1) t2)
-      sFmap
-        (_sf_0123456789876543210 :: Sing _f_0123456789876543210)
-        (SMkT1 (sA_0123456789876543210 :: Sing a_0123456789876543210)
-               (sA_0123456789876543210 :: Sing a_0123456789876543210)
-               (sA_0123456789876543210 :: Sing a_0123456789876543210)
-               (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        = (applySing
-             ((applySing
-                 ((applySing
-                     ((applySing ((singFun4 @MkT1Sym0) SMkT1))
-                        ((applySing
-                            ((singFun1
-                                @(Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210))
-                               (\ sN_0123456789876543210
-                                  -> case sN_0123456789876543210 of {
-                                       (_ :: Sing n_0123456789876543210)
-                                         -> sN_0123456789876543210 })))
-                           sA_0123456789876543210)))
-                    ((applySing _sf_0123456789876543210) sA_0123456789876543210)))
-                ((applySing
-                    ((applySing ((singFun2 @FmapSym0) sFmap)) _sf_0123456789876543210))
-                   sA_0123456789876543210)))
-            ((applySing
-                ((applySing ((singFun2 @FmapSym0) sFmap))
-                   ((applySing ((singFun2 @FmapSym0) sFmap))
-                      _sf_0123456789876543210)))
-               sA_0123456789876543210)
-      sFmap
-        (_sf_0123456789876543210 :: Sing _f_0123456789876543210)
-        (SMkT2 (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        = (applySing ((singFun1 @MkT2Sym0) SMkT2))
-            ((applySing
-                ((singFun1
-                    @(Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) a_0123456789876543210))
-                   (\ sN_0123456789876543210
-                      -> case sN_0123456789876543210 of {
-                           (_ :: Sing n_0123456789876543210) -> sN_0123456789876543210 })))
-               sA_0123456789876543210)
-      (%<$)
-        (_sz_0123456789876543210 :: Sing _z_0123456789876543210)
-        (SMkT1 (sA_0123456789876543210 :: Sing a_0123456789876543210)
-               (sA_0123456789876543210 :: Sing a_0123456789876543210)
-               (sA_0123456789876543210 :: Sing a_0123456789876543210)
-               (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        = (applySing
-             ((applySing
-                 ((applySing
-                     ((applySing ((singFun4 @MkT1Sym0) SMkT1))
-                        ((applySing
-                            ((singFun1
-                                @(Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210))
-                               (\ sN_0123456789876543210
-                                  -> case sN_0123456789876543210 of {
-                                       (_ :: Sing n_0123456789876543210)
-                                         -> sN_0123456789876543210 })))
-                           sA_0123456789876543210)))
-                    ((applySing
-                        ((singFun1
-                            @(Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210))
-                           (\ sN_0123456789876543210
-                              -> case sN_0123456789876543210 of {
-                                   (_ :: Sing n_0123456789876543210) -> _sz_0123456789876543210 })))
-                       sA_0123456789876543210)))
-                ((applySing
-                    ((applySing ((singFun2 @(<$@#@$)) (%<$))) _sz_0123456789876543210))
-                   sA_0123456789876543210)))
-            ((applySing
-                ((applySing ((singFun2 @FmapSym0) sFmap))
-                   ((applySing ((singFun2 @(<$@#@$)) (%<$)))
-                      _sz_0123456789876543210)))
-               sA_0123456789876543210)
-      (%<$)
-        (_sz_0123456789876543210 :: Sing _z_0123456789876543210)
-        (SMkT2 (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        = (applySing ((singFun1 @MkT2Sym0) SMkT2))
-            ((applySing
-                ((singFun1
-                    @(Apply (Apply Lambda_0123456789876543210Sym0 _z_0123456789876543210) a_0123456789876543210))
-                   (\ sN_0123456789876543210
-                      -> case sN_0123456789876543210 of {
-                           (_ :: Sing n_0123456789876543210) -> sN_0123456789876543210 })))
-               sA_0123456789876543210)
-    instance SFoldable (T x) where
-      sFoldMap ::
-        forall (a :: Type) (m :: Type) (t1 :: (~>) a m) (t2 :: T x a).
-        SMonoid m =>
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply (FoldMapSym0 :: TyFun ((~>) a m) ((~>) (T x a) m)
-                                                 -> Type) t1) t2)
-      sFoldr ::
-        forall (a :: Type)
-               (b :: Type)
-               (t1 :: (~>) a ((~>) b b))
-               (t2 :: b)
-               (t3 :: T x a).
-        Sing t1
-        -> Sing t2
-           -> Sing t3
-              -> Sing (Apply (Apply (Apply (FoldrSym0 :: TyFun ((~>) a ((~>) b b)) ((~>) b ((~>) (T x a) b))
-                                                         -> Type) t1) t2) t3)
-      sFoldMap
-        (_sf_0123456789876543210 :: Sing _f_0123456789876543210)
-        (SMkT1 (sA_0123456789876543210 :: Sing a_0123456789876543210)
-               (sA_0123456789876543210 :: Sing a_0123456789876543210)
-               (sA_0123456789876543210 :: Sing a_0123456789876543210)
-               (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        = (applySing
-             ((applySing ((singFun2 @MappendSym0) sMappend))
-                ((applySing
-                    ((singFun1
-                        @(Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210))
-                       (\ sN_0123456789876543210
-                          -> case sN_0123456789876543210 of {
-                               (_ :: Sing n_0123456789876543210) -> sMempty })))
-                   sA_0123456789876543210)))
-            ((applySing
-                ((applySing ((singFun2 @MappendSym0) sMappend))
-                   ((applySing _sf_0123456789876543210) sA_0123456789876543210)))
-               ((applySing
-                   ((applySing ((singFun2 @MappendSym0) sMappend))
-                      ((applySing
-                          ((applySing ((singFun2 @FoldMapSym0) sFoldMap))
-                             _sf_0123456789876543210))
-                         sA_0123456789876543210)))
-                  ((applySing
-                      ((applySing ((singFun2 @FoldMapSym0) sFoldMap))
-                         ((applySing ((singFun2 @FoldMapSym0) sFoldMap))
-                            _sf_0123456789876543210)))
-                     sA_0123456789876543210)))
-      sFoldMap
-        (_sf_0123456789876543210 :: Sing _f_0123456789876543210)
-        (SMkT2 (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        = (applySing
-             ((singFun1
-                 @(Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) a_0123456789876543210))
-                (\ sN_0123456789876543210
-                   -> case sN_0123456789876543210 of {
-                        (_ :: Sing n_0123456789876543210) -> sMempty })))
-            sA_0123456789876543210
-      sFoldr
-        (_sf_0123456789876543210 :: Sing _f_0123456789876543210)
-        (_sz_0123456789876543210 :: Sing _z_0123456789876543210)
-        (SMkT1 (sA_0123456789876543210 :: Sing a_0123456789876543210)
-               (sA_0123456789876543210 :: Sing a_0123456789876543210)
-               (sA_0123456789876543210 :: Sing a_0123456789876543210)
-               (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        = (applySing
-             ((applySing
-                 ((singFun2
-                     @(Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210))
-                    (\ sN1_0123456789876543210 sN2_0123456789876543210
-                       -> case ((,) sN1_0123456789876543210) sN2_0123456789876543210 of {
-                            (,) (_ :: Sing n1_0123456789876543210)
-                                (_ :: Sing n2_0123456789876543210)
-                              -> sN2_0123456789876543210 })))
-                sA_0123456789876543210))
-            ((applySing
-                ((applySing _sf_0123456789876543210) sA_0123456789876543210))
-               ((applySing
-                   ((applySing
-                       ((singFun2
-                           @(Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210))
-                          (\ sN1_0123456789876543210 sN2_0123456789876543210
-                             -> case ((,) sN1_0123456789876543210) sN2_0123456789876543210 of {
-                                  (,) (_ :: Sing n1_0123456789876543210)
-                                      (_ :: Sing n2_0123456789876543210)
-                                    -> (applySing
-                                          ((applySing
-                                              ((applySing ((singFun3 @FoldrSym0) sFoldr))
-                                                 _sf_0123456789876543210))
-                                             sN2_0123456789876543210))
-                                         sN1_0123456789876543210 })))
-                      sA_0123456789876543210))
-                  ((applySing
-                      ((applySing
-                          ((singFun2
-                              @(Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210))
-                             (\ sN1_0123456789876543210 sN2_0123456789876543210
-                                -> case ((,) sN1_0123456789876543210) sN2_0123456789876543210 of {
-                                     (,) (_ :: Sing n1_0123456789876543210)
-                                         (_ :: Sing n2_0123456789876543210)
-                                       -> (applySing
-                                             ((applySing
-                                                 ((applySing ((singFun3 @FoldrSym0) sFoldr))
-                                                    ((singFun2
-                                                        @(Apply (Apply (Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 n1_0123456789876543210) n2_0123456789876543210) _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210))
-                                                       (\ sN1_0123456789876543210
-                                                          sN2_0123456789876543210
-                                                          -> case
-                                                                 ((,) sN1_0123456789876543210)
-                                                                   sN2_0123456789876543210
-                                                             of {
-                                                               (,) (_ :: Sing n1_0123456789876543210)
-                                                                   (_ :: Sing n2_0123456789876543210)
-                                                                 -> (applySing
-                                                                       ((applySing
-                                                                           ((applySing
-                                                                               ((singFun3
-                                                                                   @FoldrSym0)
-                                                                                  sFoldr))
-                                                                              _sf_0123456789876543210))
-                                                                          sN2_0123456789876543210))
-                                                                      sN1_0123456789876543210 }))))
-                                                sN2_0123456789876543210))
-                                            sN1_0123456789876543210 })))
-                         sA_0123456789876543210))
-                     _sz_0123456789876543210)))
-      sFoldr
-        (_sf_0123456789876543210 :: Sing _f_0123456789876543210)
-        (_sz_0123456789876543210 :: Sing _z_0123456789876543210)
-        (SMkT2 (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        = (applySing
-             ((applySing
-                 ((singFun2
-                     @(Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210))
-                    (\ sN1_0123456789876543210 sN2_0123456789876543210
-                       -> case ((,) sN1_0123456789876543210) sN2_0123456789876543210 of {
-                            (,) (_ :: Sing n1_0123456789876543210)
-                                (_ :: Sing n2_0123456789876543210)
-                              -> sN2_0123456789876543210 })))
-                sA_0123456789876543210))
-            _sz_0123456789876543210
-    instance STraversable (T x) where
-      sTraverse ::
-        forall (a :: Type)
-               (f :: Type -> Type)
-               (b :: Type)
-               (t1 :: (~>) a (f b))
-               (t2 :: T x a).
-        SApplicative f =>
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply (TraverseSym0 :: TyFun ((~>) a (f b)) ((~>) (T x a) (f (T x b)))
-                                                  -> Type) t1) t2)
-      sTraverse
-        (_sf_0123456789876543210 :: Sing _f_0123456789876543210)
-        (SMkT1 (sA_0123456789876543210 :: Sing a_0123456789876543210)
-               (sA_0123456789876543210 :: Sing a_0123456789876543210)
-               (sA_0123456789876543210 :: Sing a_0123456789876543210)
-               (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        = (applySing
-             ((applySing ((singFun2 @(<*>@#@$)) (%<*>)))
-                ((applySing
-                    ((applySing ((singFun2 @(<*>@#@$)) (%<*>)))
-                       ((applySing
-                           ((applySing
-                               ((applySing ((singFun3 @LiftA2Sym0) sLiftA2))
-                                  ((singFun4 @MkT1Sym0) SMkT1)))
-                              ((applySing ((singFun1 @PureSym0) sPure)) sA_0123456789876543210)))
-                          ((applySing _sf_0123456789876543210) sA_0123456789876543210))))
-                   ((applySing
-                       ((applySing ((singFun2 @TraverseSym0) sTraverse))
-                          _sf_0123456789876543210))
-                      sA_0123456789876543210))))
-            ((applySing
-                ((applySing ((singFun2 @TraverseSym0) sTraverse))
-                   ((applySing ((singFun2 @TraverseSym0) sTraverse))
-                      _sf_0123456789876543210)))
-               sA_0123456789876543210)
-      sTraverse
-        (_sf_0123456789876543210 :: Sing _f_0123456789876543210)
-        (SMkT2 (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        = (applySing
-             ((applySing ((singFun2 @FmapSym0) sFmap))
-                ((singFun1 @MkT2Sym0) SMkT2)))
-            ((applySing ((singFun1 @PureSym0) sPure)) sA_0123456789876543210)
-    instance SFunctor Empty where
-      sFmap ::
-        forall (a :: Type) (b :: Type) (t1 :: (~>) a b) (t2 :: Empty a).
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply (FmapSym0 :: TyFun ((~>) a b) ((~>) (Empty a) (Empty b))
-                                              -> Type) t1) t2)
-      (%<$) ::
-        forall (a :: Type) (b :: Type) (t1 :: a) (t2 :: Empty b).
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply ((<$@#@$) :: TyFun a ((~>) (Empty b) (Empty a))
-                                              -> Type) t1) t2)
-      sFmap _ (sV_0123456789876543210 :: Sing v_0123456789876543210)
-        = (id
-             @(Sing (Case_0123456789876543210 v_0123456789876543210 v_0123456789876543210)))
-            (case sV_0123456789876543210 of)
-      (%<$) _ (sV_0123456789876543210 :: Sing v_0123456789876543210)
-        = (id
-             @(Sing (Case_0123456789876543210 v_0123456789876543210 v_0123456789876543210)))
-            (case sV_0123456789876543210 of)
-    instance SFoldable Empty where
-      sFoldMap ::
-        forall (a :: Type) (m :: Type) (t1 :: (~>) a m) (t2 :: Empty a).
-        SMonoid m =>
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply (FoldMapSym0 :: TyFun ((~>) a m) ((~>) (Empty a) m)
-                                                 -> Type) t1) t2)
-      sFoldMap _ _ = sMempty
-    instance STraversable Empty where
-      sTraverse ::
-        forall (a :: Type)
-               (f :: Type -> Type)
-               (b :: Type)
-               (t1 :: (~>) a (f b))
-               (t2 :: Empty a).
-        SApplicative f =>
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply (TraverseSym0 :: TyFun ((~>) a (f b)) ((~>) (Empty a) (f (Empty b)))
-                                                  -> Type) t1) t2)
-      sTraverse _ (sV_0123456789876543210 :: Sing v_0123456789876543210)
-        = (applySing ((singFun1 @PureSym0) sPure))
-            ((id
-                @(Sing (Case_0123456789876543210 v_0123456789876543210 v_0123456789876543210)))
-               (case sV_0123456789876543210 of))
-    instance (SingI n, SingI n, SingI n, SingI n) =>
-             SingI (MkT1 (n :: x) (n :: a) (n :: Maybe a) (n :: Maybe (Maybe a))) where
-      sing = (((SMkT1 sing) sing) sing) sing
-    instance SingI (MkT1Sym0 :: (~>) x ((~>) a ((~>) (Maybe a) ((~>) (Maybe (Maybe a)) (T x a))))) where
-      sing = (singFun4 @MkT1Sym0) SMkT1
-    instance SingI d =>
-             SingI (MkT1Sym1 (d :: x) :: (~>) a ((~>) (Maybe a) ((~>) (Maybe (Maybe a)) (T x a)))) where
-      sing = (singFun3 @(MkT1Sym1 (d :: x))) (SMkT1 (sing @d))
-    instance (SingI d, SingI d) =>
-             SingI (MkT1Sym2 (d :: x) (d :: a) :: (~>) (Maybe a) ((~>) (Maybe (Maybe a)) (T x a))) where
-      sing
-        = (singFun2 @(MkT1Sym2 (d :: x) (d :: a)))
-            ((SMkT1 (sing @d)) (sing @d))
-    instance (SingI d, SingI d, SingI d) =>
-             SingI (MkT1Sym3 (d :: x) (d :: a) (d :: Maybe a) :: (~>) (Maybe (Maybe a)) (T x a)) where
-      sing
-        = (singFun1 @(MkT1Sym3 (d :: x) (d :: a) (d :: Maybe a)))
-            (((SMkT1 (sing @d)) (sing @d)) (sing @d))
-    instance SingI n => SingI (MkT2 (n :: Maybe x)) where
-      sing = SMkT2 sing
-    instance SingI (MkT2Sym0 :: (~>) (Maybe x) (T x a)) where
-      sing = (singFun1 @MkT2Sym0) SMkT2
diff --git a/tests/compile-and-dump/Singletons/FunctorLikeDeriving.golden b/tests/compile-and-dump/Singletons/FunctorLikeDeriving.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/FunctorLikeDeriving.golden
@@ -0,0 +1,1319 @@
+Singletons/FunctorLikeDeriving.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| data T x a
+            = MkT1 x a (Maybe a) (Maybe (Maybe a)) | MkT2 (Maybe x)
+            deriving (Functor, Foldable, Traversable)
+          data Empty (a :: Type) deriving (Functor, Foldable, Traversable) |]
+  ======>
+    data T x a
+      = MkT1 x a (Maybe a) (Maybe (Maybe a)) | MkT2 (Maybe x)
+      deriving (Functor, Foldable, Traversable)
+    data Empty (a :: Type) deriving (Functor, Foldable, Traversable)
+    type MkT1Sym0 :: forall x a.
+                     (~>) x ((~>) a ((~>) (Maybe a) ((~>) (Maybe (Maybe a)) (T x a))))
+    data MkT1Sym0 a0123456789876543210
+      where
+        MkT1Sym0KindInference :: SameKind (Apply MkT1Sym0 arg) (MkT1Sym1 arg) =>
+                                 MkT1Sym0 a0123456789876543210
+    type instance Apply MkT1Sym0 a0123456789876543210 = MkT1Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings MkT1Sym0 where
+      suppressUnusedWarnings = snd (((,) MkT1Sym0KindInference) ())
+    type MkT1Sym1 :: forall x a.
+                     x -> (~>) a ((~>) (Maybe a) ((~>) (Maybe (Maybe a)) (T x a)))
+    data MkT1Sym1 a0123456789876543210 a0123456789876543210
+      where
+        MkT1Sym1KindInference :: SameKind (Apply (MkT1Sym1 a0123456789876543210) arg) (MkT1Sym2 a0123456789876543210 arg) =>
+                                 MkT1Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (MkT1Sym1 a0123456789876543210) a0123456789876543210 = MkT1Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (MkT1Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) MkT1Sym1KindInference) ())
+    type MkT1Sym2 :: forall x a.
+                     x -> a -> (~>) (Maybe a) ((~>) (Maybe (Maybe a)) (T x a))
+    data MkT1Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        MkT1Sym2KindInference :: SameKind (Apply (MkT1Sym2 a0123456789876543210 a0123456789876543210) arg) (MkT1Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                 MkT1Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (MkT1Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = MkT1Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (MkT1Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) MkT1Sym2KindInference) ())
+    type MkT1Sym3 :: forall x a.
+                     x -> a -> Maybe a -> (~>) (Maybe (Maybe a)) (T x a)
+    data MkT1Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        MkT1Sym3KindInference :: SameKind (Apply (MkT1Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) arg) (MkT1Sym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 arg) =>
+                                 MkT1Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (MkT1Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) a0123456789876543210 = MkT1Sym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (MkT1Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) MkT1Sym3KindInference) ())
+    type MkT1Sym4 (a0123456789876543210 :: x) (a0123456789876543210 :: a) (a0123456789876543210 :: Maybe a) (a0123456789876543210 :: Maybe (Maybe a)) =
+        MkT1 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: T x a
+    type MkT2Sym0 :: forall x a. (~>) (Maybe x) (T x a)
+    data MkT2Sym0 a0123456789876543210
+      where
+        MkT2Sym0KindInference :: SameKind (Apply MkT2Sym0 arg) (MkT2Sym1 arg) =>
+                                 MkT2Sym0 a0123456789876543210
+    type instance Apply MkT2Sym0 a0123456789876543210 = MkT2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings MkT2Sym0 where
+      suppressUnusedWarnings = snd (((,) MkT2Sym0KindInference) ())
+    type MkT2Sym1 (a0123456789876543210 :: Maybe x) =
+        MkT2 a0123456789876543210 :: T x a
+    type family Lambda_0123456789876543210 _f_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n_0123456789876543210 where
+      Lambda_0123456789876543210 _f_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n_0123456789876543210 = n_0123456789876543210
+    data Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    data Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym3KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
+    data Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym4KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
+    data Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym5KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) n_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym5KindInference) ())
+    type Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    type family Lambda_0123456789876543210 _f_0123456789876543210 a_0123456789876543210 n_0123456789876543210 where
+      Lambda_0123456789876543210 _f_0123456789876543210 a_0123456789876543210 n_0123456789876543210 = n_0123456789876543210
+    data Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) n_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    type Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    type Fmap_0123456789876543210 :: (~>) a b -> T x a -> T x b
+    type family Fmap_0123456789876543210 a a where
+      Fmap_0123456789876543210 _f_0123456789876543210 (MkT1 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) = Apply (Apply (Apply (Apply MkT1Sym0 (Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210)) (Apply _f_0123456789876543210 a_0123456789876543210)) (Apply (Apply FmapSym0 _f_0123456789876543210) a_0123456789876543210)) (Apply (Apply FmapSym0 (Apply FmapSym0 _f_0123456789876543210)) a_0123456789876543210)
+      Fmap_0123456789876543210 _f_0123456789876543210 (MkT2 a_0123456789876543210) = Apply MkT2Sym0 (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) a_0123456789876543210) a_0123456789876543210)
+    type Fmap_0123456789876543210Sym0 :: (~>) ((~>) a b) ((~>) (T x a) (T x b))
+    data Fmap_0123456789876543210Sym0 a0123456789876543210
+      where
+        Fmap_0123456789876543210Sym0KindInference :: SameKind (Apply Fmap_0123456789876543210Sym0 arg) (Fmap_0123456789876543210Sym1 arg) =>
+                                                     Fmap_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Fmap_0123456789876543210Sym0 a0123456789876543210 = Fmap_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Fmap_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Fmap_0123456789876543210Sym0KindInference) ())
+    type Fmap_0123456789876543210Sym1 :: (~>) a b
+                                         -> (~>) (T x a) (T x b)
+    data Fmap_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Fmap_0123456789876543210Sym1KindInference :: SameKind (Apply (Fmap_0123456789876543210Sym1 a0123456789876543210) arg) (Fmap_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                     Fmap_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Fmap_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Fmap_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Fmap_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Fmap_0123456789876543210Sym1KindInference) ())
+    type Fmap_0123456789876543210Sym2 (a0123456789876543210 :: (~>) a b) (a0123456789876543210 :: T x a) =
+        Fmap_0123456789876543210 a0123456789876543210 a0123456789876543210 :: T x b
+    type family Lambda_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n_0123456789876543210 where
+      Lambda_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n_0123456789876543210 = n_0123456789876543210
+    data Lambda_0123456789876543210Sym0 _z_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 _z_01234567898765432100123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 _z_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    data Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym3KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
+    data Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym4KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
+    data Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym5KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym6 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) n_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym6 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym5KindInference) ())
+    type Lambda_0123456789876543210Sym6 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    type family Lambda_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n_0123456789876543210 where
+      Lambda_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n_0123456789876543210 = _z_0123456789876543210
+    data Lambda_0123456789876543210Sym0 _z_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 _z_01234567898765432100123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 _z_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    data Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym3KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
+    data Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym4KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
+    data Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym5KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym6 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) n_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym6 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym5 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym5KindInference) ())
+    type Lambda_0123456789876543210Sym6 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    type family Lambda_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 n_0123456789876543210 where
+      Lambda_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 n_0123456789876543210 = n_0123456789876543210
+    data Lambda_0123456789876543210Sym0 _z_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 _z_01234567898765432100123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 _z_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _z_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) n_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    type Lambda_0123456789876543210Sym3 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    type TFHelper_0123456789876543210 :: a -> T x b -> T x a
+    type family TFHelper_0123456789876543210 a a where
+      TFHelper_0123456789876543210 _z_0123456789876543210 (MkT1 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) = Apply (Apply (Apply (Apply MkT1Sym0 (Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210)) (Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210)) (Apply (Apply (<$@#@$) _z_0123456789876543210) a_0123456789876543210)) (Apply (Apply FmapSym0 (Apply (<$@#@$) _z_0123456789876543210)) a_0123456789876543210)
+      TFHelper_0123456789876543210 _z_0123456789876543210 (MkT2 a_0123456789876543210) = Apply MkT2Sym0 (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210)
+    type TFHelper_0123456789876543210Sym0 :: (~>) a ((~>) (T x b) (T x a))
+    data TFHelper_0123456789876543210Sym0 a0123456789876543210
+      where
+        TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) =>
+                                                         TFHelper_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) TFHelper_0123456789876543210Sym0KindInference) ())
+    type TFHelper_0123456789876543210Sym1 :: a -> (~>) (T x b) (T x a)
+    data TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                         TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) TFHelper_0123456789876543210Sym1KindInference) ())
+    type TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: T x b) =
+        TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 :: T x a
+    instance PFunctor (T x) where
+      type Fmap a a = Apply (Apply Fmap_0123456789876543210Sym0 a) a
+      type (<$) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a
+    type family Lambda_0123456789876543210 _f_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n_0123456789876543210 where
+      Lambda_0123456789876543210 _f_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n_0123456789876543210 = MemptySym0
+    data Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    data Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym3KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
+    data Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym4KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
+    data Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym5KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) n_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym5KindInference) ())
+    type Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    type family Lambda_0123456789876543210 _f_0123456789876543210 a_0123456789876543210 n_0123456789876543210 where
+      Lambda_0123456789876543210 _f_0123456789876543210 a_0123456789876543210 n_0123456789876543210 = MemptySym0
+    data Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) n_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    type Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 _f_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n_01234567898765432100123456789876543210
+    type FoldMap_0123456789876543210 :: (~>) a m -> T x a -> m
+    type family FoldMap_0123456789876543210 a a where
+      FoldMap_0123456789876543210 _f_0123456789876543210 (MkT1 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) = Apply (Apply MappendSym0 (Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210)) (Apply (Apply MappendSym0 (Apply _f_0123456789876543210 a_0123456789876543210)) (Apply (Apply MappendSym0 (Apply (Apply FoldMapSym0 _f_0123456789876543210) a_0123456789876543210)) (Apply (Apply FoldMapSym0 (Apply FoldMapSym0 _f_0123456789876543210)) a_0123456789876543210)))
+      FoldMap_0123456789876543210 _f_0123456789876543210 (MkT2 a_0123456789876543210) = Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) a_0123456789876543210) a_0123456789876543210
+    type FoldMap_0123456789876543210Sym0 :: (~>) ((~>) a m) ((~>) (T x a) m)
+    data FoldMap_0123456789876543210Sym0 a0123456789876543210
+      where
+        FoldMap_0123456789876543210Sym0KindInference :: SameKind (Apply FoldMap_0123456789876543210Sym0 arg) (FoldMap_0123456789876543210Sym1 arg) =>
+                                                        FoldMap_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply FoldMap_0123456789876543210Sym0 a0123456789876543210 = FoldMap_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings FoldMap_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) FoldMap_0123456789876543210Sym0KindInference) ())
+    type FoldMap_0123456789876543210Sym1 :: (~>) a m -> (~>) (T x a) m
+    data FoldMap_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        FoldMap_0123456789876543210Sym1KindInference :: SameKind (Apply (FoldMap_0123456789876543210Sym1 a0123456789876543210) arg) (FoldMap_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                        FoldMap_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (FoldMap_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = FoldMap_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (FoldMap_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) FoldMap_0123456789876543210Sym1KindInference) ())
+    type FoldMap_0123456789876543210Sym2 (a0123456789876543210 :: (~>) a m) (a0123456789876543210 :: T x a) =
+        FoldMap_0123456789876543210 a0123456789876543210 a0123456789876543210 :: m
+    type family Lambda_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 where
+      Lambda_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 = n2_0123456789876543210
+    data Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) _z_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    data Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym3KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
+    data Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym4KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
+    data Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym5KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym5KindInference) ())
+    data Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym6KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) n1_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym6KindInference) ())
+    data Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym7KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym8 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) n2_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym8 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym7KindInference) ())
+    type Lambda_0123456789876543210Sym8 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+    type family Lambda_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 where
+      Lambda_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 = Apply (Apply (Apply FoldrSym0 _f_0123456789876543210) n2_0123456789876543210) n1_0123456789876543210
+    data Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) _z_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    data Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym3KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
+    data Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym4KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
+    data Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym5KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym5KindInference) ())
+    data Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym6KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) n1_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym6KindInference) ())
+    data Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym7KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym8 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) n2_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym8 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym7KindInference) ())
+    type Lambda_0123456789876543210Sym8 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+    type family Lambda_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 where
+      Lambda_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 = Apply (Apply (Apply FoldrSym0 _f_0123456789876543210) n2_0123456789876543210) n1_0123456789876543210
+    data Lambda_0123456789876543210Sym0 n1_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 n1_01234567898765432100123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 n1_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 n1_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 n1_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 n1_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 n1_01234567898765432100123456789876543210) n2_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 n1_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210) _f_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    data Lambda_0123456789876543210Sym3 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym3KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym3 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym4 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym3 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym3 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) _z_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym4 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
+    data Lambda_0123456789876543210Sym4 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym4KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym4 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym5 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym4 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym4 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym5 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
+    data Lambda_0123456789876543210Sym5 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym5KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym5 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym6 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym5 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym5 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym6 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym5 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym5KindInference) ())
+    data Lambda_0123456789876543210Sym6 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym6KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym6 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym7 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym6 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym6 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym7 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym6 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym6KindInference) ())
+    data Lambda_0123456789876543210Sym7 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym7KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym7 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym8 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym7 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym7 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym8 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym7 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym7KindInference) ())
+    data Lambda_0123456789876543210Sym8 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym8KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym8 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym9 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym8 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym8 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) n1_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym9 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym8 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym8KindInference) ())
+    data Lambda_0123456789876543210Sym9 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym9KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym9 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym10 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym9 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym9 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) n2_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym10 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym9 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym9KindInference) ())
+    type Lambda_0123456789876543210Sym10 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+    type family Lambda_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 where
+      Lambda_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 = Apply (Apply (Apply FoldrSym0 (Apply (Apply (Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 n1_0123456789876543210) n2_0123456789876543210) _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210)) n2_0123456789876543210) n1_0123456789876543210
+    data Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) _z_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    data Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym3KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
+    data Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym4KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
+    data Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym5KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym5KindInference) ())
+    data Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym6KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) n1_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym6 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym6KindInference) ())
+    data Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym7KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym8 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) n2_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym8 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym7 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym7KindInference) ())
+    type Lambda_0123456789876543210Sym8 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+    type family Lambda_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 where
+      Lambda_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 a_0123456789876543210 n1_0123456789876543210 n2_0123456789876543210 = n2_0123456789876543210
+    data Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 _f_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) _z_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 _f_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    data Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym3KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) n1_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
+    data Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym4KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) n2_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
+    type Lambda_0123456789876543210Sym5 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 _f_01234567898765432100123456789876543210 _z_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n1_01234567898765432100123456789876543210 n2_01234567898765432100123456789876543210
+    type Foldr_0123456789876543210 :: (~>) a ((~>) b b)
+                                      -> b -> T x a -> b
+    type family Foldr_0123456789876543210 a a a where
+      Foldr_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 (MkT1 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) = Apply (Apply (Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) (Apply (Apply _f_0123456789876543210 a_0123456789876543210) (Apply (Apply (Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) (Apply (Apply (Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) _z_0123456789876543210)))
+      Foldr_0123456789876543210 _f_0123456789876543210 _z_0123456789876543210 (MkT2 a_0123456789876543210) = Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) _z_0123456789876543210
+    type Foldr_0123456789876543210Sym0 :: (~>) ((~>) a ((~>) b b)) ((~>) b ((~>) (T x a) b))
+    data Foldr_0123456789876543210Sym0 a0123456789876543210
+      where
+        Foldr_0123456789876543210Sym0KindInference :: SameKind (Apply Foldr_0123456789876543210Sym0 arg) (Foldr_0123456789876543210Sym1 arg) =>
+                                                      Foldr_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Foldr_0123456789876543210Sym0 a0123456789876543210 = Foldr_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foldr_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Foldr_0123456789876543210Sym0KindInference) ())
+    type Foldr_0123456789876543210Sym1 :: (~>) a ((~>) b b)
+                                          -> (~>) b ((~>) (T x a) b)
+    data Foldr_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Foldr_0123456789876543210Sym1KindInference :: SameKind (Apply (Foldr_0123456789876543210Sym1 a0123456789876543210) arg) (Foldr_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                      Foldr_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Foldr_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Foldr_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Foldr_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Foldr_0123456789876543210Sym1KindInference) ())
+    type Foldr_0123456789876543210Sym2 :: (~>) a ((~>) b b)
+                                          -> b -> (~>) (T x a) b
+    data Foldr_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        Foldr_0123456789876543210Sym2KindInference :: SameKind (Apply (Foldr_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (Foldr_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                                      Foldr_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (Foldr_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = Foldr_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Foldr_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Foldr_0123456789876543210Sym2KindInference) ())
+    type Foldr_0123456789876543210Sym3 (a0123456789876543210 :: (~>) a ((~>) b b)) (a0123456789876543210 :: b) (a0123456789876543210 :: T x a) =
+        Foldr_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: b
+    instance PFoldable (T x) where
+      type FoldMap a a = Apply (Apply FoldMap_0123456789876543210Sym0 a) a
+      type Foldr a a a = Apply (Apply (Apply Foldr_0123456789876543210Sym0 a) a) a
+    type Traverse_0123456789876543210 :: (~>) a (f b)
+                                         -> T x a -> f (T x b)
+    type family Traverse_0123456789876543210 a a where
+      Traverse_0123456789876543210 _f_0123456789876543210 (MkT1 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) = Apply (Apply (<*>@#@$) (Apply (Apply (<*>@#@$) (Apply (Apply (Apply LiftA2Sym0 MkT1Sym0) (Apply PureSym0 a_0123456789876543210)) (Apply _f_0123456789876543210 a_0123456789876543210))) (Apply (Apply TraverseSym0 _f_0123456789876543210) a_0123456789876543210))) (Apply (Apply TraverseSym0 (Apply TraverseSym0 _f_0123456789876543210)) a_0123456789876543210)
+      Traverse_0123456789876543210 _f_0123456789876543210 (MkT2 a_0123456789876543210) = Apply (Apply FmapSym0 MkT2Sym0) (Apply PureSym0 a_0123456789876543210)
+    type Traverse_0123456789876543210Sym0 :: (~>) ((~>) a (f b)) ((~>) (T x a) (f (T x b)))
+    data Traverse_0123456789876543210Sym0 a0123456789876543210
+      where
+        Traverse_0123456789876543210Sym0KindInference :: SameKind (Apply Traverse_0123456789876543210Sym0 arg) (Traverse_0123456789876543210Sym1 arg) =>
+                                                         Traverse_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Traverse_0123456789876543210Sym0 a0123456789876543210 = Traverse_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Traverse_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Traverse_0123456789876543210Sym0KindInference) ())
+    type Traverse_0123456789876543210Sym1 :: (~>) a (f b)
+                                             -> (~>) (T x a) (f (T x b))
+    data Traverse_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Traverse_0123456789876543210Sym1KindInference :: SameKind (Apply (Traverse_0123456789876543210Sym1 a0123456789876543210) arg) (Traverse_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                         Traverse_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Traverse_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Traverse_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Traverse_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Traverse_0123456789876543210Sym1KindInference) ())
+    type Traverse_0123456789876543210Sym2 (a0123456789876543210 :: (~>) a (f b)) (a0123456789876543210 :: T x a) =
+        Traverse_0123456789876543210 a0123456789876543210 a0123456789876543210 :: f (T x b)
+    instance PTraversable (T x) where
+      type Traverse a a = Apply (Apply Traverse_0123456789876543210Sym0 a) a
+    type family Case_0123456789876543210 v_0123456789876543210 t where
+    type Fmap_0123456789876543210 :: (~>) a b -> Empty a -> Empty b
+    type family Fmap_0123456789876543210 a a where
+      Fmap_0123456789876543210 _ v_0123456789876543210 = Case_0123456789876543210 v_0123456789876543210 v_0123456789876543210
+    type Fmap_0123456789876543210Sym0 :: (~>) ((~>) a b) ((~>) (Empty a) (Empty b))
+    data Fmap_0123456789876543210Sym0 a0123456789876543210
+      where
+        Fmap_0123456789876543210Sym0KindInference :: SameKind (Apply Fmap_0123456789876543210Sym0 arg) (Fmap_0123456789876543210Sym1 arg) =>
+                                                     Fmap_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Fmap_0123456789876543210Sym0 a0123456789876543210 = Fmap_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Fmap_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Fmap_0123456789876543210Sym0KindInference) ())
+    type Fmap_0123456789876543210Sym1 :: (~>) a b
+                                         -> (~>) (Empty a) (Empty b)
+    data Fmap_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Fmap_0123456789876543210Sym1KindInference :: SameKind (Apply (Fmap_0123456789876543210Sym1 a0123456789876543210) arg) (Fmap_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                     Fmap_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Fmap_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Fmap_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Fmap_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Fmap_0123456789876543210Sym1KindInference) ())
+    type Fmap_0123456789876543210Sym2 (a0123456789876543210 :: (~>) a b) (a0123456789876543210 :: Empty a) =
+        Fmap_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Empty b
+    type family Case_0123456789876543210 v_0123456789876543210 t where
+    type TFHelper_0123456789876543210 :: a -> Empty b -> Empty a
+    type family TFHelper_0123456789876543210 a a where
+      TFHelper_0123456789876543210 _ v_0123456789876543210 = Case_0123456789876543210 v_0123456789876543210 v_0123456789876543210
+    type TFHelper_0123456789876543210Sym0 :: (~>) a ((~>) (Empty b) (Empty a))
+    data TFHelper_0123456789876543210Sym0 a0123456789876543210
+      where
+        TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) =>
+                                                         TFHelper_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) TFHelper_0123456789876543210Sym0KindInference) ())
+    type TFHelper_0123456789876543210Sym1 :: a
+                                             -> (~>) (Empty b) (Empty a)
+    data TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                         TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) TFHelper_0123456789876543210Sym1KindInference) ())
+    type TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: Empty b) =
+        TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Empty a
+    instance PFunctor Empty where
+      type Fmap a a = Apply (Apply Fmap_0123456789876543210Sym0 a) a
+      type (<$) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a
+    type FoldMap_0123456789876543210 :: (~>) a m -> Empty a -> m
+    type family FoldMap_0123456789876543210 a a where
+      FoldMap_0123456789876543210 _ _ = MemptySym0
+    type FoldMap_0123456789876543210Sym0 :: (~>) ((~>) a m) ((~>) (Empty a) m)
+    data FoldMap_0123456789876543210Sym0 a0123456789876543210
+      where
+        FoldMap_0123456789876543210Sym0KindInference :: SameKind (Apply FoldMap_0123456789876543210Sym0 arg) (FoldMap_0123456789876543210Sym1 arg) =>
+                                                        FoldMap_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply FoldMap_0123456789876543210Sym0 a0123456789876543210 = FoldMap_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings FoldMap_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) FoldMap_0123456789876543210Sym0KindInference) ())
+    type FoldMap_0123456789876543210Sym1 :: (~>) a m
+                                            -> (~>) (Empty a) m
+    data FoldMap_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        FoldMap_0123456789876543210Sym1KindInference :: SameKind (Apply (FoldMap_0123456789876543210Sym1 a0123456789876543210) arg) (FoldMap_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                        FoldMap_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (FoldMap_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = FoldMap_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (FoldMap_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) FoldMap_0123456789876543210Sym1KindInference) ())
+    type FoldMap_0123456789876543210Sym2 (a0123456789876543210 :: (~>) a m) (a0123456789876543210 :: Empty a) =
+        FoldMap_0123456789876543210 a0123456789876543210 a0123456789876543210 :: m
+    instance PFoldable Empty where
+      type FoldMap a a = Apply (Apply FoldMap_0123456789876543210Sym0 a) a
+    type family Case_0123456789876543210 v_0123456789876543210 t where
+    type Traverse_0123456789876543210 :: (~>) a (f b)
+                                         -> Empty a -> f (Empty b)
+    type family Traverse_0123456789876543210 a a where
+      Traverse_0123456789876543210 _ v_0123456789876543210 = Apply PureSym0 (Case_0123456789876543210 v_0123456789876543210 v_0123456789876543210)
+    type Traverse_0123456789876543210Sym0 :: (~>) ((~>) a (f b)) ((~>) (Empty a) (f (Empty b)))
+    data Traverse_0123456789876543210Sym0 a0123456789876543210
+      where
+        Traverse_0123456789876543210Sym0KindInference :: SameKind (Apply Traverse_0123456789876543210Sym0 arg) (Traverse_0123456789876543210Sym1 arg) =>
+                                                         Traverse_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Traverse_0123456789876543210Sym0 a0123456789876543210 = Traverse_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Traverse_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Traverse_0123456789876543210Sym0KindInference) ())
+    type Traverse_0123456789876543210Sym1 :: (~>) a (f b)
+                                             -> (~>) (Empty a) (f (Empty b))
+    data Traverse_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Traverse_0123456789876543210Sym1KindInference :: SameKind (Apply (Traverse_0123456789876543210Sym1 a0123456789876543210) arg) (Traverse_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                         Traverse_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Traverse_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Traverse_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Traverse_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Traverse_0123456789876543210Sym1KindInference) ())
+    type Traverse_0123456789876543210Sym2 (a0123456789876543210 :: (~>) a (f b)) (a0123456789876543210 :: Empty a) =
+        Traverse_0123456789876543210 a0123456789876543210 a0123456789876543210 :: f (Empty b)
+    instance PTraversable Empty where
+      type Traverse a a = Apply (Apply Traverse_0123456789876543210Sym0 a) a
+    data ST :: forall x a. T x a -> Type
+      where
+        SMkT1 :: forall x
+                        a
+                        (n :: x)
+                        (n :: a)
+                        (n :: Maybe a)
+                        (n :: Maybe (Maybe a)).
+                 (Sing n)
+                 -> (Sing n) -> (Sing n) -> (Sing n) -> ST (MkT1 n n n n :: T x a)
+        SMkT2 :: forall x a (n :: Maybe x).
+                 (Sing n) -> ST (MkT2 n :: T x a)
+    type instance Sing @(T x a) = ST
+    instance (SingKind x, SingKind a) => SingKind (T x a) where
+      type Demote (T x a) = T (Demote x) (Demote a)
+      fromSing (SMkT1 b b b b)
+        = (((MkT1 (fromSing b)) (fromSing b)) (fromSing b)) (fromSing b)
+      fromSing (SMkT2 b) = MkT2 (fromSing b)
+      toSing
+        (MkT1 (b :: Demote x) (b :: Demote a) (b :: Demote (Maybe a))
+              (b :: Demote (Maybe (Maybe a))))
+        = case
+              ((((,,,) (toSing b :: SomeSing x)) (toSing b :: SomeSing a))
+                 (toSing b :: SomeSing (Maybe a)))
+                (toSing b :: SomeSing (Maybe (Maybe a)))
+          of {
+            (,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)
+              -> SomeSing ((((SMkT1 c) c) c) c) }
+      toSing (MkT2 (b :: Demote (Maybe x)))
+        = case toSing b :: SomeSing (Maybe x) of {
+            SomeSing c -> SomeSing (SMkT2 c) }
+    data SEmpty :: forall a. Empty (a :: Type) -> Type
+    type instance Sing @(Empty a) = SEmpty
+    instance SingKind a => SingKind (Empty a) where
+      type Demote (Empty a) = Empty (Demote a)
+      fromSing x = case x of
+      toSing x = SomeSing (case x of)
+    instance SFunctor (T x) where
+      sFmap ::
+        forall (a :: Type) (b :: Type) (t1 :: (~>) a b) (t2 :: T x a).
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply (FmapSym0 :: TyFun ((~>) a b) ((~>) (T x a) (T x b))
+                                              -> Type) t1) t2)
+      (%<$) ::
+        forall (a :: Type) (b :: Type) (t1 :: a) (t2 :: T x b).
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply ((<$@#@$) :: TyFun a ((~>) (T x b) (T x a))
+                                              -> Type) t1) t2)
+      sFmap
+        (_sf_0123456789876543210 :: Sing _f_0123456789876543210)
+        (SMkT1 (sA_0123456789876543210 :: Sing a_0123456789876543210)
+               (sA_0123456789876543210 :: Sing a_0123456789876543210)
+               (sA_0123456789876543210 :: Sing a_0123456789876543210)
+               (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        = (applySing
+             ((applySing
+                 ((applySing
+                     ((applySing ((singFun4 @MkT1Sym0) SMkT1))
+                        ((applySing
+                            ((singFun1
+                                @(Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210))
+                               (\ sN_0123456789876543210
+                                  -> case sN_0123456789876543210 of {
+                                       (_ :: Sing n_0123456789876543210)
+                                         -> sN_0123456789876543210 })))
+                           sA_0123456789876543210)))
+                    ((applySing _sf_0123456789876543210) sA_0123456789876543210)))
+                ((applySing
+                    ((applySing ((singFun2 @FmapSym0) sFmap)) _sf_0123456789876543210))
+                   sA_0123456789876543210)))
+            ((applySing
+                ((applySing ((singFun2 @FmapSym0) sFmap))
+                   ((applySing ((singFun2 @FmapSym0) sFmap))
+                      _sf_0123456789876543210)))
+               sA_0123456789876543210)
+      sFmap
+        (_sf_0123456789876543210 :: Sing _f_0123456789876543210)
+        (SMkT2 (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        = (applySing ((singFun1 @MkT2Sym0) SMkT2))
+            ((applySing
+                ((singFun1
+                    @(Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) a_0123456789876543210))
+                   (\ sN_0123456789876543210
+                      -> case sN_0123456789876543210 of {
+                           (_ :: Sing n_0123456789876543210) -> sN_0123456789876543210 })))
+               sA_0123456789876543210)
+      (%<$)
+        (_sz_0123456789876543210 :: Sing _z_0123456789876543210)
+        (SMkT1 (sA_0123456789876543210 :: Sing a_0123456789876543210)
+               (sA_0123456789876543210 :: Sing a_0123456789876543210)
+               (sA_0123456789876543210 :: Sing a_0123456789876543210)
+               (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        = (applySing
+             ((applySing
+                 ((applySing
+                     ((applySing ((singFun4 @MkT1Sym0) SMkT1))
+                        ((applySing
+                            ((singFun1
+                                @(Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210))
+                               (\ sN_0123456789876543210
+                                  -> case sN_0123456789876543210 of {
+                                       (_ :: Sing n_0123456789876543210)
+                                         -> sN_0123456789876543210 })))
+                           sA_0123456789876543210)))
+                    ((applySing
+                        ((singFun1
+                            @(Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210))
+                           (\ sN_0123456789876543210
+                              -> case sN_0123456789876543210 of {
+                                   (_ :: Sing n_0123456789876543210) -> _sz_0123456789876543210 })))
+                       sA_0123456789876543210)))
+                ((applySing
+                    ((applySing ((singFun2 @(<$@#@$)) (%<$))) _sz_0123456789876543210))
+                   sA_0123456789876543210)))
+            ((applySing
+                ((applySing ((singFun2 @FmapSym0) sFmap))
+                   ((applySing ((singFun2 @(<$@#@$)) (%<$)))
+                      _sz_0123456789876543210)))
+               sA_0123456789876543210)
+      (%<$)
+        (_sz_0123456789876543210 :: Sing _z_0123456789876543210)
+        (SMkT2 (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        = (applySing ((singFun1 @MkT2Sym0) SMkT2))
+            ((applySing
+                ((singFun1
+                    @(Apply (Apply Lambda_0123456789876543210Sym0 _z_0123456789876543210) a_0123456789876543210))
+                   (\ sN_0123456789876543210
+                      -> case sN_0123456789876543210 of {
+                           (_ :: Sing n_0123456789876543210) -> sN_0123456789876543210 })))
+               sA_0123456789876543210)
+    instance SFoldable (T x) where
+      sFoldMap ::
+        forall (a :: Type) (m :: Type) (t1 :: (~>) a m) (t2 :: T x a).
+        SMonoid m =>
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply (FoldMapSym0 :: TyFun ((~>) a m) ((~>) (T x a) m)
+                                                 -> Type) t1) t2)
+      sFoldr ::
+        forall (a :: Type)
+               (b :: Type)
+               (t1 :: (~>) a ((~>) b b))
+               (t2 :: b)
+               (t3 :: T x a).
+        Sing t1
+        -> Sing t2
+           -> Sing t3
+              -> Sing (Apply (Apply (Apply (FoldrSym0 :: TyFun ((~>) a ((~>) b b)) ((~>) b ((~>) (T x a) b))
+                                                         -> Type) t1) t2) t3)
+      sFoldMap
+        (_sf_0123456789876543210 :: Sing _f_0123456789876543210)
+        (SMkT1 (sA_0123456789876543210 :: Sing a_0123456789876543210)
+               (sA_0123456789876543210 :: Sing a_0123456789876543210)
+               (sA_0123456789876543210 :: Sing a_0123456789876543210)
+               (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        = (applySing
+             ((applySing ((singFun2 @MappendSym0) sMappend))
+                ((applySing
+                    ((singFun1
+                        @(Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210))
+                       (\ sN_0123456789876543210
+                          -> case sN_0123456789876543210 of {
+                               (_ :: Sing n_0123456789876543210) -> sMempty })))
+                   sA_0123456789876543210)))
+            ((applySing
+                ((applySing ((singFun2 @MappendSym0) sMappend))
+                   ((applySing _sf_0123456789876543210) sA_0123456789876543210)))
+               ((applySing
+                   ((applySing ((singFun2 @MappendSym0) sMappend))
+                      ((applySing
+                          ((applySing ((singFun2 @FoldMapSym0) sFoldMap))
+                             _sf_0123456789876543210))
+                         sA_0123456789876543210)))
+                  ((applySing
+                      ((applySing ((singFun2 @FoldMapSym0) sFoldMap))
+                         ((applySing ((singFun2 @FoldMapSym0) sFoldMap))
+                            _sf_0123456789876543210)))
+                     sA_0123456789876543210)))
+      sFoldMap
+        (_sf_0123456789876543210 :: Sing _f_0123456789876543210)
+        (SMkT2 (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        = (applySing
+             ((singFun1
+                 @(Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) a_0123456789876543210))
+                (\ sN_0123456789876543210
+                   -> case sN_0123456789876543210 of {
+                        (_ :: Sing n_0123456789876543210) -> sMempty })))
+            sA_0123456789876543210
+      sFoldr
+        (_sf_0123456789876543210 :: Sing _f_0123456789876543210)
+        (_sz_0123456789876543210 :: Sing _z_0123456789876543210)
+        (SMkT1 (sA_0123456789876543210 :: Sing a_0123456789876543210)
+               (sA_0123456789876543210 :: Sing a_0123456789876543210)
+               (sA_0123456789876543210 :: Sing a_0123456789876543210)
+               (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        = (applySing
+             ((applySing
+                 ((singFun2
+                     @(Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210))
+                    (\ sN1_0123456789876543210 sN2_0123456789876543210
+                       -> case ((,) sN1_0123456789876543210) sN2_0123456789876543210 of {
+                            (,) (_ :: Sing n1_0123456789876543210)
+                                (_ :: Sing n2_0123456789876543210)
+                              -> sN2_0123456789876543210 })))
+                sA_0123456789876543210))
+            ((applySing
+                ((applySing _sf_0123456789876543210) sA_0123456789876543210))
+               ((applySing
+                   ((applySing
+                       ((singFun2
+                           @(Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210))
+                          (\ sN1_0123456789876543210 sN2_0123456789876543210
+                             -> case ((,) sN1_0123456789876543210) sN2_0123456789876543210 of {
+                                  (,) (_ :: Sing n1_0123456789876543210)
+                                      (_ :: Sing n2_0123456789876543210)
+                                    -> (applySing
+                                          ((applySing
+                                              ((applySing ((singFun3 @FoldrSym0) sFoldr))
+                                                 _sf_0123456789876543210))
+                                             sN2_0123456789876543210))
+                                         sN1_0123456789876543210 })))
+                      sA_0123456789876543210))
+                  ((applySing
+                      ((applySing
+                          ((singFun2
+                              @(Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210))
+                             (\ sN1_0123456789876543210 sN2_0123456789876543210
+                                -> case ((,) sN1_0123456789876543210) sN2_0123456789876543210 of {
+                                     (,) (_ :: Sing n1_0123456789876543210)
+                                         (_ :: Sing n2_0123456789876543210)
+                                       -> (applySing
+                                             ((applySing
+                                                 ((applySing ((singFun3 @FoldrSym0) sFoldr))
+                                                    ((singFun2
+                                                        @(Apply (Apply (Apply (Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 n1_0123456789876543210) n2_0123456789876543210) _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210))
+                                                       (\ sN1_0123456789876543210
+                                                          sN2_0123456789876543210
+                                                          -> case
+                                                                 ((,) sN1_0123456789876543210)
+                                                                   sN2_0123456789876543210
+                                                             of {
+                                                               (,) (_ :: Sing n1_0123456789876543210)
+                                                                   (_ :: Sing n2_0123456789876543210)
+                                                                 -> (applySing
+                                                                       ((applySing
+                                                                           ((applySing
+                                                                               ((singFun3
+                                                                                   @FoldrSym0)
+                                                                                  sFoldr))
+                                                                              _sf_0123456789876543210))
+                                                                          sN2_0123456789876543210))
+                                                                      sN1_0123456789876543210 }))))
+                                                sN2_0123456789876543210))
+                                            sN1_0123456789876543210 })))
+                         sA_0123456789876543210))
+                     _sz_0123456789876543210)))
+      sFoldr
+        (_sf_0123456789876543210 :: Sing _f_0123456789876543210)
+        (_sz_0123456789876543210 :: Sing _z_0123456789876543210)
+        (SMkT2 (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        = (applySing
+             ((applySing
+                 ((singFun2
+                     @(Apply (Apply (Apply Lambda_0123456789876543210Sym0 _f_0123456789876543210) _z_0123456789876543210) a_0123456789876543210))
+                    (\ sN1_0123456789876543210 sN2_0123456789876543210
+                       -> case ((,) sN1_0123456789876543210) sN2_0123456789876543210 of {
+                            (,) (_ :: Sing n1_0123456789876543210)
+                                (_ :: Sing n2_0123456789876543210)
+                              -> sN2_0123456789876543210 })))
+                sA_0123456789876543210))
+            _sz_0123456789876543210
+    instance STraversable (T x) where
+      sTraverse ::
+        forall (a :: Type)
+               (f :: Type -> Type)
+               (b :: Type)
+               (t1 :: (~>) a (f b))
+               (t2 :: T x a).
+        SApplicative f =>
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply (TraverseSym0 :: TyFun ((~>) a (f b)) ((~>) (T x a) (f (T x b)))
+                                                  -> Type) t1) t2)
+      sTraverse
+        (_sf_0123456789876543210 :: Sing _f_0123456789876543210)
+        (SMkT1 (sA_0123456789876543210 :: Sing a_0123456789876543210)
+               (sA_0123456789876543210 :: Sing a_0123456789876543210)
+               (sA_0123456789876543210 :: Sing a_0123456789876543210)
+               (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        = (applySing
+             ((applySing ((singFun2 @(<*>@#@$)) (%<*>)))
+                ((applySing
+                    ((applySing ((singFun2 @(<*>@#@$)) (%<*>)))
+                       ((applySing
+                           ((applySing
+                               ((applySing ((singFun3 @LiftA2Sym0) sLiftA2))
+                                  ((singFun4 @MkT1Sym0) SMkT1)))
+                              ((applySing ((singFun1 @PureSym0) sPure)) sA_0123456789876543210)))
+                          ((applySing _sf_0123456789876543210) sA_0123456789876543210))))
+                   ((applySing
+                       ((applySing ((singFun2 @TraverseSym0) sTraverse))
+                          _sf_0123456789876543210))
+                      sA_0123456789876543210))))
+            ((applySing
+                ((applySing ((singFun2 @TraverseSym0) sTraverse))
+                   ((applySing ((singFun2 @TraverseSym0) sTraverse))
+                      _sf_0123456789876543210)))
+               sA_0123456789876543210)
+      sTraverse
+        (_sf_0123456789876543210 :: Sing _f_0123456789876543210)
+        (SMkT2 (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        = (applySing
+             ((applySing ((singFun2 @FmapSym0) sFmap))
+                ((singFun1 @MkT2Sym0) SMkT2)))
+            ((applySing ((singFun1 @PureSym0) sPure)) sA_0123456789876543210)
+    instance SFunctor Empty where
+      sFmap ::
+        forall (a :: Type) (b :: Type) (t1 :: (~>) a b) (t2 :: Empty a).
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply (FmapSym0 :: TyFun ((~>) a b) ((~>) (Empty a) (Empty b))
+                                              -> Type) t1) t2)
+      (%<$) ::
+        forall (a :: Type) (b :: Type) (t1 :: a) (t2 :: Empty b).
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply ((<$@#@$) :: TyFun a ((~>) (Empty b) (Empty a))
+                                              -> Type) t1) t2)
+      sFmap _ (sV_0123456789876543210 :: Sing v_0123456789876543210)
+        = (id
+             @(Sing (Case_0123456789876543210 v_0123456789876543210 v_0123456789876543210)))
+            (case sV_0123456789876543210 of)
+      (%<$) _ (sV_0123456789876543210 :: Sing v_0123456789876543210)
+        = (id
+             @(Sing (Case_0123456789876543210 v_0123456789876543210 v_0123456789876543210)))
+            (case sV_0123456789876543210 of)
+    instance SFoldable Empty where
+      sFoldMap ::
+        forall (a :: Type) (m :: Type) (t1 :: (~>) a m) (t2 :: Empty a).
+        SMonoid m =>
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply (FoldMapSym0 :: TyFun ((~>) a m) ((~>) (Empty a) m)
+                                                 -> Type) t1) t2)
+      sFoldMap _ _ = sMempty
+    instance STraversable Empty where
+      sTraverse ::
+        forall (a :: Type)
+               (f :: Type -> Type)
+               (b :: Type)
+               (t1 :: (~>) a (f b))
+               (t2 :: Empty a).
+        SApplicative f =>
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply (TraverseSym0 :: TyFun ((~>) a (f b)) ((~>) (Empty a) (f (Empty b)))
+                                                  -> Type) t1) t2)
+      sTraverse _ (sV_0123456789876543210 :: Sing v_0123456789876543210)
+        = (applySing ((singFun1 @PureSym0) sPure))
+            ((id
+                @(Sing (Case_0123456789876543210 v_0123456789876543210 v_0123456789876543210)))
+               (case sV_0123456789876543210 of))
+    instance (SingI n, SingI n, SingI n, SingI n) =>
+             SingI (MkT1 (n :: x) (n :: a) (n :: Maybe a) (n :: Maybe (Maybe a))) where
+      sing = (((SMkT1 sing) sing) sing) sing
+    instance SingI (MkT1Sym0 :: (~>) x ((~>) a ((~>) (Maybe a) ((~>) (Maybe (Maybe a)) (T x a))))) where
+      sing = (singFun4 @MkT1Sym0) SMkT1
+    instance SingI d =>
+             SingI (MkT1Sym1 (d :: x) :: (~>) a ((~>) (Maybe a) ((~>) (Maybe (Maybe a)) (T x a)))) where
+      sing = (singFun3 @(MkT1Sym1 (d :: x))) (SMkT1 (sing @d))
+    instance (SingI d, SingI d) =>
+             SingI (MkT1Sym2 (d :: x) (d :: a) :: (~>) (Maybe a) ((~>) (Maybe (Maybe a)) (T x a))) where
+      sing
+        = (singFun2 @(MkT1Sym2 (d :: x) (d :: a)))
+            ((SMkT1 (sing @d)) (sing @d))
+    instance (SingI d, SingI d, SingI d) =>
+             SingI (MkT1Sym3 (d :: x) (d :: a) (d :: Maybe a) :: (~>) (Maybe (Maybe a)) (T x a)) where
+      sing
+        = (singFun1 @(MkT1Sym3 (d :: x) (d :: a) (d :: Maybe a)))
+            (((SMkT1 (sing @d)) (sing @d)) (sing @d))
+    instance SingI n => SingI (MkT2 (n :: Maybe x)) where
+      sing = SMkT2 sing
+    instance SingI (MkT2Sym0 :: (~>) (Maybe x) (T x a)) where
+      sing = (singFun1 @MkT2Sym0) SMkT2
diff --git a/tests/compile-and-dump/Singletons/HigherOrder.ghc88.template b/tests/compile-and-dump/Singletons/HigherOrder.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/HigherOrder.ghc88.template
+++ /dev/null
@@ -1,477 +0,0 @@
-Singletons/HigherOrder.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| map :: (a -> b) -> [a] -> [b]
-          map _ [] = []
-          map f (h : t) = (f h) : (map f t)
-          liftMaybe :: (a -> b) -> Maybe a -> Maybe b
-          liftMaybe f (Just x) = Just (f x)
-          liftMaybe _ Nothing = Nothing
-          zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
-          zipWith f (x : xs) (y : ys) = f x y : zipWith f xs ys
-          zipWith _ [] [] = []
-          zipWith _ (_ : _) [] = []
-          zipWith _ [] (_ : _) = []
-          foo :: ((a -> b) -> a -> b) -> (a -> b) -> a -> b
-          foo f g a = f g a
-          splunge :: [Nat] -> [Bool] -> [Nat]
-          splunge ns bs
-            = zipWith (\ n b -> if b then Succ (Succ n) else n) ns bs
-          etad :: [Nat] -> [Bool] -> [Nat]
-          etad = zipWith (\ n b -> if b then Succ (Succ n) else n)
-          
-          data Either a b = Left a | Right b |]
-  ======>
-    data Either a b = Left a | Right b
-    map :: (a -> b) -> [a] -> [b]
-    map _ [] = []
-    map f (h : t) = (f h : (map f) t)
-    liftMaybe :: (a -> b) -> Maybe a -> Maybe b
-    liftMaybe f (Just x) = Just (f x)
-    liftMaybe _ Nothing = Nothing
-    zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
-    zipWith f (x : xs) (y : ys) = ((f x) y : ((zipWith f) xs) ys)
-    zipWith _ [] [] = []
-    zipWith _ (_ : _) [] = []
-    zipWith _ [] (_ : _) = []
-    foo :: ((a -> b) -> a -> b) -> (a -> b) -> a -> b
-    foo f g a = (f g) a
-    splunge :: [Nat] -> [Bool] -> [Nat]
-    splunge ns bs
-      = ((zipWith (\ n b -> if b then Succ (Succ n) else n)) ns) bs
-    etad :: [Nat] -> [Bool] -> [Nat]
-    etad = zipWith (\ n b -> if b then Succ (Succ n) else n)
-    type LeftSym1 (t0123456789876543210 :: a0123456789876543210) =
-        Left t0123456789876543210
-    instance SuppressUnusedWarnings LeftSym0 where
-      suppressUnusedWarnings = snd (((,) LeftSym0KindInference) ())
-    data LeftSym0 :: forall a0123456789876543210 b0123456789876543210.
-                     (~>) a0123456789876543210 (Either a0123456789876543210 b0123456789876543210)
-      where
-        LeftSym0KindInference :: forall t0123456789876543210
-                                        arg. SameKind (Apply LeftSym0 arg) (LeftSym1 arg) =>
-                                 LeftSym0 t0123456789876543210
-    type instance Apply LeftSym0 t0123456789876543210 = Left t0123456789876543210
-    type RightSym1 (t0123456789876543210 :: b0123456789876543210) =
-        Right t0123456789876543210
-    instance SuppressUnusedWarnings RightSym0 where
-      suppressUnusedWarnings = snd (((,) RightSym0KindInference) ())
-    data RightSym0 :: forall b0123456789876543210 a0123456789876543210.
-                      (~>) b0123456789876543210 (Either a0123456789876543210 b0123456789876543210)
-      where
-        RightSym0KindInference :: forall t0123456789876543210
-                                         arg. SameKind (Apply RightSym0 arg) (RightSym1 arg) =>
-                                  RightSym0 t0123456789876543210
-    type instance Apply RightSym0 t0123456789876543210 = Right t0123456789876543210
-    type family Case_0123456789876543210 n b a_0123456789876543210 a_0123456789876543210 t where
-      Case_0123456789876543210 n b a_0123456789876543210 a_0123456789876543210 'True = Apply SuccSym0 (Apply SuccSym0 n)
-      Case_0123456789876543210 n b a_0123456789876543210 a_0123456789876543210 'False = n
-    type family Lambda_0123456789876543210 a_0123456789876543210 a_0123456789876543210 t t where
-      Lambda_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n b = Case_0123456789876543210 n b a_0123456789876543210 a_0123456789876543210 b
-    type Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 t0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
-    data Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym3KindInference :: forall a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210) arg) (Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym3 t0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 t0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210
-    type family Case_0123456789876543210 n b ns bs t where
-      Case_0123456789876543210 n b ns bs 'True = Apply SuccSym0 (Apply SuccSym0 n)
-      Case_0123456789876543210 n b ns bs 'False = n
-    type family Lambda_0123456789876543210 ns bs t t where
-      Lambda_0123456789876543210 ns bs n b = Case_0123456789876543210 n b ns bs b
-    type Lambda_0123456789876543210Sym4 ns0123456789876543210 bs0123456789876543210 t0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 ns0123456789876543210 bs0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 t0123456789876543210 bs0123456789876543210 ns0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
-    data Lambda_0123456789876543210Sym3 ns0123456789876543210 bs0123456789876543210 t0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym3KindInference :: forall ns0123456789876543210
-                                                              bs0123456789876543210
-                                                              t0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym3 ns0123456789876543210 bs0123456789876543210 t0123456789876543210) arg) (Lambda_0123456789876543210Sym4 ns0123456789876543210 bs0123456789876543210 t0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym3 ns0123456789876543210 bs0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym3 t0123456789876543210 bs0123456789876543210 ns0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 t0123456789876543210 bs0123456789876543210 ns0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 bs0123456789876543210 ns0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 ns0123456789876543210 bs0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall ns0123456789876543210
-                                                              bs0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 ns0123456789876543210 bs0123456789876543210) arg) (Lambda_0123456789876543210Sym3 ns0123456789876543210 bs0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 ns0123456789876543210 bs0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 bs0123456789876543210 ns0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210Sym3 bs0123456789876543210 ns0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 ns0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 ns0123456789876543210 bs0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall ns0123456789876543210
-                                                              bs0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 ns0123456789876543210) arg) (Lambda_0123456789876543210Sym2 ns0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 ns0123456789876543210 bs0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 ns0123456789876543210) bs0123456789876543210 = Lambda_0123456789876543210Sym2 ns0123456789876543210 bs0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 ns0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall ns0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 ns0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 ns0123456789876543210 = Lambda_0123456789876543210Sym1 ns0123456789876543210
-    type EtadSym2 (a0123456789876543210 :: [Nat]) (a0123456789876543210 :: [Bool]) =
-        Etad a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (EtadSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) EtadSym1KindInference) ())
-    data EtadSym1 (a0123456789876543210 :: [Nat]) :: (~>) [Bool] [Nat]
-      where
-        EtadSym1KindInference :: forall a0123456789876543210
-                                        a0123456789876543210
-                                        arg. SameKind (Apply (EtadSym1 a0123456789876543210) arg) (EtadSym2 a0123456789876543210 arg) =>
-                                 EtadSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (EtadSym1 a0123456789876543210) a0123456789876543210 = Etad a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings EtadSym0 where
-      suppressUnusedWarnings = snd (((,) EtadSym0KindInference) ())
-    data EtadSym0 :: (~>) [Nat] ((~>) [Bool] [Nat])
-      where
-        EtadSym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply EtadSym0 arg) (EtadSym1 arg) =>
-                                 EtadSym0 a0123456789876543210
-    type instance Apply EtadSym0 a0123456789876543210 = EtadSym1 a0123456789876543210
-    type SplungeSym2 (a0123456789876543210 :: [Nat]) (a0123456789876543210 :: [Bool]) =
-        Splunge a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (SplungeSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) SplungeSym1KindInference) ())
-    data SplungeSym1 (a0123456789876543210 :: [Nat]) :: (~>) [Bool] [Nat]
-      where
-        SplungeSym1KindInference :: forall a0123456789876543210
-                                           a0123456789876543210
-                                           arg. SameKind (Apply (SplungeSym1 a0123456789876543210) arg) (SplungeSym2 a0123456789876543210 arg) =>
-                                    SplungeSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (SplungeSym1 a0123456789876543210) a0123456789876543210 = Splunge a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings SplungeSym0 where
-      suppressUnusedWarnings = snd (((,) SplungeSym0KindInference) ())
-    data SplungeSym0 :: (~>) [Nat] ((~>) [Bool] [Nat])
-      where
-        SplungeSym0KindInference :: forall a0123456789876543210
-                                           arg. SameKind (Apply SplungeSym0 arg) (SplungeSym1 arg) =>
-                                    SplungeSym0 a0123456789876543210
-    type instance Apply SplungeSym0 a0123456789876543210 = SplungeSym1 a0123456789876543210
-    type FooSym3 (a0123456789876543210 :: (~>) ((~>) a0123456789876543210 b0123456789876543210) ((~>) a0123456789876543210 b0123456789876543210)) (a0123456789876543210 :: (~>) a0123456789876543210 b0123456789876543210) (a0123456789876543210 :: a0123456789876543210) =
-        Foo a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (FooSym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) FooSym2KindInference) ())
-    data FooSym2 (a0123456789876543210 :: (~>) ((~>) a0123456789876543210 b0123456789876543210) ((~>) a0123456789876543210 b0123456789876543210)) (a0123456789876543210 :: (~>) a0123456789876543210 b0123456789876543210) :: (~>) a0123456789876543210 b0123456789876543210
-      where
-        FooSym2KindInference :: forall a0123456789876543210
-                                       a0123456789876543210
-                                       a0123456789876543210
-                                       arg. SameKind (Apply (FooSym2 a0123456789876543210 a0123456789876543210) arg) (FooSym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                FooSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (FooSym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = Foo a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (FooSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) FooSym1KindInference) ())
-    data FooSym1 (a0123456789876543210 :: (~>) ((~>) a0123456789876543210 b0123456789876543210) ((~>) a0123456789876543210 b0123456789876543210)) :: (~>) ((~>) a0123456789876543210 b0123456789876543210) ((~>) a0123456789876543210 b0123456789876543210)
-      where
-        FooSym1KindInference :: forall a0123456789876543210
-                                       a0123456789876543210
-                                       arg. SameKind (Apply (FooSym1 a0123456789876543210) arg) (FooSym2 a0123456789876543210 arg) =>
-                                FooSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (FooSym1 a0123456789876543210) a0123456789876543210 = FooSym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings FooSym0 where
-      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
-    data FooSym0 :: forall a0123456789876543210 b0123456789876543210.
-                    (~>) ((~>) ((~>) a0123456789876543210 b0123456789876543210) ((~>) a0123456789876543210 b0123456789876543210)) ((~>) ((~>) a0123456789876543210 b0123456789876543210) ((~>) a0123456789876543210 b0123456789876543210))
-      where
-        FooSym0KindInference :: forall a0123456789876543210
-                                       arg. SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
-                                FooSym0 a0123456789876543210
-    type instance Apply FooSym0 a0123456789876543210 = FooSym1 a0123456789876543210
-    type ZipWithSym3 (a0123456789876543210 :: (~>) a0123456789876543210 ((~>) b0123456789876543210 c0123456789876543210)) (a0123456789876543210 :: [a0123456789876543210]) (a0123456789876543210 :: [b0123456789876543210]) =
-        ZipWith a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ZipWithSym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) ZipWithSym2KindInference) ())
-    data ZipWithSym2 (a0123456789876543210 :: (~>) a0123456789876543210 ((~>) b0123456789876543210 c0123456789876543210)) (a0123456789876543210 :: [a0123456789876543210]) :: (~>) [b0123456789876543210] [c0123456789876543210]
-      where
-        ZipWithSym2KindInference :: forall a0123456789876543210
-                                           a0123456789876543210
-                                           a0123456789876543210
-                                           arg. SameKind (Apply (ZipWithSym2 a0123456789876543210 a0123456789876543210) arg) (ZipWithSym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                    ZipWithSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (ZipWithSym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ZipWith a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ZipWithSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) ZipWithSym1KindInference) ())
-    data ZipWithSym1 (a0123456789876543210 :: (~>) a0123456789876543210 ((~>) b0123456789876543210 c0123456789876543210)) :: (~>) [a0123456789876543210] ((~>) [b0123456789876543210] [c0123456789876543210])
-      where
-        ZipWithSym1KindInference :: forall a0123456789876543210
-                                           a0123456789876543210
-                                           arg. SameKind (Apply (ZipWithSym1 a0123456789876543210) arg) (ZipWithSym2 a0123456789876543210 arg) =>
-                                    ZipWithSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ZipWithSym1 a0123456789876543210) a0123456789876543210 = ZipWithSym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ZipWithSym0 where
-      suppressUnusedWarnings = snd (((,) ZipWithSym0KindInference) ())
-    data ZipWithSym0 :: forall a0123456789876543210
-                               b0123456789876543210
-                               c0123456789876543210.
-                        (~>) ((~>) a0123456789876543210 ((~>) b0123456789876543210 c0123456789876543210)) ((~>) [a0123456789876543210] ((~>) [b0123456789876543210] [c0123456789876543210]))
-      where
-        ZipWithSym0KindInference :: forall a0123456789876543210
-                                           arg. SameKind (Apply ZipWithSym0 arg) (ZipWithSym1 arg) =>
-                                    ZipWithSym0 a0123456789876543210
-    type instance Apply ZipWithSym0 a0123456789876543210 = ZipWithSym1 a0123456789876543210
-    type LiftMaybeSym2 (a0123456789876543210 :: (~>) a0123456789876543210 b0123456789876543210) (a0123456789876543210 :: Maybe a0123456789876543210) =
-        LiftMaybe a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (LiftMaybeSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) LiftMaybeSym1KindInference) ())
-    data LiftMaybeSym1 (a0123456789876543210 :: (~>) a0123456789876543210 b0123456789876543210) :: (~>) (Maybe a0123456789876543210) (Maybe b0123456789876543210)
-      where
-        LiftMaybeSym1KindInference :: forall a0123456789876543210
-                                             a0123456789876543210
-                                             arg. SameKind (Apply (LiftMaybeSym1 a0123456789876543210) arg) (LiftMaybeSym2 a0123456789876543210 arg) =>
-                                      LiftMaybeSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (LiftMaybeSym1 a0123456789876543210) a0123456789876543210 = LiftMaybe a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings LiftMaybeSym0 where
-      suppressUnusedWarnings = snd (((,) LiftMaybeSym0KindInference) ())
-    data LiftMaybeSym0 :: forall a0123456789876543210
-                                 b0123456789876543210.
-                          (~>) ((~>) a0123456789876543210 b0123456789876543210) ((~>) (Maybe a0123456789876543210) (Maybe b0123456789876543210))
-      where
-        LiftMaybeSym0KindInference :: forall a0123456789876543210
-                                             arg. SameKind (Apply LiftMaybeSym0 arg) (LiftMaybeSym1 arg) =>
-                                      LiftMaybeSym0 a0123456789876543210
-    type instance Apply LiftMaybeSym0 a0123456789876543210 = LiftMaybeSym1 a0123456789876543210
-    type MapSym2 (a0123456789876543210 :: (~>) a0123456789876543210 b0123456789876543210) (a0123456789876543210 :: [a0123456789876543210]) =
-        Map a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (MapSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) MapSym1KindInference) ())
-    data MapSym1 (a0123456789876543210 :: (~>) a0123456789876543210 b0123456789876543210) :: (~>) [a0123456789876543210] [b0123456789876543210]
-      where
-        MapSym1KindInference :: forall a0123456789876543210
-                                       a0123456789876543210
-                                       arg. SameKind (Apply (MapSym1 a0123456789876543210) arg) (MapSym2 a0123456789876543210 arg) =>
-                                MapSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (MapSym1 a0123456789876543210) a0123456789876543210 = Map a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings MapSym0 where
-      suppressUnusedWarnings = snd (((,) MapSym0KindInference) ())
-    data MapSym0 :: forall a0123456789876543210 b0123456789876543210.
-                    (~>) ((~>) a0123456789876543210 b0123456789876543210) ((~>) [a0123456789876543210] [b0123456789876543210])
-      where
-        MapSym0KindInference :: forall a0123456789876543210
-                                       arg. SameKind (Apply MapSym0 arg) (MapSym1 arg) =>
-                                MapSym0 a0123456789876543210
-    type instance Apply MapSym0 a0123456789876543210 = MapSym1 a0123456789876543210
-    type family Etad (a :: [Nat]) (a :: [Bool]) :: [Nat] where
-      Etad a_0123456789876543210 a_0123456789876543210 = Apply (Apply (Apply ZipWithSym0 (Apply (Apply Lambda_0123456789876543210Sym0 a_0123456789876543210) a_0123456789876543210)) a_0123456789876543210) a_0123456789876543210
-    type family Splunge (a :: [Nat]) (a :: [Bool]) :: [Nat] where
-      Splunge ns bs = Apply (Apply (Apply ZipWithSym0 (Apply (Apply Lambda_0123456789876543210Sym0 ns) bs)) ns) bs
-    type family Foo (a :: (~>) ((~>) a b) ((~>) a b)) (a :: (~>) a b) (a :: a) :: b where
-      Foo f g a = Apply (Apply f g) a
-    type family ZipWith (a :: (~>) a ((~>) b c)) (a :: [a]) (a :: [b]) :: [c] where
-      ZipWith f ('(:) x xs) ('(:) y ys) = Apply (Apply (:@#@$) (Apply (Apply f x) y)) (Apply (Apply (Apply ZipWithSym0 f) xs) ys)
-      ZipWith _ '[] '[] = '[]
-      ZipWith _ ('(:) _ _) '[] = '[]
-      ZipWith _ '[] ('(:) _ _) = '[]
-    type family LiftMaybe (a :: (~>) a b) (a :: Maybe a) :: Maybe b where
-      LiftMaybe f ('Just x) = Apply JustSym0 (Apply f x)
-      LiftMaybe _ 'Nothing = NothingSym0
-    type family Map (a :: (~>) a b) (a :: [a]) :: [b] where
-      Map _ '[] = '[]
-      Map f ('(:) h t) = Apply (Apply (:@#@$) (Apply f h)) (Apply (Apply MapSym0 f) t)
-    sEtad ::
-      forall (t :: [Nat]) (t :: [Bool]).
-      Sing t -> Sing t -> Sing (Apply (Apply EtadSym0 t) t :: [Nat])
-    sSplunge ::
-      forall (t :: [Nat]) (t :: [Bool]).
-      Sing t -> Sing t -> Sing (Apply (Apply SplungeSym0 t) t :: [Nat])
-    sFoo ::
-      forall a
-             b
-             (t :: (~>) ((~>) a b) ((~>) a b))
-             (t :: (~>) a b)
-             (t :: a).
-      Sing t
-      -> Sing t
-         -> Sing t -> Sing (Apply (Apply (Apply FooSym0 t) t) t :: b)
-    sZipWith ::
-      forall a b c (t :: (~>) a ((~>) b c)) (t :: [a]) (t :: [b]).
-      Sing t
-      -> Sing t
-         -> Sing t -> Sing (Apply (Apply (Apply ZipWithSym0 t) t) t :: [c])
-    sLiftMaybe ::
-      forall a b (t :: (~>) a b) (t :: Maybe a).
-      Sing t
-      -> Sing t -> Sing (Apply (Apply LiftMaybeSym0 t) t :: Maybe b)
-    sMap ::
-      forall a b (t :: (~>) a b) (t :: [a]).
-      Sing t -> Sing t -> Sing (Apply (Apply MapSym0 t) t :: [b])
-    sEtad
-      (sA_0123456789876543210 :: Sing a_0123456789876543210)
-      (sA_0123456789876543210 :: Sing a_0123456789876543210)
-      = (applySing
-           ((applySing
-               ((applySing ((singFun3 @ZipWithSym0) sZipWith))
-                  ((singFun2
-                      @(Apply (Apply Lambda_0123456789876543210Sym0 a_0123456789876543210) a_0123456789876543210))
-                     (\ sN sB
-                        -> case ((,) sN) sB of {
-                             (,) (_ :: Sing n) (_ :: Sing b)
-                               -> (id
-                                     @(Sing (Case_0123456789876543210 n b a_0123456789876543210 a_0123456789876543210 b)))
-                                    (case sB of
-                                       STrue
-                                         -> (applySing ((singFun1 @SuccSym0) SSucc))
-                                              ((applySing ((singFun1 @SuccSym0) SSucc)) sN)
-                                       SFalse -> sN) }))))
-              sA_0123456789876543210))
-          sA_0123456789876543210
-    sSplunge (sNs :: Sing ns) (sBs :: Sing bs)
-      = (applySing
-           ((applySing
-               ((applySing ((singFun3 @ZipWithSym0) sZipWith))
-                  ((singFun2 @(Apply (Apply Lambda_0123456789876543210Sym0 ns) bs))
-                     (\ sN sB
-                        -> case ((,) sN) sB of {
-                             (,) (_ :: Sing n) (_ :: Sing b)
-                               -> (id @(Sing (Case_0123456789876543210 n b ns bs b)))
-                                    (case sB of
-                                       STrue
-                                         -> (applySing ((singFun1 @SuccSym0) SSucc))
-                                              ((applySing ((singFun1 @SuccSym0) SSucc)) sN)
-                                       SFalse -> sN) }))))
-              sNs))
-          sBs
-    sFoo (sF :: Sing f) (sG :: Sing g) (sA :: Sing a)
-      = (applySing ((applySing sF) sG)) sA
-    sZipWith
-      (sF :: Sing f)
-      (SCons (sX :: Sing x) (sXs :: Sing xs))
-      (SCons (sY :: Sing y) (sYs :: Sing ys))
-      = (applySing
-           ((applySing ((singFun2 @(:@#@$)) SCons))
-              ((applySing ((applySing sF) sX)) sY)))
-          ((applySing
-              ((applySing ((applySing ((singFun3 @ZipWithSym0) sZipWith)) sF))
-                 sXs))
-             sYs)
-    sZipWith _ SNil SNil = SNil
-    sZipWith _ (SCons _ _) SNil = SNil
-    sZipWith _ SNil (SCons _ _) = SNil
-    sLiftMaybe (sF :: Sing f) (SJust (sX :: Sing x))
-      = (applySing ((singFun1 @JustSym0) SJust)) ((applySing sF) sX)
-    sLiftMaybe _ SNothing = SNothing
-    sMap _ SNil = SNil
-    sMap (sF :: Sing f) (SCons (sH :: Sing h) (sT :: Sing t))
-      = (applySing
-           ((applySing ((singFun2 @(:@#@$)) SCons)) ((applySing sF) sH)))
-          ((applySing ((applySing ((singFun2 @MapSym0) sMap)) sF)) sT)
-    instance SingI (EtadSym0 :: (~>) [Nat] ((~>) [Bool] [Nat])) where
-      sing = (singFun2 @EtadSym0) sEtad
-    instance SingI d =>
-             SingI (EtadSym1 (d :: [Nat]) :: (~>) [Bool] [Nat]) where
-      sing = (singFun1 @(EtadSym1 (d :: [Nat]))) (sEtad (sing @d))
-    instance SingI (SplungeSym0 :: (~>) [Nat] ((~>) [Bool] [Nat])) where
-      sing = (singFun2 @SplungeSym0) sSplunge
-    instance SingI d =>
-             SingI (SplungeSym1 (d :: [Nat]) :: (~>) [Bool] [Nat]) where
-      sing = (singFun1 @(SplungeSym1 (d :: [Nat]))) (sSplunge (sing @d))
-    instance SingI (FooSym0 :: (~>) ((~>) ((~>) a b) ((~>) a b)) ((~>) ((~>) a b) ((~>) a b))) where
-      sing = (singFun3 @FooSym0) sFoo
-    instance SingI d =>
-             SingI (FooSym1 (d :: (~>) ((~>) a b) ((~>) a b)) :: (~>) ((~>) a b) ((~>) a b)) where
-      sing
-        = (singFun2 @(FooSym1 (d :: (~>) ((~>) a b) ((~>) a b))))
-            (sFoo (sing @d))
-    instance (SingI d, SingI d) =>
-             SingI (FooSym2 (d :: (~>) ((~>) a b) ((~>) a b)) (d :: (~>) a b) :: (~>) a b) where
-      sing
-        = (singFun1
-             @(FooSym2 (d :: (~>) ((~>) a b) ((~>) a b)) (d :: (~>) a b)))
-            ((sFoo (sing @d)) (sing @d))
-    instance SingI (ZipWithSym0 :: (~>) ((~>) a ((~>) b c)) ((~>) [a] ((~>) [b] [c]))) where
-      sing = (singFun3 @ZipWithSym0) sZipWith
-    instance SingI d =>
-             SingI (ZipWithSym1 (d :: (~>) a ((~>) b c)) :: (~>) [a] ((~>) [b] [c])) where
-      sing
-        = (singFun2 @(ZipWithSym1 (d :: (~>) a ((~>) b c))))
-            (sZipWith (sing @d))
-    instance (SingI d, SingI d) =>
-             SingI (ZipWithSym2 (d :: (~>) a ((~>) b c)) (d :: [a]) :: (~>) [b] [c]) where
-      sing
-        = (singFun1 @(ZipWithSym2 (d :: (~>) a ((~>) b c)) (d :: [a])))
-            ((sZipWith (sing @d)) (sing @d))
-    instance SingI (LiftMaybeSym0 :: (~>) ((~>) a b) ((~>) (Maybe a) (Maybe b))) where
-      sing = (singFun2 @LiftMaybeSym0) sLiftMaybe
-    instance SingI d =>
-             SingI (LiftMaybeSym1 (d :: (~>) a b) :: (~>) (Maybe a) (Maybe b)) where
-      sing
-        = (singFun1 @(LiftMaybeSym1 (d :: (~>) a b)))
-            (sLiftMaybe (sing @d))
-    instance SingI (MapSym0 :: (~>) ((~>) a b) ((~>) [a] [b])) where
-      sing = (singFun2 @MapSym0) sMap
-    instance SingI d =>
-             SingI (MapSym1 (d :: (~>) a b) :: (~>) [a] [b]) where
-      sing = (singFun1 @(MapSym1 (d :: (~>) a b))) (sMap (sing @d))
-    data SEither :: forall a b. Either a b -> GHC.Types.Type
-      where
-        SLeft :: forall a (n :: a). (Sing (n :: a)) -> SEither (Left n)
-        SRight :: forall b (n :: b). (Sing (n :: b)) -> SEither (Right n)
-    type instance Sing @(Either a b) = SEither
-    instance (SingKind a, SingKind b) => SingKind (Either a b) where
-      type Demote (Either a b) = Either (Demote a) (Demote b)
-      fromSing (SLeft b) = Left (fromSing b)
-      fromSing (SRight b) = Right (fromSing b)
-      toSing (Left (b :: Demote a))
-        = case toSing b :: SomeSing a of {
-            SomeSing c -> SomeSing (SLeft c) }
-      toSing (Right (b :: Demote b))
-        = case toSing b :: SomeSing b of {
-            SomeSing c -> SomeSing (SRight c) }
-    instance SingI n => SingI (Left (n :: a)) where
-      sing = SLeft sing
-    instance SingI (LeftSym0 :: (~>) a (Either a b)) where
-      sing = (singFun1 @LeftSym0) SLeft
-    instance SingI n => SingI (Right (n :: b)) where
-      sing = SRight sing
-    instance SingI (RightSym0 :: (~>) b (Either a b)) where
-      sing = (singFun1 @RightSym0) SRight
diff --git a/tests/compile-and-dump/Singletons/HigherOrder.golden b/tests/compile-and-dump/Singletons/HigherOrder.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/HigherOrder.golden
@@ -0,0 +1,447 @@
+Singletons/HigherOrder.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| map :: (a -> b) -> [a] -> [b]
+          map _ [] = []
+          map f (h : t) = (f h) : (map f t)
+          liftMaybe :: (a -> b) -> Maybe a -> Maybe b
+          liftMaybe f (Just x) = Just (f x)
+          liftMaybe _ Nothing = Nothing
+          zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+          zipWith f (x : xs) (y : ys) = f x y : zipWith f xs ys
+          zipWith _ [] [] = []
+          zipWith _ (_ : _) [] = []
+          zipWith _ [] (_ : _) = []
+          foo :: ((a -> b) -> a -> b) -> (a -> b) -> a -> b
+          foo f g a = f g a
+          splunge :: [Nat] -> [Bool] -> [Nat]
+          splunge ns bs
+            = zipWith (\ n b -> if b then Succ (Succ n) else n) ns bs
+          etad :: [Nat] -> [Bool] -> [Nat]
+          etad = zipWith (\ n b -> if b then Succ (Succ n) else n)
+          
+          data Either a b = Left a | Right b |]
+  ======>
+    data Either a b = Left a | Right b
+    map :: (a -> b) -> [a] -> [b]
+    map _ [] = []
+    map f (h : t) = (f h : (map f) t)
+    liftMaybe :: (a -> b) -> Maybe a -> Maybe b
+    liftMaybe f (Just x) = Just (f x)
+    liftMaybe _ Nothing = Nothing
+    zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+    zipWith f (x : xs) (y : ys) = ((f x) y : ((zipWith f) xs) ys)
+    zipWith _ [] [] = []
+    zipWith _ (_ : _) [] = []
+    zipWith _ [] (_ : _) = []
+    foo :: ((a -> b) -> a -> b) -> (a -> b) -> a -> b
+    foo f g a = (f g) a
+    splunge :: [Nat] -> [Bool] -> [Nat]
+    splunge ns bs
+      = ((zipWith (\ n b -> if b then Succ (Succ n) else n)) ns) bs
+    etad :: [Nat] -> [Bool] -> [Nat]
+    etad = zipWith (\ n b -> if b then Succ (Succ n) else n)
+    type LeftSym0 :: forall a b. (~>) a (Either a b)
+    data LeftSym0 a0123456789876543210
+      where
+        LeftSym0KindInference :: SameKind (Apply LeftSym0 arg) (LeftSym1 arg) =>
+                                 LeftSym0 a0123456789876543210
+    type instance Apply LeftSym0 a0123456789876543210 = LeftSym1 a0123456789876543210
+    instance SuppressUnusedWarnings LeftSym0 where
+      suppressUnusedWarnings = snd (((,) LeftSym0KindInference) ())
+    type LeftSym1 (a0123456789876543210 :: a) =
+        Left a0123456789876543210 :: Either a b
+    type RightSym0 :: forall a b. (~>) b (Either a b)
+    data RightSym0 a0123456789876543210
+      where
+        RightSym0KindInference :: SameKind (Apply RightSym0 arg) (RightSym1 arg) =>
+                                  RightSym0 a0123456789876543210
+    type instance Apply RightSym0 a0123456789876543210 = RightSym1 a0123456789876543210
+    instance SuppressUnusedWarnings RightSym0 where
+      suppressUnusedWarnings = snd (((,) RightSym0KindInference) ())
+    type RightSym1 (a0123456789876543210 :: b) =
+        Right a0123456789876543210 :: Either a b
+    type family Case_0123456789876543210 n b a_0123456789876543210 a_0123456789876543210 t where
+      Case_0123456789876543210 n b a_0123456789876543210 a_0123456789876543210 'True = Apply SuccSym0 (Apply SuccSym0 n)
+      Case_0123456789876543210 n b a_0123456789876543210 a_0123456789876543210 'False = n
+    type family Lambda_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n b where
+      Lambda_0123456789876543210 a_0123456789876543210 a_0123456789876543210 n b = Case_0123456789876543210 n b a_0123456789876543210 a_0123456789876543210 b
+    data Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n0123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) n0123456789876543210 = Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    data Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n0123456789876543210 b0123456789876543210
+      where
+        Lambda_0123456789876543210Sym3KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n0123456789876543210) arg) (Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n0123456789876543210 b0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n0123456789876543210) b0123456789876543210 = Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n0123456789876543210 b0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
+    type Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n0123456789876543210 b0123456789876543210 =
+        Lambda_0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 n0123456789876543210 b0123456789876543210
+    type family Case_0123456789876543210 n b ns bs t where
+      Case_0123456789876543210 n b ns bs 'True = Apply SuccSym0 (Apply SuccSym0 n)
+      Case_0123456789876543210 n b ns bs 'False = n
+    type family Lambda_0123456789876543210 ns bs n b where
+      Lambda_0123456789876543210 ns bs n b = Case_0123456789876543210 n b ns bs b
+    data Lambda_0123456789876543210Sym0 ns0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 ns0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 ns0123456789876543210 = Lambda_0123456789876543210Sym1 ns0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 ns0123456789876543210 bs0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 ns0123456789876543210) arg) (Lambda_0123456789876543210Sym2 ns0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 ns0123456789876543210 bs0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 ns0123456789876543210) bs0123456789876543210 = Lambda_0123456789876543210Sym2 ns0123456789876543210 bs0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 ns0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 ns0123456789876543210 bs0123456789876543210 n0123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 ns0123456789876543210 bs0123456789876543210) arg) (Lambda_0123456789876543210Sym3 ns0123456789876543210 bs0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 ns0123456789876543210 bs0123456789876543210 n0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 ns0123456789876543210 bs0123456789876543210) n0123456789876543210 = Lambda_0123456789876543210Sym3 ns0123456789876543210 bs0123456789876543210 n0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 ns0123456789876543210 bs0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    data Lambda_0123456789876543210Sym3 ns0123456789876543210 bs0123456789876543210 n0123456789876543210 b0123456789876543210
+      where
+        Lambda_0123456789876543210Sym3KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym3 ns0123456789876543210 bs0123456789876543210 n0123456789876543210) arg) (Lambda_0123456789876543210Sym4 ns0123456789876543210 bs0123456789876543210 n0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym3 ns0123456789876543210 bs0123456789876543210 n0123456789876543210 b0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym3 ns0123456789876543210 bs0123456789876543210 n0123456789876543210) b0123456789876543210 = Lambda_0123456789876543210Sym4 ns0123456789876543210 bs0123456789876543210 n0123456789876543210 b0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 ns0123456789876543210 bs0123456789876543210 n0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
+    type Lambda_0123456789876543210Sym4 ns0123456789876543210 bs0123456789876543210 n0123456789876543210 b0123456789876543210 =
+        Lambda_0123456789876543210 ns0123456789876543210 bs0123456789876543210 n0123456789876543210 b0123456789876543210
+    type EtadSym0 :: (~>) [Nat] ((~>) [Bool] [Nat])
+    data EtadSym0 a0123456789876543210
+      where
+        EtadSym0KindInference :: SameKind (Apply EtadSym0 arg) (EtadSym1 arg) =>
+                                 EtadSym0 a0123456789876543210
+    type instance Apply EtadSym0 a0123456789876543210 = EtadSym1 a0123456789876543210
+    instance SuppressUnusedWarnings EtadSym0 where
+      suppressUnusedWarnings = snd (((,) EtadSym0KindInference) ())
+    type EtadSym1 :: [Nat] -> (~>) [Bool] [Nat]
+    data EtadSym1 a0123456789876543210 a0123456789876543210
+      where
+        EtadSym1KindInference :: SameKind (Apply (EtadSym1 a0123456789876543210) arg) (EtadSym2 a0123456789876543210 arg) =>
+                                 EtadSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (EtadSym1 a0123456789876543210) a0123456789876543210 = EtadSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (EtadSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) EtadSym1KindInference) ())
+    type EtadSym2 (a0123456789876543210 :: [Nat]) (a0123456789876543210 :: [Bool]) =
+        Etad a0123456789876543210 a0123456789876543210 :: [Nat]
+    type SplungeSym0 :: (~>) [Nat] ((~>) [Bool] [Nat])
+    data SplungeSym0 a0123456789876543210
+      where
+        SplungeSym0KindInference :: SameKind (Apply SplungeSym0 arg) (SplungeSym1 arg) =>
+                                    SplungeSym0 a0123456789876543210
+    type instance Apply SplungeSym0 a0123456789876543210 = SplungeSym1 a0123456789876543210
+    instance SuppressUnusedWarnings SplungeSym0 where
+      suppressUnusedWarnings = snd (((,) SplungeSym0KindInference) ())
+    type SplungeSym1 :: [Nat] -> (~>) [Bool] [Nat]
+    data SplungeSym1 a0123456789876543210 a0123456789876543210
+      where
+        SplungeSym1KindInference :: SameKind (Apply (SplungeSym1 a0123456789876543210) arg) (SplungeSym2 a0123456789876543210 arg) =>
+                                    SplungeSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (SplungeSym1 a0123456789876543210) a0123456789876543210 = SplungeSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (SplungeSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) SplungeSym1KindInference) ())
+    type SplungeSym2 (a0123456789876543210 :: [Nat]) (a0123456789876543210 :: [Bool]) =
+        Splunge a0123456789876543210 a0123456789876543210 :: [Nat]
+    type FooSym0 :: (~>) ((~>) ((~>) a b) ((~>) a b)) ((~>) ((~>) a b) ((~>) a b))
+    data FooSym0 a0123456789876543210
+      where
+        FooSym0KindInference :: SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
+                                FooSym0 a0123456789876543210
+    type instance Apply FooSym0 a0123456789876543210 = FooSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FooSym0 where
+      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
+    type FooSym1 :: (~>) ((~>) a b) ((~>) a b)
+                    -> (~>) ((~>) a b) ((~>) a b)
+    data FooSym1 a0123456789876543210 a0123456789876543210
+      where
+        FooSym1KindInference :: SameKind (Apply (FooSym1 a0123456789876543210) arg) (FooSym2 a0123456789876543210 arg) =>
+                                FooSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (FooSym1 a0123456789876543210) a0123456789876543210 = FooSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (FooSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) FooSym1KindInference) ())
+    type FooSym2 :: (~>) ((~>) a b) ((~>) a b) -> (~>) a b -> (~>) a b
+    data FooSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        FooSym2KindInference :: SameKind (Apply (FooSym2 a0123456789876543210 a0123456789876543210) arg) (FooSym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                FooSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (FooSym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = FooSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (FooSym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) FooSym2KindInference) ())
+    type FooSym3 (a0123456789876543210 :: (~>) ((~>) a b) ((~>) a b)) (a0123456789876543210 :: (~>) a b) (a0123456789876543210 :: a) =
+        Foo a0123456789876543210 a0123456789876543210 a0123456789876543210 :: b
+    type ZipWithSym0 :: (~>) ((~>) a ((~>) b c)) ((~>) [a] ((~>) [b] [c]))
+    data ZipWithSym0 a0123456789876543210
+      where
+        ZipWithSym0KindInference :: SameKind (Apply ZipWithSym0 arg) (ZipWithSym1 arg) =>
+                                    ZipWithSym0 a0123456789876543210
+    type instance Apply ZipWithSym0 a0123456789876543210 = ZipWithSym1 a0123456789876543210
+    instance SuppressUnusedWarnings ZipWithSym0 where
+      suppressUnusedWarnings = snd (((,) ZipWithSym0KindInference) ())
+    type ZipWithSym1 :: (~>) a ((~>) b c) -> (~>) [a] ((~>) [b] [c])
+    data ZipWithSym1 a0123456789876543210 a0123456789876543210
+      where
+        ZipWithSym1KindInference :: SameKind (Apply (ZipWithSym1 a0123456789876543210) arg) (ZipWithSym2 a0123456789876543210 arg) =>
+                                    ZipWithSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ZipWithSym1 a0123456789876543210) a0123456789876543210 = ZipWithSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ZipWithSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) ZipWithSym1KindInference) ())
+    type ZipWithSym2 :: (~>) a ((~>) b c) -> [a] -> (~>) [b] [c]
+    data ZipWithSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ZipWithSym2KindInference :: SameKind (Apply (ZipWithSym2 a0123456789876543210 a0123456789876543210) arg) (ZipWithSym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                    ZipWithSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ZipWithSym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ZipWithSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ZipWithSym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) ZipWithSym2KindInference) ())
+    type ZipWithSym3 (a0123456789876543210 :: (~>) a ((~>) b c)) (a0123456789876543210 :: [a]) (a0123456789876543210 :: [b]) =
+        ZipWith a0123456789876543210 a0123456789876543210 a0123456789876543210 :: [c]
+    type LiftMaybeSym0 :: (~>) ((~>) a b) ((~>) (Maybe a) (Maybe b))
+    data LiftMaybeSym0 a0123456789876543210
+      where
+        LiftMaybeSym0KindInference :: SameKind (Apply LiftMaybeSym0 arg) (LiftMaybeSym1 arg) =>
+                                      LiftMaybeSym0 a0123456789876543210
+    type instance Apply LiftMaybeSym0 a0123456789876543210 = LiftMaybeSym1 a0123456789876543210
+    instance SuppressUnusedWarnings LiftMaybeSym0 where
+      suppressUnusedWarnings = snd (((,) LiftMaybeSym0KindInference) ())
+    type LiftMaybeSym1 :: (~>) a b -> (~>) (Maybe a) (Maybe b)
+    data LiftMaybeSym1 a0123456789876543210 a0123456789876543210
+      where
+        LiftMaybeSym1KindInference :: SameKind (Apply (LiftMaybeSym1 a0123456789876543210) arg) (LiftMaybeSym2 a0123456789876543210 arg) =>
+                                      LiftMaybeSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (LiftMaybeSym1 a0123456789876543210) a0123456789876543210 = LiftMaybeSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (LiftMaybeSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) LiftMaybeSym1KindInference) ())
+    type LiftMaybeSym2 (a0123456789876543210 :: (~>) a b) (a0123456789876543210 :: Maybe a) =
+        LiftMaybe a0123456789876543210 a0123456789876543210 :: Maybe b
+    type MapSym0 :: (~>) ((~>) a b) ((~>) [a] [b])
+    data MapSym0 a0123456789876543210
+      where
+        MapSym0KindInference :: SameKind (Apply MapSym0 arg) (MapSym1 arg) =>
+                                MapSym0 a0123456789876543210
+    type instance Apply MapSym0 a0123456789876543210 = MapSym1 a0123456789876543210
+    instance SuppressUnusedWarnings MapSym0 where
+      suppressUnusedWarnings = snd (((,) MapSym0KindInference) ())
+    type MapSym1 :: (~>) a b -> (~>) [a] [b]
+    data MapSym1 a0123456789876543210 a0123456789876543210
+      where
+        MapSym1KindInference :: SameKind (Apply (MapSym1 a0123456789876543210) arg) (MapSym2 a0123456789876543210 arg) =>
+                                MapSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (MapSym1 a0123456789876543210) a0123456789876543210 = MapSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (MapSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) MapSym1KindInference) ())
+    type MapSym2 (a0123456789876543210 :: (~>) a b) (a0123456789876543210 :: [a]) =
+        Map a0123456789876543210 a0123456789876543210 :: [b]
+    type Etad :: [Nat] -> [Bool] -> [Nat]
+    type family Etad a a where
+      Etad a_0123456789876543210 a_0123456789876543210 = Apply (Apply (Apply ZipWithSym0 (Apply (Apply Lambda_0123456789876543210Sym0 a_0123456789876543210) a_0123456789876543210)) a_0123456789876543210) a_0123456789876543210
+    type Splunge :: [Nat] -> [Bool] -> [Nat]
+    type family Splunge a a where
+      Splunge ns bs = Apply (Apply (Apply ZipWithSym0 (Apply (Apply Lambda_0123456789876543210Sym0 ns) bs)) ns) bs
+    type Foo :: (~>) ((~>) a b) ((~>) a b) -> (~>) a b -> a -> b
+    type family Foo a a a where
+      Foo f g a = Apply (Apply f g) a
+    type ZipWith :: (~>) a ((~>) b c) -> [a] -> [b] -> [c]
+    type family ZipWith a a a where
+      ZipWith f ('(:) x xs) ('(:) y ys) = Apply (Apply (:@#@$) (Apply (Apply f x) y)) (Apply (Apply (Apply ZipWithSym0 f) xs) ys)
+      ZipWith _ '[] '[] = NilSym0
+      ZipWith _ ('(:) _ _) '[] = NilSym0
+      ZipWith _ '[] ('(:) _ _) = NilSym0
+    type LiftMaybe :: (~>) a b -> Maybe a -> Maybe b
+    type family LiftMaybe a a where
+      LiftMaybe f ('Just x) = Apply JustSym0 (Apply f x)
+      LiftMaybe _ 'Nothing = NothingSym0
+    type Map :: (~>) a b -> [a] -> [b]
+    type family Map a a where
+      Map _ '[] = NilSym0
+      Map f ('(:) h t) = Apply (Apply (:@#@$) (Apply f h)) (Apply (Apply MapSym0 f) t)
+    sEtad ::
+      forall (t :: [Nat]) (t :: [Bool]).
+      Sing t -> Sing t -> Sing (Apply (Apply EtadSym0 t) t :: [Nat])
+    sSplunge ::
+      forall (t :: [Nat]) (t :: [Bool]).
+      Sing t -> Sing t -> Sing (Apply (Apply SplungeSym0 t) t :: [Nat])
+    sFoo ::
+      forall a
+             b
+             (t :: (~>) ((~>) a b) ((~>) a b))
+             (t :: (~>) a b)
+             (t :: a).
+      Sing t
+      -> Sing t
+         -> Sing t -> Sing (Apply (Apply (Apply FooSym0 t) t) t :: b)
+    sZipWith ::
+      forall a b c (t :: (~>) a ((~>) b c)) (t :: [a]) (t :: [b]).
+      Sing t
+      -> Sing t
+         -> Sing t -> Sing (Apply (Apply (Apply ZipWithSym0 t) t) t :: [c])
+    sLiftMaybe ::
+      forall a b (t :: (~>) a b) (t :: Maybe a).
+      Sing t
+      -> Sing t -> Sing (Apply (Apply LiftMaybeSym0 t) t :: Maybe b)
+    sMap ::
+      forall a b (t :: (~>) a b) (t :: [a]).
+      Sing t -> Sing t -> Sing (Apply (Apply MapSym0 t) t :: [b])
+    sEtad
+      (sA_0123456789876543210 :: Sing a_0123456789876543210)
+      (sA_0123456789876543210 :: Sing a_0123456789876543210)
+      = (applySing
+           ((applySing
+               ((applySing ((singFun3 @ZipWithSym0) sZipWith))
+                  ((singFun2
+                      @(Apply (Apply Lambda_0123456789876543210Sym0 a_0123456789876543210) a_0123456789876543210))
+                     (\ sN sB
+                        -> case ((,) sN) sB of {
+                             (,) (_ :: Sing n) (_ :: Sing b)
+                               -> (id
+                                     @(Sing (Case_0123456789876543210 n b a_0123456789876543210 a_0123456789876543210 b)))
+                                    (case sB of
+                                       STrue
+                                         -> (applySing ((singFun1 @SuccSym0) SSucc))
+                                              ((applySing ((singFun1 @SuccSym0) SSucc)) sN)
+                                       SFalse -> sN) }))))
+              sA_0123456789876543210))
+          sA_0123456789876543210
+    sSplunge (sNs :: Sing ns) (sBs :: Sing bs)
+      = (applySing
+           ((applySing
+               ((applySing ((singFun3 @ZipWithSym0) sZipWith))
+                  ((singFun2 @(Apply (Apply Lambda_0123456789876543210Sym0 ns) bs))
+                     (\ sN sB
+                        -> case ((,) sN) sB of {
+                             (,) (_ :: Sing n) (_ :: Sing b)
+                               -> (id @(Sing (Case_0123456789876543210 n b ns bs b)))
+                                    (case sB of
+                                       STrue
+                                         -> (applySing ((singFun1 @SuccSym0) SSucc))
+                                              ((applySing ((singFun1 @SuccSym0) SSucc)) sN)
+                                       SFalse -> sN) }))))
+              sNs))
+          sBs
+    sFoo (sF :: Sing f) (sG :: Sing g) (sA :: Sing a)
+      = (applySing ((applySing sF) sG)) sA
+    sZipWith
+      (sF :: Sing f)
+      (SCons (sX :: Sing x) (sXs :: Sing xs))
+      (SCons (sY :: Sing y) (sYs :: Sing ys))
+      = (applySing
+           ((applySing ((singFun2 @(:@#@$)) SCons))
+              ((applySing ((applySing sF) sX)) sY)))
+          ((applySing
+              ((applySing ((applySing ((singFun3 @ZipWithSym0) sZipWith)) sF))
+                 sXs))
+             sYs)
+    sZipWith _ SNil SNil = SNil
+    sZipWith _ (SCons _ _) SNil = SNil
+    sZipWith _ SNil (SCons _ _) = SNil
+    sLiftMaybe (sF :: Sing f) (SJust (sX :: Sing x))
+      = (applySing ((singFun1 @JustSym0) SJust)) ((applySing sF) sX)
+    sLiftMaybe _ SNothing = SNothing
+    sMap _ SNil = SNil
+    sMap (sF :: Sing f) (SCons (sH :: Sing h) (sT :: Sing t))
+      = (applySing
+           ((applySing ((singFun2 @(:@#@$)) SCons)) ((applySing sF) sH)))
+          ((applySing ((applySing ((singFun2 @MapSym0) sMap)) sF)) sT)
+    instance SingI (EtadSym0 :: (~>) [Nat] ((~>) [Bool] [Nat])) where
+      sing = (singFun2 @EtadSym0) sEtad
+    instance SingI d =>
+             SingI (EtadSym1 (d :: [Nat]) :: (~>) [Bool] [Nat]) where
+      sing = (singFun1 @(EtadSym1 (d :: [Nat]))) (sEtad (sing @d))
+    instance SingI (SplungeSym0 :: (~>) [Nat] ((~>) [Bool] [Nat])) where
+      sing = (singFun2 @SplungeSym0) sSplunge
+    instance SingI d =>
+             SingI (SplungeSym1 (d :: [Nat]) :: (~>) [Bool] [Nat]) where
+      sing = (singFun1 @(SplungeSym1 (d :: [Nat]))) (sSplunge (sing @d))
+    instance SingI (FooSym0 :: (~>) ((~>) ((~>) a b) ((~>) a b)) ((~>) ((~>) a b) ((~>) a b))) where
+      sing = (singFun3 @FooSym0) sFoo
+    instance SingI d =>
+             SingI (FooSym1 (d :: (~>) ((~>) a b) ((~>) a b)) :: (~>) ((~>) a b) ((~>) a b)) where
+      sing
+        = (singFun2 @(FooSym1 (d :: (~>) ((~>) a b) ((~>) a b))))
+            (sFoo (sing @d))
+    instance (SingI d, SingI d) =>
+             SingI (FooSym2 (d :: (~>) ((~>) a b) ((~>) a b)) (d :: (~>) a b) :: (~>) a b) where
+      sing
+        = (singFun1
+             @(FooSym2 (d :: (~>) ((~>) a b) ((~>) a b)) (d :: (~>) a b)))
+            ((sFoo (sing @d)) (sing @d))
+    instance SingI (ZipWithSym0 :: (~>) ((~>) a ((~>) b c)) ((~>) [a] ((~>) [b] [c]))) where
+      sing = (singFun3 @ZipWithSym0) sZipWith
+    instance SingI d =>
+             SingI (ZipWithSym1 (d :: (~>) a ((~>) b c)) :: (~>) [a] ((~>) [b] [c])) where
+      sing
+        = (singFun2 @(ZipWithSym1 (d :: (~>) a ((~>) b c))))
+            (sZipWith (sing @d))
+    instance (SingI d, SingI d) =>
+             SingI (ZipWithSym2 (d :: (~>) a ((~>) b c)) (d :: [a]) :: (~>) [b] [c]) where
+      sing
+        = (singFun1 @(ZipWithSym2 (d :: (~>) a ((~>) b c)) (d :: [a])))
+            ((sZipWith (sing @d)) (sing @d))
+    instance SingI (LiftMaybeSym0 :: (~>) ((~>) a b) ((~>) (Maybe a) (Maybe b))) where
+      sing = (singFun2 @LiftMaybeSym0) sLiftMaybe
+    instance SingI d =>
+             SingI (LiftMaybeSym1 (d :: (~>) a b) :: (~>) (Maybe a) (Maybe b)) where
+      sing
+        = (singFun1 @(LiftMaybeSym1 (d :: (~>) a b)))
+            (sLiftMaybe (sing @d))
+    instance SingI (MapSym0 :: (~>) ((~>) a b) ((~>) [a] [b])) where
+      sing = (singFun2 @MapSym0) sMap
+    instance SingI d =>
+             SingI (MapSym1 (d :: (~>) a b) :: (~>) [a] [b]) where
+      sing = (singFun1 @(MapSym1 (d :: (~>) a b))) (sMap (sing @d))
+    data SEither :: forall a b. Either a b -> GHC.Types.Type
+      where
+        SLeft :: forall a b (n :: a).
+                 (Sing n) -> SEither (Left n :: Either a b)
+        SRight :: forall a b (n :: b).
+                  (Sing n) -> SEither (Right n :: Either a b)
+    type instance Sing @(Either a b) = SEither
+    instance (SingKind a, SingKind b) => SingKind (Either a b) where
+      type Demote (Either a b) = Either (Demote a) (Demote b)
+      fromSing (SLeft b) = Left (fromSing b)
+      fromSing (SRight b) = Right (fromSing b)
+      toSing (Left (b :: Demote a))
+        = case toSing b :: SomeSing a of {
+            SomeSing c -> SomeSing (SLeft c) }
+      toSing (Right (b :: Demote b))
+        = case toSing b :: SomeSing b of {
+            SomeSing c -> SomeSing (SRight c) }
+    instance SingI n => SingI (Left (n :: a)) where
+      sing = SLeft sing
+    instance SingI (LeftSym0 :: (~>) a (Either a b)) where
+      sing = (singFun1 @LeftSym0) SLeft
+    instance SingI n => SingI (Right (n :: b)) where
+      sing = SRight sing
+    instance SingI (RightSym0 :: (~>) b (Either a b)) where
+      sing = (singFun1 @RightSym0) SRight
diff --git a/tests/compile-and-dump/Singletons/LambdaCase.ghc88.template b/tests/compile-and-dump/Singletons/LambdaCase.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/LambdaCase.ghc88.template
+++ /dev/null
@@ -1,255 +0,0 @@
-Singletons/LambdaCase.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| foo1 :: a -> Maybe a -> a
-          foo1 d x
-            = (\case
-                 Just y -> y
-                 Nothing -> d)
-                x
-          foo2 :: a -> Maybe a -> a
-          foo2 d _
-            = (\case
-                 Just y -> y
-                 Nothing -> d)
-                (Just d)
-          foo3 :: a -> b -> a
-          foo3 a b = (\case (p, _) -> p) (a, b) |]
-  ======>
-    foo1 :: a -> Maybe a -> a
-    foo1 d x
-      = (\case
-           Just y -> y
-           Nothing -> d)
-          x
-    foo2 :: a -> Maybe a -> a
-    foo2 d _
-      = (\case
-           Just y -> y
-           Nothing -> d)
-          (Just d)
-    foo3 :: a -> b -> a
-    foo3 a b = (\case (p, _) -> p) (a, b)
-    type family Case_0123456789876543210 x_0123456789876543210 a b t where
-      Case_0123456789876543210 x_0123456789876543210 a b '(p, _) = p
-    type family Lambda_0123456789876543210 a b t where
-      Lambda_0123456789876543210 a b x_0123456789876543210 = Case_0123456789876543210 x_0123456789876543210 a b x_0123456789876543210
-    type Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 a0123456789876543210 b0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 b0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                              b0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210) arg) (Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 b0123456789876543210 a0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 b0123456789876543210 a0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                              b0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 a0123456789876543210) arg) (Lambda_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 a0123456789876543210) b0123456789876543210 = Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 a0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 a0123456789876543210 = Lambda_0123456789876543210Sym1 a0123456789876543210
-    type family Case_0123456789876543210 x_0123456789876543210 d t where
-      Case_0123456789876543210 x_0123456789876543210 d ('Just y) = y
-      Case_0123456789876543210 x_0123456789876543210 d 'Nothing = d
-    type family Lambda_0123456789876543210 d t where
-      Lambda_0123456789876543210 d x_0123456789876543210 = Case_0123456789876543210 x_0123456789876543210 d x_0123456789876543210
-    type Lambda_0123456789876543210Sym2 d0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 d0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 d0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 d0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall d0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 d0123456789876543210) arg) (Lambda_0123456789876543210Sym2 d0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 d0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 d0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 d0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 d0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall d0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 d0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 d0123456789876543210 = Lambda_0123456789876543210Sym1 d0123456789876543210
-    type family Case_0123456789876543210 x_0123456789876543210 d x t where
-      Case_0123456789876543210 x_0123456789876543210 d x ('Just y) = y
-      Case_0123456789876543210 x_0123456789876543210 d x 'Nothing = d
-    type family Lambda_0123456789876543210 d x t where
-      Lambda_0123456789876543210 d x x_0123456789876543210 = Case_0123456789876543210 x_0123456789876543210 d x x_0123456789876543210
-    type Lambda_0123456789876543210Sym3 d0123456789876543210 x0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 d0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 x0123456789876543210 d0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 d0123456789876543210 x0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall d0123456789876543210
-                                                              x0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 d0123456789876543210 x0123456789876543210) arg) (Lambda_0123456789876543210Sym3 d0123456789876543210 x0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 d0123456789876543210 x0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 d0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 x0123456789876543210 d0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 d0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 d0123456789876543210 x0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall d0123456789876543210
-                                                              x0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 d0123456789876543210) arg) (Lambda_0123456789876543210Sym2 d0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 d0123456789876543210 x0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 d0123456789876543210) x0123456789876543210 = Lambda_0123456789876543210Sym2 d0123456789876543210 x0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 d0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall d0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 d0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 d0123456789876543210 = Lambda_0123456789876543210Sym1 d0123456789876543210
-    type Foo3Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: b0123456789876543210) =
-        Foo3 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Foo3Sym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) Foo3Sym1KindInference) ())
-    data Foo3Sym1 (a0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                    (~>) b0123456789876543210 a0123456789876543210
-      where
-        Foo3Sym1KindInference :: forall a0123456789876543210
-                                        a0123456789876543210
-                                        arg. SameKind (Apply (Foo3Sym1 a0123456789876543210) arg) (Foo3Sym2 a0123456789876543210 arg) =>
-                                 Foo3Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Foo3Sym1 a0123456789876543210) a0123456789876543210 = Foo3 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Foo3Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo3Sym0KindInference) ())
-    data Foo3Sym0 :: forall a0123456789876543210 b0123456789876543210.
-                     (~>) a0123456789876543210 ((~>) b0123456789876543210 a0123456789876543210)
-      where
-        Foo3Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo3Sym0 arg) (Foo3Sym1 arg) =>
-                                 Foo3Sym0 a0123456789876543210
-    type instance Apply Foo3Sym0 a0123456789876543210 = Foo3Sym1 a0123456789876543210
-    type Foo2Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: Maybe a0123456789876543210) =
-        Foo2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Foo2Sym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) Foo2Sym1KindInference) ())
-    data Foo2Sym1 (a0123456789876543210 :: a0123456789876543210) :: (~>) (Maybe a0123456789876543210) a0123456789876543210
-      where
-        Foo2Sym1KindInference :: forall a0123456789876543210
-                                        a0123456789876543210
-                                        arg. SameKind (Apply (Foo2Sym1 a0123456789876543210) arg) (Foo2Sym2 a0123456789876543210 arg) =>
-                                 Foo2Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Foo2Sym1 a0123456789876543210) a0123456789876543210 = Foo2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Foo2Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo2Sym0KindInference) ())
-    data Foo2Sym0 :: forall a0123456789876543210.
-                     (~>) a0123456789876543210 ((~>) (Maybe a0123456789876543210) a0123456789876543210)
-      where
-        Foo2Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo2Sym0 arg) (Foo2Sym1 arg) =>
-                                 Foo2Sym0 a0123456789876543210
-    type instance Apply Foo2Sym0 a0123456789876543210 = Foo2Sym1 a0123456789876543210
-    type Foo1Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: Maybe a0123456789876543210) =
-        Foo1 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Foo1Sym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) Foo1Sym1KindInference) ())
-    data Foo1Sym1 (a0123456789876543210 :: a0123456789876543210) :: (~>) (Maybe a0123456789876543210) a0123456789876543210
-      where
-        Foo1Sym1KindInference :: forall a0123456789876543210
-                                        a0123456789876543210
-                                        arg. SameKind (Apply (Foo1Sym1 a0123456789876543210) arg) (Foo1Sym2 a0123456789876543210 arg) =>
-                                 Foo1Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Foo1Sym1 a0123456789876543210) a0123456789876543210 = Foo1 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Foo1Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo1Sym0KindInference) ())
-    data Foo1Sym0 :: forall a0123456789876543210.
-                     (~>) a0123456789876543210 ((~>) (Maybe a0123456789876543210) a0123456789876543210)
-      where
-        Foo1Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo1Sym0 arg) (Foo1Sym1 arg) =>
-                                 Foo1Sym0 a0123456789876543210
-    type instance Apply Foo1Sym0 a0123456789876543210 = Foo1Sym1 a0123456789876543210
-    type family Foo3 (a :: a) (a :: b) :: a where
-      Foo3 a b = Apply (Apply (Apply Lambda_0123456789876543210Sym0 a) b) (Apply (Apply Tuple2Sym0 a) b)
-    type family Foo2 (a :: a) (a :: Maybe a) :: a where
-      Foo2 d _ = Apply (Apply Lambda_0123456789876543210Sym0 d) (Apply JustSym0 d)
-    type family Foo1 (a :: a) (a :: Maybe a) :: a where
-      Foo1 d x = Apply (Apply (Apply Lambda_0123456789876543210Sym0 d) x) x
-    sFoo3 ::
-      forall a b (t :: a) (t :: b).
-      Sing t -> Sing t -> Sing (Apply (Apply Foo3Sym0 t) t :: a)
-    sFoo2 ::
-      forall a (t :: a) (t :: Maybe a).
-      Sing t -> Sing t -> Sing (Apply (Apply Foo2Sym0 t) t :: a)
-    sFoo1 ::
-      forall a (t :: a) (t :: Maybe a).
-      Sing t -> Sing t -> Sing (Apply (Apply Foo1Sym0 t) t :: a)
-    sFoo3 (sA :: Sing a) (sB :: Sing b)
-      = (applySing
-           ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 a) b))
-              (\ sX_0123456789876543210
-                 -> case sX_0123456789876543210 of {
-                      (_ :: Sing x_0123456789876543210)
-                        -> (id
-                              @(Sing (Case_0123456789876543210 x_0123456789876543210 a b x_0123456789876543210)))
-                             (case sX_0123456789876543210 of {
-                                STuple2 (sP :: Sing p) _ -> sP }) })))
-          ((applySing ((applySing ((singFun2 @Tuple2Sym0) STuple2)) sA)) sB)
-    sFoo2 (sD :: Sing d) _
-      = (applySing
-           ((singFun1 @(Apply Lambda_0123456789876543210Sym0 d))
-              (\ sX_0123456789876543210
-                 -> case sX_0123456789876543210 of {
-                      (_ :: Sing x_0123456789876543210)
-                        -> (id
-                              @(Sing (Case_0123456789876543210 x_0123456789876543210 d x_0123456789876543210)))
-                             (case sX_0123456789876543210 of
-                                SJust (sY :: Sing y) -> sY
-                                SNothing -> sD) })))
-          ((applySing ((singFun1 @JustSym0) SJust)) sD)
-    sFoo1 (sD :: Sing d) (sX :: Sing x)
-      = (applySing
-           ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 d) x))
-              (\ sX_0123456789876543210
-                 -> case sX_0123456789876543210 of {
-                      (_ :: Sing x_0123456789876543210)
-                        -> (id
-                              @(Sing (Case_0123456789876543210 x_0123456789876543210 d x x_0123456789876543210)))
-                             (case sX_0123456789876543210 of
-                                SJust (sY :: Sing y) -> sY
-                                SNothing -> sD) })))
-          sX
-    instance SingI (Foo3Sym0 :: (~>) a ((~>) b a)) where
-      sing = (singFun2 @Foo3Sym0) sFoo3
-    instance SingI d => SingI (Foo3Sym1 (d :: a) :: (~>) b a) where
-      sing = (singFun1 @(Foo3Sym1 (d :: a))) (sFoo3 (sing @d))
-    instance SingI (Foo2Sym0 :: (~>) a ((~>) (Maybe a) a)) where
-      sing = (singFun2 @Foo2Sym0) sFoo2
-    instance SingI d =>
-             SingI (Foo2Sym1 (d :: a) :: (~>) (Maybe a) a) where
-      sing = (singFun1 @(Foo2Sym1 (d :: a))) (sFoo2 (sing @d))
-    instance SingI (Foo1Sym0 :: (~>) a ((~>) (Maybe a) a)) where
-      sing = (singFun2 @Foo1Sym0) sFoo1
-    instance SingI d =>
-             SingI (Foo1Sym1 (d :: a) :: (~>) (Maybe a) a) where
-      sing = (singFun1 @(Foo1Sym1 (d :: a))) (sFoo1 (sing @d))
diff --git a/tests/compile-and-dump/Singletons/LambdaCase.golden b/tests/compile-and-dump/Singletons/LambdaCase.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/LambdaCase.golden
@@ -0,0 +1,236 @@
+Singletons/LambdaCase.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| foo1 :: a -> Maybe a -> a
+          foo1 d x
+            = (\case
+                 Just y -> y
+                 Nothing -> d)
+                x
+          foo2 :: a -> Maybe a -> a
+          foo2 d _
+            = (\case
+                 Just y -> y
+                 Nothing -> d)
+                (Just d)
+          foo3 :: a -> b -> a
+          foo3 a b = (\case (p, _) -> p) (a, b) |]
+  ======>
+    foo1 :: a -> Maybe a -> a
+    foo1 d x
+      = (\case
+           Just y -> y
+           Nothing -> d)
+          x
+    foo2 :: a -> Maybe a -> a
+    foo2 d _
+      = (\case
+           Just y -> y
+           Nothing -> d)
+          (Just d)
+    foo3 :: a -> b -> a
+    foo3 a b = (\case (p, _) -> p) (a, b)
+    type family Case_0123456789876543210 x_0123456789876543210 a b t where
+      Case_0123456789876543210 x_0123456789876543210 a b '(p, _) = p
+    type family Lambda_0123456789876543210 a b x_0123456789876543210 where
+      Lambda_0123456789876543210 a b x_0123456789876543210 = Case_0123456789876543210 x_0123456789876543210 a b x_0123456789876543210
+    data Lambda_0123456789876543210Sym0 a0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 a0123456789876543210 = Lambda_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 a0123456789876543210) arg) (Lambda_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 a0123456789876543210) b0123456789876543210 = Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210 x_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210) arg) (Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210 x_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210) x_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 x_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    type Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 x_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 a0123456789876543210 b0123456789876543210 x_01234567898765432100123456789876543210
+    type family Case_0123456789876543210 x_0123456789876543210 d t where
+      Case_0123456789876543210 x_0123456789876543210 d ('Just y) = y
+      Case_0123456789876543210 x_0123456789876543210 d 'Nothing = d
+    type family Lambda_0123456789876543210 d x_0123456789876543210 where
+      Lambda_0123456789876543210 d x_0123456789876543210 = Case_0123456789876543210 x_0123456789876543210 d x_0123456789876543210
+    data Lambda_0123456789876543210Sym0 d0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 d0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 d0123456789876543210 = Lambda_0123456789876543210Sym1 d0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 d0123456789876543210 x_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 d0123456789876543210) arg) (Lambda_0123456789876543210Sym2 d0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 d0123456789876543210 x_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 d0123456789876543210) x_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 d0123456789876543210 x_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 d0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    type Lambda_0123456789876543210Sym2 d0123456789876543210 x_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 d0123456789876543210 x_01234567898765432100123456789876543210
+    type family Case_0123456789876543210 x_0123456789876543210 d x t where
+      Case_0123456789876543210 x_0123456789876543210 d x ('Just y) = y
+      Case_0123456789876543210 x_0123456789876543210 d x 'Nothing = d
+    type family Lambda_0123456789876543210 d x x_0123456789876543210 where
+      Lambda_0123456789876543210 d x x_0123456789876543210 = Case_0123456789876543210 x_0123456789876543210 d x x_0123456789876543210
+    data Lambda_0123456789876543210Sym0 d0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 d0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 d0123456789876543210 = Lambda_0123456789876543210Sym1 d0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 d0123456789876543210 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 d0123456789876543210) arg) (Lambda_0123456789876543210Sym2 d0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 d0123456789876543210 x0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 d0123456789876543210) x0123456789876543210 = Lambda_0123456789876543210Sym2 d0123456789876543210 x0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 d0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 d0123456789876543210 x0123456789876543210 x_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 d0123456789876543210 x0123456789876543210) arg) (Lambda_0123456789876543210Sym3 d0123456789876543210 x0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 d0123456789876543210 x0123456789876543210 x_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 d0123456789876543210 x0123456789876543210) x_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 d0123456789876543210 x0123456789876543210 x_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 d0123456789876543210 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    type Lambda_0123456789876543210Sym3 d0123456789876543210 x0123456789876543210 x_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 d0123456789876543210 x0123456789876543210 x_01234567898765432100123456789876543210
+    type Foo3Sym0 :: (~>) a ((~>) b a)
+    data Foo3Sym0 a0123456789876543210
+      where
+        Foo3Sym0KindInference :: SameKind (Apply Foo3Sym0 arg) (Foo3Sym1 arg) =>
+                                 Foo3Sym0 a0123456789876543210
+    type instance Apply Foo3Sym0 a0123456789876543210 = Foo3Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo3Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo3Sym0KindInference) ())
+    type Foo3Sym1 :: a -> (~>) b a
+    data Foo3Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Foo3Sym1KindInference :: SameKind (Apply (Foo3Sym1 a0123456789876543210) arg) (Foo3Sym2 a0123456789876543210 arg) =>
+                                 Foo3Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Foo3Sym1 a0123456789876543210) a0123456789876543210 = Foo3Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Foo3Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) Foo3Sym1KindInference) ())
+    type Foo3Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        Foo3 a0123456789876543210 a0123456789876543210 :: a
+    type Foo2Sym0 :: (~>) a ((~>) (Maybe a) a)
+    data Foo2Sym0 a0123456789876543210
+      where
+        Foo2Sym0KindInference :: SameKind (Apply Foo2Sym0 arg) (Foo2Sym1 arg) =>
+                                 Foo2Sym0 a0123456789876543210
+    type instance Apply Foo2Sym0 a0123456789876543210 = Foo2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo2Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo2Sym0KindInference) ())
+    type Foo2Sym1 :: a -> (~>) (Maybe a) a
+    data Foo2Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Foo2Sym1KindInference :: SameKind (Apply (Foo2Sym1 a0123456789876543210) arg) (Foo2Sym2 a0123456789876543210 arg) =>
+                                 Foo2Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Foo2Sym1 a0123456789876543210) a0123456789876543210 = Foo2Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Foo2Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) Foo2Sym1KindInference) ())
+    type Foo2Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: Maybe a) =
+        Foo2 a0123456789876543210 a0123456789876543210 :: a
+    type Foo1Sym0 :: (~>) a ((~>) (Maybe a) a)
+    data Foo1Sym0 a0123456789876543210
+      where
+        Foo1Sym0KindInference :: SameKind (Apply Foo1Sym0 arg) (Foo1Sym1 arg) =>
+                                 Foo1Sym0 a0123456789876543210
+    type instance Apply Foo1Sym0 a0123456789876543210 = Foo1Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo1Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo1Sym0KindInference) ())
+    type Foo1Sym1 :: a -> (~>) (Maybe a) a
+    data Foo1Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Foo1Sym1KindInference :: SameKind (Apply (Foo1Sym1 a0123456789876543210) arg) (Foo1Sym2 a0123456789876543210 arg) =>
+                                 Foo1Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Foo1Sym1 a0123456789876543210) a0123456789876543210 = Foo1Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Foo1Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) Foo1Sym1KindInference) ())
+    type Foo1Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: Maybe a) =
+        Foo1 a0123456789876543210 a0123456789876543210 :: a
+    type Foo3 :: a -> b -> a
+    type family Foo3 a a where
+      Foo3 a b = Apply (Apply (Apply Lambda_0123456789876543210Sym0 a) b) (Apply (Apply Tuple2Sym0 a) b)
+    type Foo2 :: a -> Maybe a -> a
+    type family Foo2 a a where
+      Foo2 d _ = Apply (Apply Lambda_0123456789876543210Sym0 d) (Apply JustSym0 d)
+    type Foo1 :: a -> Maybe a -> a
+    type family Foo1 a a where
+      Foo1 d x = Apply (Apply (Apply Lambda_0123456789876543210Sym0 d) x) x
+    sFoo3 ::
+      forall a b (t :: a) (t :: b).
+      Sing t -> Sing t -> Sing (Apply (Apply Foo3Sym0 t) t :: a)
+    sFoo2 ::
+      forall a (t :: a) (t :: Maybe a).
+      Sing t -> Sing t -> Sing (Apply (Apply Foo2Sym0 t) t :: a)
+    sFoo1 ::
+      forall a (t :: a) (t :: Maybe a).
+      Sing t -> Sing t -> Sing (Apply (Apply Foo1Sym0 t) t :: a)
+    sFoo3 (sA :: Sing a) (sB :: Sing b)
+      = (applySing
+           ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 a) b))
+              (\ sX_0123456789876543210
+                 -> case sX_0123456789876543210 of {
+                      (_ :: Sing x_0123456789876543210)
+                        -> (id
+                              @(Sing (Case_0123456789876543210 x_0123456789876543210 a b x_0123456789876543210)))
+                             (case sX_0123456789876543210 of {
+                                STuple2 (sP :: Sing p) _ -> sP }) })))
+          ((applySing ((applySing ((singFun2 @Tuple2Sym0) STuple2)) sA)) sB)
+    sFoo2 (sD :: Sing d) _
+      = (applySing
+           ((singFun1 @(Apply Lambda_0123456789876543210Sym0 d))
+              (\ sX_0123456789876543210
+                 -> case sX_0123456789876543210 of {
+                      (_ :: Sing x_0123456789876543210)
+                        -> (id
+                              @(Sing (Case_0123456789876543210 x_0123456789876543210 d x_0123456789876543210)))
+                             (case sX_0123456789876543210 of
+                                SJust (sY :: Sing y) -> sY
+                                SNothing -> sD) })))
+          ((applySing ((singFun1 @JustSym0) SJust)) sD)
+    sFoo1 (sD :: Sing d) (sX :: Sing x)
+      = (applySing
+           ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 d) x))
+              (\ sX_0123456789876543210
+                 -> case sX_0123456789876543210 of {
+                      (_ :: Sing x_0123456789876543210)
+                        -> (id
+                              @(Sing (Case_0123456789876543210 x_0123456789876543210 d x x_0123456789876543210)))
+                             (case sX_0123456789876543210 of
+                                SJust (sY :: Sing y) -> sY
+                                SNothing -> sD) })))
+          sX
+    instance SingI (Foo3Sym0 :: (~>) a ((~>) b a)) where
+      sing = (singFun2 @Foo3Sym0) sFoo3
+    instance SingI d => SingI (Foo3Sym1 (d :: a) :: (~>) b a) where
+      sing = (singFun1 @(Foo3Sym1 (d :: a))) (sFoo3 (sing @d))
+    instance SingI (Foo2Sym0 :: (~>) a ((~>) (Maybe a) a)) where
+      sing = (singFun2 @Foo2Sym0) sFoo2
+    instance SingI d =>
+             SingI (Foo2Sym1 (d :: a) :: (~>) (Maybe a) a) where
+      sing = (singFun1 @(Foo2Sym1 (d :: a))) (sFoo2 (sing @d))
+    instance SingI (Foo1Sym0 :: (~>) a ((~>) (Maybe a) a)) where
+      sing = (singFun2 @Foo1Sym0) sFoo1
+    instance SingI d =>
+             SingI (Foo1Sym1 (d :: a) :: (~>) (Maybe a) a) where
+      sing = (singFun1 @(Foo1Sym1 (d :: a))) (sFoo1 (sing @d))
diff --git a/tests/compile-and-dump/Singletons/Lambdas.ghc88.template b/tests/compile-and-dump/Singletons/Lambdas.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/Lambdas.ghc88.template
+++ /dev/null
@@ -1,832 +0,0 @@
-Singletons/Lambdas.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| foo0 :: a -> b -> a
-          foo0 = (\ x y -> x)
-          foo1 :: a -> b -> a
-          foo1 x = (\ _ -> x)
-          foo2 :: a -> b -> a
-          foo2 x y = (\ _ -> x) y
-          foo3 :: a -> a
-          foo3 x = (\ y -> y) x
-          foo4 :: a -> b -> c -> a
-          foo4 x y z = (\ _ _ -> x) y z
-          foo5 :: a -> b -> b
-          foo5 x y = (\ x -> x) y
-          foo6 :: a -> b -> a
-          foo6 a b = (\ x -> \ _ -> x) a b
-          foo7 :: a -> b -> b
-          foo7 x y = (\ (_, b) -> b) (x, y)
-          foo8 :: Foo a b -> a
-          foo8 x = (\ (Foo a _) -> a) x
-          
-          data Foo a b = Foo a b |]
-  ======>
-    foo0 :: a -> b -> a
-    foo0 = \ x y -> x
-    foo1 :: a -> b -> a
-    foo1 x = \ _ -> x
-    foo2 :: a -> b -> a
-    foo2 x y = (\ _ -> x) y
-    foo3 :: a -> a
-    foo3 x = (\ y -> y) x
-    foo4 :: a -> b -> c -> a
-    foo4 x y z = ((\ _ _ -> x) y) z
-    foo5 :: a -> b -> b
-    foo5 x y = (\ x -> x) y
-    foo6 :: a -> b -> a
-    foo6 a b = ((\ x -> \ _ -> x) a) b
-    foo7 :: a -> b -> b
-    foo7 x y = (\ (_, b) -> b) (x, y)
-    data Foo a b = Foo a b
-    foo8 :: Foo a b -> a
-    foo8 x = (\ (Foo a _) -> a) x
-    type FooSym2 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) =
-        Foo t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (FooSym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) FooSym1KindInference) ())
-    data FooSym1 (t0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                   (~>) b0123456789876543210 (Foo a0123456789876543210 b0123456789876543210)
-      where
-        FooSym1KindInference :: forall t0123456789876543210
-                                       t0123456789876543210
-                                       arg. SameKind (Apply (FooSym1 t0123456789876543210) arg) (FooSym2 t0123456789876543210 arg) =>
-                                FooSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (FooSym1 t0123456789876543210) t0123456789876543210 = Foo t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings FooSym0 where
-      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
-    data FooSym0 :: forall a0123456789876543210 b0123456789876543210.
-                    (~>) a0123456789876543210 ((~>) b0123456789876543210 (Foo a0123456789876543210 b0123456789876543210))
-      where
-        FooSym0KindInference :: forall t0123456789876543210
-                                       arg. SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
-                                FooSym0 t0123456789876543210
-    type instance Apply FooSym0 t0123456789876543210 = FooSym1 t0123456789876543210
-    type family Case_0123456789876543210 arg_0123456789876543210 x t where
-      Case_0123456789876543210 arg_0123456789876543210 x (Foo a _) = a
-    type family Lambda_0123456789876543210 x t where
-      Lambda_0123456789876543210 x arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 x arg_0123456789876543210
-    type Lambda_0123456789876543210Sym2 x0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 x0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall x0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 x0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall x0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
-    type family Case_0123456789876543210 arg_0123456789876543210 x y t where
-      Case_0123456789876543210 arg_0123456789876543210 x y '(_, b) = b
-    type family Lambda_0123456789876543210 x y t where
-      Lambda_0123456789876543210 x y arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 x y arg_0123456789876543210
-    type Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 x0123456789876543210 y0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall x0123456789876543210
-                                                              y0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) arg) (Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 y0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall x0123456789876543210
-                                                              y0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) y0123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 x0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall x0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
-    type family Case_0123456789876543210 arg_0123456789876543210 x a b t where
-      Case_0123456789876543210 arg_0123456789876543210 x a b _ = x
-    type family Lambda_0123456789876543210 x a b t where
-      Lambda_0123456789876543210 x a b arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 x a b arg_0123456789876543210
-    type Lambda_0123456789876543210Sym4 x0123456789876543210 a0123456789876543210 b0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 x0123456789876543210 a0123456789876543210 b0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 b0123456789876543210 a0123456789876543210 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
-    data Lambda_0123456789876543210Sym3 x0123456789876543210 a0123456789876543210 b0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym3KindInference :: forall x0123456789876543210
-                                                              a0123456789876543210
-                                                              b0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym3 x0123456789876543210 a0123456789876543210 b0123456789876543210) arg) (Lambda_0123456789876543210Sym4 x0123456789876543210 a0123456789876543210 b0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym3 x0123456789876543210 a0123456789876543210 b0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym3 b0123456789876543210 a0123456789876543210 x0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 b0123456789876543210 a0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 a0123456789876543210 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 x0123456789876543210 a0123456789876543210 b0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall x0123456789876543210
-                                                              a0123456789876543210
-                                                              b0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 a0123456789876543210) arg) (Lambda_0123456789876543210Sym3 x0123456789876543210 a0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 x0123456789876543210 a0123456789876543210 b0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 a0123456789876543210 x0123456789876543210) b0123456789876543210 = Lambda_0123456789876543210Sym3 a0123456789876543210 x0123456789876543210 b0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 x0123456789876543210 a0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall x0123456789876543210
-                                                              a0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 a0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) a0123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 x0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall x0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
-    type family Lambda_0123456789876543210 a b t where
-      Lambda_0123456789876543210 a b x = Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) a) b
-    type Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 a0123456789876543210 b0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 b0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                              b0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210) arg) (Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 b0123456789876543210 a0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 b0123456789876543210 a0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                              b0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 a0123456789876543210) arg) (Lambda_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 a0123456789876543210) b0123456789876543210 = Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 a0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 a0123456789876543210 = Lambda_0123456789876543210Sym1 a0123456789876543210
-    type family Lambda_0123456789876543210 x y t where
-      Lambda_0123456789876543210 x y x = x
-    type Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 x0123456789876543210 y0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall x0123456789876543210
-                                                              y0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) arg) (Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 y0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall x0123456789876543210
-                                                              y0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) y0123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 x0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall x0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
-    type family Case_0123456789876543210 arg_0123456789876543210 arg_0123456789876543210 x y z t where
-      Case_0123456789876543210 arg_0123456789876543210 arg_0123456789876543210 x y z '(_,
-                                                                                       _) = x
-    type family Lambda_0123456789876543210 x y z t t where
-      Lambda_0123456789876543210 x y z arg_0123456789876543210 arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 arg_0123456789876543210 x y z (Apply (Apply Tuple2Sym0 arg_0123456789876543210) arg_0123456789876543210)
-    type Lambda_0123456789876543210Sym5 x0123456789876543210 y0123456789876543210 z0123456789876543210 t0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 x0123456789876543210 y0123456789876543210 z0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 t0123456789876543210 z0123456789876543210 y0123456789876543210 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
-    data Lambda_0123456789876543210Sym4 x0123456789876543210 y0123456789876543210 z0123456789876543210 t0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym4KindInference :: forall x0123456789876543210
-                                                              y0123456789876543210
-                                                              z0123456789876543210
-                                                              t0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym4 x0123456789876543210 y0123456789876543210 z0123456789876543210 t0123456789876543210) arg) (Lambda_0123456789876543210Sym5 x0123456789876543210 y0123456789876543210 z0123456789876543210 t0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym4 x0123456789876543210 y0123456789876543210 z0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym4 t0123456789876543210 z0123456789876543210 y0123456789876543210 x0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 t0123456789876543210 z0123456789876543210 y0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 z0123456789876543210 y0123456789876543210 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
-    data Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 z0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym3KindInference :: forall x0123456789876543210
-                                                              y0123456789876543210
-                                                              z0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 z0123456789876543210) arg) (Lambda_0123456789876543210Sym4 x0123456789876543210 y0123456789876543210 z0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 z0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym3 z0123456789876543210 y0123456789876543210 x0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210Sym4 z0123456789876543210 y0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 z0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall x0123456789876543210
-                                                              y0123456789876543210
-                                                              z0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) arg) (Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 z0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210) z0123456789876543210 = Lambda_0123456789876543210Sym3 y0123456789876543210 x0123456789876543210 z0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall x0123456789876543210
-                                                              y0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) y0123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 x0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall x0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
-    type family Lambda_0123456789876543210 x t where
-      Lambda_0123456789876543210 x y = y
-    type Lambda_0123456789876543210Sym2 x0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 x0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall x0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 x0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall x0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
-    type family Case_0123456789876543210 arg_0123456789876543210 x y t where
-      Case_0123456789876543210 arg_0123456789876543210 x y _ = x
-    type family Lambda_0123456789876543210 x y t where
-      Lambda_0123456789876543210 x y arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 x y arg_0123456789876543210
-    type Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 x0123456789876543210 y0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall x0123456789876543210
-                                                              y0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) arg) (Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 y0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall x0123456789876543210
-                                                              y0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) y0123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 x0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall x0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
-    type family Case_0123456789876543210 arg_0123456789876543210 x a_0123456789876543210 t where
-      Case_0123456789876543210 arg_0123456789876543210 x a_0123456789876543210 _ = x
-    type family Lambda_0123456789876543210 x a_0123456789876543210 t where
-      Lambda_0123456789876543210 x a_0123456789876543210 arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 x a_0123456789876543210 arg_0123456789876543210
-    type Lambda_0123456789876543210Sym3 x0123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 x0123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 x0123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall x0123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 x0123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 x0123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 x0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 a_01234567898765432100123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 x0123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall x0123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 x0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall x0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
-    type family Lambda_0123456789876543210 a_0123456789876543210 a_0123456789876543210 t t where
-      Lambda_0123456789876543210 a_0123456789876543210 a_0123456789876543210 x y = x
-    type Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 t0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
-    data Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym3KindInference :: forall a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210) arg) (Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym3 t0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 t0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall a_01234567898765432100123456789876543210
-                                                              a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210
-    type Foo8Sym1 (a0123456789876543210 :: Foo a0123456789876543210 b0123456789876543210) =
-        Foo8 a0123456789876543210
-    instance SuppressUnusedWarnings Foo8Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo8Sym0KindInference) ())
-    data Foo8Sym0 :: forall a0123456789876543210 b0123456789876543210.
-                     (~>) (Foo a0123456789876543210 b0123456789876543210) a0123456789876543210
-      where
-        Foo8Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo8Sym0 arg) (Foo8Sym1 arg) =>
-                                 Foo8Sym0 a0123456789876543210
-    type instance Apply Foo8Sym0 a0123456789876543210 = Foo8 a0123456789876543210
-    type Foo7Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: b0123456789876543210) =
-        Foo7 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Foo7Sym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) Foo7Sym1KindInference) ())
-    data Foo7Sym1 (a0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                    (~>) b0123456789876543210 b0123456789876543210
-      where
-        Foo7Sym1KindInference :: forall a0123456789876543210
-                                        a0123456789876543210
-                                        arg. SameKind (Apply (Foo7Sym1 a0123456789876543210) arg) (Foo7Sym2 a0123456789876543210 arg) =>
-                                 Foo7Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Foo7Sym1 a0123456789876543210) a0123456789876543210 = Foo7 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Foo7Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo7Sym0KindInference) ())
-    data Foo7Sym0 :: forall a0123456789876543210 b0123456789876543210.
-                     (~>) a0123456789876543210 ((~>) b0123456789876543210 b0123456789876543210)
-      where
-        Foo7Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo7Sym0 arg) (Foo7Sym1 arg) =>
-                                 Foo7Sym0 a0123456789876543210
-    type instance Apply Foo7Sym0 a0123456789876543210 = Foo7Sym1 a0123456789876543210
-    type Foo6Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: b0123456789876543210) =
-        Foo6 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Foo6Sym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) Foo6Sym1KindInference) ())
-    data Foo6Sym1 (a0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                    (~>) b0123456789876543210 a0123456789876543210
-      where
-        Foo6Sym1KindInference :: forall a0123456789876543210
-                                        a0123456789876543210
-                                        arg. SameKind (Apply (Foo6Sym1 a0123456789876543210) arg) (Foo6Sym2 a0123456789876543210 arg) =>
-                                 Foo6Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Foo6Sym1 a0123456789876543210) a0123456789876543210 = Foo6 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Foo6Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo6Sym0KindInference) ())
-    data Foo6Sym0 :: forall a0123456789876543210 b0123456789876543210.
-                     (~>) a0123456789876543210 ((~>) b0123456789876543210 a0123456789876543210)
-      where
-        Foo6Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo6Sym0 arg) (Foo6Sym1 arg) =>
-                                 Foo6Sym0 a0123456789876543210
-    type instance Apply Foo6Sym0 a0123456789876543210 = Foo6Sym1 a0123456789876543210
-    type Foo5Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: b0123456789876543210) =
-        Foo5 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Foo5Sym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) Foo5Sym1KindInference) ())
-    data Foo5Sym1 (a0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                    (~>) b0123456789876543210 b0123456789876543210
-      where
-        Foo5Sym1KindInference :: forall a0123456789876543210
-                                        a0123456789876543210
-                                        arg. SameKind (Apply (Foo5Sym1 a0123456789876543210) arg) (Foo5Sym2 a0123456789876543210 arg) =>
-                                 Foo5Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Foo5Sym1 a0123456789876543210) a0123456789876543210 = Foo5 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Foo5Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo5Sym0KindInference) ())
-    data Foo5Sym0 :: forall a0123456789876543210 b0123456789876543210.
-                     (~>) a0123456789876543210 ((~>) b0123456789876543210 b0123456789876543210)
-      where
-        Foo5Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo5Sym0 arg) (Foo5Sym1 arg) =>
-                                 Foo5Sym0 a0123456789876543210
-    type instance Apply Foo5Sym0 a0123456789876543210 = Foo5Sym1 a0123456789876543210
-    type Foo4Sym3 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: b0123456789876543210) (a0123456789876543210 :: c0123456789876543210) =
-        Foo4 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Foo4Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) Foo4Sym2KindInference) ())
-    data Foo4Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: b0123456789876543210) :: forall c0123456789876543210.
-                                                                                                                   (~>) c0123456789876543210 a0123456789876543210
-      where
-        Foo4Sym2KindInference :: forall a0123456789876543210
-                                        a0123456789876543210
-                                        a0123456789876543210
-                                        arg. SameKind (Apply (Foo4Sym2 a0123456789876543210 a0123456789876543210) arg) (Foo4Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                 Foo4Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (Foo4Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = Foo4 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Foo4Sym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) Foo4Sym1KindInference) ())
-    data Foo4Sym1 (a0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210
-                                                                           c0123456789876543210.
-                                                                    (~>) b0123456789876543210 ((~>) c0123456789876543210 a0123456789876543210)
-      where
-        Foo4Sym1KindInference :: forall a0123456789876543210
-                                        a0123456789876543210
-                                        arg. SameKind (Apply (Foo4Sym1 a0123456789876543210) arg) (Foo4Sym2 a0123456789876543210 arg) =>
-                                 Foo4Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Foo4Sym1 a0123456789876543210) a0123456789876543210 = Foo4Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Foo4Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo4Sym0KindInference) ())
-    data Foo4Sym0 :: forall a0123456789876543210
-                            b0123456789876543210
-                            c0123456789876543210.
-                     (~>) a0123456789876543210 ((~>) b0123456789876543210 ((~>) c0123456789876543210 a0123456789876543210))
-      where
-        Foo4Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo4Sym0 arg) (Foo4Sym1 arg) =>
-                                 Foo4Sym0 a0123456789876543210
-    type instance Apply Foo4Sym0 a0123456789876543210 = Foo4Sym1 a0123456789876543210
-    type Foo3Sym1 (a0123456789876543210 :: a0123456789876543210) =
-        Foo3 a0123456789876543210
-    instance SuppressUnusedWarnings Foo3Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo3Sym0KindInference) ())
-    data Foo3Sym0 :: forall a0123456789876543210.
-                     (~>) a0123456789876543210 a0123456789876543210
-      where
-        Foo3Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo3Sym0 arg) (Foo3Sym1 arg) =>
-                                 Foo3Sym0 a0123456789876543210
-    type instance Apply Foo3Sym0 a0123456789876543210 = Foo3 a0123456789876543210
-    type Foo2Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: b0123456789876543210) =
-        Foo2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Foo2Sym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) Foo2Sym1KindInference) ())
-    data Foo2Sym1 (a0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                    (~>) b0123456789876543210 a0123456789876543210
-      where
-        Foo2Sym1KindInference :: forall a0123456789876543210
-                                        a0123456789876543210
-                                        arg. SameKind (Apply (Foo2Sym1 a0123456789876543210) arg) (Foo2Sym2 a0123456789876543210 arg) =>
-                                 Foo2Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Foo2Sym1 a0123456789876543210) a0123456789876543210 = Foo2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Foo2Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo2Sym0KindInference) ())
-    data Foo2Sym0 :: forall a0123456789876543210 b0123456789876543210.
-                     (~>) a0123456789876543210 ((~>) b0123456789876543210 a0123456789876543210)
-      where
-        Foo2Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo2Sym0 arg) (Foo2Sym1 arg) =>
-                                 Foo2Sym0 a0123456789876543210
-    type instance Apply Foo2Sym0 a0123456789876543210 = Foo2Sym1 a0123456789876543210
-    type Foo1Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: b0123456789876543210) =
-        Foo1 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Foo1Sym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) Foo1Sym1KindInference) ())
-    data Foo1Sym1 (a0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                    (~>) b0123456789876543210 a0123456789876543210
-      where
-        Foo1Sym1KindInference :: forall a0123456789876543210
-                                        a0123456789876543210
-                                        arg. SameKind (Apply (Foo1Sym1 a0123456789876543210) arg) (Foo1Sym2 a0123456789876543210 arg) =>
-                                 Foo1Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Foo1Sym1 a0123456789876543210) a0123456789876543210 = Foo1 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Foo1Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo1Sym0KindInference) ())
-    data Foo1Sym0 :: forall a0123456789876543210 b0123456789876543210.
-                     (~>) a0123456789876543210 ((~>) b0123456789876543210 a0123456789876543210)
-      where
-        Foo1Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo1Sym0 arg) (Foo1Sym1 arg) =>
-                                 Foo1Sym0 a0123456789876543210
-    type instance Apply Foo1Sym0 a0123456789876543210 = Foo1Sym1 a0123456789876543210
-    type Foo0Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: b0123456789876543210) =
-        Foo0 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Foo0Sym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) Foo0Sym1KindInference) ())
-    data Foo0Sym1 (a0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                    (~>) b0123456789876543210 a0123456789876543210
-      where
-        Foo0Sym1KindInference :: forall a0123456789876543210
-                                        a0123456789876543210
-                                        arg. SameKind (Apply (Foo0Sym1 a0123456789876543210) arg) (Foo0Sym2 a0123456789876543210 arg) =>
-                                 Foo0Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Foo0Sym1 a0123456789876543210) a0123456789876543210 = Foo0 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Foo0Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo0Sym0KindInference) ())
-    data Foo0Sym0 :: forall a0123456789876543210 b0123456789876543210.
-                     (~>) a0123456789876543210 ((~>) b0123456789876543210 a0123456789876543210)
-      where
-        Foo0Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo0Sym0 arg) (Foo0Sym1 arg) =>
-                                 Foo0Sym0 a0123456789876543210
-    type instance Apply Foo0Sym0 a0123456789876543210 = Foo0Sym1 a0123456789876543210
-    type family Foo8 (a :: Foo a b) :: a where
-      Foo8 x = Apply (Apply Lambda_0123456789876543210Sym0 x) x
-    type family Foo7 (a :: a) (a :: b) :: b where
-      Foo7 x y = Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) y) (Apply (Apply Tuple2Sym0 x) y)
-    type family Foo6 (a :: a) (a :: b) :: a where
-      Foo6 a b = Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 a) b) a) b
-    type family Foo5 (a :: a) (a :: b) :: b where
-      Foo5 x y = Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) y) y
-    type family Foo4 (a :: a) (a :: b) (a :: c) :: a where
-      Foo4 x y z = Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) y) z) y) z
-    type family Foo3 (a :: a) :: a where
-      Foo3 x = Apply (Apply Lambda_0123456789876543210Sym0 x) x
-    type family Foo2 (a :: a) (a :: b) :: a where
-      Foo2 x y = Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) y) y
-    type family Foo1 (a :: a) (a :: b) :: a where
-      Foo1 x a_0123456789876543210 = Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) a_0123456789876543210) a_0123456789876543210
-    type family Foo0 (a :: a) (a :: b) :: a where
-      Foo0 a_0123456789876543210 a_0123456789876543210 = Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210
-    sFoo8 ::
-      forall a b (t :: Foo a b). Sing t -> Sing (Apply Foo8Sym0 t :: a)
-    sFoo7 ::
-      forall a b (t :: a) (t :: b).
-      Sing t -> Sing t -> Sing (Apply (Apply Foo7Sym0 t) t :: b)
-    sFoo6 ::
-      forall a b (t :: a) (t :: b).
-      Sing t -> Sing t -> Sing (Apply (Apply Foo6Sym0 t) t :: a)
-    sFoo5 ::
-      forall a b (t :: a) (t :: b).
-      Sing t -> Sing t -> Sing (Apply (Apply Foo5Sym0 t) t :: b)
-    sFoo4 ::
-      forall a b c (t :: a) (t :: b) (t :: c).
-      Sing t
-      -> Sing t
-         -> Sing t -> Sing (Apply (Apply (Apply Foo4Sym0 t) t) t :: a)
-    sFoo3 :: forall a (t :: a). Sing t -> Sing (Apply Foo3Sym0 t :: a)
-    sFoo2 ::
-      forall a b (t :: a) (t :: b).
-      Sing t -> Sing t -> Sing (Apply (Apply Foo2Sym0 t) t :: a)
-    sFoo1 ::
-      forall a b (t :: a) (t :: b).
-      Sing t -> Sing t -> Sing (Apply (Apply Foo1Sym0 t) t :: a)
-    sFoo0 ::
-      forall a b (t :: a) (t :: b).
-      Sing t -> Sing t -> Sing (Apply (Apply Foo0Sym0 t) t :: a)
-    sFoo8 (sX :: Sing x)
-      = (applySing
-           ((singFun1 @(Apply Lambda_0123456789876543210Sym0 x))
-              (\ sArg_0123456789876543210
-                 -> case sArg_0123456789876543210 of {
-                      (_ :: Sing arg_0123456789876543210)
-                        -> (id
-                              @(Sing (Case_0123456789876543210 arg_0123456789876543210 x arg_0123456789876543210)))
-                             (case sArg_0123456789876543210 of {
-                                SFoo (sA :: Sing a) _ -> sA }) })))
-          sX
-    sFoo7 (sX :: Sing x) (sY :: Sing y)
-      = (applySing
-           ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 x) y))
-              (\ sArg_0123456789876543210
-                 -> case sArg_0123456789876543210 of {
-                      (_ :: Sing arg_0123456789876543210)
-                        -> (id
-                              @(Sing (Case_0123456789876543210 arg_0123456789876543210 x y arg_0123456789876543210)))
-                             (case sArg_0123456789876543210 of {
-                                STuple2 _ (sB :: Sing b) -> sB }) })))
-          ((applySing ((applySing ((singFun2 @Tuple2Sym0) STuple2)) sX)) sY)
-    sFoo6 (sA :: Sing a) (sB :: Sing b)
-      = (applySing
-           ((applySing
-               ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 a) b))
-                  (\ sX
-                     -> case sX of {
-                          (_ :: Sing x)
-                            -> (singFun1
-                                  @(Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) a) b))
-                                 (\ sArg_0123456789876543210
-                                    -> case sArg_0123456789876543210 of {
-                                         (_ :: Sing arg_0123456789876543210)
-                                           -> (id
-                                                 @(Sing (Case_0123456789876543210 arg_0123456789876543210 x a b arg_0123456789876543210)))
-                                                (case sArg_0123456789876543210 of {
-                                                   _ -> sX }) }) })))
-              sA))
-          sB
-    sFoo5 (sX :: Sing x) (sY :: Sing y)
-      = (applySing
-           ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 x) y))
-              (\ sX -> case sX of { (_ :: Sing x) -> sX })))
-          sY
-    sFoo4 (sX :: Sing x) (sY :: Sing y) (sZ :: Sing z)
-      = (applySing
-           ((applySing
-               ((singFun2
-                   @(Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) y) z))
-                  (\ sArg_0123456789876543210 sArg_0123456789876543210
-                     -> case
-                            ((,) sArg_0123456789876543210) sArg_0123456789876543210
-                        of {
-                          (,) (_ :: Sing arg_0123456789876543210)
-                              (_ :: Sing arg_0123456789876543210)
-                            -> (id
-                                  @(Sing (Case_0123456789876543210 arg_0123456789876543210 arg_0123456789876543210 x y z (Apply (Apply Tuple2Sym0 arg_0123456789876543210) arg_0123456789876543210))))
-                                 (case
-                                      (applySing
-                                         ((applySing ((singFun2 @Tuple2Sym0) STuple2))
-                                            sArg_0123456789876543210))
-                                        sArg_0123456789876543210
-                                  of {
-                                    STuple2 _ _ -> sX }) })))
-              sY))
-          sZ
-    sFoo3 (sX :: Sing x)
-      = (applySing
-           ((singFun1 @(Apply Lambda_0123456789876543210Sym0 x))
-              (\ sY -> case sY of { (_ :: Sing y) -> sY })))
-          sX
-    sFoo2 (sX :: Sing x) (sY :: Sing y)
-      = (applySing
-           ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 x) y))
-              (\ sArg_0123456789876543210
-                 -> case sArg_0123456789876543210 of {
-                      (_ :: Sing arg_0123456789876543210)
-                        -> (id
-                              @(Sing (Case_0123456789876543210 arg_0123456789876543210 x y arg_0123456789876543210)))
-                             (case sArg_0123456789876543210 of { _ -> sX }) })))
-          sY
-    sFoo1
-      (sX :: Sing x)
-      (sA_0123456789876543210 :: Sing a_0123456789876543210)
-      = (applySing
-           ((singFun1
-               @(Apply (Apply Lambda_0123456789876543210Sym0 x) a_0123456789876543210))
-              (\ sArg_0123456789876543210
-                 -> case sArg_0123456789876543210 of {
-                      (_ :: Sing arg_0123456789876543210)
-                        -> (id
-                              @(Sing (Case_0123456789876543210 arg_0123456789876543210 x a_0123456789876543210 arg_0123456789876543210)))
-                             (case sArg_0123456789876543210 of { _ -> sX }) })))
-          sA_0123456789876543210
-    sFoo0
-      (sA_0123456789876543210 :: Sing a_0123456789876543210)
-      (sA_0123456789876543210 :: Sing a_0123456789876543210)
-      = (applySing
-           ((applySing
-               ((singFun2
-                   @(Apply (Apply Lambda_0123456789876543210Sym0 a_0123456789876543210) a_0123456789876543210))
-                  (\ sX sY
-                     -> case ((,) sX) sY of { (,) (_ :: Sing x) (_ :: Sing y) -> sX })))
-              sA_0123456789876543210))
-          sA_0123456789876543210
-    instance SingI (Foo8Sym0 :: (~>) (Foo a b) a) where
-      sing = (singFun1 @Foo8Sym0) sFoo8
-    instance SingI (Foo7Sym0 :: (~>) a ((~>) b b)) where
-      sing = (singFun2 @Foo7Sym0) sFoo7
-    instance SingI d => SingI (Foo7Sym1 (d :: a) :: (~>) b b) where
-      sing = (singFun1 @(Foo7Sym1 (d :: a))) (sFoo7 (sing @d))
-    instance SingI (Foo6Sym0 :: (~>) a ((~>) b a)) where
-      sing = (singFun2 @Foo6Sym0) sFoo6
-    instance SingI d => SingI (Foo6Sym1 (d :: a) :: (~>) b a) where
-      sing = (singFun1 @(Foo6Sym1 (d :: a))) (sFoo6 (sing @d))
-    instance SingI (Foo5Sym0 :: (~>) a ((~>) b b)) where
-      sing = (singFun2 @Foo5Sym0) sFoo5
-    instance SingI d => SingI (Foo5Sym1 (d :: a) :: (~>) b b) where
-      sing = (singFun1 @(Foo5Sym1 (d :: a))) (sFoo5 (sing @d))
-    instance SingI (Foo4Sym0 :: (~>) a ((~>) b ((~>) c a))) where
-      sing = (singFun3 @Foo4Sym0) sFoo4
-    instance SingI d =>
-             SingI (Foo4Sym1 (d :: a) :: (~>) b ((~>) c a)) where
-      sing = (singFun2 @(Foo4Sym1 (d :: a))) (sFoo4 (sing @d))
-    instance (SingI d, SingI d) =>
-             SingI (Foo4Sym2 (d :: a) (d :: b) :: (~>) c a) where
-      sing
-        = (singFun1 @(Foo4Sym2 (d :: a) (d :: b)))
-            ((sFoo4 (sing @d)) (sing @d))
-    instance SingI (Foo3Sym0 :: (~>) a a) where
-      sing = (singFun1 @Foo3Sym0) sFoo3
-    instance SingI (Foo2Sym0 :: (~>) a ((~>) b a)) where
-      sing = (singFun2 @Foo2Sym0) sFoo2
-    instance SingI d => SingI (Foo2Sym1 (d :: a) :: (~>) b a) where
-      sing = (singFun1 @(Foo2Sym1 (d :: a))) (sFoo2 (sing @d))
-    instance SingI (Foo1Sym0 :: (~>) a ((~>) b a)) where
-      sing = (singFun2 @Foo1Sym0) sFoo1
-    instance SingI d => SingI (Foo1Sym1 (d :: a) :: (~>) b a) where
-      sing = (singFun1 @(Foo1Sym1 (d :: a))) (sFoo1 (sing @d))
-    instance SingI (Foo0Sym0 :: (~>) a ((~>) b a)) where
-      sing = (singFun2 @Foo0Sym0) sFoo0
-    instance SingI d => SingI (Foo0Sym1 (d :: a) :: (~>) b a) where
-      sing = (singFun1 @(Foo0Sym1 (d :: a))) (sFoo0 (sing @d))
-    data SFoo :: forall a b. Foo a b -> GHC.Types.Type
-      where
-        SFoo :: forall a b (n :: a) (n :: b).
-                (Sing (n :: a)) -> (Sing (n :: b)) -> SFoo (Foo n n)
-    type instance Sing @(Foo a b) = SFoo
-    instance (SingKind a, SingKind b) => SingKind (Foo a b) where
-      type Demote (Foo a b) = Foo (Demote a) (Demote b)
-      fromSing (SFoo b b) = (Foo (fromSing b)) (fromSing b)
-      toSing (Foo (b :: Demote a) (b :: Demote b))
-        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b) of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SFoo c) c) }
-    instance (SingI n, SingI n) => SingI (Foo (n :: a) (n :: b)) where
-      sing = (SFoo sing) sing
-    instance SingI (FooSym0 :: (~>) a ((~>) b (Foo a b))) where
-      sing = (singFun2 @FooSym0) SFoo
-    instance SingI d =>
-             SingI (FooSym1 (d :: a) :: (~>) b (Foo a b)) where
-      sing = (singFun1 @(FooSym1 (d :: a))) (SFoo (sing @d))
diff --git a/tests/compile-and-dump/Singletons/Lambdas.golden b/tests/compile-and-dump/Singletons/Lambdas.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/Lambdas.golden
@@ -0,0 +1,738 @@
+Singletons/Lambdas.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| foo0 :: a -> b -> a
+          foo0 = (\ x y -> x)
+          foo1 :: a -> b -> a
+          foo1 x = (\ _ -> x)
+          foo2 :: a -> b -> a
+          foo2 x y = (\ _ -> x) y
+          foo3 :: a -> a
+          foo3 x = (\ y -> y) x
+          foo4 :: a -> b -> c -> a
+          foo4 x y z = (\ _ _ -> x) y z
+          foo5 :: a -> b -> b
+          foo5 x y = (\ x -> x) y
+          foo6 :: a -> b -> a
+          foo6 a b = (\ x -> \ _ -> x) a b
+          foo7 :: a -> b -> b
+          foo7 x y = (\ (_, b) -> b) (x, y)
+          foo8 :: Foo a b -> a
+          foo8 x = (\ (Foo a _) -> a) x
+          
+          data Foo a b = Foo a b |]
+  ======>
+    foo0 :: a -> b -> a
+    foo0 = \ x y -> x
+    foo1 :: a -> b -> a
+    foo1 x = \ _ -> x
+    foo2 :: a -> b -> a
+    foo2 x y = (\ _ -> x) y
+    foo3 :: a -> a
+    foo3 x = (\ y -> y) x
+    foo4 :: a -> b -> c -> a
+    foo4 x y z = ((\ _ _ -> x) y) z
+    foo5 :: a -> b -> b
+    foo5 x y = (\ x -> x) y
+    foo6 :: a -> b -> a
+    foo6 a b = ((\ x -> \ _ -> x) a) b
+    foo7 :: a -> b -> b
+    foo7 x y = (\ (_, b) -> b) (x, y)
+    data Foo a b = Foo a b
+    foo8 :: Foo a b -> a
+    foo8 x = (\ (Foo a _) -> a) x
+    type FooSym0 :: forall a b. (~>) a ((~>) b (Foo a b))
+    data FooSym0 a0123456789876543210
+      where
+        FooSym0KindInference :: SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
+                                FooSym0 a0123456789876543210
+    type instance Apply FooSym0 a0123456789876543210 = FooSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FooSym0 where
+      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
+    type FooSym1 :: forall a b. a -> (~>) b (Foo a b)
+    data FooSym1 a0123456789876543210 a0123456789876543210
+      where
+        FooSym1KindInference :: SameKind (Apply (FooSym1 a0123456789876543210) arg) (FooSym2 a0123456789876543210 arg) =>
+                                FooSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (FooSym1 a0123456789876543210) a0123456789876543210 = FooSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (FooSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) FooSym1KindInference) ())
+    type FooSym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        Foo a0123456789876543210 a0123456789876543210 :: Foo a b
+    type family Case_0123456789876543210 arg_0123456789876543210 x t where
+      Case_0123456789876543210 arg_0123456789876543210 x (Foo a _) = a
+    type family Lambda_0123456789876543210 x arg_0123456789876543210 where
+      Lambda_0123456789876543210 x arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 x arg_0123456789876543210
+    data Lambda_0123456789876543210Sym0 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 x0123456789876543210 arg_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 arg_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 arg_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    type Lambda_0123456789876543210Sym2 x0123456789876543210 arg_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 x0123456789876543210 arg_01234567898765432100123456789876543210
+    type family Case_0123456789876543210 arg_0123456789876543210 x y t where
+      Case_0123456789876543210 arg_0123456789876543210 x y '(_, b) = b
+    type family Lambda_0123456789876543210 x y arg_0123456789876543210 where
+      Lambda_0123456789876543210 x y arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 x y arg_0123456789876543210
+    data Lambda_0123456789876543210Sym0 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) y0123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) arg) (Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) arg_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    type Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210
+    type family Case_0123456789876543210 arg_0123456789876543210 x a b t where
+      Case_0123456789876543210 arg_0123456789876543210 x a b _ = x
+    type family Lambda_0123456789876543210 x a b arg_0123456789876543210 where
+      Lambda_0123456789876543210 x a b arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 x a b arg_0123456789876543210
+    data Lambda_0123456789876543210Sym0 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 x0123456789876543210 a0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 a0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) a0123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 x0123456789876543210 a0123456789876543210 b0123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 a0123456789876543210) arg) (Lambda_0123456789876543210Sym3 x0123456789876543210 a0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 x0123456789876543210 a0123456789876543210 b0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 a0123456789876543210) b0123456789876543210 = Lambda_0123456789876543210Sym3 x0123456789876543210 a0123456789876543210 b0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 x0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    data Lambda_0123456789876543210Sym3 x0123456789876543210 a0123456789876543210 b0123456789876543210 arg_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym3KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym3 x0123456789876543210 a0123456789876543210 b0123456789876543210) arg) (Lambda_0123456789876543210Sym4 x0123456789876543210 a0123456789876543210 b0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym3 x0123456789876543210 a0123456789876543210 b0123456789876543210 arg_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym3 x0123456789876543210 a0123456789876543210 b0123456789876543210) arg_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym4 x0123456789876543210 a0123456789876543210 b0123456789876543210 arg_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 x0123456789876543210 a0123456789876543210 b0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
+    type Lambda_0123456789876543210Sym4 x0123456789876543210 a0123456789876543210 b0123456789876543210 arg_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 x0123456789876543210 a0123456789876543210 b0123456789876543210 arg_01234567898765432100123456789876543210
+    type family Lambda_0123456789876543210 a b x where
+      Lambda_0123456789876543210 a b x = Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) a) b
+    data Lambda_0123456789876543210Sym0 a0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 a0123456789876543210 = Lambda_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 a0123456789876543210) arg) (Lambda_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 a0123456789876543210) b0123456789876543210 = Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210) arg) (Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210 x0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210) x0123456789876543210 = Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 x0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    type Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 x0123456789876543210 =
+        Lambda_0123456789876543210 a0123456789876543210 b0123456789876543210 x0123456789876543210
+    type family Lambda_0123456789876543210 x y x where
+      Lambda_0123456789876543210 x y x = x
+    data Lambda_0123456789876543210Sym0 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) y0123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) arg) (Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 x0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) x0123456789876543210 = Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 x0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    type Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 x0123456789876543210 =
+        Lambda_0123456789876543210 x0123456789876543210 y0123456789876543210 x0123456789876543210
+    type family Case_0123456789876543210 arg_0123456789876543210 arg_0123456789876543210 x y z t where
+      Case_0123456789876543210 arg_0123456789876543210 arg_0123456789876543210 x y z '(_,
+                                                                                       _) = x
+    type family Lambda_0123456789876543210 x y z arg_0123456789876543210 arg_0123456789876543210 where
+      Lambda_0123456789876543210 x y z arg_0123456789876543210 arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 arg_0123456789876543210 x y z (Apply (Apply Tuple2Sym0 arg_0123456789876543210) arg_0123456789876543210)
+    data Lambda_0123456789876543210Sym0 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) y0123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 z0123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) arg) (Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 z0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) z0123456789876543210 = Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 z0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    data Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 z0123456789876543210 arg_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym3KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 z0123456789876543210) arg) (Lambda_0123456789876543210Sym4 x0123456789876543210 y0123456789876543210 z0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 z0123456789876543210 arg_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 z0123456789876543210) arg_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym4 x0123456789876543210 y0123456789876543210 z0123456789876543210 arg_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 z0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
+    data Lambda_0123456789876543210Sym4 x0123456789876543210 y0123456789876543210 z0123456789876543210 arg_01234567898765432100123456789876543210 arg_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym4KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym4 x0123456789876543210 y0123456789876543210 z0123456789876543210 arg_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym5 x0123456789876543210 y0123456789876543210 z0123456789876543210 arg_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym4 x0123456789876543210 y0123456789876543210 z0123456789876543210 arg_01234567898765432100123456789876543210 arg_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym4 x0123456789876543210 y0123456789876543210 z0123456789876543210 arg_01234567898765432100123456789876543210) arg_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym5 x0123456789876543210 y0123456789876543210 z0123456789876543210 arg_01234567898765432100123456789876543210 arg_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 x0123456789876543210 y0123456789876543210 z0123456789876543210 arg_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
+    type Lambda_0123456789876543210Sym5 x0123456789876543210 y0123456789876543210 z0123456789876543210 arg_01234567898765432100123456789876543210 arg_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 x0123456789876543210 y0123456789876543210 z0123456789876543210 arg_01234567898765432100123456789876543210 arg_01234567898765432100123456789876543210
+    type family Lambda_0123456789876543210 x y where
+      Lambda_0123456789876543210 x y = y
+    data Lambda_0123456789876543210Sym0 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) y0123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    type Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 =
+        Lambda_0123456789876543210 x0123456789876543210 y0123456789876543210
+    type family Case_0123456789876543210 arg_0123456789876543210 x y t where
+      Case_0123456789876543210 arg_0123456789876543210 x y _ = x
+    type family Lambda_0123456789876543210 x y arg_0123456789876543210 where
+      Lambda_0123456789876543210 x y arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 x y arg_0123456789876543210
+    data Lambda_0123456789876543210Sym0 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) y0123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) arg) (Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) arg_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    type Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210
+    type family Case_0123456789876543210 arg_0123456789876543210 x a_0123456789876543210 t where
+      Case_0123456789876543210 arg_0123456789876543210 x a_0123456789876543210 _ = x
+    type family Lambda_0123456789876543210 x a_0123456789876543210 arg_0123456789876543210 where
+      Lambda_0123456789876543210 x a_0123456789876543210 arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 x a_0123456789876543210 arg_0123456789876543210
+    data Lambda_0123456789876543210Sym0 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 x0123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 x0123456789876543210 a_01234567898765432100123456789876543210 arg_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 x0123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 x0123456789876543210 a_01234567898765432100123456789876543210 arg_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 a_01234567898765432100123456789876543210) arg_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 x0123456789876543210 a_01234567898765432100123456789876543210 arg_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 x0123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    type Lambda_0123456789876543210Sym3 x0123456789876543210 a_01234567898765432100123456789876543210 arg_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 x0123456789876543210 a_01234567898765432100123456789876543210 arg_01234567898765432100123456789876543210
+    type family Lambda_0123456789876543210 a_0123456789876543210 a_0123456789876543210 x y where
+      Lambda_0123456789876543210 a_0123456789876543210 a_0123456789876543210 x y = x
+    data Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 x0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) x0123456789876543210 = Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 x0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    data Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 x0123456789876543210 y0123456789876543210
+      where
+        Lambda_0123456789876543210Sym3KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 x0123456789876543210) arg) (Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 x0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 x0123456789876543210 y0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 x0123456789876543210) y0123456789876543210 = Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 x0123456789876543210 y0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
+    type Lambda_0123456789876543210Sym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 x0123456789876543210 y0123456789876543210 =
+        Lambda_0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 x0123456789876543210 y0123456789876543210
+    type Foo8Sym0 :: (~>) (Foo a b) a
+    data Foo8Sym0 a0123456789876543210
+      where
+        Foo8Sym0KindInference :: SameKind (Apply Foo8Sym0 arg) (Foo8Sym1 arg) =>
+                                 Foo8Sym0 a0123456789876543210
+    type instance Apply Foo8Sym0 a0123456789876543210 = Foo8Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo8Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo8Sym0KindInference) ())
+    type Foo8Sym1 (a0123456789876543210 :: Foo a b) =
+        Foo8 a0123456789876543210 :: a
+    type Foo7Sym0 :: (~>) a ((~>) b b)
+    data Foo7Sym0 a0123456789876543210
+      where
+        Foo7Sym0KindInference :: SameKind (Apply Foo7Sym0 arg) (Foo7Sym1 arg) =>
+                                 Foo7Sym0 a0123456789876543210
+    type instance Apply Foo7Sym0 a0123456789876543210 = Foo7Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo7Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo7Sym0KindInference) ())
+    type Foo7Sym1 :: a -> (~>) b b
+    data Foo7Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Foo7Sym1KindInference :: SameKind (Apply (Foo7Sym1 a0123456789876543210) arg) (Foo7Sym2 a0123456789876543210 arg) =>
+                                 Foo7Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Foo7Sym1 a0123456789876543210) a0123456789876543210 = Foo7Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Foo7Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) Foo7Sym1KindInference) ())
+    type Foo7Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        Foo7 a0123456789876543210 a0123456789876543210 :: b
+    type Foo6Sym0 :: (~>) a ((~>) b a)
+    data Foo6Sym0 a0123456789876543210
+      where
+        Foo6Sym0KindInference :: SameKind (Apply Foo6Sym0 arg) (Foo6Sym1 arg) =>
+                                 Foo6Sym0 a0123456789876543210
+    type instance Apply Foo6Sym0 a0123456789876543210 = Foo6Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo6Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo6Sym0KindInference) ())
+    type Foo6Sym1 :: a -> (~>) b a
+    data Foo6Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Foo6Sym1KindInference :: SameKind (Apply (Foo6Sym1 a0123456789876543210) arg) (Foo6Sym2 a0123456789876543210 arg) =>
+                                 Foo6Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Foo6Sym1 a0123456789876543210) a0123456789876543210 = Foo6Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Foo6Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) Foo6Sym1KindInference) ())
+    type Foo6Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        Foo6 a0123456789876543210 a0123456789876543210 :: a
+    type Foo5Sym0 :: (~>) a ((~>) b b)
+    data Foo5Sym0 a0123456789876543210
+      where
+        Foo5Sym0KindInference :: SameKind (Apply Foo5Sym0 arg) (Foo5Sym1 arg) =>
+                                 Foo5Sym0 a0123456789876543210
+    type instance Apply Foo5Sym0 a0123456789876543210 = Foo5Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo5Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo5Sym0KindInference) ())
+    type Foo5Sym1 :: a -> (~>) b b
+    data Foo5Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Foo5Sym1KindInference :: SameKind (Apply (Foo5Sym1 a0123456789876543210) arg) (Foo5Sym2 a0123456789876543210 arg) =>
+                                 Foo5Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Foo5Sym1 a0123456789876543210) a0123456789876543210 = Foo5Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Foo5Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) Foo5Sym1KindInference) ())
+    type Foo5Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        Foo5 a0123456789876543210 a0123456789876543210 :: b
+    type Foo4Sym0 :: (~>) a ((~>) b ((~>) c a))
+    data Foo4Sym0 a0123456789876543210
+      where
+        Foo4Sym0KindInference :: SameKind (Apply Foo4Sym0 arg) (Foo4Sym1 arg) =>
+                                 Foo4Sym0 a0123456789876543210
+    type instance Apply Foo4Sym0 a0123456789876543210 = Foo4Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo4Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo4Sym0KindInference) ())
+    type Foo4Sym1 :: a -> (~>) b ((~>) c a)
+    data Foo4Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Foo4Sym1KindInference :: SameKind (Apply (Foo4Sym1 a0123456789876543210) arg) (Foo4Sym2 a0123456789876543210 arg) =>
+                                 Foo4Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Foo4Sym1 a0123456789876543210) a0123456789876543210 = Foo4Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Foo4Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) Foo4Sym1KindInference) ())
+    type Foo4Sym2 :: a -> b -> (~>) c a
+    data Foo4Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        Foo4Sym2KindInference :: SameKind (Apply (Foo4Sym2 a0123456789876543210 a0123456789876543210) arg) (Foo4Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                 Foo4Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (Foo4Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = Foo4Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Foo4Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) Foo4Sym2KindInference) ())
+    type Foo4Sym3 (a0123456789876543210 :: a) (a0123456789876543210 :: b) (a0123456789876543210 :: c) =
+        Foo4 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: a
+    type Foo3Sym0 :: (~>) a a
+    data Foo3Sym0 a0123456789876543210
+      where
+        Foo3Sym0KindInference :: SameKind (Apply Foo3Sym0 arg) (Foo3Sym1 arg) =>
+                                 Foo3Sym0 a0123456789876543210
+    type instance Apply Foo3Sym0 a0123456789876543210 = Foo3Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo3Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo3Sym0KindInference) ())
+    type Foo3Sym1 (a0123456789876543210 :: a) =
+        Foo3 a0123456789876543210 :: a
+    type Foo2Sym0 :: (~>) a ((~>) b a)
+    data Foo2Sym0 a0123456789876543210
+      where
+        Foo2Sym0KindInference :: SameKind (Apply Foo2Sym0 arg) (Foo2Sym1 arg) =>
+                                 Foo2Sym0 a0123456789876543210
+    type instance Apply Foo2Sym0 a0123456789876543210 = Foo2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo2Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo2Sym0KindInference) ())
+    type Foo2Sym1 :: a -> (~>) b a
+    data Foo2Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Foo2Sym1KindInference :: SameKind (Apply (Foo2Sym1 a0123456789876543210) arg) (Foo2Sym2 a0123456789876543210 arg) =>
+                                 Foo2Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Foo2Sym1 a0123456789876543210) a0123456789876543210 = Foo2Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Foo2Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) Foo2Sym1KindInference) ())
+    type Foo2Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        Foo2 a0123456789876543210 a0123456789876543210 :: a
+    type Foo1Sym0 :: (~>) a ((~>) b a)
+    data Foo1Sym0 a0123456789876543210
+      where
+        Foo1Sym0KindInference :: SameKind (Apply Foo1Sym0 arg) (Foo1Sym1 arg) =>
+                                 Foo1Sym0 a0123456789876543210
+    type instance Apply Foo1Sym0 a0123456789876543210 = Foo1Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo1Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo1Sym0KindInference) ())
+    type Foo1Sym1 :: a -> (~>) b a
+    data Foo1Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Foo1Sym1KindInference :: SameKind (Apply (Foo1Sym1 a0123456789876543210) arg) (Foo1Sym2 a0123456789876543210 arg) =>
+                                 Foo1Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Foo1Sym1 a0123456789876543210) a0123456789876543210 = Foo1Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Foo1Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) Foo1Sym1KindInference) ())
+    type Foo1Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        Foo1 a0123456789876543210 a0123456789876543210 :: a
+    type Foo0Sym0 :: (~>) a ((~>) b a)
+    data Foo0Sym0 a0123456789876543210
+      where
+        Foo0Sym0KindInference :: SameKind (Apply Foo0Sym0 arg) (Foo0Sym1 arg) =>
+                                 Foo0Sym0 a0123456789876543210
+    type instance Apply Foo0Sym0 a0123456789876543210 = Foo0Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo0Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo0Sym0KindInference) ())
+    type Foo0Sym1 :: a -> (~>) b a
+    data Foo0Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Foo0Sym1KindInference :: SameKind (Apply (Foo0Sym1 a0123456789876543210) arg) (Foo0Sym2 a0123456789876543210 arg) =>
+                                 Foo0Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Foo0Sym1 a0123456789876543210) a0123456789876543210 = Foo0Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Foo0Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) Foo0Sym1KindInference) ())
+    type Foo0Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        Foo0 a0123456789876543210 a0123456789876543210 :: a
+    type Foo8 :: Foo a b -> a
+    type family Foo8 a where
+      Foo8 x = Apply (Apply Lambda_0123456789876543210Sym0 x) x
+    type Foo7 :: a -> b -> b
+    type family Foo7 a a where
+      Foo7 x y = Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) y) (Apply (Apply Tuple2Sym0 x) y)
+    type Foo6 :: a -> b -> a
+    type family Foo6 a a where
+      Foo6 a b = Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 a) b) a) b
+    type Foo5 :: a -> b -> b
+    type family Foo5 a a where
+      Foo5 x y = Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) y) y
+    type Foo4 :: a -> b -> c -> a
+    type family Foo4 a a a where
+      Foo4 x y z = Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) y) z) y) z
+    type Foo3 :: a -> a
+    type family Foo3 a where
+      Foo3 x = Apply (Apply Lambda_0123456789876543210Sym0 x) x
+    type Foo2 :: a -> b -> a
+    type family Foo2 a a where
+      Foo2 x y = Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) y) y
+    type Foo1 :: a -> b -> a
+    type family Foo1 a a where
+      Foo1 x a_0123456789876543210 = Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) a_0123456789876543210) a_0123456789876543210
+    type Foo0 :: a -> b -> a
+    type family Foo0 a a where
+      Foo0 a_0123456789876543210 a_0123456789876543210 = Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 a_0123456789876543210) a_0123456789876543210) a_0123456789876543210) a_0123456789876543210
+    sFoo8 ::
+      forall a b (t :: Foo a b). Sing t -> Sing (Apply Foo8Sym0 t :: a)
+    sFoo7 ::
+      forall a b (t :: a) (t :: b).
+      Sing t -> Sing t -> Sing (Apply (Apply Foo7Sym0 t) t :: b)
+    sFoo6 ::
+      forall a b (t :: a) (t :: b).
+      Sing t -> Sing t -> Sing (Apply (Apply Foo6Sym0 t) t :: a)
+    sFoo5 ::
+      forall a b (t :: a) (t :: b).
+      Sing t -> Sing t -> Sing (Apply (Apply Foo5Sym0 t) t :: b)
+    sFoo4 ::
+      forall a b c (t :: a) (t :: b) (t :: c).
+      Sing t
+      -> Sing t
+         -> Sing t -> Sing (Apply (Apply (Apply Foo4Sym0 t) t) t :: a)
+    sFoo3 :: forall a (t :: a). Sing t -> Sing (Apply Foo3Sym0 t :: a)
+    sFoo2 ::
+      forall a b (t :: a) (t :: b).
+      Sing t -> Sing t -> Sing (Apply (Apply Foo2Sym0 t) t :: a)
+    sFoo1 ::
+      forall a b (t :: a) (t :: b).
+      Sing t -> Sing t -> Sing (Apply (Apply Foo1Sym0 t) t :: a)
+    sFoo0 ::
+      forall a b (t :: a) (t :: b).
+      Sing t -> Sing t -> Sing (Apply (Apply Foo0Sym0 t) t :: a)
+    sFoo8 (sX :: Sing x)
+      = (applySing
+           ((singFun1 @(Apply Lambda_0123456789876543210Sym0 x))
+              (\ sArg_0123456789876543210
+                 -> case sArg_0123456789876543210 of {
+                      (_ :: Sing arg_0123456789876543210)
+                        -> (id
+                              @(Sing (Case_0123456789876543210 arg_0123456789876543210 x arg_0123456789876543210)))
+                             (case sArg_0123456789876543210 of {
+                                SFoo (sA :: Sing a) _ -> sA }) })))
+          sX
+    sFoo7 (sX :: Sing x) (sY :: Sing y)
+      = (applySing
+           ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 x) y))
+              (\ sArg_0123456789876543210
+                 -> case sArg_0123456789876543210 of {
+                      (_ :: Sing arg_0123456789876543210)
+                        -> (id
+                              @(Sing (Case_0123456789876543210 arg_0123456789876543210 x y arg_0123456789876543210)))
+                             (case sArg_0123456789876543210 of {
+                                STuple2 _ (sB :: Sing b) -> sB }) })))
+          ((applySing ((applySing ((singFun2 @Tuple2Sym0) STuple2)) sX)) sY)
+    sFoo6 (sA :: Sing a) (sB :: Sing b)
+      = (applySing
+           ((applySing
+               ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 a) b))
+                  (\ sX
+                     -> case sX of {
+                          (_ :: Sing x)
+                            -> (singFun1
+                                  @(Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) a) b))
+                                 (\ sArg_0123456789876543210
+                                    -> case sArg_0123456789876543210 of {
+                                         (_ :: Sing arg_0123456789876543210)
+                                           -> (id
+                                                 @(Sing (Case_0123456789876543210 arg_0123456789876543210 x a b arg_0123456789876543210)))
+                                                (case sArg_0123456789876543210 of {
+                                                   _ -> sX }) }) })))
+              sA))
+          sB
+    sFoo5 (sX :: Sing x) (sY :: Sing y)
+      = (applySing
+           ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 x) y))
+              (\ sX -> case sX of { (_ :: Sing x) -> sX })))
+          sY
+    sFoo4 (sX :: Sing x) (sY :: Sing y) (sZ :: Sing z)
+      = (applySing
+           ((applySing
+               ((singFun2
+                   @(Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) y) z))
+                  (\ sArg_0123456789876543210 sArg_0123456789876543210
+                     -> case
+                            ((,) sArg_0123456789876543210) sArg_0123456789876543210
+                        of {
+                          (,) (_ :: Sing arg_0123456789876543210)
+                              (_ :: Sing arg_0123456789876543210)
+                            -> (id
+                                  @(Sing (Case_0123456789876543210 arg_0123456789876543210 arg_0123456789876543210 x y z (Apply (Apply Tuple2Sym0 arg_0123456789876543210) arg_0123456789876543210))))
+                                 (case
+                                      (applySing
+                                         ((applySing ((singFun2 @Tuple2Sym0) STuple2))
+                                            sArg_0123456789876543210))
+                                        sArg_0123456789876543210
+                                  of {
+                                    STuple2 _ _ -> sX }) })))
+              sY))
+          sZ
+    sFoo3 (sX :: Sing x)
+      = (applySing
+           ((singFun1 @(Apply Lambda_0123456789876543210Sym0 x))
+              (\ sY -> case sY of { (_ :: Sing y) -> sY })))
+          sX
+    sFoo2 (sX :: Sing x) (sY :: Sing y)
+      = (applySing
+           ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 x) y))
+              (\ sArg_0123456789876543210
+                 -> case sArg_0123456789876543210 of {
+                      (_ :: Sing arg_0123456789876543210)
+                        -> (id
+                              @(Sing (Case_0123456789876543210 arg_0123456789876543210 x y arg_0123456789876543210)))
+                             (case sArg_0123456789876543210 of { _ -> sX }) })))
+          sY
+    sFoo1
+      (sX :: Sing x)
+      (sA_0123456789876543210 :: Sing a_0123456789876543210)
+      = (applySing
+           ((singFun1
+               @(Apply (Apply Lambda_0123456789876543210Sym0 x) a_0123456789876543210))
+              (\ sArg_0123456789876543210
+                 -> case sArg_0123456789876543210 of {
+                      (_ :: Sing arg_0123456789876543210)
+                        -> (id
+                              @(Sing (Case_0123456789876543210 arg_0123456789876543210 x a_0123456789876543210 arg_0123456789876543210)))
+                             (case sArg_0123456789876543210 of { _ -> sX }) })))
+          sA_0123456789876543210
+    sFoo0
+      (sA_0123456789876543210 :: Sing a_0123456789876543210)
+      (sA_0123456789876543210 :: Sing a_0123456789876543210)
+      = (applySing
+           ((applySing
+               ((singFun2
+                   @(Apply (Apply Lambda_0123456789876543210Sym0 a_0123456789876543210) a_0123456789876543210))
+                  (\ sX sY
+                     -> case ((,) sX) sY of { (,) (_ :: Sing x) (_ :: Sing y) -> sX })))
+              sA_0123456789876543210))
+          sA_0123456789876543210
+    instance SingI (Foo8Sym0 :: (~>) (Foo a b) a) where
+      sing = (singFun1 @Foo8Sym0) sFoo8
+    instance SingI (Foo7Sym0 :: (~>) a ((~>) b b)) where
+      sing = (singFun2 @Foo7Sym0) sFoo7
+    instance SingI d => SingI (Foo7Sym1 (d :: a) :: (~>) b b) where
+      sing = (singFun1 @(Foo7Sym1 (d :: a))) (sFoo7 (sing @d))
+    instance SingI (Foo6Sym0 :: (~>) a ((~>) b a)) where
+      sing = (singFun2 @Foo6Sym0) sFoo6
+    instance SingI d => SingI (Foo6Sym1 (d :: a) :: (~>) b a) where
+      sing = (singFun1 @(Foo6Sym1 (d :: a))) (sFoo6 (sing @d))
+    instance SingI (Foo5Sym0 :: (~>) a ((~>) b b)) where
+      sing = (singFun2 @Foo5Sym0) sFoo5
+    instance SingI d => SingI (Foo5Sym1 (d :: a) :: (~>) b b) where
+      sing = (singFun1 @(Foo5Sym1 (d :: a))) (sFoo5 (sing @d))
+    instance SingI (Foo4Sym0 :: (~>) a ((~>) b ((~>) c a))) where
+      sing = (singFun3 @Foo4Sym0) sFoo4
+    instance SingI d =>
+             SingI (Foo4Sym1 (d :: a) :: (~>) b ((~>) c a)) where
+      sing = (singFun2 @(Foo4Sym1 (d :: a))) (sFoo4 (sing @d))
+    instance (SingI d, SingI d) =>
+             SingI (Foo4Sym2 (d :: a) (d :: b) :: (~>) c a) where
+      sing
+        = (singFun1 @(Foo4Sym2 (d :: a) (d :: b)))
+            ((sFoo4 (sing @d)) (sing @d))
+    instance SingI (Foo3Sym0 :: (~>) a a) where
+      sing = (singFun1 @Foo3Sym0) sFoo3
+    instance SingI (Foo2Sym0 :: (~>) a ((~>) b a)) where
+      sing = (singFun2 @Foo2Sym0) sFoo2
+    instance SingI d => SingI (Foo2Sym1 (d :: a) :: (~>) b a) where
+      sing = (singFun1 @(Foo2Sym1 (d :: a))) (sFoo2 (sing @d))
+    instance SingI (Foo1Sym0 :: (~>) a ((~>) b a)) where
+      sing = (singFun2 @Foo1Sym0) sFoo1
+    instance SingI d => SingI (Foo1Sym1 (d :: a) :: (~>) b a) where
+      sing = (singFun1 @(Foo1Sym1 (d :: a))) (sFoo1 (sing @d))
+    instance SingI (Foo0Sym0 :: (~>) a ((~>) b a)) where
+      sing = (singFun2 @Foo0Sym0) sFoo0
+    instance SingI d => SingI (Foo0Sym1 (d :: a) :: (~>) b a) where
+      sing = (singFun1 @(Foo0Sym1 (d :: a))) (sFoo0 (sing @d))
+    data SFoo :: forall a b. Foo a b -> GHC.Types.Type
+      where
+        SFoo :: forall a b (n :: a) (n :: b).
+                (Sing n) -> (Sing n) -> SFoo (Foo n n :: Foo a b)
+    type instance Sing @(Foo a b) = SFoo
+    instance (SingKind a, SingKind b) => SingKind (Foo a b) where
+      type Demote (Foo a b) = Foo (Demote a) (Demote b)
+      fromSing (SFoo b b) = (Foo (fromSing b)) (fromSing b)
+      toSing (Foo (b :: Demote a) (b :: Demote b))
+        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b) of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SFoo c) c) }
+    instance (SingI n, SingI n) => SingI (Foo (n :: a) (n :: b)) where
+      sing = (SFoo sing) sing
+    instance SingI (FooSym0 :: (~>) a ((~>) b (Foo a b))) where
+      sing = (singFun2 @FooSym0) SFoo
+    instance SingI d =>
+             SingI (FooSym1 (d :: a) :: (~>) b (Foo a b)) where
+      sing = (singFun1 @(FooSym1 (d :: a))) (SFoo (sing @d))
diff --git a/tests/compile-and-dump/Singletons/LambdasComprehensive.ghc88.template b/tests/compile-and-dump/Singletons/LambdasComprehensive.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/LambdasComprehensive.ghc88.template
+++ /dev/null
@@ -1,71 +0,0 @@
-Singletons/LambdasComprehensive.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| foo :: [Nat]
-          foo
-            = map (\ x -> either_ pred Succ x) [Left Zero, Right (Succ Zero)]
-          bar :: [Nat]
-          bar = map (either_ pred Succ) [Left Zero, Right (Succ Zero)] |]
-  ======>
-    foo :: [Nat]
-    foo
-      = (map (\ x -> ((either_ pred) Succ) x))
-          [Left Zero, Right (Succ Zero)]
-    bar :: [Nat]
-    bar = (map ((either_ pred) Succ)) [Left Zero, Right (Succ Zero)]
-    type family Lambda_0123456789876543210 t where
-      Lambda_0123456789876543210 x = Apply (Apply (Apply Either_Sym0 PredSym0) SuccSym0) x
-    type Lambda_0123456789876543210Sym1 t0123456789876543210 =
-        Lambda_0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall t0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 t0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 t0123456789876543210 = Lambda_0123456789876543210 t0123456789876543210
-    type BarSym0 = Bar
-    type FooSym0 = Foo
-    type family Bar :: [Nat] where
-      Bar = Apply (Apply MapSym0 (Apply (Apply Either_Sym0 PredSym0) SuccSym0)) (Apply (Apply (:@#@$) (Apply LeftSym0 ZeroSym0)) (Apply (Apply (:@#@$) (Apply RightSym0 (Apply SuccSym0 ZeroSym0))) '[]))
-    type family Foo :: [Nat] where
-      Foo = Apply (Apply MapSym0 Lambda_0123456789876543210Sym0) (Apply (Apply (:@#@$) (Apply LeftSym0 ZeroSym0)) (Apply (Apply (:@#@$) (Apply RightSym0 (Apply SuccSym0 ZeroSym0))) '[]))
-    sBar :: Sing (BarSym0 :: [Nat])
-    sFoo :: Sing (FooSym0 :: [Nat])
-    sBar
-      = (applySing
-           ((applySing ((singFun2 @MapSym0) sMap))
-              ((applySing
-                  ((applySing ((singFun3 @Either_Sym0) sEither_))
-                     ((singFun1 @PredSym0) sPred)))
-                 ((singFun1 @SuccSym0) SSucc))))
-          ((applySing
-              ((applySing ((singFun2 @(:@#@$)) SCons))
-                 ((applySing ((singFun1 @LeftSym0) SLeft)) SZero)))
-             ((applySing
-                 ((applySing ((singFun2 @(:@#@$)) SCons))
-                    ((applySing ((singFun1 @RightSym0) SRight))
-                       ((applySing ((singFun1 @SuccSym0) SSucc)) SZero))))
-                SNil))
-    sFoo
-      = (applySing
-           ((applySing ((singFun2 @MapSym0) sMap))
-              ((singFun1 @Lambda_0123456789876543210Sym0)
-                 (\ sX
-                    -> case sX of {
-                         (_ :: Sing x)
-                           -> (applySing
-                                 ((applySing
-                                     ((applySing ((singFun3 @Either_Sym0) sEither_))
-                                        ((singFun1 @PredSym0) sPred)))
-                                    ((singFun1 @SuccSym0) SSucc)))
-                                sX }))))
-          ((applySing
-              ((applySing ((singFun2 @(:@#@$)) SCons))
-                 ((applySing ((singFun1 @LeftSym0) SLeft)) SZero)))
-             ((applySing
-                 ((applySing ((singFun2 @(:@#@$)) SCons))
-                    ((applySing ((singFun1 @RightSym0) SRight))
-                       ((applySing ((singFun1 @SuccSym0) SSucc)) SZero))))
-                SNil))
diff --git a/tests/compile-and-dump/Singletons/LambdasComprehensive.golden b/tests/compile-and-dump/Singletons/LambdasComprehensive.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/LambdasComprehensive.golden
@@ -0,0 +1,72 @@
+Singletons/LambdasComprehensive.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| foo :: [Nat]
+          foo
+            = map (\ x -> either_ pred Succ x) [Left Zero, Right (Succ Zero)]
+          bar :: [Nat]
+          bar = map (either_ pred Succ) [Left Zero, Right (Succ Zero)] |]
+  ======>
+    foo :: [Nat]
+    foo
+      = (map (\ x -> ((either_ pred) Succ) x))
+          [Left Zero, Right (Succ Zero)]
+    bar :: [Nat]
+    bar = (map ((either_ pred) Succ)) [Left Zero, Right (Succ Zero)]
+    type family Lambda_0123456789876543210 x where
+      Lambda_0123456789876543210 x = Apply (Apply (Apply Either_Sym0 PredSym0) SuccSym0) x
+    data Lambda_0123456789876543210Sym0 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    type Lambda_0123456789876543210Sym1 x0123456789876543210 =
+        Lambda_0123456789876543210 x0123456789876543210
+    type BarSym0 = Bar :: [Nat]
+    type FooSym0 = Foo :: [Nat]
+    type Bar :: [Nat]
+    type family Bar where
+      Bar = Apply (Apply MapSym0 (Apply (Apply Either_Sym0 PredSym0) SuccSym0)) (Apply (Apply (:@#@$) (Apply LeftSym0 ZeroSym0)) (Apply (Apply (:@#@$) (Apply RightSym0 (Apply SuccSym0 ZeroSym0))) NilSym0))
+    type Foo :: [Nat]
+    type family Foo where
+      Foo = Apply (Apply MapSym0 Lambda_0123456789876543210Sym0) (Apply (Apply (:@#@$) (Apply LeftSym0 ZeroSym0)) (Apply (Apply (:@#@$) (Apply RightSym0 (Apply SuccSym0 ZeroSym0))) NilSym0))
+    sBar :: Sing (BarSym0 :: [Nat])
+    sFoo :: Sing (FooSym0 :: [Nat])
+    sBar
+      = (applySing
+           ((applySing ((singFun2 @MapSym0) sMap))
+              ((applySing
+                  ((applySing ((singFun3 @Either_Sym0) sEither_))
+                     ((singFun1 @PredSym0) sPred)))
+                 ((singFun1 @SuccSym0) SSucc))))
+          ((applySing
+              ((applySing ((singFun2 @(:@#@$)) SCons))
+                 ((applySing ((singFun1 @LeftSym0) SLeft)) SZero)))
+             ((applySing
+                 ((applySing ((singFun2 @(:@#@$)) SCons))
+                    ((applySing ((singFun1 @RightSym0) SRight))
+                       ((applySing ((singFun1 @SuccSym0) SSucc)) SZero))))
+                SNil))
+    sFoo
+      = (applySing
+           ((applySing ((singFun2 @MapSym0) sMap))
+              ((singFun1 @Lambda_0123456789876543210Sym0)
+                 (\ sX
+                    -> case sX of {
+                         (_ :: Sing x)
+                           -> (applySing
+                                 ((applySing
+                                     ((applySing ((singFun3 @Either_Sym0) sEither_))
+                                        ((singFun1 @PredSym0) sPred)))
+                                    ((singFun1 @SuccSym0) SSucc)))
+                                sX }))))
+          ((applySing
+              ((applySing ((singFun2 @(:@#@$)) SCons))
+                 ((applySing ((singFun1 @LeftSym0) SLeft)) SZero)))
+             ((applySing
+                 ((applySing ((singFun2 @(:@#@$)) SCons))
+                    ((applySing ((singFun1 @RightSym0) SRight))
+                       ((applySing ((singFun1 @SuccSym0) SSucc)) SZero))))
+                SNil))
diff --git a/tests/compile-and-dump/Singletons/LetStatements.ghc88.template b/tests/compile-and-dump/Singletons/LetStatements.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/LetStatements.ghc88.template
+++ /dev/null
@@ -1,1004 +0,0 @@
-Singletons/LetStatements.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| foo1 :: Nat -> Nat
-          foo1 x
-            = let
-                y :: Nat
-                y = Succ Zero
-              in y
-          foo2 :: Nat
-          foo2
-            = let
-                y = Succ Zero
-                z = Succ y
-              in z
-          foo3 :: Nat -> Nat
-          foo3 x
-            = let
-                y :: Nat
-                y = Succ x
-              in y
-          foo4 :: Nat -> Nat
-          foo4 x
-            = let
-                f :: Nat -> Nat
-                f y = Succ y
-              in f x
-          foo5 :: Nat -> Nat
-          foo5 x
-            = let
-                f :: Nat -> Nat
-                f y
-                  = let
-                      z :: Nat
-                      z = Succ y
-                    in Succ z
-              in f x
-          foo6 :: Nat -> Nat
-          foo6 x
-            = let
-                f :: Nat -> Nat
-                f y = Succ y in
-              let
-                z :: Nat
-                z = f x
-              in z
-          foo7 :: Nat -> Nat
-          foo7 x
-            = let
-                x :: Nat
-                x = Zero
-              in x
-          foo8 :: Nat -> Nat
-          foo8 x
-            = let
-                z :: Nat
-                z = (\ x -> x) Zero
-              in z
-          foo9 :: Nat -> Nat
-          foo9 x
-            = let
-                z :: Nat -> Nat
-                z = (\ x -> x)
-              in z x
-          foo10 :: Nat -> Nat
-          foo10 x
-            = let
-                (+) :: Nat -> Nat -> Nat
-                Zero + m = m
-                (Succ n) + m = Succ (n + m)
-              in (Succ Zero) + x
-          foo11 :: Nat -> Nat
-          foo11 x
-            = let
-                (+) :: Nat -> Nat -> Nat
-                Zero + m = m
-                (Succ n) + m = Succ (n + m)
-                z :: Nat
-                z = x
-              in (Succ Zero) + z
-          foo12 :: Nat -> Nat
-          foo12 x
-            = let
-                (+) :: Nat -> Nat -> Nat
-                Zero + m = m
-                (Succ n) + m = Succ (n + x)
-              in x + (Succ (Succ Zero))
-          foo13 :: forall a. a -> a
-          foo13 x
-            = let
-                bar :: a
-                bar = x
-              in foo13_ bar
-          foo13_ :: a -> a
-          foo13_ y = y
-          foo14 :: Nat -> (Nat, Nat)
-          foo14 x = let (y, z) = (Succ x, x) in (z, y) |]
-  ======>
-    foo1 :: Nat -> Nat
-    foo1 x
-      = let
-          y :: Nat
-          y = Succ Zero
-        in y
-    foo2 :: Nat
-    foo2
-      = let
-          y = Succ Zero
-          z = Succ y
-        in z
-    foo3 :: Nat -> Nat
-    foo3 x
-      = let
-          y :: Nat
-          y = Succ x
-        in y
-    foo4 :: Nat -> Nat
-    foo4 x
-      = let
-          f :: Nat -> Nat
-          f y = Succ y
-        in f x
-    foo5 :: Nat -> Nat
-    foo5 x
-      = let
-          f :: Nat -> Nat
-          f y
-            = let
-                z :: Nat
-                z = Succ y
-              in Succ z
-        in f x
-    foo6 :: Nat -> Nat
-    foo6 x
-      = let
-          f :: Nat -> Nat
-          f y = Succ y in
-        let
-          z :: Nat
-          z = f x
-        in z
-    foo7 :: Nat -> Nat
-    foo7 x
-      = let
-          x :: Nat
-          x = Zero
-        in x
-    foo8 :: Nat -> Nat
-    foo8 x
-      = let
-          z :: Nat
-          z = (\ x -> x) Zero
-        in z
-    foo9 :: Nat -> Nat
-    foo9 x
-      = let
-          z :: Nat -> Nat
-          z = \ x -> x
-        in z x
-    foo10 :: Nat -> Nat
-    foo10 x
-      = let
-          (+) :: Nat -> Nat -> Nat
-          (+) Zero m = m
-          (+) (Succ n) m = Succ (n + m)
-        in (Succ Zero + x)
-    foo11 :: Nat -> Nat
-    foo11 x
-      = let
-          (+) :: Nat -> Nat -> Nat
-          z :: Nat
-          (+) Zero m = m
-          (+) (Succ n) m = Succ (n + m)
-          z = x
-        in (Succ Zero + z)
-    foo12 :: Nat -> Nat
-    foo12 x
-      = let
-          (+) :: Nat -> Nat -> Nat
-          (+) Zero m = m
-          (+) (Succ n) m = Succ (n + x)
-        in (x + Succ (Succ Zero))
-    foo13 :: forall a. a -> a
-    foo13 x
-      = let
-          bar :: a
-          bar = x
-        in foo13_ bar
-    foo13_ :: a -> a
-    foo13_ y = y
-    foo14 :: Nat -> (Nat, Nat)
-    foo14 x = let (y, z) = (Succ x, x) in (z, y)
-    type family Case_0123456789876543210 x t where
-      Case_0123456789876543210 x '(_,
-                                   y_0123456789876543210) = y_0123456789876543210
-    type family Case_0123456789876543210 x t where
-      Case_0123456789876543210 x '(y_0123456789876543210,
-                                   _) = y_0123456789876543210
-    type Let0123456789876543210ZSym1 x0123456789876543210 =
-        Let0123456789876543210Z x0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210ZSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210ZSym0KindInference) ())
-    data Let0123456789876543210ZSym0 x0123456789876543210
-      where
-        Let0123456789876543210ZSym0KindInference :: forall x0123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210ZSym0 arg) (Let0123456789876543210ZSym1 arg) =>
-                                                    Let0123456789876543210ZSym0 x0123456789876543210
-    type instance Apply Let0123456789876543210ZSym0 x0123456789876543210 = Let0123456789876543210Z x0123456789876543210
-    type Let0123456789876543210YSym1 x0123456789876543210 =
-        Let0123456789876543210Y x0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210YSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210YSym0KindInference) ())
-    data Let0123456789876543210YSym0 x0123456789876543210
-      where
-        Let0123456789876543210YSym0KindInference :: forall x0123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210YSym0 arg) (Let0123456789876543210YSym1 arg) =>
-                                                    Let0123456789876543210YSym0 x0123456789876543210
-    type instance Apply Let0123456789876543210YSym0 x0123456789876543210 = Let0123456789876543210Y x0123456789876543210
-    type Let0123456789876543210X_0123456789876543210Sym1 x0123456789876543210 =
-        Let0123456789876543210X_0123456789876543210 x0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210X_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd
-            (((,) Let0123456789876543210X_0123456789876543210Sym0KindInference)
-               ())
-    data Let0123456789876543210X_0123456789876543210Sym0 x0123456789876543210
-      where
-        Let0123456789876543210X_0123456789876543210Sym0KindInference :: forall x0123456789876543210
-                                                                               arg. SameKind (Apply Let0123456789876543210X_0123456789876543210Sym0 arg) (Let0123456789876543210X_0123456789876543210Sym1 arg) =>
-                                                                        Let0123456789876543210X_0123456789876543210Sym0 x0123456789876543210
-    type instance Apply Let0123456789876543210X_0123456789876543210Sym0 x0123456789876543210 = Let0123456789876543210X_0123456789876543210 x0123456789876543210
-    type family Let0123456789876543210Z x where
-      Let0123456789876543210Z x = Case_0123456789876543210 x (Let0123456789876543210X_0123456789876543210Sym1 x)
-    type family Let0123456789876543210Y x where
-      Let0123456789876543210Y x = Case_0123456789876543210 x (Let0123456789876543210X_0123456789876543210Sym1 x)
-    type family Let0123456789876543210X_0123456789876543210 x where
-      Let0123456789876543210X_0123456789876543210 x = Apply (Apply Tuple2Sym0 (Apply SuccSym0 x)) x
-    type Let0123456789876543210BarSym1 x0123456789876543210 =
-        Let0123456789876543210Bar x0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210BarSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210BarSym0KindInference) ())
-    data Let0123456789876543210BarSym0 x0123456789876543210
-      where
-        Let0123456789876543210BarSym0KindInference :: forall x0123456789876543210
-                                                             arg. SameKind (Apply Let0123456789876543210BarSym0 arg) (Let0123456789876543210BarSym1 arg) =>
-                                                      Let0123456789876543210BarSym0 x0123456789876543210
-    type instance Apply Let0123456789876543210BarSym0 x0123456789876543210 = Let0123456789876543210Bar x0123456789876543210
-    type family Let0123456789876543210Bar x :: a where
-      Let0123456789876543210Bar x = x
-    type (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$$) x0123456789876543210 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
-        (<<<%%%%%%%%%%%%%%%%%%%%) x0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) a0123456789876543210 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$$###)) ())
-    data (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 (a0123456789876543210 :: Nat) :: (~>) Nat Nat
-      where
-        (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$$###) :: forall x0123456789876543210
-                                                      a0123456789876543210
-                                                      a0123456789876543210
-                                                      arg. SameKind (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210) arg) ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$$) x0123456789876543210 a0123456789876543210 arg) =>
-                                               (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) a0123456789876543210 x0123456789876543210) a0123456789876543210 = (<<<%%%%%%%%%%%%%%%%%%%%) a0123456789876543210 x0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$###)) ())
-    data (<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210 :: (~>) Nat ((~>) Nat Nat)
-      where
-        (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$###) :: forall x0123456789876543210
-                                                     a0123456789876543210
-                                                     arg. SameKind (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210) arg) ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 arg) =>
-                                              (<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210 a0123456789876543210
-    type instance Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210) a0123456789876543210 = (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (<<<%%%%%%%%%%%%%%%%%%%%@#@$) where
-      suppressUnusedWarnings
-        = snd (((,) (:<<<%%%%%%%%%%%%%%%%%%%%@#@$###)) ())
-    data (<<<%%%%%%%%%%%%%%%%%%%%@#@$) x0123456789876543210
-      where
-        (:<<<%%%%%%%%%%%%%%%%%%%%@#@$###) :: forall x0123456789876543210
-                                                    arg. SameKind (Apply (<<<%%%%%%%%%%%%%%%%%%%%@#@$) arg) ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) arg) =>
-                                             (<<<%%%%%%%%%%%%%%%%%%%%@#@$) x0123456789876543210
-    type instance Apply (<<<%%%%%%%%%%%%%%%%%%%%@#@$) x0123456789876543210 = (<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210
-    type family (<<<%%%%%%%%%%%%%%%%%%%%) x (a :: Nat) (a :: Nat) :: Nat where
-      (<<<%%%%%%%%%%%%%%%%%%%%) x 'Zero m = m
-      (<<<%%%%%%%%%%%%%%%%%%%%) x ('Succ n) m = Apply SuccSym0 (Apply (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x) n) x)
-    type Let0123456789876543210ZSym1 x0123456789876543210 =
-        Let0123456789876543210Z x0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210ZSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210ZSym0KindInference) ())
-    data Let0123456789876543210ZSym0 x0123456789876543210
-      where
-        Let0123456789876543210ZSym0KindInference :: forall x0123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210ZSym0 arg) (Let0123456789876543210ZSym1 arg) =>
-                                                    Let0123456789876543210ZSym0 x0123456789876543210
-    type instance Apply Let0123456789876543210ZSym0 x0123456789876543210 = Let0123456789876543210Z x0123456789876543210
-    type (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$$) x0123456789876543210 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
-        (<<<%%%%%%%%%%%%%%%%%%%%) x0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) a0123456789876543210 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$$###)) ())
-    data (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 (a0123456789876543210 :: Nat) :: (~>) Nat Nat
-      where
-        (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$$###) :: forall x0123456789876543210
-                                                      a0123456789876543210
-                                                      a0123456789876543210
-                                                      arg. SameKind (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210) arg) ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$$) x0123456789876543210 a0123456789876543210 arg) =>
-                                               (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) a0123456789876543210 x0123456789876543210) a0123456789876543210 = (<<<%%%%%%%%%%%%%%%%%%%%) a0123456789876543210 x0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$###)) ())
-    data (<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210 :: (~>) Nat ((~>) Nat Nat)
-      where
-        (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$###) :: forall x0123456789876543210
-                                                     a0123456789876543210
-                                                     arg. SameKind (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210) arg) ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 arg) =>
-                                              (<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210 a0123456789876543210
-    type instance Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210) a0123456789876543210 = (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (<<<%%%%%%%%%%%%%%%%%%%%@#@$) where
-      suppressUnusedWarnings
-        = snd (((,) (:<<<%%%%%%%%%%%%%%%%%%%%@#@$###)) ())
-    data (<<<%%%%%%%%%%%%%%%%%%%%@#@$) x0123456789876543210
-      where
-        (:<<<%%%%%%%%%%%%%%%%%%%%@#@$###) :: forall x0123456789876543210
-                                                    arg. SameKind (Apply (<<<%%%%%%%%%%%%%%%%%%%%@#@$) arg) ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) arg) =>
-                                             (<<<%%%%%%%%%%%%%%%%%%%%@#@$) x0123456789876543210
-    type instance Apply (<<<%%%%%%%%%%%%%%%%%%%%@#@$) x0123456789876543210 = (<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210
-    type family Let0123456789876543210Z x :: Nat where
-      Let0123456789876543210Z x = x
-    type family (<<<%%%%%%%%%%%%%%%%%%%%) x (a :: Nat) (a :: Nat) :: Nat where
-      (<<<%%%%%%%%%%%%%%%%%%%%) x 'Zero m = m
-      (<<<%%%%%%%%%%%%%%%%%%%%) x ('Succ n) m = Apply SuccSym0 (Apply (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x) n) m)
-    type (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$$) x0123456789876543210 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
-        (<<<%%%%%%%%%%%%%%%%%%%%) x0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) a0123456789876543210 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$$###)) ())
-    data (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 (a0123456789876543210 :: Nat) :: (~>) Nat Nat
-      where
-        (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$$###) :: forall x0123456789876543210
-                                                      a0123456789876543210
-                                                      a0123456789876543210
-                                                      arg. SameKind (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210) arg) ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$$) x0123456789876543210 a0123456789876543210 arg) =>
-                                               (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) a0123456789876543210 x0123456789876543210) a0123456789876543210 = (<<<%%%%%%%%%%%%%%%%%%%%) a0123456789876543210 x0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$###)) ())
-    data (<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210 :: (~>) Nat ((~>) Nat Nat)
-      where
-        (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$###) :: forall x0123456789876543210
-                                                     a0123456789876543210
-                                                     arg. SameKind (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210) arg) ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 arg) =>
-                                              (<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210 a0123456789876543210
-    type instance Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210) a0123456789876543210 = (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (<<<%%%%%%%%%%%%%%%%%%%%@#@$) where
-      suppressUnusedWarnings
-        = snd (((,) (:<<<%%%%%%%%%%%%%%%%%%%%@#@$###)) ())
-    data (<<<%%%%%%%%%%%%%%%%%%%%@#@$) x0123456789876543210
-      where
-        (:<<<%%%%%%%%%%%%%%%%%%%%@#@$###) :: forall x0123456789876543210
-                                                    arg. SameKind (Apply (<<<%%%%%%%%%%%%%%%%%%%%@#@$) arg) ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) arg) =>
-                                             (<<<%%%%%%%%%%%%%%%%%%%%@#@$) x0123456789876543210
-    type instance Apply (<<<%%%%%%%%%%%%%%%%%%%%@#@$) x0123456789876543210 = (<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210
-    type family (<<<%%%%%%%%%%%%%%%%%%%%) x (a :: Nat) (a :: Nat) :: Nat where
-      (<<<%%%%%%%%%%%%%%%%%%%%) x 'Zero m = m
-      (<<<%%%%%%%%%%%%%%%%%%%%) x ('Succ n) m = Apply SuccSym0 (Apply (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x) n) m)
-    type family Lambda_0123456789876543210 a_0123456789876543210 x t where
-      Lambda_0123456789876543210 a_0123456789876543210 x x = x
-    type Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 x0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 a_01234567898765432100123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 x0123456789876543210 a_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 x0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall a_01234567898765432100123456789876543210
-                                                              x0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 x0123456789876543210) arg) (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 x0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 x0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 a_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 x0123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210 x0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall a_01234567898765432100123456789876543210
-                                                              x0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210 x0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) x0123456789876543210 = Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 x0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210
-    type Let0123456789876543210ZSym2 x0123456789876543210 (a0123456789876543210 :: Nat) =
-        Let0123456789876543210Z x0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210ZSym1 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210ZSym1KindInference) ())
-    data Let0123456789876543210ZSym1 x0123456789876543210 :: (~>) Nat Nat
-      where
-        Let0123456789876543210ZSym1KindInference :: forall x0123456789876543210
-                                                           a0123456789876543210
-                                                           arg. SameKind (Apply (Let0123456789876543210ZSym1 x0123456789876543210) arg) (Let0123456789876543210ZSym2 x0123456789876543210 arg) =>
-                                                    Let0123456789876543210ZSym1 x0123456789876543210 a0123456789876543210
-    type instance Apply (Let0123456789876543210ZSym1 x0123456789876543210) a0123456789876543210 = Let0123456789876543210Z x0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210ZSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210ZSym0KindInference) ())
-    data Let0123456789876543210ZSym0 x0123456789876543210
-      where
-        Let0123456789876543210ZSym0KindInference :: forall x0123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210ZSym0 arg) (Let0123456789876543210ZSym1 arg) =>
-                                                    Let0123456789876543210ZSym0 x0123456789876543210
-    type instance Apply Let0123456789876543210ZSym0 x0123456789876543210 = Let0123456789876543210ZSym1 x0123456789876543210
-    type family Let0123456789876543210Z x (a :: Nat) :: Nat where
-      Let0123456789876543210Z x a_0123456789876543210 = Apply (Apply (Apply Lambda_0123456789876543210Sym0 a_0123456789876543210) x) a_0123456789876543210
-    type family Lambda_0123456789876543210 x t where
-      Lambda_0123456789876543210 x x = x
-    type Lambda_0123456789876543210Sym2 x0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 x0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall x0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 x0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall x0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
-    type Let0123456789876543210ZSym1 x0123456789876543210 =
-        Let0123456789876543210Z x0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210ZSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210ZSym0KindInference) ())
-    data Let0123456789876543210ZSym0 x0123456789876543210
-      where
-        Let0123456789876543210ZSym0KindInference :: forall x0123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210ZSym0 arg) (Let0123456789876543210ZSym1 arg) =>
-                                                    Let0123456789876543210ZSym0 x0123456789876543210
-    type instance Apply Let0123456789876543210ZSym0 x0123456789876543210 = Let0123456789876543210Z x0123456789876543210
-    type family Let0123456789876543210Z x :: Nat where
-      Let0123456789876543210Z x = Apply (Apply Lambda_0123456789876543210Sym0 x) ZeroSym0
-    type Let0123456789876543210XSym1 x0123456789876543210 =
-        Let0123456789876543210X x0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210XSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210XSym0KindInference) ())
-    data Let0123456789876543210XSym0 x0123456789876543210
-      where
-        Let0123456789876543210XSym0KindInference :: forall x0123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210XSym0 arg) (Let0123456789876543210XSym1 arg) =>
-                                                    Let0123456789876543210XSym0 x0123456789876543210
-    type instance Apply Let0123456789876543210XSym0 x0123456789876543210 = Let0123456789876543210X x0123456789876543210
-    type family Let0123456789876543210X x :: Nat where
-      Let0123456789876543210X x = ZeroSym0
-    type Let0123456789876543210FSym2 x0123456789876543210 (a0123456789876543210 :: Nat) =
-        Let0123456789876543210F x0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210FSym1 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210FSym1KindInference) ())
-    data Let0123456789876543210FSym1 x0123456789876543210 :: (~>) Nat Nat
-      where
-        Let0123456789876543210FSym1KindInference :: forall x0123456789876543210
-                                                           a0123456789876543210
-                                                           arg. SameKind (Apply (Let0123456789876543210FSym1 x0123456789876543210) arg) (Let0123456789876543210FSym2 x0123456789876543210 arg) =>
-                                                    Let0123456789876543210FSym1 x0123456789876543210 a0123456789876543210
-    type instance Apply (Let0123456789876543210FSym1 x0123456789876543210) a0123456789876543210 = Let0123456789876543210F x0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210FSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210FSym0KindInference) ())
-    data Let0123456789876543210FSym0 x0123456789876543210
-      where
-        Let0123456789876543210FSym0KindInference :: forall x0123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210FSym0 arg) (Let0123456789876543210FSym1 arg) =>
-                                                    Let0123456789876543210FSym0 x0123456789876543210
-    type instance Apply Let0123456789876543210FSym0 x0123456789876543210 = Let0123456789876543210FSym1 x0123456789876543210
-    type family Let0123456789876543210F x (a :: Nat) :: Nat where
-      Let0123456789876543210F x y = Apply SuccSym0 y
-    type Let0123456789876543210ZSym1 x0123456789876543210 =
-        Let0123456789876543210Z x0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210ZSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210ZSym0KindInference) ())
-    data Let0123456789876543210ZSym0 x0123456789876543210
-      where
-        Let0123456789876543210ZSym0KindInference :: forall x0123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210ZSym0 arg) (Let0123456789876543210ZSym1 arg) =>
-                                                    Let0123456789876543210ZSym0 x0123456789876543210
-    type instance Apply Let0123456789876543210ZSym0 x0123456789876543210 = Let0123456789876543210Z x0123456789876543210
-    type family Let0123456789876543210Z x :: Nat where
-      Let0123456789876543210Z x = Apply (Let0123456789876543210FSym1 x) x
-    type Let0123456789876543210ZSym2 y0123456789876543210 x0123456789876543210 =
-        Let0123456789876543210Z y0123456789876543210 x0123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210ZSym1 y0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210ZSym1KindInference) ())
-    data Let0123456789876543210ZSym1 y0123456789876543210 x0123456789876543210
-      where
-        Let0123456789876543210ZSym1KindInference :: forall y0123456789876543210
-                                                           x0123456789876543210
-                                                           arg. SameKind (Apply (Let0123456789876543210ZSym1 y0123456789876543210) arg) (Let0123456789876543210ZSym2 y0123456789876543210 arg) =>
-                                                    Let0123456789876543210ZSym1 y0123456789876543210 x0123456789876543210
-    type instance Apply (Let0123456789876543210ZSym1 y0123456789876543210) x0123456789876543210 = Let0123456789876543210Z y0123456789876543210 x0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210ZSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210ZSym0KindInference) ())
-    data Let0123456789876543210ZSym0 y0123456789876543210
-      where
-        Let0123456789876543210ZSym0KindInference :: forall y0123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210ZSym0 arg) (Let0123456789876543210ZSym1 arg) =>
-                                                    Let0123456789876543210ZSym0 y0123456789876543210
-    type instance Apply Let0123456789876543210ZSym0 y0123456789876543210 = Let0123456789876543210ZSym1 y0123456789876543210
-    type family Let0123456789876543210Z y x :: Nat where
-      Let0123456789876543210Z y x = Apply SuccSym0 y
-    type Let0123456789876543210FSym2 x0123456789876543210 (a0123456789876543210 :: Nat) =
-        Let0123456789876543210F x0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210FSym1 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210FSym1KindInference) ())
-    data Let0123456789876543210FSym1 x0123456789876543210 :: (~>) Nat Nat
-      where
-        Let0123456789876543210FSym1KindInference :: forall x0123456789876543210
-                                                           a0123456789876543210
-                                                           arg. SameKind (Apply (Let0123456789876543210FSym1 x0123456789876543210) arg) (Let0123456789876543210FSym2 x0123456789876543210 arg) =>
-                                                    Let0123456789876543210FSym1 x0123456789876543210 a0123456789876543210
-    type instance Apply (Let0123456789876543210FSym1 x0123456789876543210) a0123456789876543210 = Let0123456789876543210F x0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210FSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210FSym0KindInference) ())
-    data Let0123456789876543210FSym0 x0123456789876543210
-      where
-        Let0123456789876543210FSym0KindInference :: forall x0123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210FSym0 arg) (Let0123456789876543210FSym1 arg) =>
-                                                    Let0123456789876543210FSym0 x0123456789876543210
-    type instance Apply Let0123456789876543210FSym0 x0123456789876543210 = Let0123456789876543210FSym1 x0123456789876543210
-    type family Let0123456789876543210F x (a :: Nat) :: Nat where
-      Let0123456789876543210F x y = Apply SuccSym0 (Let0123456789876543210ZSym2 y x)
-    type Let0123456789876543210FSym2 x0123456789876543210 (a0123456789876543210 :: Nat) =
-        Let0123456789876543210F x0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210FSym1 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210FSym1KindInference) ())
-    data Let0123456789876543210FSym1 x0123456789876543210 :: (~>) Nat Nat
-      where
-        Let0123456789876543210FSym1KindInference :: forall x0123456789876543210
-                                                           a0123456789876543210
-                                                           arg. SameKind (Apply (Let0123456789876543210FSym1 x0123456789876543210) arg) (Let0123456789876543210FSym2 x0123456789876543210 arg) =>
-                                                    Let0123456789876543210FSym1 x0123456789876543210 a0123456789876543210
-    type instance Apply (Let0123456789876543210FSym1 x0123456789876543210) a0123456789876543210 = Let0123456789876543210F x0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210FSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210FSym0KindInference) ())
-    data Let0123456789876543210FSym0 x0123456789876543210
-      where
-        Let0123456789876543210FSym0KindInference :: forall x0123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210FSym0 arg) (Let0123456789876543210FSym1 arg) =>
-                                                    Let0123456789876543210FSym0 x0123456789876543210
-    type instance Apply Let0123456789876543210FSym0 x0123456789876543210 = Let0123456789876543210FSym1 x0123456789876543210
-    type family Let0123456789876543210F x (a :: Nat) :: Nat where
-      Let0123456789876543210F x y = Apply SuccSym0 y
-    type Let0123456789876543210YSym1 x0123456789876543210 =
-        Let0123456789876543210Y x0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210YSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210YSym0KindInference) ())
-    data Let0123456789876543210YSym0 x0123456789876543210
-      where
-        Let0123456789876543210YSym0KindInference :: forall x0123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210YSym0 arg) (Let0123456789876543210YSym1 arg) =>
-                                                    Let0123456789876543210YSym0 x0123456789876543210
-    type instance Apply Let0123456789876543210YSym0 x0123456789876543210 = Let0123456789876543210Y x0123456789876543210
-    type family Let0123456789876543210Y x :: Nat where
-      Let0123456789876543210Y x = Apply SuccSym0 x
-    type Let0123456789876543210ZSym0 = Let0123456789876543210Z
-    type Let0123456789876543210YSym0 = Let0123456789876543210Y
-    type family Let0123456789876543210Z where
-      Let0123456789876543210Z = Apply SuccSym0 Let0123456789876543210YSym0
-    type family Let0123456789876543210Y where
-      Let0123456789876543210Y = Apply SuccSym0 ZeroSym0
-    type Let0123456789876543210YSym1 x0123456789876543210 =
-        Let0123456789876543210Y x0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210YSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210YSym0KindInference) ())
-    data Let0123456789876543210YSym0 x0123456789876543210
-      where
-        Let0123456789876543210YSym0KindInference :: forall x0123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210YSym0 arg) (Let0123456789876543210YSym1 arg) =>
-                                                    Let0123456789876543210YSym0 x0123456789876543210
-    type instance Apply Let0123456789876543210YSym0 x0123456789876543210 = Let0123456789876543210Y x0123456789876543210
-    type family Let0123456789876543210Y x :: Nat where
-      Let0123456789876543210Y x = Apply SuccSym0 ZeroSym0
-    type Foo14Sym1 (a0123456789876543210 :: Nat) =
-        Foo14 a0123456789876543210
-    instance SuppressUnusedWarnings Foo14Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo14Sym0KindInference) ())
-    data Foo14Sym0 :: (~>) Nat (Nat, Nat)
-      where
-        Foo14Sym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply Foo14Sym0 arg) (Foo14Sym1 arg) =>
-                                  Foo14Sym0 a0123456789876543210
-    type instance Apply Foo14Sym0 a0123456789876543210 = Foo14 a0123456789876543210
-    type Foo13_Sym1 (a0123456789876543210 :: a0123456789876543210) =
-        Foo13_ a0123456789876543210
-    instance SuppressUnusedWarnings Foo13_Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo13_Sym0KindInference) ())
-    data Foo13_Sym0 :: forall a0123456789876543210.
-                       (~>) a0123456789876543210 a0123456789876543210
-      where
-        Foo13_Sym0KindInference :: forall a0123456789876543210
-                                          arg. SameKind (Apply Foo13_Sym0 arg) (Foo13_Sym1 arg) =>
-                                   Foo13_Sym0 a0123456789876543210
-    type instance Apply Foo13_Sym0 a0123456789876543210 = Foo13_ a0123456789876543210
-    type Foo13Sym1 (a0123456789876543210 :: a0123456789876543210) =
-        Foo13 a0123456789876543210
-    instance SuppressUnusedWarnings Foo13Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo13Sym0KindInference) ())
-    data Foo13Sym0 :: forall a0123456789876543210.
-                      (~>) a0123456789876543210 a0123456789876543210
-      where
-        Foo13Sym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply Foo13Sym0 arg) (Foo13Sym1 arg) =>
-                                  Foo13Sym0 a0123456789876543210
-    type instance Apply Foo13Sym0 a0123456789876543210 = Foo13 a0123456789876543210
-    type Foo12Sym1 (a0123456789876543210 :: Nat) =
-        Foo12 a0123456789876543210
-    instance SuppressUnusedWarnings Foo12Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo12Sym0KindInference) ())
-    data Foo12Sym0 :: (~>) Nat Nat
-      where
-        Foo12Sym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply Foo12Sym0 arg) (Foo12Sym1 arg) =>
-                                  Foo12Sym0 a0123456789876543210
-    type instance Apply Foo12Sym0 a0123456789876543210 = Foo12 a0123456789876543210
-    type Foo11Sym1 (a0123456789876543210 :: Nat) =
-        Foo11 a0123456789876543210
-    instance SuppressUnusedWarnings Foo11Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo11Sym0KindInference) ())
-    data Foo11Sym0 :: (~>) Nat Nat
-      where
-        Foo11Sym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply Foo11Sym0 arg) (Foo11Sym1 arg) =>
-                                  Foo11Sym0 a0123456789876543210
-    type instance Apply Foo11Sym0 a0123456789876543210 = Foo11 a0123456789876543210
-    type Foo10Sym1 (a0123456789876543210 :: Nat) =
-        Foo10 a0123456789876543210
-    instance SuppressUnusedWarnings Foo10Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo10Sym0KindInference) ())
-    data Foo10Sym0 :: (~>) Nat Nat
-      where
-        Foo10Sym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply Foo10Sym0 arg) (Foo10Sym1 arg) =>
-                                  Foo10Sym0 a0123456789876543210
-    type instance Apply Foo10Sym0 a0123456789876543210 = Foo10 a0123456789876543210
-    type Foo9Sym1 (a0123456789876543210 :: Nat) =
-        Foo9 a0123456789876543210
-    instance SuppressUnusedWarnings Foo9Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo9Sym0KindInference) ())
-    data Foo9Sym0 :: (~>) Nat Nat
-      where
-        Foo9Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo9Sym0 arg) (Foo9Sym1 arg) =>
-                                 Foo9Sym0 a0123456789876543210
-    type instance Apply Foo9Sym0 a0123456789876543210 = Foo9 a0123456789876543210
-    type Foo8Sym1 (a0123456789876543210 :: Nat) =
-        Foo8 a0123456789876543210
-    instance SuppressUnusedWarnings Foo8Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo8Sym0KindInference) ())
-    data Foo8Sym0 :: (~>) Nat Nat
-      where
-        Foo8Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo8Sym0 arg) (Foo8Sym1 arg) =>
-                                 Foo8Sym0 a0123456789876543210
-    type instance Apply Foo8Sym0 a0123456789876543210 = Foo8 a0123456789876543210
-    type Foo7Sym1 (a0123456789876543210 :: Nat) =
-        Foo7 a0123456789876543210
-    instance SuppressUnusedWarnings Foo7Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo7Sym0KindInference) ())
-    data Foo7Sym0 :: (~>) Nat Nat
-      where
-        Foo7Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo7Sym0 arg) (Foo7Sym1 arg) =>
-                                 Foo7Sym0 a0123456789876543210
-    type instance Apply Foo7Sym0 a0123456789876543210 = Foo7 a0123456789876543210
-    type Foo6Sym1 (a0123456789876543210 :: Nat) =
-        Foo6 a0123456789876543210
-    instance SuppressUnusedWarnings Foo6Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo6Sym0KindInference) ())
-    data Foo6Sym0 :: (~>) Nat Nat
-      where
-        Foo6Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo6Sym0 arg) (Foo6Sym1 arg) =>
-                                 Foo6Sym0 a0123456789876543210
-    type instance Apply Foo6Sym0 a0123456789876543210 = Foo6 a0123456789876543210
-    type Foo5Sym1 (a0123456789876543210 :: Nat) =
-        Foo5 a0123456789876543210
-    instance SuppressUnusedWarnings Foo5Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo5Sym0KindInference) ())
-    data Foo5Sym0 :: (~>) Nat Nat
-      where
-        Foo5Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo5Sym0 arg) (Foo5Sym1 arg) =>
-                                 Foo5Sym0 a0123456789876543210
-    type instance Apply Foo5Sym0 a0123456789876543210 = Foo5 a0123456789876543210
-    type Foo4Sym1 (a0123456789876543210 :: Nat) =
-        Foo4 a0123456789876543210
-    instance SuppressUnusedWarnings Foo4Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo4Sym0KindInference) ())
-    data Foo4Sym0 :: (~>) Nat Nat
-      where
-        Foo4Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo4Sym0 arg) (Foo4Sym1 arg) =>
-                                 Foo4Sym0 a0123456789876543210
-    type instance Apply Foo4Sym0 a0123456789876543210 = Foo4 a0123456789876543210
-    type Foo3Sym1 (a0123456789876543210 :: Nat) =
-        Foo3 a0123456789876543210
-    instance SuppressUnusedWarnings Foo3Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo3Sym0KindInference) ())
-    data Foo3Sym0 :: (~>) Nat Nat
-      where
-        Foo3Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo3Sym0 arg) (Foo3Sym1 arg) =>
-                                 Foo3Sym0 a0123456789876543210
-    type instance Apply Foo3Sym0 a0123456789876543210 = Foo3 a0123456789876543210
-    type Foo2Sym0 = Foo2
-    type Foo1Sym1 (a0123456789876543210 :: Nat) =
-        Foo1 a0123456789876543210
-    instance SuppressUnusedWarnings Foo1Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo1Sym0KindInference) ())
-    data Foo1Sym0 :: (~>) Nat Nat
-      where
-        Foo1Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo1Sym0 arg) (Foo1Sym1 arg) =>
-                                 Foo1Sym0 a0123456789876543210
-    type instance Apply Foo1Sym0 a0123456789876543210 = Foo1 a0123456789876543210
-    type family Foo14 (a :: Nat) :: (Nat, Nat) where
-      Foo14 x = Apply (Apply Tuple2Sym0 (Let0123456789876543210ZSym1 x)) (Let0123456789876543210YSym1 x)
-    type family Foo13_ (a :: a) :: a where
-      Foo13_ y = y
-    type family Foo13 (a :: a) :: a where
-      Foo13 x = Apply Foo13_Sym0 (Let0123456789876543210BarSym1 x)
-    type family Foo12 (a :: Nat) :: Nat where
-      Foo12 x = Apply (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x) x) (Apply SuccSym0 (Apply SuccSym0 ZeroSym0))
-    type family Foo11 (a :: Nat) :: Nat where
-      Foo11 x = Apply (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x) (Apply SuccSym0 ZeroSym0)) (Let0123456789876543210ZSym1 x)
-    type family Foo10 (a :: Nat) :: Nat where
-      Foo10 x = Apply (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x) (Apply SuccSym0 ZeroSym0)) x
-    type family Foo9 (a :: Nat) :: Nat where
-      Foo9 x = Apply (Let0123456789876543210ZSym1 x) x
-    type family Foo8 (a :: Nat) :: Nat where
-      Foo8 x = Let0123456789876543210ZSym1 x
-    type family Foo7 (a :: Nat) :: Nat where
-      Foo7 x = Let0123456789876543210XSym1 x
-    type family Foo6 (a :: Nat) :: Nat where
-      Foo6 x = Let0123456789876543210ZSym1 x
-    type family Foo5 (a :: Nat) :: Nat where
-      Foo5 x = Apply (Let0123456789876543210FSym1 x) x
-    type family Foo4 (a :: Nat) :: Nat where
-      Foo4 x = Apply (Let0123456789876543210FSym1 x) x
-    type family Foo3 (a :: Nat) :: Nat where
-      Foo3 x = Let0123456789876543210YSym1 x
-    type family Foo2 :: Nat where
-      Foo2 = Let0123456789876543210ZSym0
-    type family Foo1 (a :: Nat) :: Nat where
-      Foo1 x = Let0123456789876543210YSym1 x
-    sFoo14 ::
-      forall (t :: Nat). Sing t -> Sing (Apply Foo14Sym0 t :: (Nat, Nat))
-    sFoo13_ ::
-      forall a (t :: a). Sing t -> Sing (Apply Foo13_Sym0 t :: a)
-    sFoo13 ::
-      forall a (t :: a). Sing t -> Sing (Apply Foo13Sym0 t :: a)
-    sFoo12 ::
-      forall (t :: Nat). Sing t -> Sing (Apply Foo12Sym0 t :: Nat)
-    sFoo11 ::
-      forall (t :: Nat). Sing t -> Sing (Apply Foo11Sym0 t :: Nat)
-    sFoo10 ::
-      forall (t :: Nat). Sing t -> Sing (Apply Foo10Sym0 t :: Nat)
-    sFoo9 ::
-      forall (t :: Nat). Sing t -> Sing (Apply Foo9Sym0 t :: Nat)
-    sFoo8 ::
-      forall (t :: Nat). Sing t -> Sing (Apply Foo8Sym0 t :: Nat)
-    sFoo7 ::
-      forall (t :: Nat). Sing t -> Sing (Apply Foo7Sym0 t :: Nat)
-    sFoo6 ::
-      forall (t :: Nat). Sing t -> Sing (Apply Foo6Sym0 t :: Nat)
-    sFoo5 ::
-      forall (t :: Nat). Sing t -> Sing (Apply Foo5Sym0 t :: Nat)
-    sFoo4 ::
-      forall (t :: Nat). Sing t -> Sing (Apply Foo4Sym0 t :: Nat)
-    sFoo3 ::
-      forall (t :: Nat). Sing t -> Sing (Apply Foo3Sym0 t :: Nat)
-    sFoo2 :: Sing (Foo2Sym0 :: Nat)
-    sFoo1 ::
-      forall (t :: Nat). Sing t -> Sing (Apply Foo1Sym0 t :: Nat)
-    sFoo14 (sX :: Sing x)
-      = let
-          sZ :: Sing (Let0123456789876543210ZSym1 x)
-          sY :: Sing (Let0123456789876543210YSym1 x)
-          sX_0123456789876543210 ::
-            Sing (Let0123456789876543210X_0123456789876543210Sym1 x)
-          sZ
-            = (id
-                 @(Sing (Case_0123456789876543210 x (Let0123456789876543210X_0123456789876543210Sym1 x))))
-                (case sX_0123456789876543210 of {
-                   STuple2 _ (sY_0123456789876543210 :: Sing y_0123456789876543210)
-                     -> sY_0123456789876543210 })
-          sY
-            = (id
-                 @(Sing (Case_0123456789876543210 x (Let0123456789876543210X_0123456789876543210Sym1 x))))
-                (case sX_0123456789876543210 of {
-                   STuple2 (sY_0123456789876543210 :: Sing y_0123456789876543210) _
-                     -> sY_0123456789876543210 })
-          sX_0123456789876543210
-            = (applySing
-                 ((applySing ((singFun2 @Tuple2Sym0) STuple2))
-                    ((applySing ((singFun1 @SuccSym0) SSucc)) sX)))
-                sX
-        in (applySing ((applySing ((singFun2 @Tuple2Sym0) STuple2)) sZ)) sY
-    sFoo13_ (sY :: Sing y) = sY
-    sFoo13 (sX :: Sing x)
-      = let
-          sBar :: Sing (Let0123456789876543210BarSym1 x :: a)
-          sBar = sX
-        in (applySing ((singFun1 @Foo13_Sym0) sFoo13_)) sBar
-    sFoo12 (sX :: Sing x)
-      = let
-          (%+) ::
-            forall (t :: Nat) (t :: Nat).
-            Sing t
-            -> Sing t
-               -> Sing (Apply (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x) t) t :: Nat)
-          (%+) SZero (sM :: Sing m) = sM
-          (%+) (SSucc (sN :: Sing n)) (sM :: Sing m)
-            = (applySing ((singFun1 @SuccSym0) SSucc))
-                ((applySing
-                    ((applySing ((singFun2 @((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x)) (%+)))
-                       sN))
-                   sX)
-        in
-          (applySing
-             ((applySing ((singFun2 @((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x)) (%+)))
-                sX))
-            ((applySing ((singFun1 @SuccSym0) SSucc))
-               ((applySing ((singFun1 @SuccSym0) SSucc)) SZero))
-    sFoo11 (sX :: Sing x)
-      = let
-          sZ :: Sing (Let0123456789876543210ZSym1 x :: Nat)
-          (%+) ::
-            forall (t :: Nat) (t :: Nat).
-            Sing t
-            -> Sing t
-               -> Sing (Apply (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x) t) t :: Nat)
-          sZ = sX
-          (%+) SZero (sM :: Sing m) = sM
-          (%+) (SSucc (sN :: Sing n)) (sM :: Sing m)
-            = (applySing ((singFun1 @SuccSym0) SSucc))
-                ((applySing
-                    ((applySing ((singFun2 @((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x)) (%+)))
-                       sN))
-                   sM)
-        in
-          (applySing
-             ((applySing ((singFun2 @((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x)) (%+)))
-                ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
-            sZ
-    sFoo10 (sX :: Sing x)
-      = let
-          (%+) ::
-            forall (t :: Nat) (t :: Nat).
-            Sing t
-            -> Sing t
-               -> Sing (Apply (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x) t) t :: Nat)
-          (%+) SZero (sM :: Sing m) = sM
-          (%+) (SSucc (sN :: Sing n)) (sM :: Sing m)
-            = (applySing ((singFun1 @SuccSym0) SSucc))
-                ((applySing
-                    ((applySing ((singFun2 @((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x)) (%+)))
-                       sN))
-                   sM)
-        in
-          (applySing
-             ((applySing ((singFun2 @((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x)) (%+)))
-                ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
-            sX
-    sFoo9 (sX :: Sing x)
-      = let
-          sZ ::
-            forall (t :: Nat).
-            Sing t -> Sing (Apply (Let0123456789876543210ZSym1 x) t :: Nat)
-          sZ (sA_0123456789876543210 :: Sing a_0123456789876543210)
-            = (applySing
-                 ((singFun1
-                     @(Apply (Apply Lambda_0123456789876543210Sym0 a_0123456789876543210) x))
-                    (\ sX -> case sX of { (_ :: Sing x) -> sX })))
-                sA_0123456789876543210
-        in (applySing ((singFun1 @(Let0123456789876543210ZSym1 x)) sZ)) sX
-    sFoo8 (sX :: Sing x)
-      = let
-          sZ :: Sing (Let0123456789876543210ZSym1 x :: Nat)
-          sZ
-            = (applySing
-                 ((singFun1 @(Apply Lambda_0123456789876543210Sym0 x))
-                    (\ sX -> case sX of { (_ :: Sing x) -> sX })))
-                SZero
-        in sZ
-    sFoo7 (sX :: Sing x)
-      = let
-          sX :: Sing (Let0123456789876543210XSym1 x :: Nat)
-          sX = SZero
-        in sX
-    sFoo6 (sX :: Sing x)
-      = let
-          sF ::
-            forall (t :: Nat).
-            Sing t -> Sing (Apply (Let0123456789876543210FSym1 x) t :: Nat)
-          sF (sY :: Sing y) = (applySing ((singFun1 @SuccSym0) SSucc)) sY in
-        let
-          sZ :: Sing (Let0123456789876543210ZSym1 x :: Nat)
-          sZ
-            = (applySing ((singFun1 @(Let0123456789876543210FSym1 x)) sF)) sX
-        in sZ
-    sFoo5 (sX :: Sing x)
-      = let
-          sF ::
-            forall (t :: Nat).
-            Sing t -> Sing (Apply (Let0123456789876543210FSym1 x) t :: Nat)
-          sF (sY :: Sing y)
-            = let
-                sZ :: Sing (Let0123456789876543210ZSym2 y x :: Nat)
-                sZ = (applySing ((singFun1 @SuccSym0) SSucc)) sY
-              in (applySing ((singFun1 @SuccSym0) SSucc)) sZ
-        in (applySing ((singFun1 @(Let0123456789876543210FSym1 x)) sF)) sX
-    sFoo4 (sX :: Sing x)
-      = let
-          sF ::
-            forall (t :: Nat).
-            Sing t -> Sing (Apply (Let0123456789876543210FSym1 x) t :: Nat)
-          sF (sY :: Sing y) = (applySing ((singFun1 @SuccSym0) SSucc)) sY
-        in (applySing ((singFun1 @(Let0123456789876543210FSym1 x)) sF)) sX
-    sFoo3 (sX :: Sing x)
-      = let
-          sY :: Sing (Let0123456789876543210YSym1 x :: Nat)
-          sY = (applySing ((singFun1 @SuccSym0) SSucc)) sX
-        in sY
-    sFoo2
-      = let
-          sZ :: Sing Let0123456789876543210ZSym0
-          sY :: Sing Let0123456789876543210YSym0
-          sZ = (applySing ((singFun1 @SuccSym0) SSucc)) sY
-          sY = (applySing ((singFun1 @SuccSym0) SSucc)) SZero
-        in sZ
-    sFoo1 (sX :: Sing x)
-      = let
-          sY :: Sing (Let0123456789876543210YSym1 x :: Nat)
-          sY = (applySing ((singFun1 @SuccSym0) SSucc)) SZero
-        in sY
-    instance SingI (Foo14Sym0 :: (~>) Nat (Nat, Nat)) where
-      sing = (singFun1 @Foo14Sym0) sFoo14
-    instance SingI (Foo13_Sym0 :: (~>) a a) where
-      sing = (singFun1 @Foo13_Sym0) sFoo13_
-    instance SingI (Foo13Sym0 :: (~>) a a) where
-      sing = (singFun1 @Foo13Sym0) sFoo13
-    instance SingI (Foo12Sym0 :: (~>) Nat Nat) where
-      sing = (singFun1 @Foo12Sym0) sFoo12
-    instance SingI (Foo11Sym0 :: (~>) Nat Nat) where
-      sing = (singFun1 @Foo11Sym0) sFoo11
-    instance SingI (Foo10Sym0 :: (~>) Nat Nat) where
-      sing = (singFun1 @Foo10Sym0) sFoo10
-    instance SingI (Foo9Sym0 :: (~>) Nat Nat) where
-      sing = (singFun1 @Foo9Sym0) sFoo9
-    instance SingI (Foo8Sym0 :: (~>) Nat Nat) where
-      sing = (singFun1 @Foo8Sym0) sFoo8
-    instance SingI (Foo7Sym0 :: (~>) Nat Nat) where
-      sing = (singFun1 @Foo7Sym0) sFoo7
-    instance SingI (Foo6Sym0 :: (~>) Nat Nat) where
-      sing = (singFun1 @Foo6Sym0) sFoo6
-    instance SingI (Foo5Sym0 :: (~>) Nat Nat) where
-      sing = (singFun1 @Foo5Sym0) sFoo5
-    instance SingI (Foo4Sym0 :: (~>) Nat Nat) where
-      sing = (singFun1 @Foo4Sym0) sFoo4
-    instance SingI (Foo3Sym0 :: (~>) Nat Nat) where
-      sing = (singFun1 @Foo3Sym0) sFoo3
-    instance SingI (Foo1Sym0 :: (~>) Nat Nat) where
-      sing = (singFun1 @Foo1Sym0) sFoo1
diff --git a/tests/compile-and-dump/Singletons/LetStatements.golden b/tests/compile-and-dump/Singletons/LetStatements.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/LetStatements.golden
@@ -0,0 +1,965 @@
+Singletons/LetStatements.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| foo1 :: Nat -> Nat
+          foo1 x
+            = let
+                y :: Nat
+                y = Succ Zero
+              in y
+          foo2 :: Nat
+          foo2
+            = let
+                y = Succ Zero
+                z = Succ y
+              in z
+          foo3 :: Nat -> Nat
+          foo3 x
+            = let
+                y :: Nat
+                y = Succ x
+              in y
+          foo4 :: Nat -> Nat
+          foo4 x
+            = let
+                f :: Nat -> Nat
+                f y = Succ y
+              in f x
+          foo5 :: Nat -> Nat
+          foo5 x
+            = let
+                f :: Nat -> Nat
+                f y
+                  = let
+                      z :: Nat
+                      z = Succ y
+                    in Succ z
+              in f x
+          foo6 :: Nat -> Nat
+          foo6 x
+            = let
+                f :: Nat -> Nat
+                f y = Succ y in
+              let
+                z :: Nat
+                z = f x
+              in z
+          foo7 :: Nat -> Nat
+          foo7 x
+            = let
+                x :: Nat
+                x = Zero
+              in x
+          foo8 :: Nat -> Nat
+          foo8 x
+            = let
+                z :: Nat
+                z = (\ x -> x) Zero
+              in z
+          foo9 :: Nat -> Nat
+          foo9 x
+            = let
+                z :: Nat -> Nat
+                z = (\ x -> x)
+              in z x
+          foo10 :: Nat -> Nat
+          foo10 x
+            = let
+                (+) :: Nat -> Nat -> Nat
+                Zero + m = m
+                (Succ n) + m = Succ (n + m)
+              in (Succ Zero) + x
+          foo11 :: Nat -> Nat
+          foo11 x
+            = let
+                (+) :: Nat -> Nat -> Nat
+                Zero + m = m
+                (Succ n) + m = Succ (n + m)
+                z :: Nat
+                z = x
+              in (Succ Zero) + z
+          foo12 :: Nat -> Nat
+          foo12 x
+            = let
+                (+) :: Nat -> Nat -> Nat
+                Zero + m = m
+                (Succ n) + m = Succ (n + x)
+              in x + (Succ (Succ Zero))
+          foo13 :: forall a. a -> a
+          foo13 x
+            = let
+                bar :: a
+                bar = x
+              in foo13_ bar
+          foo13_ :: a -> a
+          foo13_ y = y
+          foo14 :: Nat -> (Nat, Nat)
+          foo14 x = let (y, z) = (Succ x, x) in (z, y) |]
+  ======>
+    foo1 :: Nat -> Nat
+    foo1 x
+      = let
+          y :: Nat
+          y = Succ Zero
+        in y
+    foo2 :: Nat
+    foo2
+      = let
+          y = Succ Zero
+          z = Succ y
+        in z
+    foo3 :: Nat -> Nat
+    foo3 x
+      = let
+          y :: Nat
+          y = Succ x
+        in y
+    foo4 :: Nat -> Nat
+    foo4 x
+      = let
+          f :: Nat -> Nat
+          f y = Succ y
+        in f x
+    foo5 :: Nat -> Nat
+    foo5 x
+      = let
+          f :: Nat -> Nat
+          f y
+            = let
+                z :: Nat
+                z = Succ y
+              in Succ z
+        in f x
+    foo6 :: Nat -> Nat
+    foo6 x
+      = let
+          f :: Nat -> Nat
+          f y = Succ y in
+        let
+          z :: Nat
+          z = f x
+        in z
+    foo7 :: Nat -> Nat
+    foo7 x
+      = let
+          x :: Nat
+          x = Zero
+        in x
+    foo8 :: Nat -> Nat
+    foo8 x
+      = let
+          z :: Nat
+          z = (\ x -> x) Zero
+        in z
+    foo9 :: Nat -> Nat
+    foo9 x
+      = let
+          z :: Nat -> Nat
+          z = \ x -> x
+        in z x
+    foo10 :: Nat -> Nat
+    foo10 x
+      = let
+          (+) :: Nat -> Nat -> Nat
+          (+) Zero m = m
+          (+) (Succ n) m = Succ (n + m)
+        in (Succ Zero + x)
+    foo11 :: Nat -> Nat
+    foo11 x
+      = let
+          (+) :: Nat -> Nat -> Nat
+          z :: Nat
+          (+) Zero m = m
+          (+) (Succ n) m = Succ (n + m)
+          z = x
+        in (Succ Zero + z)
+    foo12 :: Nat -> Nat
+    foo12 x
+      = let
+          (+) :: Nat -> Nat -> Nat
+          (+) Zero m = m
+          (+) (Succ n) m = Succ (n + x)
+        in (x + Succ (Succ Zero))
+    foo13 :: forall a. a -> a
+    foo13 x
+      = let
+          bar :: a
+          bar = x
+        in foo13_ bar
+    foo13_ :: a -> a
+    foo13_ y = y
+    foo14 :: Nat -> (Nat, Nat)
+    foo14 x = let (y, z) = (Succ x, x) in (z, y)
+    type family Case_0123456789876543210 x t where
+      Case_0123456789876543210 x '(_,
+                                   y_0123456789876543210) = y_0123456789876543210
+    type family Case_0123456789876543210 x t where
+      Case_0123456789876543210 x '(y_0123456789876543210,
+                                   _) = y_0123456789876543210
+    data Let0123456789876543210ZSym0 x0123456789876543210
+      where
+        Let0123456789876543210ZSym0KindInference :: SameKind (Apply Let0123456789876543210ZSym0 arg) (Let0123456789876543210ZSym1 arg) =>
+                                                    Let0123456789876543210ZSym0 x0123456789876543210
+    type instance Apply Let0123456789876543210ZSym0 x0123456789876543210 = Let0123456789876543210ZSym1 x0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210ZSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210ZSym0KindInference) ())
+    type Let0123456789876543210ZSym1 x0123456789876543210 =
+        Let0123456789876543210Z x0123456789876543210
+    data Let0123456789876543210YSym0 x0123456789876543210
+      where
+        Let0123456789876543210YSym0KindInference :: SameKind (Apply Let0123456789876543210YSym0 arg) (Let0123456789876543210YSym1 arg) =>
+                                                    Let0123456789876543210YSym0 x0123456789876543210
+    type instance Apply Let0123456789876543210YSym0 x0123456789876543210 = Let0123456789876543210YSym1 x0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210YSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210YSym0KindInference) ())
+    type Let0123456789876543210YSym1 x0123456789876543210 =
+        Let0123456789876543210Y x0123456789876543210
+    data Let0123456789876543210X_0123456789876543210Sym0 x0123456789876543210
+      where
+        Let0123456789876543210X_0123456789876543210Sym0KindInference :: SameKind (Apply Let0123456789876543210X_0123456789876543210Sym0 arg) (Let0123456789876543210X_0123456789876543210Sym1 arg) =>
+                                                                        Let0123456789876543210X_0123456789876543210Sym0 x0123456789876543210
+    type instance Apply Let0123456789876543210X_0123456789876543210Sym0 x0123456789876543210 = Let0123456789876543210X_0123456789876543210Sym1 x0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210X_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd
+            (((,) Let0123456789876543210X_0123456789876543210Sym0KindInference)
+               ())
+    type Let0123456789876543210X_0123456789876543210Sym1 x0123456789876543210 =
+        Let0123456789876543210X_0123456789876543210 x0123456789876543210
+    type family Let0123456789876543210Z x where
+      Let0123456789876543210Z x = Case_0123456789876543210 x (Let0123456789876543210X_0123456789876543210Sym1 x)
+    type family Let0123456789876543210Y x where
+      Let0123456789876543210Y x = Case_0123456789876543210 x (Let0123456789876543210X_0123456789876543210Sym1 x)
+    type family Let0123456789876543210X_0123456789876543210 x where
+      Let0123456789876543210X_0123456789876543210 x = Apply (Apply Tuple2Sym0 (Apply SuccSym0 x)) x
+    data Let0123456789876543210BarSym0 x0123456789876543210
+      where
+        Let0123456789876543210BarSym0KindInference :: SameKind (Apply Let0123456789876543210BarSym0 arg) (Let0123456789876543210BarSym1 arg) =>
+                                                      Let0123456789876543210BarSym0 x0123456789876543210
+    type instance Apply Let0123456789876543210BarSym0 x0123456789876543210 = Let0123456789876543210BarSym1 x0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210BarSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210BarSym0KindInference) ())
+    type Let0123456789876543210BarSym1 x0123456789876543210 =
+        Let0123456789876543210Bar x0123456789876543210 :: a0123456789876543210
+    type family Let0123456789876543210Bar x :: a where
+      Let0123456789876543210Bar x = x
+    data (<<<%%%%%%%%%%%%%%%%%%%%@#@$) x0123456789876543210
+      where
+        (:<<<%%%%%%%%%%%%%%%%%%%%@#@$###) :: SameKind (Apply (<<<%%%%%%%%%%%%%%%%%%%%@#@$) arg) ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) arg) =>
+                                             (<<<%%%%%%%%%%%%%%%%%%%%@#@$) x0123456789876543210
+    type instance Apply (<<<%%%%%%%%%%%%%%%%%%%%@#@$) x0123456789876543210 = (<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210
+    instance SuppressUnusedWarnings (<<<%%%%%%%%%%%%%%%%%%%%@#@$) where
+      suppressUnusedWarnings
+        = snd (((,) (:<<<%%%%%%%%%%%%%%%%%%%%@#@$###)) ())
+    data (<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210 :: (~>) Nat ((~>) Nat Nat)
+      where
+        (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$###) :: SameKind (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210) arg) ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 arg) =>
+                                              (<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210 a0123456789876543210
+    type instance Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210) a0123456789876543210 = (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$###)) ())
+    data (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 (a0123456789876543210 :: Nat) :: (~>) Nat Nat
+      where
+        (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$$###) :: SameKind (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210) arg) ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$$) x0123456789876543210 a0123456789876543210 arg) =>
+                                               (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210) a0123456789876543210 = (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$$) x0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$$###)) ())
+    type (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$$) x0123456789876543210 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
+        (<<<%%%%%%%%%%%%%%%%%%%%) x0123456789876543210 a0123456789876543210 a0123456789876543210 :: Nat
+    type family (<<<%%%%%%%%%%%%%%%%%%%%) x (a :: Nat) (a :: Nat) :: Nat where
+      (<<<%%%%%%%%%%%%%%%%%%%%) x 'Zero m = m
+      (<<<%%%%%%%%%%%%%%%%%%%%) x ('Succ n) m = Apply SuccSym0 (Apply (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x) n) x)
+    data Let0123456789876543210ZSym0 x0123456789876543210
+      where
+        Let0123456789876543210ZSym0KindInference :: SameKind (Apply Let0123456789876543210ZSym0 arg) (Let0123456789876543210ZSym1 arg) =>
+                                                    Let0123456789876543210ZSym0 x0123456789876543210
+    type instance Apply Let0123456789876543210ZSym0 x0123456789876543210 = Let0123456789876543210ZSym1 x0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210ZSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210ZSym0KindInference) ())
+    type Let0123456789876543210ZSym1 x0123456789876543210 =
+        Let0123456789876543210Z x0123456789876543210 :: Nat
+    data (<<<%%%%%%%%%%%%%%%%%%%%@#@$) x0123456789876543210
+      where
+        (:<<<%%%%%%%%%%%%%%%%%%%%@#@$###) :: SameKind (Apply (<<<%%%%%%%%%%%%%%%%%%%%@#@$) arg) ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) arg) =>
+                                             (<<<%%%%%%%%%%%%%%%%%%%%@#@$) x0123456789876543210
+    type instance Apply (<<<%%%%%%%%%%%%%%%%%%%%@#@$) x0123456789876543210 = (<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210
+    instance SuppressUnusedWarnings (<<<%%%%%%%%%%%%%%%%%%%%@#@$) where
+      suppressUnusedWarnings
+        = snd (((,) (:<<<%%%%%%%%%%%%%%%%%%%%@#@$###)) ())
+    data (<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210 :: (~>) Nat ((~>) Nat Nat)
+      where
+        (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$###) :: SameKind (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210) arg) ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 arg) =>
+                                              (<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210 a0123456789876543210
+    type instance Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210) a0123456789876543210 = (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$###)) ())
+    data (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 (a0123456789876543210 :: Nat) :: (~>) Nat Nat
+      where
+        (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$$###) :: SameKind (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210) arg) ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$$) x0123456789876543210 a0123456789876543210 arg) =>
+                                               (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210) a0123456789876543210 = (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$$) x0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$$###)) ())
+    type (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$$) x0123456789876543210 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
+        (<<<%%%%%%%%%%%%%%%%%%%%) x0123456789876543210 a0123456789876543210 a0123456789876543210 :: Nat
+    type family Let0123456789876543210Z x :: Nat where
+      Let0123456789876543210Z x = x
+    type family (<<<%%%%%%%%%%%%%%%%%%%%) x (a :: Nat) (a :: Nat) :: Nat where
+      (<<<%%%%%%%%%%%%%%%%%%%%) x 'Zero m = m
+      (<<<%%%%%%%%%%%%%%%%%%%%) x ('Succ n) m = Apply SuccSym0 (Apply (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x) n) m)
+    data (<<<%%%%%%%%%%%%%%%%%%%%@#@$) x0123456789876543210
+      where
+        (:<<<%%%%%%%%%%%%%%%%%%%%@#@$###) :: SameKind (Apply (<<<%%%%%%%%%%%%%%%%%%%%@#@$) arg) ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) arg) =>
+                                             (<<<%%%%%%%%%%%%%%%%%%%%@#@$) x0123456789876543210
+    type instance Apply (<<<%%%%%%%%%%%%%%%%%%%%@#@$) x0123456789876543210 = (<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210
+    instance SuppressUnusedWarnings (<<<%%%%%%%%%%%%%%%%%%%%@#@$) where
+      suppressUnusedWarnings
+        = snd (((,) (:<<<%%%%%%%%%%%%%%%%%%%%@#@$###)) ())
+    data (<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210 :: (~>) Nat ((~>) Nat Nat)
+      where
+        (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$###) :: SameKind (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210) arg) ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 arg) =>
+                                              (<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210 a0123456789876543210
+    type instance Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210) a0123456789876543210 = (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$###)) ())
+    data (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 (a0123456789876543210 :: Nat) :: (~>) Nat Nat
+      where
+        (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$$###) :: SameKind (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210) arg) ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$$) x0123456789876543210 a0123456789876543210 arg) =>
+                                               (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210) a0123456789876543210 = (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$$) x0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$$) x0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) (:<<<%%%%%%%%%%%%%%%%%%%%@#@$$$###)) ())
+    type (<<<%%%%%%%%%%%%%%%%%%%%@#@$$$$) x0123456789876543210 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
+        (<<<%%%%%%%%%%%%%%%%%%%%) x0123456789876543210 a0123456789876543210 a0123456789876543210 :: Nat
+    type family (<<<%%%%%%%%%%%%%%%%%%%%) x (a :: Nat) (a :: Nat) :: Nat where
+      (<<<%%%%%%%%%%%%%%%%%%%%) x 'Zero m = m
+      (<<<%%%%%%%%%%%%%%%%%%%%) x ('Succ n) m = Apply SuccSym0 (Apply (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x) n) m)
+    type family Lambda_0123456789876543210 a_0123456789876543210 x x where
+      Lambda_0123456789876543210 a_0123456789876543210 x x = x
+    data Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210 x0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) x0123456789876543210 = Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 x0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 x0123456789876543210 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 x0123456789876543210) arg) (Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 x0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 x0123456789876543210 x0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 x0123456789876543210) x0123456789876543210 = Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 x0123456789876543210 x0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    type Lambda_0123456789876543210Sym3 a_01234567898765432100123456789876543210 x0123456789876543210 x0123456789876543210 =
+        Lambda_0123456789876543210 a_01234567898765432100123456789876543210 x0123456789876543210 x0123456789876543210
+    data Let0123456789876543210ZSym0 x0123456789876543210
+      where
+        Let0123456789876543210ZSym0KindInference :: SameKind (Apply Let0123456789876543210ZSym0 arg) (Let0123456789876543210ZSym1 arg) =>
+                                                    Let0123456789876543210ZSym0 x0123456789876543210
+    type instance Apply Let0123456789876543210ZSym0 x0123456789876543210 = Let0123456789876543210ZSym1 x0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210ZSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210ZSym0KindInference) ())
+    data Let0123456789876543210ZSym1 x0123456789876543210 :: (~>) Nat Nat
+      where
+        Let0123456789876543210ZSym1KindInference :: SameKind (Apply (Let0123456789876543210ZSym1 x0123456789876543210) arg) (Let0123456789876543210ZSym2 x0123456789876543210 arg) =>
+                                                    Let0123456789876543210ZSym1 x0123456789876543210 a0123456789876543210
+    type instance Apply (Let0123456789876543210ZSym1 x0123456789876543210) a0123456789876543210 = Let0123456789876543210ZSym2 x0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210ZSym1 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210ZSym1KindInference) ())
+    type Let0123456789876543210ZSym2 x0123456789876543210 (a0123456789876543210 :: Nat) =
+        Let0123456789876543210Z x0123456789876543210 a0123456789876543210 :: Nat
+    type family Let0123456789876543210Z x (a :: Nat) :: Nat where
+      Let0123456789876543210Z x a_0123456789876543210 = Apply (Apply (Apply Lambda_0123456789876543210Sym0 a_0123456789876543210) x) a_0123456789876543210
+    type family Lambda_0123456789876543210 x x where
+      Lambda_0123456789876543210 x x = x
+    data Lambda_0123456789876543210Sym0 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 x0123456789876543210 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 x0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) x0123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 x0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    type Lambda_0123456789876543210Sym2 x0123456789876543210 x0123456789876543210 =
+        Lambda_0123456789876543210 x0123456789876543210 x0123456789876543210
+    data Let0123456789876543210ZSym0 x0123456789876543210
+      where
+        Let0123456789876543210ZSym0KindInference :: SameKind (Apply Let0123456789876543210ZSym0 arg) (Let0123456789876543210ZSym1 arg) =>
+                                                    Let0123456789876543210ZSym0 x0123456789876543210
+    type instance Apply Let0123456789876543210ZSym0 x0123456789876543210 = Let0123456789876543210ZSym1 x0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210ZSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210ZSym0KindInference) ())
+    type Let0123456789876543210ZSym1 x0123456789876543210 =
+        Let0123456789876543210Z x0123456789876543210 :: Nat
+    type family Let0123456789876543210Z x :: Nat where
+      Let0123456789876543210Z x = Apply (Apply Lambda_0123456789876543210Sym0 x) ZeroSym0
+    data Let0123456789876543210XSym0 x0123456789876543210
+      where
+        Let0123456789876543210XSym0KindInference :: SameKind (Apply Let0123456789876543210XSym0 arg) (Let0123456789876543210XSym1 arg) =>
+                                                    Let0123456789876543210XSym0 x0123456789876543210
+    type instance Apply Let0123456789876543210XSym0 x0123456789876543210 = Let0123456789876543210XSym1 x0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210XSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210XSym0KindInference) ())
+    type Let0123456789876543210XSym1 x0123456789876543210 =
+        Let0123456789876543210X x0123456789876543210 :: Nat
+    type family Let0123456789876543210X x :: Nat where
+      Let0123456789876543210X x = ZeroSym0
+    data Let0123456789876543210FSym0 x0123456789876543210
+      where
+        Let0123456789876543210FSym0KindInference :: SameKind (Apply Let0123456789876543210FSym0 arg) (Let0123456789876543210FSym1 arg) =>
+                                                    Let0123456789876543210FSym0 x0123456789876543210
+    type instance Apply Let0123456789876543210FSym0 x0123456789876543210 = Let0123456789876543210FSym1 x0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210FSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210FSym0KindInference) ())
+    data Let0123456789876543210FSym1 x0123456789876543210 :: (~>) Nat Nat
+      where
+        Let0123456789876543210FSym1KindInference :: SameKind (Apply (Let0123456789876543210FSym1 x0123456789876543210) arg) (Let0123456789876543210FSym2 x0123456789876543210 arg) =>
+                                                    Let0123456789876543210FSym1 x0123456789876543210 a0123456789876543210
+    type instance Apply (Let0123456789876543210FSym1 x0123456789876543210) a0123456789876543210 = Let0123456789876543210FSym2 x0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210FSym1 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210FSym1KindInference) ())
+    type Let0123456789876543210FSym2 x0123456789876543210 (a0123456789876543210 :: Nat) =
+        Let0123456789876543210F x0123456789876543210 a0123456789876543210 :: Nat
+    type family Let0123456789876543210F x (a :: Nat) :: Nat where
+      Let0123456789876543210F x y = Apply SuccSym0 y
+    data Let0123456789876543210ZSym0 x0123456789876543210
+      where
+        Let0123456789876543210ZSym0KindInference :: SameKind (Apply Let0123456789876543210ZSym0 arg) (Let0123456789876543210ZSym1 arg) =>
+                                                    Let0123456789876543210ZSym0 x0123456789876543210
+    type instance Apply Let0123456789876543210ZSym0 x0123456789876543210 = Let0123456789876543210ZSym1 x0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210ZSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210ZSym0KindInference) ())
+    type Let0123456789876543210ZSym1 x0123456789876543210 =
+        Let0123456789876543210Z x0123456789876543210 :: Nat
+    type family Let0123456789876543210Z x :: Nat where
+      Let0123456789876543210Z x = Apply (Let0123456789876543210FSym1 x) x
+    data Let0123456789876543210ZSym0 y0123456789876543210
+      where
+        Let0123456789876543210ZSym0KindInference :: SameKind (Apply Let0123456789876543210ZSym0 arg) (Let0123456789876543210ZSym1 arg) =>
+                                                    Let0123456789876543210ZSym0 y0123456789876543210
+    type instance Apply Let0123456789876543210ZSym0 y0123456789876543210 = Let0123456789876543210ZSym1 y0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210ZSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210ZSym0KindInference) ())
+    data Let0123456789876543210ZSym1 y0123456789876543210 x0123456789876543210
+      where
+        Let0123456789876543210ZSym1KindInference :: SameKind (Apply (Let0123456789876543210ZSym1 y0123456789876543210) arg) (Let0123456789876543210ZSym2 y0123456789876543210 arg) =>
+                                                    Let0123456789876543210ZSym1 y0123456789876543210 x0123456789876543210
+    type instance Apply (Let0123456789876543210ZSym1 y0123456789876543210) x0123456789876543210 = Let0123456789876543210ZSym2 y0123456789876543210 x0123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210ZSym1 y0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210ZSym1KindInference) ())
+    type Let0123456789876543210ZSym2 y0123456789876543210 x0123456789876543210 =
+        Let0123456789876543210Z y0123456789876543210 x0123456789876543210 :: Nat
+    type family Let0123456789876543210Z y x :: Nat where
+      Let0123456789876543210Z y x = Apply SuccSym0 y
+    data Let0123456789876543210FSym0 x0123456789876543210
+      where
+        Let0123456789876543210FSym0KindInference :: SameKind (Apply Let0123456789876543210FSym0 arg) (Let0123456789876543210FSym1 arg) =>
+                                                    Let0123456789876543210FSym0 x0123456789876543210
+    type instance Apply Let0123456789876543210FSym0 x0123456789876543210 = Let0123456789876543210FSym1 x0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210FSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210FSym0KindInference) ())
+    data Let0123456789876543210FSym1 x0123456789876543210 :: (~>) Nat Nat
+      where
+        Let0123456789876543210FSym1KindInference :: SameKind (Apply (Let0123456789876543210FSym1 x0123456789876543210) arg) (Let0123456789876543210FSym2 x0123456789876543210 arg) =>
+                                                    Let0123456789876543210FSym1 x0123456789876543210 a0123456789876543210
+    type instance Apply (Let0123456789876543210FSym1 x0123456789876543210) a0123456789876543210 = Let0123456789876543210FSym2 x0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210FSym1 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210FSym1KindInference) ())
+    type Let0123456789876543210FSym2 x0123456789876543210 (a0123456789876543210 :: Nat) =
+        Let0123456789876543210F x0123456789876543210 a0123456789876543210 :: Nat
+    type family Let0123456789876543210F x (a :: Nat) :: Nat where
+      Let0123456789876543210F x y = Apply SuccSym0 (Let0123456789876543210ZSym2 y x)
+    data Let0123456789876543210FSym0 x0123456789876543210
+      where
+        Let0123456789876543210FSym0KindInference :: SameKind (Apply Let0123456789876543210FSym0 arg) (Let0123456789876543210FSym1 arg) =>
+                                                    Let0123456789876543210FSym0 x0123456789876543210
+    type instance Apply Let0123456789876543210FSym0 x0123456789876543210 = Let0123456789876543210FSym1 x0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210FSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210FSym0KindInference) ())
+    data Let0123456789876543210FSym1 x0123456789876543210 :: (~>) Nat Nat
+      where
+        Let0123456789876543210FSym1KindInference :: SameKind (Apply (Let0123456789876543210FSym1 x0123456789876543210) arg) (Let0123456789876543210FSym2 x0123456789876543210 arg) =>
+                                                    Let0123456789876543210FSym1 x0123456789876543210 a0123456789876543210
+    type instance Apply (Let0123456789876543210FSym1 x0123456789876543210) a0123456789876543210 = Let0123456789876543210FSym2 x0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210FSym1 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210FSym1KindInference) ())
+    type Let0123456789876543210FSym2 x0123456789876543210 (a0123456789876543210 :: Nat) =
+        Let0123456789876543210F x0123456789876543210 a0123456789876543210 :: Nat
+    type family Let0123456789876543210F x (a :: Nat) :: Nat where
+      Let0123456789876543210F x y = Apply SuccSym0 y
+    data Let0123456789876543210YSym0 x0123456789876543210
+      where
+        Let0123456789876543210YSym0KindInference :: SameKind (Apply Let0123456789876543210YSym0 arg) (Let0123456789876543210YSym1 arg) =>
+                                                    Let0123456789876543210YSym0 x0123456789876543210
+    type instance Apply Let0123456789876543210YSym0 x0123456789876543210 = Let0123456789876543210YSym1 x0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210YSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210YSym0KindInference) ())
+    type Let0123456789876543210YSym1 x0123456789876543210 =
+        Let0123456789876543210Y x0123456789876543210 :: Nat
+    type family Let0123456789876543210Y x :: Nat where
+      Let0123456789876543210Y x = Apply SuccSym0 x
+    type Let0123456789876543210ZSym0 = Let0123456789876543210Z
+    type Let0123456789876543210YSym0 = Let0123456789876543210Y
+    type family Let0123456789876543210Z where
+      Let0123456789876543210Z = Apply SuccSym0 Let0123456789876543210YSym0
+    type family Let0123456789876543210Y where
+      Let0123456789876543210Y = Apply SuccSym0 ZeroSym0
+    data Let0123456789876543210YSym0 x0123456789876543210
+      where
+        Let0123456789876543210YSym0KindInference :: SameKind (Apply Let0123456789876543210YSym0 arg) (Let0123456789876543210YSym1 arg) =>
+                                                    Let0123456789876543210YSym0 x0123456789876543210
+    type instance Apply Let0123456789876543210YSym0 x0123456789876543210 = Let0123456789876543210YSym1 x0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210YSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210YSym0KindInference) ())
+    type Let0123456789876543210YSym1 x0123456789876543210 =
+        Let0123456789876543210Y x0123456789876543210 :: Nat
+    type family Let0123456789876543210Y x :: Nat where
+      Let0123456789876543210Y x = Apply SuccSym0 ZeroSym0
+    type Foo14Sym0 :: (~>) Nat (Nat, Nat)
+    data Foo14Sym0 a0123456789876543210
+      where
+        Foo14Sym0KindInference :: SameKind (Apply Foo14Sym0 arg) (Foo14Sym1 arg) =>
+                                  Foo14Sym0 a0123456789876543210
+    type instance Apply Foo14Sym0 a0123456789876543210 = Foo14Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo14Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo14Sym0KindInference) ())
+    type Foo14Sym1 (a0123456789876543210 :: Nat) =
+        Foo14 a0123456789876543210 :: (Nat, Nat)
+    type Foo13_Sym0 :: (~>) a a
+    data Foo13_Sym0 a0123456789876543210
+      where
+        Foo13_Sym0KindInference :: SameKind (Apply Foo13_Sym0 arg) (Foo13_Sym1 arg) =>
+                                   Foo13_Sym0 a0123456789876543210
+    type instance Apply Foo13_Sym0 a0123456789876543210 = Foo13_Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo13_Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo13_Sym0KindInference) ())
+    type Foo13_Sym1 (a0123456789876543210 :: a) =
+        Foo13_ a0123456789876543210 :: a
+    type Foo13Sym0 :: forall a. (~>) a a
+    data Foo13Sym0 a0123456789876543210
+      where
+        Foo13Sym0KindInference :: SameKind (Apply Foo13Sym0 arg) (Foo13Sym1 arg) =>
+                                  Foo13Sym0 a0123456789876543210
+    type instance Apply Foo13Sym0 a0123456789876543210 = Foo13Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo13Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo13Sym0KindInference) ())
+    type Foo13Sym1 (a0123456789876543210 :: a) =
+        Foo13 a0123456789876543210 :: a
+    type Foo12Sym0 :: (~>) Nat Nat
+    data Foo12Sym0 a0123456789876543210
+      where
+        Foo12Sym0KindInference :: SameKind (Apply Foo12Sym0 arg) (Foo12Sym1 arg) =>
+                                  Foo12Sym0 a0123456789876543210
+    type instance Apply Foo12Sym0 a0123456789876543210 = Foo12Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo12Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo12Sym0KindInference) ())
+    type Foo12Sym1 (a0123456789876543210 :: Nat) =
+        Foo12 a0123456789876543210 :: Nat
+    type Foo11Sym0 :: (~>) Nat Nat
+    data Foo11Sym0 a0123456789876543210
+      where
+        Foo11Sym0KindInference :: SameKind (Apply Foo11Sym0 arg) (Foo11Sym1 arg) =>
+                                  Foo11Sym0 a0123456789876543210
+    type instance Apply Foo11Sym0 a0123456789876543210 = Foo11Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo11Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo11Sym0KindInference) ())
+    type Foo11Sym1 (a0123456789876543210 :: Nat) =
+        Foo11 a0123456789876543210 :: Nat
+    type Foo10Sym0 :: (~>) Nat Nat
+    data Foo10Sym0 a0123456789876543210
+      where
+        Foo10Sym0KindInference :: SameKind (Apply Foo10Sym0 arg) (Foo10Sym1 arg) =>
+                                  Foo10Sym0 a0123456789876543210
+    type instance Apply Foo10Sym0 a0123456789876543210 = Foo10Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo10Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo10Sym0KindInference) ())
+    type Foo10Sym1 (a0123456789876543210 :: Nat) =
+        Foo10 a0123456789876543210 :: Nat
+    type Foo9Sym0 :: (~>) Nat Nat
+    data Foo9Sym0 a0123456789876543210
+      where
+        Foo9Sym0KindInference :: SameKind (Apply Foo9Sym0 arg) (Foo9Sym1 arg) =>
+                                 Foo9Sym0 a0123456789876543210
+    type instance Apply Foo9Sym0 a0123456789876543210 = Foo9Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo9Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo9Sym0KindInference) ())
+    type Foo9Sym1 (a0123456789876543210 :: Nat) =
+        Foo9 a0123456789876543210 :: Nat
+    type Foo8Sym0 :: (~>) Nat Nat
+    data Foo8Sym0 a0123456789876543210
+      where
+        Foo8Sym0KindInference :: SameKind (Apply Foo8Sym0 arg) (Foo8Sym1 arg) =>
+                                 Foo8Sym0 a0123456789876543210
+    type instance Apply Foo8Sym0 a0123456789876543210 = Foo8Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo8Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo8Sym0KindInference) ())
+    type Foo8Sym1 (a0123456789876543210 :: Nat) =
+        Foo8 a0123456789876543210 :: Nat
+    type Foo7Sym0 :: (~>) Nat Nat
+    data Foo7Sym0 a0123456789876543210
+      where
+        Foo7Sym0KindInference :: SameKind (Apply Foo7Sym0 arg) (Foo7Sym1 arg) =>
+                                 Foo7Sym0 a0123456789876543210
+    type instance Apply Foo7Sym0 a0123456789876543210 = Foo7Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo7Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo7Sym0KindInference) ())
+    type Foo7Sym1 (a0123456789876543210 :: Nat) =
+        Foo7 a0123456789876543210 :: Nat
+    type Foo6Sym0 :: (~>) Nat Nat
+    data Foo6Sym0 a0123456789876543210
+      where
+        Foo6Sym0KindInference :: SameKind (Apply Foo6Sym0 arg) (Foo6Sym1 arg) =>
+                                 Foo6Sym0 a0123456789876543210
+    type instance Apply Foo6Sym0 a0123456789876543210 = Foo6Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo6Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo6Sym0KindInference) ())
+    type Foo6Sym1 (a0123456789876543210 :: Nat) =
+        Foo6 a0123456789876543210 :: Nat
+    type Foo5Sym0 :: (~>) Nat Nat
+    data Foo5Sym0 a0123456789876543210
+      where
+        Foo5Sym0KindInference :: SameKind (Apply Foo5Sym0 arg) (Foo5Sym1 arg) =>
+                                 Foo5Sym0 a0123456789876543210
+    type instance Apply Foo5Sym0 a0123456789876543210 = Foo5Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo5Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo5Sym0KindInference) ())
+    type Foo5Sym1 (a0123456789876543210 :: Nat) =
+        Foo5 a0123456789876543210 :: Nat
+    type Foo4Sym0 :: (~>) Nat Nat
+    data Foo4Sym0 a0123456789876543210
+      where
+        Foo4Sym0KindInference :: SameKind (Apply Foo4Sym0 arg) (Foo4Sym1 arg) =>
+                                 Foo4Sym0 a0123456789876543210
+    type instance Apply Foo4Sym0 a0123456789876543210 = Foo4Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo4Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo4Sym0KindInference) ())
+    type Foo4Sym1 (a0123456789876543210 :: Nat) =
+        Foo4 a0123456789876543210 :: Nat
+    type Foo3Sym0 :: (~>) Nat Nat
+    data Foo3Sym0 a0123456789876543210
+      where
+        Foo3Sym0KindInference :: SameKind (Apply Foo3Sym0 arg) (Foo3Sym1 arg) =>
+                                 Foo3Sym0 a0123456789876543210
+    type instance Apply Foo3Sym0 a0123456789876543210 = Foo3Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo3Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo3Sym0KindInference) ())
+    type Foo3Sym1 (a0123456789876543210 :: Nat) =
+        Foo3 a0123456789876543210 :: Nat
+    type Foo2Sym0 = Foo2 :: Nat
+    type Foo1Sym0 :: (~>) Nat Nat
+    data Foo1Sym0 a0123456789876543210
+      where
+        Foo1Sym0KindInference :: SameKind (Apply Foo1Sym0 arg) (Foo1Sym1 arg) =>
+                                 Foo1Sym0 a0123456789876543210
+    type instance Apply Foo1Sym0 a0123456789876543210 = Foo1Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo1Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo1Sym0KindInference) ())
+    type Foo1Sym1 (a0123456789876543210 :: Nat) =
+        Foo1 a0123456789876543210 :: Nat
+    type Foo14 :: Nat -> (Nat, Nat)
+    type family Foo14 a where
+      Foo14 x = Apply (Apply Tuple2Sym0 (Let0123456789876543210ZSym1 x)) (Let0123456789876543210YSym1 x)
+    type Foo13_ :: a -> a
+    type family Foo13_ a where
+      Foo13_ y = y
+    type Foo13 :: forall a. a -> a
+    type family Foo13 a where
+      Foo13 x = Apply Foo13_Sym0 (Let0123456789876543210BarSym1 x)
+    type Foo12 :: Nat -> Nat
+    type family Foo12 a where
+      Foo12 x = Apply (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x) x) (Apply SuccSym0 (Apply SuccSym0 ZeroSym0))
+    type Foo11 :: Nat -> Nat
+    type family Foo11 a where
+      Foo11 x = Apply (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x) (Apply SuccSym0 ZeroSym0)) (Let0123456789876543210ZSym1 x)
+    type Foo10 :: Nat -> Nat
+    type family Foo10 a where
+      Foo10 x = Apply (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x) (Apply SuccSym0 ZeroSym0)) x
+    type Foo9 :: Nat -> Nat
+    type family Foo9 a where
+      Foo9 x = Apply (Let0123456789876543210ZSym1 x) x
+    type Foo8 :: Nat -> Nat
+    type family Foo8 a where
+      Foo8 x = Let0123456789876543210ZSym1 x
+    type Foo7 :: Nat -> Nat
+    type family Foo7 a where
+      Foo7 x = Let0123456789876543210XSym1 x
+    type Foo6 :: Nat -> Nat
+    type family Foo6 a where
+      Foo6 x = Let0123456789876543210ZSym1 x
+    type Foo5 :: Nat -> Nat
+    type family Foo5 a where
+      Foo5 x = Apply (Let0123456789876543210FSym1 x) x
+    type Foo4 :: Nat -> Nat
+    type family Foo4 a where
+      Foo4 x = Apply (Let0123456789876543210FSym1 x) x
+    type Foo3 :: Nat -> Nat
+    type family Foo3 a where
+      Foo3 x = Let0123456789876543210YSym1 x
+    type Foo2 :: Nat
+    type family Foo2 where
+      Foo2 = Let0123456789876543210ZSym0
+    type Foo1 :: Nat -> Nat
+    type family Foo1 a where
+      Foo1 x = Let0123456789876543210YSym1 x
+    sFoo14 ::
+      forall (t :: Nat). Sing t -> Sing (Apply Foo14Sym0 t :: (Nat, Nat))
+    sFoo13_ ::
+      forall a (t :: a). Sing t -> Sing (Apply Foo13_Sym0 t :: a)
+    sFoo13 ::
+      forall a (t :: a). Sing t -> Sing (Apply Foo13Sym0 t :: a)
+    sFoo12 ::
+      forall (t :: Nat). Sing t -> Sing (Apply Foo12Sym0 t :: Nat)
+    sFoo11 ::
+      forall (t :: Nat). Sing t -> Sing (Apply Foo11Sym0 t :: Nat)
+    sFoo10 ::
+      forall (t :: Nat). Sing t -> Sing (Apply Foo10Sym0 t :: Nat)
+    sFoo9 ::
+      forall (t :: Nat). Sing t -> Sing (Apply Foo9Sym0 t :: Nat)
+    sFoo8 ::
+      forall (t :: Nat). Sing t -> Sing (Apply Foo8Sym0 t :: Nat)
+    sFoo7 ::
+      forall (t :: Nat). Sing t -> Sing (Apply Foo7Sym0 t :: Nat)
+    sFoo6 ::
+      forall (t :: Nat). Sing t -> Sing (Apply Foo6Sym0 t :: Nat)
+    sFoo5 ::
+      forall (t :: Nat). Sing t -> Sing (Apply Foo5Sym0 t :: Nat)
+    sFoo4 ::
+      forall (t :: Nat). Sing t -> Sing (Apply Foo4Sym0 t :: Nat)
+    sFoo3 ::
+      forall (t :: Nat). Sing t -> Sing (Apply Foo3Sym0 t :: Nat)
+    sFoo2 :: Sing (Foo2Sym0 :: Nat)
+    sFoo1 ::
+      forall (t :: Nat). Sing t -> Sing (Apply Foo1Sym0 t :: Nat)
+    sFoo14 (sX :: Sing x)
+      = let
+          sZ :: Sing @_ (Let0123456789876543210ZSym1 x)
+          sY :: Sing @_ (Let0123456789876543210YSym1 x)
+          sX_0123456789876543210 ::
+            Sing @_ (Let0123456789876543210X_0123456789876543210Sym1 x)
+          sZ
+            = (id
+                 @(Sing (Case_0123456789876543210 x (Let0123456789876543210X_0123456789876543210Sym1 x))))
+                (case sX_0123456789876543210 of {
+                   STuple2 _ (sY_0123456789876543210 :: Sing y_0123456789876543210)
+                     -> sY_0123456789876543210 })
+          sY
+            = (id
+                 @(Sing (Case_0123456789876543210 x (Let0123456789876543210X_0123456789876543210Sym1 x))))
+                (case sX_0123456789876543210 of {
+                   STuple2 (sY_0123456789876543210 :: Sing y_0123456789876543210) _
+                     -> sY_0123456789876543210 })
+          sX_0123456789876543210
+            = (applySing
+                 ((applySing ((singFun2 @Tuple2Sym0) STuple2))
+                    ((applySing ((singFun1 @SuccSym0) SSucc)) sX)))
+                sX
+        in (applySing ((applySing ((singFun2 @Tuple2Sym0) STuple2)) sZ)) sY
+    sFoo13_ (sY :: Sing y) = sY
+    sFoo13 (sX :: Sing x)
+      = let
+          sBar :: Sing (Let0123456789876543210BarSym1 x :: a)
+          sBar = sX
+        in (applySing ((singFun1 @Foo13_Sym0) sFoo13_)) sBar
+    sFoo12 (sX :: Sing x)
+      = let
+          (%+) ::
+            forall (t :: Nat) (t :: Nat).
+            Sing t
+            -> Sing t
+               -> Sing (Apply (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x) t) t :: Nat)
+          (%+) SZero (sM :: Sing m) = sM
+          (%+) (SSucc (sN :: Sing n)) (sM :: Sing m)
+            = (applySing ((singFun1 @SuccSym0) SSucc))
+                ((applySing
+                    ((applySing ((singFun2 @((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x)) (%+)))
+                       sN))
+                   sX)
+        in
+          (applySing
+             ((applySing ((singFun2 @((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x)) (%+)))
+                sX))
+            ((applySing ((singFun1 @SuccSym0) SSucc))
+               ((applySing ((singFun1 @SuccSym0) SSucc)) SZero))
+    sFoo11 (sX :: Sing x)
+      = let
+          sZ :: Sing (Let0123456789876543210ZSym1 x :: Nat)
+          (%+) ::
+            forall (t :: Nat) (t :: Nat).
+            Sing t
+            -> Sing t
+               -> Sing (Apply (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x) t) t :: Nat)
+          sZ = sX
+          (%+) SZero (sM :: Sing m) = sM
+          (%+) (SSucc (sN :: Sing n)) (sM :: Sing m)
+            = (applySing ((singFun1 @SuccSym0) SSucc))
+                ((applySing
+                    ((applySing ((singFun2 @((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x)) (%+)))
+                       sN))
+                   sM)
+        in
+          (applySing
+             ((applySing ((singFun2 @((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x)) (%+)))
+                ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
+            sZ
+    sFoo10 (sX :: Sing x)
+      = let
+          (%+) ::
+            forall (t :: Nat) (t :: Nat).
+            Sing t
+            -> Sing t
+               -> Sing (Apply (Apply ((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x) t) t :: Nat)
+          (%+) SZero (sM :: Sing m) = sM
+          (%+) (SSucc (sN :: Sing n)) (sM :: Sing m)
+            = (applySing ((singFun1 @SuccSym0) SSucc))
+                ((applySing
+                    ((applySing ((singFun2 @((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x)) (%+)))
+                       sN))
+                   sM)
+        in
+          (applySing
+             ((applySing ((singFun2 @((<<<%%%%%%%%%%%%%%%%%%%%@#@$$) x)) (%+)))
+                ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
+            sX
+    sFoo9 (sX :: Sing x)
+      = let
+          sZ ::
+            forall (t :: Nat).
+            Sing t -> Sing (Apply (Let0123456789876543210ZSym1 x) t :: Nat)
+          sZ (sA_0123456789876543210 :: Sing a_0123456789876543210)
+            = (applySing
+                 ((singFun1
+                     @(Apply (Apply Lambda_0123456789876543210Sym0 a_0123456789876543210) x))
+                    (\ sX -> case sX of { (_ :: Sing x) -> sX })))
+                sA_0123456789876543210
+        in (applySing ((singFun1 @(Let0123456789876543210ZSym1 x)) sZ)) sX
+    sFoo8 (sX :: Sing x)
+      = let
+          sZ :: Sing (Let0123456789876543210ZSym1 x :: Nat)
+          sZ
+            = (applySing
+                 ((singFun1 @(Apply Lambda_0123456789876543210Sym0 x))
+                    (\ sX -> case sX of { (_ :: Sing x) -> sX })))
+                SZero
+        in sZ
+    sFoo7 (sX :: Sing x)
+      = let
+          sX :: Sing (Let0123456789876543210XSym1 x :: Nat)
+          sX = SZero
+        in sX
+    sFoo6 (sX :: Sing x)
+      = let
+          sF ::
+            forall (t :: Nat).
+            Sing t -> Sing (Apply (Let0123456789876543210FSym1 x) t :: Nat)
+          sF (sY :: Sing y) = (applySing ((singFun1 @SuccSym0) SSucc)) sY in
+        let
+          sZ :: Sing (Let0123456789876543210ZSym1 x :: Nat)
+          sZ
+            = (applySing ((singFun1 @(Let0123456789876543210FSym1 x)) sF)) sX
+        in sZ
+    sFoo5 (sX :: Sing x)
+      = let
+          sF ::
+            forall (t :: Nat).
+            Sing t -> Sing (Apply (Let0123456789876543210FSym1 x) t :: Nat)
+          sF (sY :: Sing y)
+            = let
+                sZ :: Sing (Let0123456789876543210ZSym2 y x :: Nat)
+                sZ = (applySing ((singFun1 @SuccSym0) SSucc)) sY
+              in (applySing ((singFun1 @SuccSym0) SSucc)) sZ
+        in (applySing ((singFun1 @(Let0123456789876543210FSym1 x)) sF)) sX
+    sFoo4 (sX :: Sing x)
+      = let
+          sF ::
+            forall (t :: Nat).
+            Sing t -> Sing (Apply (Let0123456789876543210FSym1 x) t :: Nat)
+          sF (sY :: Sing y) = (applySing ((singFun1 @SuccSym0) SSucc)) sY
+        in (applySing ((singFun1 @(Let0123456789876543210FSym1 x)) sF)) sX
+    sFoo3 (sX :: Sing x)
+      = let
+          sY :: Sing (Let0123456789876543210YSym1 x :: Nat)
+          sY = (applySing ((singFun1 @SuccSym0) SSucc)) sX
+        in sY
+    sFoo2
+      = let
+          sZ :: Sing @_ Let0123456789876543210ZSym0
+          sY :: Sing @_ Let0123456789876543210YSym0
+          sZ = (applySing ((singFun1 @SuccSym0) SSucc)) sY
+          sY = (applySing ((singFun1 @SuccSym0) SSucc)) SZero
+        in sZ
+    sFoo1 (sX :: Sing x)
+      = let
+          sY :: Sing (Let0123456789876543210YSym1 x :: Nat)
+          sY = (applySing ((singFun1 @SuccSym0) SSucc)) SZero
+        in sY
+    instance SingI (Foo14Sym0 :: (~>) Nat (Nat, Nat)) where
+      sing = (singFun1 @Foo14Sym0) sFoo14
+    instance SingI (Foo13_Sym0 :: (~>) a a) where
+      sing = (singFun1 @Foo13_Sym0) sFoo13_
+    instance SingI (Foo13Sym0 :: (~>) a a) where
+      sing = (singFun1 @Foo13Sym0) sFoo13
+    instance SingI (Foo12Sym0 :: (~>) Nat Nat) where
+      sing = (singFun1 @Foo12Sym0) sFoo12
+    instance SingI (Foo11Sym0 :: (~>) Nat Nat) where
+      sing = (singFun1 @Foo11Sym0) sFoo11
+    instance SingI (Foo10Sym0 :: (~>) Nat Nat) where
+      sing = (singFun1 @Foo10Sym0) sFoo10
+    instance SingI (Foo9Sym0 :: (~>) Nat Nat) where
+      sing = (singFun1 @Foo9Sym0) sFoo9
+    instance SingI (Foo8Sym0 :: (~>) Nat Nat) where
+      sing = (singFun1 @Foo8Sym0) sFoo8
+    instance SingI (Foo7Sym0 :: (~>) Nat Nat) where
+      sing = (singFun1 @Foo7Sym0) sFoo7
+    instance SingI (Foo6Sym0 :: (~>) Nat Nat) where
+      sing = (singFun1 @Foo6Sym0) sFoo6
+    instance SingI (Foo5Sym0 :: (~>) Nat Nat) where
+      sing = (singFun1 @Foo5Sym0) sFoo5
+    instance SingI (Foo4Sym0 :: (~>) Nat Nat) where
+      sing = (singFun1 @Foo4Sym0) sFoo4
+    instance SingI (Foo3Sym0 :: (~>) Nat Nat) where
+      sing = (singFun1 @Foo3Sym0) sFoo3
+    instance SingI (Foo1Sym0 :: (~>) Nat Nat) where
+      sing = (singFun1 @Foo1Sym0) sFoo1
diff --git a/tests/compile-and-dump/Singletons/Maybe.ghc88.template b/tests/compile-and-dump/Singletons/Maybe.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/Maybe.ghc88.template
+++ /dev/null
@@ -1,157 +0,0 @@
-Singletons/Maybe.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| data Maybe a
-            = Nothing | Just a
-            deriving (Eq, Show) |]
-  ======>
-    data Maybe a
-      = Nothing | Just a
-      deriving (Eq, Show)
-    type NothingSym0 = Nothing
-    type JustSym1 (t0123456789876543210 :: a0123456789876543210) =
-        Just t0123456789876543210
-    instance SuppressUnusedWarnings JustSym0 where
-      suppressUnusedWarnings = snd (((,) JustSym0KindInference) ())
-    data JustSym0 :: forall a0123456789876543210.
-                     (~>) a0123456789876543210 (Maybe a0123456789876543210)
-      where
-        JustSym0KindInference :: forall t0123456789876543210
-                                        arg. SameKind (Apply JustSym0 arg) (JustSym1 arg) =>
-                                 JustSym0 t0123456789876543210
-    type instance Apply JustSym0 t0123456789876543210 = Just t0123456789876543210
-    type family ShowsPrec_0123456789876543210 (a :: GHC.Types.Nat) (a :: Maybe a) (a :: GHC.Types.Symbol) :: GHC.Types.Symbol where
-      ShowsPrec_0123456789876543210 _ Nothing a_0123456789876543210 = Apply (Apply ShowStringSym0 "Nothing") a_0123456789876543210
-      ShowsPrec_0123456789876543210 p_0123456789876543210 (Just arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (Data.Singletons.Prelude.Num.FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Just ")) (Apply (Apply ShowsPrecSym0 (Data.Singletons.Prelude.Num.FromInteger 11)) arg_0123456789876543210))) a_0123456789876543210
-    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Maybe a0123456789876543210) (a0123456789876543210 :: GHC.Types.Symbol) =
-        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
-    data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Maybe a0123456789876543210) :: (~>) GHC.Types.Symbol GHC.Types.Symbol
-      where
-        ShowsPrec_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
-    data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) :: forall a0123456789876543210.
-                                                                                      (~>) (Maybe a0123456789876543210) ((~>) GHC.Types.Symbol GHC.Types.Symbol)
-      where
-        ShowsPrec_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
-    data ShowsPrec_0123456789876543210Sym0 :: forall a0123456789876543210.
-                                              (~>) GHC.Types.Nat ((~>) (Maybe a0123456789876543210) ((~>) GHC.Types.Symbol GHC.Types.Symbol))
-      where
-        ShowsPrec_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
-    instance PShow (Maybe a) where
-      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
-    type family Equals_0123456789876543210 (a :: Maybe a) (b :: Maybe a) :: Bool where
-      Equals_0123456789876543210 Nothing Nothing = TrueSym0
-      Equals_0123456789876543210 (Just a) (Just b) = (==) a b
-      Equals_0123456789876543210 (_ :: Maybe a) (_ :: Maybe a) = FalseSym0
-    instance PEq (Maybe a) where
-      type (==) a b = Equals_0123456789876543210 a b
-    data SMaybe :: forall a. Maybe a -> GHC.Types.Type
-      where
-        SNothing :: SMaybe Nothing
-        SJust :: forall a (n :: a). (Sing (n :: a)) -> SMaybe (Just n)
-    type instance Sing @(Maybe a) = SMaybe
-    instance SingKind a => SingKind (Maybe a) where
-      type Demote (Maybe a) = Maybe (Demote a)
-      fromSing SNothing = Nothing
-      fromSing (SJust b) = Just (fromSing b)
-      toSing Nothing = SomeSing SNothing
-      toSing (Just (b :: Demote a))
-        = case toSing b :: SomeSing a of {
-            SomeSing c -> SomeSing (SJust c) }
-    instance SShow a => SShow (Maybe a) where
-      sShowsPrec ::
-        forall (t1 :: GHC.Types.Nat)
-               (t2 :: Maybe a)
-               (t3 :: GHC.Types.Symbol).
-        Sing t1
-        -> Sing t2
-           -> Sing t3
-              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) (Maybe a) ((~>) GHC.Types.Symbol GHC.Types.Symbol))
-                                                             -> GHC.Types.Type) t1) t2) t3)
-      sShowsPrec
-        _
-        SNothing
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "Nothing")))
-            sA_0123456789876543210
-      sShowsPrec
-        (sP_0123456789876543210 :: Sing p_0123456789876543210)
-        (SJust (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
-                    ((applySing
-                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
-                       (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 10)))))
-                ((applySing
-                    ((applySing ((singFun3 @(.@#@$)) (%.)))
-                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                          (sing :: Sing "Just "))))
-                   ((applySing
-                       ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                          (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 11))))
-                      sArg_0123456789876543210))))
-            sA_0123456789876543210
-    instance SEq a => SEq (Maybe a) where
-      (%==) SNothing SNothing = STrue
-      (%==) SNothing (SJust _) = SFalse
-      (%==) (SJust _) SNothing = SFalse
-      (%==) (SJust a) (SJust b) = ((%==) a) b
-    instance SDecide a => SDecide (Maybe a) where
-      (%~) SNothing SNothing = Proved Refl
-      (%~) SNothing (SJust _) = Disproved (\ x -> case x of)
-      (%~) (SJust _) SNothing = Disproved (\ x -> case x of)
-      (%~) (SJust a) (SJust b)
-        = case ((%~) a) b of
-            Proved Refl -> Proved Refl
-            Disproved contra
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-    instance SDecide a =>
-             Data.Type.Equality.TestEquality (SMaybe :: Maybe a
-                                                        -> GHC.Types.Type) where
-      Data.Type.Equality.testEquality
-        = Data.Singletons.Decide.decideEquality
-    instance SDecide a =>
-             Data.Type.Coercion.TestCoercion (SMaybe :: Maybe a
-                                                        -> GHC.Types.Type) where
-      Data.Type.Coercion.testCoercion
-        = Data.Singletons.Decide.decideCoercion
-    instance Data.Singletons.ShowSing.ShowSing a =>
-             Show (SMaybe (z :: Maybe a)) where
-      showsPrec _ SNothing = showString "SNothing"
-      showsPrec
-        p_0123456789876543210
-        (SJust (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
-        = (showParen (((>) p_0123456789876543210) 10))
-            (((.) (showString "SJust "))
-               ((showsPrec 11) arg_0123456789876543210)) ::
-            Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210 =>
-            ShowS
-    instance SingI Nothing where
-      sing = SNothing
-    instance SingI n => SingI (Just (n :: a)) where
-      sing = SJust sing
-    instance SingI (JustSym0 :: (~>) a (Maybe a)) where
-      sing = (singFun1 @JustSym0) SJust
diff --git a/tests/compile-and-dump/Singletons/Maybe.golden b/tests/compile-and-dump/Singletons/Maybe.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/Maybe.golden
@@ -0,0 +1,156 @@
+Singletons/Maybe.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| data Maybe a
+            = Nothing | Just a
+            deriving (Eq, Show) |]
+  ======>
+    data Maybe a
+      = Nothing | Just a
+      deriving (Eq, Show)
+    type NothingSym0 = Nothing :: Maybe a
+    type JustSym0 :: forall a. (~>) a (Maybe a)
+    data JustSym0 a0123456789876543210
+      where
+        JustSym0KindInference :: SameKind (Apply JustSym0 arg) (JustSym1 arg) =>
+                                 JustSym0 a0123456789876543210
+    type instance Apply JustSym0 a0123456789876543210 = JustSym1 a0123456789876543210
+    instance SuppressUnusedWarnings JustSym0 where
+      suppressUnusedWarnings = snd (((,) JustSym0KindInference) ())
+    type JustSym1 (a0123456789876543210 :: a) =
+        Just a0123456789876543210 :: Maybe a
+    type ShowsPrec_0123456789876543210 :: GHC.Types.Nat
+                                          -> Maybe a -> GHC.Types.Symbol -> GHC.Types.Symbol
+    type family ShowsPrec_0123456789876543210 a a a where
+      ShowsPrec_0123456789876543210 _ Nothing a_0123456789876543210 = Apply (Apply ShowStringSym0 "Nothing") a_0123456789876543210
+      ShowsPrec_0123456789876543210 p_0123456789876543210 (Just arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (Data.Singletons.Prelude.Num.FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Just ")) (Apply (Apply ShowsPrecSym0 (Data.Singletons.Prelude.Num.FromInteger 11)) arg_0123456789876543210))) a_0123456789876543210
+    type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) (Maybe a) ((~>) GHC.Types.Symbol GHC.Types.Symbol))
+    data ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
+    type ShowsPrec_0123456789876543210Sym1 :: GHC.Types.Nat
+                                              -> (~>) (Maybe a) ((~>) GHC.Types.Symbol GHC.Types.Symbol)
+    data ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
+    type ShowsPrec_0123456789876543210Sym2 :: GHC.Types.Nat
+                                              -> Maybe a -> (~>) GHC.Types.Symbol GHC.Types.Symbol
+    data ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
+    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Maybe a) (a0123456789876543210 :: GHC.Types.Symbol) =
+        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: GHC.Types.Symbol
+    instance PShow (Maybe a) where
+      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
+    type Equals_0123456789876543210 :: Maybe a -> Maybe a -> Bool
+    type family Equals_0123456789876543210 a b where
+      Equals_0123456789876543210 Nothing Nothing = TrueSym0
+      Equals_0123456789876543210 (Just a) (Just b) = (==) a b
+      Equals_0123456789876543210 (_ :: Maybe a) (_ :: Maybe a) = FalseSym0
+    instance PEq (Maybe a) where
+      type (==) a b = Equals_0123456789876543210 a b
+    data SMaybe :: forall a. Maybe a -> GHC.Types.Type
+      where
+        SNothing :: forall a. SMaybe (Nothing :: Maybe a)
+        SJust :: forall a (n :: a). (Sing n) -> SMaybe (Just n :: Maybe a)
+    type instance Sing @(Maybe a) = SMaybe
+    instance SingKind a => SingKind (Maybe a) where
+      type Demote (Maybe a) = Maybe (Demote a)
+      fromSing SNothing = Nothing
+      fromSing (SJust b) = Just (fromSing b)
+      toSing Nothing = SomeSing SNothing
+      toSing (Just (b :: Demote a))
+        = case toSing b :: SomeSing a of {
+            SomeSing c -> SomeSing (SJust c) }
+    instance SShow a => SShow (Maybe a) where
+      sShowsPrec ::
+        forall (t1 :: GHC.Types.Nat)
+               (t2 :: Maybe a)
+               (t3 :: GHC.Types.Symbol).
+        Sing t1
+        -> Sing t2
+           -> Sing t3
+              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) (Maybe a) ((~>) GHC.Types.Symbol GHC.Types.Symbol))
+                                                             -> GHC.Types.Type) t1) t2) t3)
+      sShowsPrec
+        _
+        SNothing
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "Nothing")))
+            sA_0123456789876543210
+      sShowsPrec
+        (sP_0123456789876543210 :: Sing p_0123456789876543210)
+        (SJust (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
+                    ((applySing
+                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
+                       (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 10)))))
+                ((applySing
+                    ((applySing ((singFun3 @(.@#@$)) (%.)))
+                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                          (sing :: Sing "Just "))))
+                   ((applySing
+                       ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                          (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 11))))
+                      sArg_0123456789876543210))))
+            sA_0123456789876543210
+    instance SEq a => SEq (Maybe a) where
+      (%==) SNothing SNothing = STrue
+      (%==) SNothing (SJust _) = SFalse
+      (%==) (SJust _) SNothing = SFalse
+      (%==) (SJust a) (SJust b) = ((%==) a) b
+    instance SDecide a => SDecide (Maybe a) where
+      (%~) SNothing SNothing = Proved Refl
+      (%~) SNothing (SJust _) = Disproved (\ x -> case x of)
+      (%~) (SJust _) SNothing = Disproved (\ x -> case x of)
+      (%~) (SJust a) (SJust b)
+        = case ((%~) a) b of
+            Proved Refl -> Proved Refl
+            Disproved contra
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+    instance SDecide a =>
+             Data.Type.Equality.TestEquality (SMaybe :: Maybe a
+                                                        -> GHC.Types.Type) where
+      Data.Type.Equality.testEquality
+        = Data.Singletons.Decide.decideEquality
+    instance SDecide a =>
+             Data.Type.Coercion.TestCoercion (SMaybe :: Maybe a
+                                                        -> GHC.Types.Type) where
+      Data.Type.Coercion.testCoercion
+        = Data.Singletons.Decide.decideCoercion
+    instance Data.Singletons.ShowSing.ShowSing a =>
+             Show (SMaybe (z :: Maybe a)) where
+      showsPrec _ SNothing = showString "SNothing"
+      showsPrec
+        p_0123456789876543210
+        (SJust (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
+        = (showParen (((>) p_0123456789876543210) 10))
+            (((.) (showString "SJust "))
+               ((showsPrec 11) arg_0123456789876543210)) ::
+            Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210 =>
+            ShowS
+    instance SingI Nothing where
+      sing = SNothing
+    instance SingI n => SingI (Just (n :: a)) where
+      sing = SJust sing
+    instance SingI (JustSym0 :: (~>) a (Maybe a)) where
+      sing = (singFun1 @JustSym0) SJust
diff --git a/tests/compile-and-dump/Singletons/Nat.ghc88.template b/tests/compile-and-dump/Singletons/Nat.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/Nat.ghc88.template
+++ /dev/null
@@ -1,283 +0,0 @@
-Singletons/Nat.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| plus :: Nat -> Nat -> Nat
-          plus Zero m = m
-          plus (Succ n) m = Succ (plus n m)
-          pred :: Nat -> Nat
-          pred Zero = Zero
-          pred (Succ n) = n
-          
-          data Nat
-            where
-              Zero :: Nat
-              Succ :: Nat -> Nat
-            deriving (Eq, Show, Read, Ord) |]
-  ======>
-    data Nat
-      where
-        Zero :: Nat
-        Succ :: Nat -> Nat
-      deriving (Eq, Show, Read, Ord)
-    plus :: Nat -> Nat -> Nat
-    plus Zero m = m
-    plus (Succ n) m = Succ ((plus n) m)
-    pred :: Nat -> Nat
-    pred Zero = Zero
-    pred (Succ n) = n
-    type ZeroSym0 = Zero
-    type SuccSym1 (t0123456789876543210 :: Nat) =
-        Succ t0123456789876543210
-    instance SuppressUnusedWarnings SuccSym0 where
-      suppressUnusedWarnings = snd (((,) SuccSym0KindInference) ())
-    data SuccSym0 :: (~>) Nat Nat
-      where
-        SuccSym0KindInference :: forall t0123456789876543210
-                                        arg. SameKind (Apply SuccSym0 arg) (SuccSym1 arg) =>
-                                 SuccSym0 t0123456789876543210
-    type instance Apply SuccSym0 t0123456789876543210 = Succ t0123456789876543210
-    type PredSym1 (a0123456789876543210 :: Nat) =
-        Pred a0123456789876543210
-    instance SuppressUnusedWarnings PredSym0 where
-      suppressUnusedWarnings = snd (((,) PredSym0KindInference) ())
-    data PredSym0 :: (~>) Nat Nat
-      where
-        PredSym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply PredSym0 arg) (PredSym1 arg) =>
-                                 PredSym0 a0123456789876543210
-    type instance Apply PredSym0 a0123456789876543210 = Pred a0123456789876543210
-    type PlusSym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
-        Plus a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (PlusSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) PlusSym1KindInference) ())
-    data PlusSym1 (a0123456789876543210 :: Nat) :: (~>) Nat Nat
-      where
-        PlusSym1KindInference :: forall a0123456789876543210
-                                        a0123456789876543210
-                                        arg. SameKind (Apply (PlusSym1 a0123456789876543210) arg) (PlusSym2 a0123456789876543210 arg) =>
-                                 PlusSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (PlusSym1 a0123456789876543210) a0123456789876543210 = Plus a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings PlusSym0 where
-      suppressUnusedWarnings = snd (((,) PlusSym0KindInference) ())
-    data PlusSym0 :: (~>) Nat ((~>) Nat Nat)
-      where
-        PlusSym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply PlusSym0 arg) (PlusSym1 arg) =>
-                                 PlusSym0 a0123456789876543210
-    type instance Apply PlusSym0 a0123456789876543210 = PlusSym1 a0123456789876543210
-    type family Pred (a :: Nat) :: Nat where
-      Pred Zero = ZeroSym0
-      Pred (Succ n) = n
-    type family Plus (a :: Nat) (a :: Nat) :: Nat where
-      Plus Zero m = m
-      Plus (Succ n) m = Apply SuccSym0 (Apply (Apply PlusSym0 n) m)
-    type family ShowsPrec_0123456789876543210 (a :: GHC.Types.Nat) (a :: Nat) (a :: GHC.Types.Symbol) :: GHC.Types.Symbol where
-      ShowsPrec_0123456789876543210 _ Zero a_0123456789876543210 = Apply (Apply ShowStringSym0 "Zero") a_0123456789876543210
-      ShowsPrec_0123456789876543210 p_0123456789876543210 (Succ arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (Data.Singletons.Prelude.Num.FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Succ ")) (Apply (Apply ShowsPrecSym0 (Data.Singletons.Prelude.Num.FromInteger 11)) arg_0123456789876543210))) a_0123456789876543210
-    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Nat) (a0123456789876543210 :: GHC.Types.Symbol) =
-        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
-    data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Nat) :: (~>) GHC.Types.Symbol GHC.Types.Symbol
-      where
-        ShowsPrec_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
-    data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) :: (~>) Nat ((~>) GHC.Types.Symbol GHC.Types.Symbol)
-      where
-        ShowsPrec_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
-    data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) Nat ((~>) GHC.Types.Symbol GHC.Types.Symbol))
-      where
-        ShowsPrec_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
-    instance PShow Nat where
-      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
-    type family Compare_0123456789876543210 (a :: Nat) (a :: Nat) :: Ordering where
-      Compare_0123456789876543210 Zero Zero = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) '[]
-      Compare_0123456789876543210 (Succ a_0123456789876543210) (Succ b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) '[])
-      Compare_0123456789876543210 Zero (Succ _) = LTSym0
-      Compare_0123456789876543210 (Succ _) Zero = GTSym0
-    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
-        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
-    data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Nat) :: (~>) Nat Ordering
-      where
-        Compare_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                               a0123456789876543210
-                                                               arg. SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
-    data Compare_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Ordering)
-      where
-        Compare_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                               arg. SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
-                                                        Compare_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
-    instance POrd Nat where
-      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
-    type family Equals_0123456789876543210 (a :: Nat) (b :: Nat) :: Bool where
-      Equals_0123456789876543210 Zero Zero = TrueSym0
-      Equals_0123456789876543210 (Succ a) (Succ b) = (==) a b
-      Equals_0123456789876543210 (_ :: Nat) (_ :: Nat) = FalseSym0
-    instance PEq Nat where
-      type (==) a b = Equals_0123456789876543210 a b
-    sPred ::
-      forall (t :: Nat). Sing t -> Sing (Apply PredSym0 t :: Nat)
-    sPlus ::
-      forall (t :: Nat) (t :: Nat).
-      Sing t -> Sing t -> Sing (Apply (Apply PlusSym0 t) t :: Nat)
-    sPred SZero = SZero
-    sPred (SSucc (sN :: Sing n)) = sN
-    sPlus SZero (sM :: Sing m) = sM
-    sPlus (SSucc (sN :: Sing n)) (sM :: Sing m)
-      = (applySing ((singFun1 @SuccSym0) SSucc))
-          ((applySing ((applySing ((singFun2 @PlusSym0) sPlus)) sN)) sM)
-    instance SingI (PredSym0 :: (~>) Nat Nat) where
-      sing = (singFun1 @PredSym0) sPred
-    instance SingI (PlusSym0 :: (~>) Nat ((~>) Nat Nat)) where
-      sing = (singFun2 @PlusSym0) sPlus
-    instance SingI d =>
-             SingI (PlusSym1 (d :: Nat) :: (~>) Nat Nat) where
-      sing = (singFun1 @(PlusSym1 (d :: Nat))) (sPlus (sing @d))
-    data SNat :: Nat -> GHC.Types.Type
-      where
-        SZero :: SNat Zero
-        SSucc :: forall (n :: Nat). (Sing (n :: Nat)) -> SNat (Succ n)
-    type instance Sing @Nat = SNat
-    instance SingKind Nat where
-      type Demote Nat = Nat
-      fromSing SZero = Zero
-      fromSing (SSucc b) = Succ (fromSing b)
-      toSing Zero = SomeSing SZero
-      toSing (Succ (b :: Demote Nat))
-        = case toSing b :: SomeSing Nat of {
-            SomeSing c -> SomeSing (SSucc c) }
-    instance SShow Nat => SShow Nat where
-      sShowsPrec ::
-        forall (t1 :: GHC.Types.Nat) (t2 :: Nat) (t3 :: GHC.Types.Symbol).
-        Sing t1
-        -> Sing t2
-           -> Sing t3
-              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) Nat ((~>) GHC.Types.Symbol GHC.Types.Symbol))
-                                                             -> GHC.Types.Type) t1) t2) t3)
-      sShowsPrec
-        _
-        SZero
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "Zero")))
-            sA_0123456789876543210
-      sShowsPrec
-        (sP_0123456789876543210 :: Sing p_0123456789876543210)
-        (SSucc (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
-                    ((applySing
-                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
-                       (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 10)))))
-                ((applySing
-                    ((applySing ((singFun3 @(.@#@$)) (%.)))
-                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                          (sing :: Sing "Succ "))))
-                   ((applySing
-                       ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                          (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 11))))
-                      sArg_0123456789876543210))))
-            sA_0123456789876543210
-    instance SOrd Nat => SOrd Nat where
-      sCompare ::
-        forall (t1 :: Nat) (t2 :: Nat).
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply (CompareSym0 :: TyFun Nat ((~>) Nat Ordering)
-                                                 -> GHC.Types.Type) t1) t2)
-      sCompare SZero SZero
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            Data.Singletons.Prelude.Instances.SNil
-      sCompare
-        (SSucc (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        (SSucc (sB_0123456789876543210 :: Sing b_0123456789876543210))
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            ((applySing
-                ((applySing
-                    ((singFun2 @(:@#@$))
-                       Data.Singletons.Prelude.Instances.SCons))
-                   ((applySing
-                       ((applySing ((singFun2 @CompareSym0) sCompare))
-                          sA_0123456789876543210))
-                      sB_0123456789876543210)))
-               Data.Singletons.Prelude.Instances.SNil)
-      sCompare SZero (SSucc _) = SLT
-      sCompare (SSucc _) SZero = SGT
-    instance SEq Nat => SEq Nat where
-      (%==) SZero SZero = STrue
-      (%==) SZero (SSucc _) = SFalse
-      (%==) (SSucc _) SZero = SFalse
-      (%==) (SSucc a) (SSucc b) = ((%==) a) b
-    instance SDecide Nat => SDecide Nat where
-      (%~) SZero SZero = Proved Refl
-      (%~) SZero (SSucc _) = Disproved (\ x -> case x of)
-      (%~) (SSucc _) SZero = Disproved (\ x -> case x of)
-      (%~) (SSucc a) (SSucc b)
-        = case ((%~) a) b of
-            Proved Refl -> Proved Refl
-            Disproved contra
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-    instance SDecide Nat =>
-             Data.Type.Equality.TestEquality (SNat :: Nat
-                                                      -> GHC.Types.Type) where
-      Data.Type.Equality.testEquality
-        = Data.Singletons.Decide.decideEquality
-    instance SDecide Nat =>
-             Data.Type.Coercion.TestCoercion (SNat :: Nat
-                                                      -> GHC.Types.Type) where
-      Data.Type.Coercion.testCoercion
-        = Data.Singletons.Decide.decideCoercion
-    instance Data.Singletons.ShowSing.ShowSing Nat =>
-             Show (SNat (z :: Nat)) where
-      showsPrec _ SZero = showString "SZero"
-      showsPrec
-        p_0123456789876543210
-        (SSucc (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
-        = (showParen (((>) p_0123456789876543210) 10))
-            (((.) (showString "SSucc "))
-               ((showsPrec 11) arg_0123456789876543210)) ::
-            Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210 =>
-            ShowS
-    instance SingI Zero where
-      sing = SZero
-    instance SingI n => SingI (Succ (n :: Nat)) where
-      sing = SSucc sing
-    instance SingI (SuccSym0 :: (~>) Nat Nat) where
-      sing = (singFun1 @SuccSym0) SSucc
diff --git a/tests/compile-and-dump/Singletons/Nat.golden b/tests/compile-and-dump/Singletons/Nat.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/Nat.golden
@@ -0,0 +1,286 @@
+Singletons/Nat.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| plus :: Nat -> Nat -> Nat
+          plus Zero m = m
+          plus (Succ n) m = Succ (plus n m)
+          pred :: Nat -> Nat
+          pred Zero = Zero
+          pred (Succ n) = n
+          
+          data Nat
+            where
+              Zero :: Nat
+              Succ :: Nat -> Nat
+            deriving (Eq, Show, Read, Ord) |]
+  ======>
+    data Nat
+      where
+        Zero :: Nat
+        Succ :: Nat -> Nat
+      deriving (Eq, Show, Read, Ord)
+    plus :: Nat -> Nat -> Nat
+    plus Zero m = m
+    plus (Succ n) m = Succ ((plus n) m)
+    pred :: Nat -> Nat
+    pred Zero = Zero
+    pred (Succ n) = n
+    type ZeroSym0 = Zero :: Nat
+    type SuccSym0 :: (~>) Nat Nat
+    data SuccSym0 a0123456789876543210
+      where
+        SuccSym0KindInference :: SameKind (Apply SuccSym0 arg) (SuccSym1 arg) =>
+                                 SuccSym0 a0123456789876543210
+    type instance Apply SuccSym0 a0123456789876543210 = SuccSym1 a0123456789876543210
+    instance SuppressUnusedWarnings SuccSym0 where
+      suppressUnusedWarnings = snd (((,) SuccSym0KindInference) ())
+    type SuccSym1 (a0123456789876543210 :: Nat) =
+        Succ a0123456789876543210 :: Nat
+    type PredSym0 :: (~>) Nat Nat
+    data PredSym0 a0123456789876543210
+      where
+        PredSym0KindInference :: SameKind (Apply PredSym0 arg) (PredSym1 arg) =>
+                                 PredSym0 a0123456789876543210
+    type instance Apply PredSym0 a0123456789876543210 = PredSym1 a0123456789876543210
+    instance SuppressUnusedWarnings PredSym0 where
+      suppressUnusedWarnings = snd (((,) PredSym0KindInference) ())
+    type PredSym1 (a0123456789876543210 :: Nat) =
+        Pred a0123456789876543210 :: Nat
+    type PlusSym0 :: (~>) Nat ((~>) Nat Nat)
+    data PlusSym0 a0123456789876543210
+      where
+        PlusSym0KindInference :: SameKind (Apply PlusSym0 arg) (PlusSym1 arg) =>
+                                 PlusSym0 a0123456789876543210
+    type instance Apply PlusSym0 a0123456789876543210 = PlusSym1 a0123456789876543210
+    instance SuppressUnusedWarnings PlusSym0 where
+      suppressUnusedWarnings = snd (((,) PlusSym0KindInference) ())
+    type PlusSym1 :: Nat -> (~>) Nat Nat
+    data PlusSym1 a0123456789876543210 a0123456789876543210
+      where
+        PlusSym1KindInference :: SameKind (Apply (PlusSym1 a0123456789876543210) arg) (PlusSym2 a0123456789876543210 arg) =>
+                                 PlusSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (PlusSym1 a0123456789876543210) a0123456789876543210 = PlusSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (PlusSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) PlusSym1KindInference) ())
+    type PlusSym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
+        Plus a0123456789876543210 a0123456789876543210 :: Nat
+    type Pred :: Nat -> Nat
+    type family Pred a where
+      Pred Zero = ZeroSym0
+      Pred (Succ n) = n
+    type Plus :: Nat -> Nat -> Nat
+    type family Plus a a where
+      Plus Zero m = m
+      Plus (Succ n) m = Apply SuccSym0 (Apply (Apply PlusSym0 n) m)
+    type ShowsPrec_0123456789876543210 :: GHC.Types.Nat
+                                          -> Nat -> GHC.Types.Symbol -> GHC.Types.Symbol
+    type family ShowsPrec_0123456789876543210 a a a where
+      ShowsPrec_0123456789876543210 _ Zero a_0123456789876543210 = Apply (Apply ShowStringSym0 "Zero") a_0123456789876543210
+      ShowsPrec_0123456789876543210 p_0123456789876543210 (Succ arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (Data.Singletons.Prelude.Num.FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Succ ")) (Apply (Apply ShowsPrecSym0 (Data.Singletons.Prelude.Num.FromInteger 11)) arg_0123456789876543210))) a_0123456789876543210
+    type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) Nat ((~>) GHC.Types.Symbol GHC.Types.Symbol))
+    data ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
+    type ShowsPrec_0123456789876543210Sym1 :: GHC.Types.Nat
+                                              -> (~>) Nat ((~>) GHC.Types.Symbol GHC.Types.Symbol)
+    data ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
+    type ShowsPrec_0123456789876543210Sym2 :: GHC.Types.Nat
+                                              -> Nat -> (~>) GHC.Types.Symbol GHC.Types.Symbol
+    data ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
+    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Nat) (a0123456789876543210 :: GHC.Types.Symbol) =
+        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: GHC.Types.Symbol
+    instance PShow Nat where
+      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
+    type Compare_0123456789876543210 :: Nat -> Nat -> Ordering
+    type family Compare_0123456789876543210 a a where
+      Compare_0123456789876543210 Zero Zero = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) NilSym0
+      Compare_0123456789876543210 (Succ a_0123456789876543210) (Succ b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0)
+      Compare_0123456789876543210 Zero (Succ _) = LTSym0
+      Compare_0123456789876543210 (Succ _) Zero = GTSym0
+    type Compare_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Ordering)
+    data Compare_0123456789876543210Sym0 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
+                                                        Compare_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
+    type Compare_0123456789876543210Sym1 :: Nat -> (~>) Nat Ordering
+    data Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
+    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
+        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    instance POrd Nat where
+      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
+    type Equals_0123456789876543210 :: Nat -> Nat -> Bool
+    type family Equals_0123456789876543210 a b where
+      Equals_0123456789876543210 Zero Zero = TrueSym0
+      Equals_0123456789876543210 (Succ a) (Succ b) = (==) a b
+      Equals_0123456789876543210 (_ :: Nat) (_ :: Nat) = FalseSym0
+    instance PEq Nat where
+      type (==) a b = Equals_0123456789876543210 a b
+    sPred ::
+      forall (t :: Nat). Sing t -> Sing (Apply PredSym0 t :: Nat)
+    sPlus ::
+      forall (t :: Nat) (t :: Nat).
+      Sing t -> Sing t -> Sing (Apply (Apply PlusSym0 t) t :: Nat)
+    sPred SZero = SZero
+    sPred (SSucc (sN :: Sing n)) = sN
+    sPlus SZero (sM :: Sing m) = sM
+    sPlus (SSucc (sN :: Sing n)) (sM :: Sing m)
+      = (applySing ((singFun1 @SuccSym0) SSucc))
+          ((applySing ((applySing ((singFun2 @PlusSym0) sPlus)) sN)) sM)
+    instance SingI (PredSym0 :: (~>) Nat Nat) where
+      sing = (singFun1 @PredSym0) sPred
+    instance SingI (PlusSym0 :: (~>) Nat ((~>) Nat Nat)) where
+      sing = (singFun2 @PlusSym0) sPlus
+    instance SingI d =>
+             SingI (PlusSym1 (d :: Nat) :: (~>) Nat Nat) where
+      sing = (singFun1 @(PlusSym1 (d :: Nat))) (sPlus (sing @d))
+    data SNat :: Nat -> GHC.Types.Type
+      where
+        SZero :: SNat (Zero :: Nat)
+        SSucc :: forall (n :: Nat). (Sing n) -> SNat (Succ n :: Nat)
+    type instance Sing @Nat = SNat
+    instance SingKind Nat where
+      type Demote Nat = Nat
+      fromSing SZero = Zero
+      fromSing (SSucc b) = Succ (fromSing b)
+      toSing Zero = SomeSing SZero
+      toSing (Succ (b :: Demote Nat))
+        = case toSing b :: SomeSing Nat of {
+            SomeSing c -> SomeSing (SSucc c) }
+    instance SShow Nat => SShow Nat where
+      sShowsPrec ::
+        forall (t1 :: GHC.Types.Nat) (t2 :: Nat) (t3 :: GHC.Types.Symbol).
+        Sing t1
+        -> Sing t2
+           -> Sing t3
+              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) Nat ((~>) GHC.Types.Symbol GHC.Types.Symbol))
+                                                             -> GHC.Types.Type) t1) t2) t3)
+      sShowsPrec
+        _
+        SZero
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "Zero")))
+            sA_0123456789876543210
+      sShowsPrec
+        (sP_0123456789876543210 :: Sing p_0123456789876543210)
+        (SSucc (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
+                    ((applySing
+                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
+                       (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 10)))))
+                ((applySing
+                    ((applySing ((singFun3 @(.@#@$)) (%.)))
+                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                          (sing :: Sing "Succ "))))
+                   ((applySing
+                       ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                          (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 11))))
+                      sArg_0123456789876543210))))
+            sA_0123456789876543210
+    instance SOrd Nat => SOrd Nat where
+      sCompare ::
+        forall (t1 :: Nat) (t2 :: Nat).
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply (CompareSym0 :: TyFun Nat ((~>) Nat Ordering)
+                                                 -> GHC.Types.Type) t1) t2)
+      sCompare SZero SZero
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            Data.Singletons.Prelude.Instances.SNil
+      sCompare
+        (SSucc (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        (SSucc (sB_0123456789876543210 :: Sing b_0123456789876543210))
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            ((applySing
+                ((applySing
+                    ((singFun2 @(:@#@$))
+                       Data.Singletons.Prelude.Instances.SCons))
+                   ((applySing
+                       ((applySing ((singFun2 @CompareSym0) sCompare))
+                          sA_0123456789876543210))
+                      sB_0123456789876543210)))
+               Data.Singletons.Prelude.Instances.SNil)
+      sCompare SZero (SSucc _) = SLT
+      sCompare (SSucc _) SZero = SGT
+    instance SEq Nat => SEq Nat where
+      (%==) SZero SZero = STrue
+      (%==) SZero (SSucc _) = SFalse
+      (%==) (SSucc _) SZero = SFalse
+      (%==) (SSucc a) (SSucc b) = ((%==) a) b
+    instance SDecide Nat => SDecide Nat where
+      (%~) SZero SZero = Proved Refl
+      (%~) SZero (SSucc _) = Disproved (\ x -> case x of)
+      (%~) (SSucc _) SZero = Disproved (\ x -> case x of)
+      (%~) (SSucc a) (SSucc b)
+        = case ((%~) a) b of
+            Proved Refl -> Proved Refl
+            Disproved contra
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+    instance SDecide Nat =>
+             Data.Type.Equality.TestEquality (SNat :: Nat
+                                                      -> GHC.Types.Type) where
+      Data.Type.Equality.testEquality
+        = Data.Singletons.Decide.decideEquality
+    instance SDecide Nat =>
+             Data.Type.Coercion.TestCoercion (SNat :: Nat
+                                                      -> GHC.Types.Type) where
+      Data.Type.Coercion.testCoercion
+        = Data.Singletons.Decide.decideCoercion
+    instance Data.Singletons.ShowSing.ShowSing Nat =>
+             Show (SNat (z :: Nat)) where
+      showsPrec _ SZero = showString "SZero"
+      showsPrec
+        p_0123456789876543210
+        (SSucc (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
+        = (showParen (((>) p_0123456789876543210) 10))
+            (((.) (showString "SSucc "))
+               ((showsPrec 11) arg_0123456789876543210)) ::
+            Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210 =>
+            ShowS
+    instance SingI Zero where
+      sing = SZero
+    instance SingI n => SingI (Succ (n :: Nat)) where
+      sing = SSucc sing
+    instance SingI (SuccSym0 :: (~>) Nat Nat) where
+      sing = (singFun1 @SuccSym0) SSucc
diff --git a/tests/compile-and-dump/Singletons/NatSymbolReflexive.ghc88.template b/tests/compile-and-dump/Singletons/NatSymbolReflexive.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/NatSymbolReflexive.ghc88.template
+++ /dev/null
diff --git a/tests/compile-and-dump/Singletons/NatSymbolReflexive.golden b/tests/compile-and-dump/Singletons/NatSymbolReflexive.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/NatSymbolReflexive.golden
diff --git a/tests/compile-and-dump/Singletons/Operators.ghc88.template b/tests/compile-and-dump/Singletons/Operators.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/Operators.ghc88.template
+++ /dev/null
@@ -1,123 +0,0 @@
-Singletons/Operators.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| child :: Foo -> Foo
-          child FLeaf = FLeaf
-          child (a :+: _) = a
-          (+) :: Nat -> Nat -> Nat
-          Zero + m = m
-          (Succ n) + m = Succ (n + m)
-          
-          data Foo
-            where
-              FLeaf :: Foo
-              (:+:) :: Foo -> Foo -> Foo |]
-  ======>
-    data Foo
-      where
-        FLeaf :: Foo
-        (:+:) :: Foo -> Foo -> Foo
-    child :: Foo -> Foo
-    child FLeaf = FLeaf
-    child (a :+: _) = a
-    (+) :: Nat -> Nat -> Nat
-    (+) Zero m = m
-    (+) (Succ n) m = Succ (n + m)
-    type FLeafSym0 = FLeaf
-    type (:+:@#@$$$) (t0123456789876543210 :: Foo) (t0123456789876543210 :: Foo) =
-        (:+:) t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings ((:+:@#@$$) t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (::+:@#@$$###)) ())
-    data (:+:@#@$$) (t0123456789876543210 :: Foo) :: (~>) Foo Foo
-      where
-        (::+:@#@$$###) :: forall t0123456789876543210
-                                 t0123456789876543210
-                                 arg. SameKind (Apply ((:+:@#@$$) t0123456789876543210) arg) ((:+:@#@$$$) t0123456789876543210 arg) =>
-                          (:+:@#@$$) t0123456789876543210 t0123456789876543210
-    type instance Apply ((:+:@#@$$) t0123456789876543210) t0123456789876543210 = (:+:) t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (:+:@#@$) where
-      suppressUnusedWarnings = snd (((,) (::+:@#@$###)) ())
-    data (:+:@#@$) :: (~>) Foo ((~>) Foo Foo)
-      where
-        (::+:@#@$###) :: forall t0123456789876543210
-                                arg. SameKind (Apply (:+:@#@$) arg) ((:+:@#@$$) arg) =>
-                         (:+:@#@$) t0123456789876543210
-    type instance Apply (:+:@#@$) t0123456789876543210 = (:+:@#@$$) t0123456789876543210
-    type (+@#@$$$) (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
-        (+) a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ((+@#@$$) a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (:+@#@$$###)) ())
-    data (+@#@$$) (a0123456789876543210 :: Nat) :: (~>) Nat Nat
-      where
-        (:+@#@$$###) :: forall a0123456789876543210
-                               a0123456789876543210
-                               arg. SameKind (Apply ((+@#@$$) a0123456789876543210) arg) ((+@#@$$$) a0123456789876543210 arg) =>
-                        (+@#@$$) a0123456789876543210 a0123456789876543210
-    type instance Apply ((+@#@$$) a0123456789876543210) a0123456789876543210 = (+) a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (+@#@$) where
-      suppressUnusedWarnings = snd (((,) (:+@#@$###)) ())
-    data (+@#@$) :: (~>) Nat ((~>) Nat Nat)
-      where
-        (:+@#@$###) :: forall a0123456789876543210
-                              arg. SameKind (Apply (+@#@$) arg) ((+@#@$$) arg) =>
-                       (+@#@$) a0123456789876543210
-    type instance Apply (+@#@$) a0123456789876543210 = (+@#@$$) a0123456789876543210
-    type ChildSym1 (a0123456789876543210 :: Foo) =
-        Child a0123456789876543210
-    instance SuppressUnusedWarnings ChildSym0 where
-      suppressUnusedWarnings = snd (((,) ChildSym0KindInference) ())
-    data ChildSym0 :: (~>) Foo Foo
-      where
-        ChildSym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply ChildSym0 arg) (ChildSym1 arg) =>
-                                  ChildSym0 a0123456789876543210
-    type instance Apply ChildSym0 a0123456789876543210 = Child a0123456789876543210
-    type family (+) (a :: Nat) (a :: Nat) :: Nat where
-      (+) 'Zero m = m
-      (+) ('Succ n) m = Apply SuccSym0 (Apply (Apply (+@#@$) n) m)
-    type family Child (a :: Foo) :: Foo where
-      Child FLeaf = FLeafSym0
-      Child ((:+:) a _) = a
-    (%+) ::
-      forall (t :: Nat) (t :: Nat).
-      Sing t -> Sing t -> Sing (Apply (Apply (+@#@$) t) t :: Nat)
-    sChild ::
-      forall (t :: Foo). Sing t -> Sing (Apply ChildSym0 t :: Foo)
-    (%+) SZero (sM :: Sing m) = sM
-    (%+) (SSucc (sN :: Sing n)) (sM :: Sing m)
-      = (applySing ((singFun1 @SuccSym0) SSucc))
-          ((applySing ((applySing ((singFun2 @(+@#@$)) (%+))) sN)) sM)
-    sChild SFLeaf = SFLeaf
-    sChild ((:%+:) (sA :: Sing a) _) = sA
-    instance SingI ((+@#@$) :: (~>) Nat ((~>) Nat Nat)) where
-      sing = (singFun2 @(+@#@$)) (%+)
-    instance SingI d =>
-             SingI ((+@#@$$) (d :: Nat) :: (~>) Nat Nat) where
-      sing = (singFun1 @((+@#@$$) (d :: Nat))) ((%+) (sing @d))
-    instance SingI (ChildSym0 :: (~>) Foo Foo) where
-      sing = (singFun1 @ChildSym0) sChild
-    data SFoo :: Foo -> GHC.Types.Type
-      where
-        SFLeaf :: SFoo FLeaf
-        (:%+:) :: forall (n :: Foo) (n :: Foo).
-                  (Sing (n :: Foo)) -> (Sing (n :: Foo)) -> SFoo ((:+:) n n)
-    type instance Sing @Foo = SFoo
-    instance SingKind Foo where
-      type Demote Foo = Foo
-      fromSing SFLeaf = FLeaf
-      fromSing ((:%+:) b b) = ((:+:) (fromSing b)) (fromSing b)
-      toSing FLeaf = SomeSing SFLeaf
-      toSing ((:+:) (b :: Demote Foo) (b :: Demote Foo))
-        = case
-              ((,) (toSing b :: SomeSing Foo)) (toSing b :: SomeSing Foo)
-          of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:%+:) c) c) }
-    instance SingI FLeaf where
-      sing = SFLeaf
-    instance (SingI n, SingI n) =>
-             SingI ((:+:) (n :: Foo) (n :: Foo)) where
-      sing = ((:%+:) sing) sing
-    instance SingI ((:+:@#@$) :: (~>) Foo ((~>) Foo Foo)) where
-      sing = (singFun2 @(:+:@#@$)) (:%+:)
-    instance SingI d =>
-             SingI ((:+:@#@$$) (d :: Foo) :: (~>) Foo Foo) where
-      sing = (singFun1 @((:+:@#@$$) (d :: Foo))) ((:%+:) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/Operators.golden b/tests/compile-and-dump/Singletons/Operators.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/Operators.golden
@@ -0,0 +1,123 @@
+Singletons/Operators.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| child :: Foo -> Foo
+          child FLeaf = FLeaf
+          child (a :+: _) = a
+          (+) :: Nat -> Nat -> Nat
+          Zero + m = m
+          (Succ n) + m = Succ (n + m)
+          
+          data Foo
+            where
+              FLeaf :: Foo
+              (:+:) :: Foo -> Foo -> Foo |]
+  ======>
+    data Foo
+      where
+        FLeaf :: Foo
+        (:+:) :: Foo -> Foo -> Foo
+    child :: Foo -> Foo
+    child FLeaf = FLeaf
+    child (a :+: _) = a
+    (+) :: Nat -> Nat -> Nat
+    (+) Zero m = m
+    (+) (Succ n) m = Succ (n + m)
+    type FLeafSym0 = FLeaf :: Foo
+    type (:+:@#@$) :: (~>) Foo ((~>) Foo Foo)
+    data (:+:@#@$) a0123456789876543210
+      where
+        (::+:@#@$###) :: SameKind (Apply (:+:@#@$) arg) ((:+:@#@$$) arg) =>
+                         (:+:@#@$) a0123456789876543210
+    type instance Apply (:+:@#@$) a0123456789876543210 = (:+:@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (:+:@#@$) where
+      suppressUnusedWarnings = snd (((,) (::+:@#@$###)) ())
+    type (:+:@#@$$) :: Foo -> (~>) Foo Foo
+    data (:+:@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (::+:@#@$$###) :: SameKind (Apply ((:+:@#@$$) a0123456789876543210) arg) ((:+:@#@$$$) a0123456789876543210 arg) =>
+                          (:+:@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((:+:@#@$$) a0123456789876543210) a0123456789876543210 = (:+:@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((:+:@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (::+:@#@$$###)) ())
+    type (:+:@#@$$$) (a0123456789876543210 :: Foo) (a0123456789876543210 :: Foo) =
+        (:+:) a0123456789876543210 a0123456789876543210 :: Foo
+    type (+@#@$) :: (~>) Nat ((~>) Nat Nat)
+    data (+@#@$) a0123456789876543210
+      where
+        (:+@#@$###) :: SameKind (Apply (+@#@$) arg) ((+@#@$$) arg) =>
+                       (+@#@$) a0123456789876543210
+    type instance Apply (+@#@$) a0123456789876543210 = (+@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (+@#@$) where
+      suppressUnusedWarnings = snd (((,) (:+@#@$###)) ())
+    type (+@#@$$) :: Nat -> (~>) Nat Nat
+    data (+@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (:+@#@$$###) :: SameKind (Apply ((+@#@$$) a0123456789876543210) arg) ((+@#@$$$) a0123456789876543210 arg) =>
+                        (+@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((+@#@$$) a0123456789876543210) a0123456789876543210 = (+@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((+@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (:+@#@$$###)) ())
+    type (+@#@$$$) (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
+        (+) a0123456789876543210 a0123456789876543210 :: Nat
+    type ChildSym0 :: (~>) Foo Foo
+    data ChildSym0 a0123456789876543210
+      where
+        ChildSym0KindInference :: SameKind (Apply ChildSym0 arg) (ChildSym1 arg) =>
+                                  ChildSym0 a0123456789876543210
+    type instance Apply ChildSym0 a0123456789876543210 = ChildSym1 a0123456789876543210
+    instance SuppressUnusedWarnings ChildSym0 where
+      suppressUnusedWarnings = snd (((,) ChildSym0KindInference) ())
+    type ChildSym1 (a0123456789876543210 :: Foo) =
+        Child a0123456789876543210 :: Foo
+    type (+) :: Nat -> Nat -> Nat
+    type family (+) a a where
+      (+) 'Zero m = m
+      (+) ('Succ n) m = Apply SuccSym0 (Apply (Apply (+@#@$) n) m)
+    type Child :: Foo -> Foo
+    type family Child a where
+      Child FLeaf = FLeafSym0
+      Child ((:+:) a _) = a
+    (%+) ::
+      forall (t :: Nat) (t :: Nat).
+      Sing t -> Sing t -> Sing (Apply (Apply (+@#@$) t) t :: Nat)
+    sChild ::
+      forall (t :: Foo). Sing t -> Sing (Apply ChildSym0 t :: Foo)
+    (%+) SZero (sM :: Sing m) = sM
+    (%+) (SSucc (sN :: Sing n)) (sM :: Sing m)
+      = (applySing ((singFun1 @SuccSym0) SSucc))
+          ((applySing ((applySing ((singFun2 @(+@#@$)) (%+))) sN)) sM)
+    sChild SFLeaf = SFLeaf
+    sChild ((:%+:) (sA :: Sing a) _) = sA
+    instance SingI ((+@#@$) :: (~>) Nat ((~>) Nat Nat)) where
+      sing = (singFun2 @(+@#@$)) (%+)
+    instance SingI d =>
+             SingI ((+@#@$$) (d :: Nat) :: (~>) Nat Nat) where
+      sing = (singFun1 @((+@#@$$) (d :: Nat))) ((%+) (sing @d))
+    instance SingI (ChildSym0 :: (~>) Foo Foo) where
+      sing = (singFun1 @ChildSym0) sChild
+    data SFoo :: Foo -> GHC.Types.Type
+      where
+        SFLeaf :: SFoo (FLeaf :: Foo)
+        (:%+:) :: forall (n :: Foo) (n :: Foo).
+                  (Sing n) -> (Sing n) -> SFoo ((:+:) n n :: Foo)
+    type instance Sing @Foo = SFoo
+    instance SingKind Foo where
+      type Demote Foo = Foo
+      fromSing SFLeaf = FLeaf
+      fromSing ((:%+:) b b) = ((:+:) (fromSing b)) (fromSing b)
+      toSing FLeaf = SomeSing SFLeaf
+      toSing ((:+:) (b :: Demote Foo) (b :: Demote Foo))
+        = case
+              ((,) (toSing b :: SomeSing Foo)) (toSing b :: SomeSing Foo)
+          of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:%+:) c) c) }
+    instance SingI FLeaf where
+      sing = SFLeaf
+    instance (SingI n, SingI n) =>
+             SingI ((:+:) (n :: Foo) (n :: Foo)) where
+      sing = ((:%+:) sing) sing
+    instance SingI ((:+:@#@$) :: (~>) Foo ((~>) Foo Foo)) where
+      sing = (singFun2 @(:+:@#@$)) (:%+:)
+    instance SingI d =>
+             SingI ((:+:@#@$$) (d :: Foo) :: (~>) Foo Foo) where
+      sing = (singFun1 @((:+:@#@$$) (d :: Foo))) ((:%+:) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/OrdDeriving.ghc88.template b/tests/compile-and-dump/Singletons/OrdDeriving.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/OrdDeriving.ghc88.template
+++ /dev/null
@@ -1,1163 +0,0 @@
-Singletons/OrdDeriving.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| data Nat
-            = Zero | Succ Nat
-            deriving (Eq, Ord)
-          data Foo a b c d
-            = A a b c d |
-              B a b c d |
-              C a b c d |
-              D a b c d |
-              E a b c d |
-              F a b c d
-            deriving (Eq, Ord) |]
-  ======>
-    data Nat
-      = Zero | Succ Nat
-      deriving (Eq, Ord)
-    data Foo a b c d
-      = A a b c d |
-        B a b c d |
-        C a b c d |
-        D a b c d |
-        E a b c d |
-        F a b c d
-      deriving (Eq, Ord)
-    type ZeroSym0 = Zero
-    type SuccSym1 (t0123456789876543210 :: Nat) =
-        Succ t0123456789876543210
-    instance SuppressUnusedWarnings SuccSym0 where
-      suppressUnusedWarnings = snd (((,) SuccSym0KindInference) ())
-    data SuccSym0 :: (~>) Nat Nat
-      where
-        SuccSym0KindInference :: forall t0123456789876543210
-                                        arg. SameKind (Apply SuccSym0 arg) (SuccSym1 arg) =>
-                                 SuccSym0 t0123456789876543210
-    type instance Apply SuccSym0 t0123456789876543210 = Succ t0123456789876543210
-    type ASym4 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) (t0123456789876543210 :: c0123456789876543210) (t0123456789876543210 :: d0123456789876543210) =
-        A t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (ASym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) ASym3KindInference) ())
-    data ASym3 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) (t0123456789876543210 :: c0123456789876543210) :: forall d0123456789876543210.
-                                                                                                                                                               (~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210)
-      where
-        ASym3KindInference :: forall t0123456789876543210
-                                     t0123456789876543210
-                                     t0123456789876543210
-                                     t0123456789876543210
-                                     arg. SameKind (Apply (ASym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) arg) (ASym4 t0123456789876543210 t0123456789876543210 t0123456789876543210 arg) =>
-                              ASym3 t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (ASym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) t0123456789876543210 = A t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (ASym2 t0123456789876543210 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) ASym2KindInference) ())
-    data ASym2 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) :: forall c0123456789876543210
-                                                                                                                       d0123456789876543210.
-                                                                                                                (~>) c0123456789876543210 ((~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210))
-      where
-        ASym2KindInference :: forall t0123456789876543210
-                                     t0123456789876543210
-                                     t0123456789876543210
-                                     arg. SameKind (Apply (ASym2 t0123456789876543210 t0123456789876543210) arg) (ASym3 t0123456789876543210 t0123456789876543210 arg) =>
-                              ASym2 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (ASym2 t0123456789876543210 t0123456789876543210) t0123456789876543210 = ASym3 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (ASym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) ASym1KindInference) ())
-    data ASym1 (t0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210
-                                                                        c0123456789876543210
-                                                                        d0123456789876543210.
-                                                                 (~>) b0123456789876543210 ((~>) c0123456789876543210 ((~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210)))
-      where
-        ASym1KindInference :: forall t0123456789876543210
-                                     t0123456789876543210
-                                     arg. SameKind (Apply (ASym1 t0123456789876543210) arg) (ASym2 t0123456789876543210 arg) =>
-                              ASym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (ASym1 t0123456789876543210) t0123456789876543210 = ASym2 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings ASym0 where
-      suppressUnusedWarnings = snd (((,) ASym0KindInference) ())
-    data ASym0 :: forall a0123456789876543210
-                         b0123456789876543210
-                         c0123456789876543210
-                         d0123456789876543210.
-                  (~>) a0123456789876543210 ((~>) b0123456789876543210 ((~>) c0123456789876543210 ((~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210))))
-      where
-        ASym0KindInference :: forall t0123456789876543210
-                                     arg. SameKind (Apply ASym0 arg) (ASym1 arg) =>
-                              ASym0 t0123456789876543210
-    type instance Apply ASym0 t0123456789876543210 = ASym1 t0123456789876543210
-    type BSym4 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) (t0123456789876543210 :: c0123456789876543210) (t0123456789876543210 :: d0123456789876543210) =
-        B t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (BSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) BSym3KindInference) ())
-    data BSym3 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) (t0123456789876543210 :: c0123456789876543210) :: forall d0123456789876543210.
-                                                                                                                                                               (~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210)
-      where
-        BSym3KindInference :: forall t0123456789876543210
-                                     t0123456789876543210
-                                     t0123456789876543210
-                                     t0123456789876543210
-                                     arg. SameKind (Apply (BSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) arg) (BSym4 t0123456789876543210 t0123456789876543210 t0123456789876543210 arg) =>
-                              BSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (BSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) t0123456789876543210 = B t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (BSym2 t0123456789876543210 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) BSym2KindInference) ())
-    data BSym2 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) :: forall c0123456789876543210
-                                                                                                                       d0123456789876543210.
-                                                                                                                (~>) c0123456789876543210 ((~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210))
-      where
-        BSym2KindInference :: forall t0123456789876543210
-                                     t0123456789876543210
-                                     t0123456789876543210
-                                     arg. SameKind (Apply (BSym2 t0123456789876543210 t0123456789876543210) arg) (BSym3 t0123456789876543210 t0123456789876543210 arg) =>
-                              BSym2 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (BSym2 t0123456789876543210 t0123456789876543210) t0123456789876543210 = BSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (BSym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) BSym1KindInference) ())
-    data BSym1 (t0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210
-                                                                        c0123456789876543210
-                                                                        d0123456789876543210.
-                                                                 (~>) b0123456789876543210 ((~>) c0123456789876543210 ((~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210)))
-      where
-        BSym1KindInference :: forall t0123456789876543210
-                                     t0123456789876543210
-                                     arg. SameKind (Apply (BSym1 t0123456789876543210) arg) (BSym2 t0123456789876543210 arg) =>
-                              BSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (BSym1 t0123456789876543210) t0123456789876543210 = BSym2 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings BSym0 where
-      suppressUnusedWarnings = snd (((,) BSym0KindInference) ())
-    data BSym0 :: forall a0123456789876543210
-                         b0123456789876543210
-                         c0123456789876543210
-                         d0123456789876543210.
-                  (~>) a0123456789876543210 ((~>) b0123456789876543210 ((~>) c0123456789876543210 ((~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210))))
-      where
-        BSym0KindInference :: forall t0123456789876543210
-                                     arg. SameKind (Apply BSym0 arg) (BSym1 arg) =>
-                              BSym0 t0123456789876543210
-    type instance Apply BSym0 t0123456789876543210 = BSym1 t0123456789876543210
-    type CSym4 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) (t0123456789876543210 :: c0123456789876543210) (t0123456789876543210 :: d0123456789876543210) =
-        C t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (CSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) CSym3KindInference) ())
-    data CSym3 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) (t0123456789876543210 :: c0123456789876543210) :: forall d0123456789876543210.
-                                                                                                                                                               (~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210)
-      where
-        CSym3KindInference :: forall t0123456789876543210
-                                     t0123456789876543210
-                                     t0123456789876543210
-                                     t0123456789876543210
-                                     arg. SameKind (Apply (CSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) arg) (CSym4 t0123456789876543210 t0123456789876543210 t0123456789876543210 arg) =>
-                              CSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (CSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) t0123456789876543210 = C t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (CSym2 t0123456789876543210 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) CSym2KindInference) ())
-    data CSym2 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) :: forall c0123456789876543210
-                                                                                                                       d0123456789876543210.
-                                                                                                                (~>) c0123456789876543210 ((~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210))
-      where
-        CSym2KindInference :: forall t0123456789876543210
-                                     t0123456789876543210
-                                     t0123456789876543210
-                                     arg. SameKind (Apply (CSym2 t0123456789876543210 t0123456789876543210) arg) (CSym3 t0123456789876543210 t0123456789876543210 arg) =>
-                              CSym2 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (CSym2 t0123456789876543210 t0123456789876543210) t0123456789876543210 = CSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (CSym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) CSym1KindInference) ())
-    data CSym1 (t0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210
-                                                                        c0123456789876543210
-                                                                        d0123456789876543210.
-                                                                 (~>) b0123456789876543210 ((~>) c0123456789876543210 ((~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210)))
-      where
-        CSym1KindInference :: forall t0123456789876543210
-                                     t0123456789876543210
-                                     arg. SameKind (Apply (CSym1 t0123456789876543210) arg) (CSym2 t0123456789876543210 arg) =>
-                              CSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (CSym1 t0123456789876543210) t0123456789876543210 = CSym2 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings CSym0 where
-      suppressUnusedWarnings = snd (((,) CSym0KindInference) ())
-    data CSym0 :: forall a0123456789876543210
-                         b0123456789876543210
-                         c0123456789876543210
-                         d0123456789876543210.
-                  (~>) a0123456789876543210 ((~>) b0123456789876543210 ((~>) c0123456789876543210 ((~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210))))
-      where
-        CSym0KindInference :: forall t0123456789876543210
-                                     arg. SameKind (Apply CSym0 arg) (CSym1 arg) =>
-                              CSym0 t0123456789876543210
-    type instance Apply CSym0 t0123456789876543210 = CSym1 t0123456789876543210
-    type DSym4 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) (t0123456789876543210 :: c0123456789876543210) (t0123456789876543210 :: d0123456789876543210) =
-        D t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (DSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) DSym3KindInference) ())
-    data DSym3 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) (t0123456789876543210 :: c0123456789876543210) :: forall d0123456789876543210.
-                                                                                                                                                               (~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210)
-      where
-        DSym3KindInference :: forall t0123456789876543210
-                                     t0123456789876543210
-                                     t0123456789876543210
-                                     t0123456789876543210
-                                     arg. SameKind (Apply (DSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) arg) (DSym4 t0123456789876543210 t0123456789876543210 t0123456789876543210 arg) =>
-                              DSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (DSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) t0123456789876543210 = D t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (DSym2 t0123456789876543210 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) DSym2KindInference) ())
-    data DSym2 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) :: forall c0123456789876543210
-                                                                                                                       d0123456789876543210.
-                                                                                                                (~>) c0123456789876543210 ((~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210))
-      where
-        DSym2KindInference :: forall t0123456789876543210
-                                     t0123456789876543210
-                                     t0123456789876543210
-                                     arg. SameKind (Apply (DSym2 t0123456789876543210 t0123456789876543210) arg) (DSym3 t0123456789876543210 t0123456789876543210 arg) =>
-                              DSym2 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (DSym2 t0123456789876543210 t0123456789876543210) t0123456789876543210 = DSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (DSym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) DSym1KindInference) ())
-    data DSym1 (t0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210
-                                                                        c0123456789876543210
-                                                                        d0123456789876543210.
-                                                                 (~>) b0123456789876543210 ((~>) c0123456789876543210 ((~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210)))
-      where
-        DSym1KindInference :: forall t0123456789876543210
-                                     t0123456789876543210
-                                     arg. SameKind (Apply (DSym1 t0123456789876543210) arg) (DSym2 t0123456789876543210 arg) =>
-                              DSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (DSym1 t0123456789876543210) t0123456789876543210 = DSym2 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings DSym0 where
-      suppressUnusedWarnings = snd (((,) DSym0KindInference) ())
-    data DSym0 :: forall a0123456789876543210
-                         b0123456789876543210
-                         c0123456789876543210
-                         d0123456789876543210.
-                  (~>) a0123456789876543210 ((~>) b0123456789876543210 ((~>) c0123456789876543210 ((~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210))))
-      where
-        DSym0KindInference :: forall t0123456789876543210
-                                     arg. SameKind (Apply DSym0 arg) (DSym1 arg) =>
-                              DSym0 t0123456789876543210
-    type instance Apply DSym0 t0123456789876543210 = DSym1 t0123456789876543210
-    type ESym4 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) (t0123456789876543210 :: c0123456789876543210) (t0123456789876543210 :: d0123456789876543210) =
-        E t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (ESym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) ESym3KindInference) ())
-    data ESym3 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) (t0123456789876543210 :: c0123456789876543210) :: forall d0123456789876543210.
-                                                                                                                                                               (~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210)
-      where
-        ESym3KindInference :: forall t0123456789876543210
-                                     t0123456789876543210
-                                     t0123456789876543210
-                                     t0123456789876543210
-                                     arg. SameKind (Apply (ESym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) arg) (ESym4 t0123456789876543210 t0123456789876543210 t0123456789876543210 arg) =>
-                              ESym3 t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (ESym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) t0123456789876543210 = E t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (ESym2 t0123456789876543210 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) ESym2KindInference) ())
-    data ESym2 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) :: forall c0123456789876543210
-                                                                                                                       d0123456789876543210.
-                                                                                                                (~>) c0123456789876543210 ((~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210))
-      where
-        ESym2KindInference :: forall t0123456789876543210
-                                     t0123456789876543210
-                                     t0123456789876543210
-                                     arg. SameKind (Apply (ESym2 t0123456789876543210 t0123456789876543210) arg) (ESym3 t0123456789876543210 t0123456789876543210 arg) =>
-                              ESym2 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (ESym2 t0123456789876543210 t0123456789876543210) t0123456789876543210 = ESym3 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (ESym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) ESym1KindInference) ())
-    data ESym1 (t0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210
-                                                                        c0123456789876543210
-                                                                        d0123456789876543210.
-                                                                 (~>) b0123456789876543210 ((~>) c0123456789876543210 ((~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210)))
-      where
-        ESym1KindInference :: forall t0123456789876543210
-                                     t0123456789876543210
-                                     arg. SameKind (Apply (ESym1 t0123456789876543210) arg) (ESym2 t0123456789876543210 arg) =>
-                              ESym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (ESym1 t0123456789876543210) t0123456789876543210 = ESym2 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings ESym0 where
-      suppressUnusedWarnings = snd (((,) ESym0KindInference) ())
-    data ESym0 :: forall a0123456789876543210
-                         b0123456789876543210
-                         c0123456789876543210
-                         d0123456789876543210.
-                  (~>) a0123456789876543210 ((~>) b0123456789876543210 ((~>) c0123456789876543210 ((~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210))))
-      where
-        ESym0KindInference :: forall t0123456789876543210
-                                     arg. SameKind (Apply ESym0 arg) (ESym1 arg) =>
-                              ESym0 t0123456789876543210
-    type instance Apply ESym0 t0123456789876543210 = ESym1 t0123456789876543210
-    type FSym4 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) (t0123456789876543210 :: c0123456789876543210) (t0123456789876543210 :: d0123456789876543210) =
-        F t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (FSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) FSym3KindInference) ())
-    data FSym3 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) (t0123456789876543210 :: c0123456789876543210) :: forall d0123456789876543210.
-                                                                                                                                                               (~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210)
-      where
-        FSym3KindInference :: forall t0123456789876543210
-                                     t0123456789876543210
-                                     t0123456789876543210
-                                     t0123456789876543210
-                                     arg. SameKind (Apply (FSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) arg) (FSym4 t0123456789876543210 t0123456789876543210 t0123456789876543210 arg) =>
-                              FSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (FSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210) t0123456789876543210 = F t0123456789876543210 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (FSym2 t0123456789876543210 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) FSym2KindInference) ())
-    data FSym2 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) :: forall c0123456789876543210
-                                                                                                                       d0123456789876543210.
-                                                                                                                (~>) c0123456789876543210 ((~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210))
-      where
-        FSym2KindInference :: forall t0123456789876543210
-                                     t0123456789876543210
-                                     t0123456789876543210
-                                     arg. SameKind (Apply (FSym2 t0123456789876543210 t0123456789876543210) arg) (FSym3 t0123456789876543210 t0123456789876543210 arg) =>
-                              FSym2 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    type instance Apply (FSym2 t0123456789876543210 t0123456789876543210) t0123456789876543210 = FSym3 t0123456789876543210 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (FSym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) FSym1KindInference) ())
-    data FSym1 (t0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210
-                                                                        c0123456789876543210
-                                                                        d0123456789876543210.
-                                                                 (~>) b0123456789876543210 ((~>) c0123456789876543210 ((~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210)))
-      where
-        FSym1KindInference :: forall t0123456789876543210
-                                     t0123456789876543210
-                                     arg. SameKind (Apply (FSym1 t0123456789876543210) arg) (FSym2 t0123456789876543210 arg) =>
-                              FSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (FSym1 t0123456789876543210) t0123456789876543210 = FSym2 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings FSym0 where
-      suppressUnusedWarnings = snd (((,) FSym0KindInference) ())
-    data FSym0 :: forall a0123456789876543210
-                         b0123456789876543210
-                         c0123456789876543210
-                         d0123456789876543210.
-                  (~>) a0123456789876543210 ((~>) b0123456789876543210 ((~>) c0123456789876543210 ((~>) d0123456789876543210 (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210))))
-      where
-        FSym0KindInference :: forall t0123456789876543210
-                                     arg. SameKind (Apply FSym0 arg) (FSym1 arg) =>
-                              FSym0 t0123456789876543210
-    type instance Apply FSym0 t0123456789876543210 = FSym1 t0123456789876543210
-    type family Compare_0123456789876543210 (a :: Nat) (a :: Nat) :: Ordering where
-      Compare_0123456789876543210 Zero Zero = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) '[]
-      Compare_0123456789876543210 (Succ a_0123456789876543210) (Succ b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) '[])
-      Compare_0123456789876543210 Zero (Succ _) = LTSym0
-      Compare_0123456789876543210 (Succ _) Zero = GTSym0
-    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
-        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
-    data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Nat) :: (~>) Nat Ordering
-      where
-        Compare_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                               a0123456789876543210
-                                                               arg. SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
-    data Compare_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Ordering)
-      where
-        Compare_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                               arg. SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
-                                                        Compare_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
-    instance POrd Nat where
-      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
-    type family Compare_0123456789876543210 (a :: Foo a b c d) (a :: Foo a b c d) :: Ordering where
-      Compare_0123456789876543210 (A a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) (A b_0123456789876543210 b_0123456789876543210 b_0123456789876543210 b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) '[]))))
-      Compare_0123456789876543210 (B a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) (B b_0123456789876543210 b_0123456789876543210 b_0123456789876543210 b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) '[]))))
-      Compare_0123456789876543210 (C a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) (C b_0123456789876543210 b_0123456789876543210 b_0123456789876543210 b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) '[]))))
-      Compare_0123456789876543210 (D a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) (D b_0123456789876543210 b_0123456789876543210 b_0123456789876543210 b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) '[]))))
-      Compare_0123456789876543210 (E a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) (E b_0123456789876543210 b_0123456789876543210 b_0123456789876543210 b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) '[]))))
-      Compare_0123456789876543210 (F a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) (F b_0123456789876543210 b_0123456789876543210 b_0123456789876543210 b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) '[]))))
-      Compare_0123456789876543210 (A _ _ _ _) (B _ _ _ _) = LTSym0
-      Compare_0123456789876543210 (A _ _ _ _) (C _ _ _ _) = LTSym0
-      Compare_0123456789876543210 (A _ _ _ _) (D _ _ _ _) = LTSym0
-      Compare_0123456789876543210 (A _ _ _ _) (E _ _ _ _) = LTSym0
-      Compare_0123456789876543210 (A _ _ _ _) (F _ _ _ _) = LTSym0
-      Compare_0123456789876543210 (B _ _ _ _) (A _ _ _ _) = GTSym0
-      Compare_0123456789876543210 (B _ _ _ _) (C _ _ _ _) = LTSym0
-      Compare_0123456789876543210 (B _ _ _ _) (D _ _ _ _) = LTSym0
-      Compare_0123456789876543210 (B _ _ _ _) (E _ _ _ _) = LTSym0
-      Compare_0123456789876543210 (B _ _ _ _) (F _ _ _ _) = LTSym0
-      Compare_0123456789876543210 (C _ _ _ _) (A _ _ _ _) = GTSym0
-      Compare_0123456789876543210 (C _ _ _ _) (B _ _ _ _) = GTSym0
-      Compare_0123456789876543210 (C _ _ _ _) (D _ _ _ _) = LTSym0
-      Compare_0123456789876543210 (C _ _ _ _) (E _ _ _ _) = LTSym0
-      Compare_0123456789876543210 (C _ _ _ _) (F _ _ _ _) = LTSym0
-      Compare_0123456789876543210 (D _ _ _ _) (A _ _ _ _) = GTSym0
-      Compare_0123456789876543210 (D _ _ _ _) (B _ _ _ _) = GTSym0
-      Compare_0123456789876543210 (D _ _ _ _) (C _ _ _ _) = GTSym0
-      Compare_0123456789876543210 (D _ _ _ _) (E _ _ _ _) = LTSym0
-      Compare_0123456789876543210 (D _ _ _ _) (F _ _ _ _) = LTSym0
-      Compare_0123456789876543210 (E _ _ _ _) (A _ _ _ _) = GTSym0
-      Compare_0123456789876543210 (E _ _ _ _) (B _ _ _ _) = GTSym0
-      Compare_0123456789876543210 (E _ _ _ _) (C _ _ _ _) = GTSym0
-      Compare_0123456789876543210 (E _ _ _ _) (D _ _ _ _) = GTSym0
-      Compare_0123456789876543210 (E _ _ _ _) (F _ _ _ _) = LTSym0
-      Compare_0123456789876543210 (F _ _ _ _) (A _ _ _ _) = GTSym0
-      Compare_0123456789876543210 (F _ _ _ _) (B _ _ _ _) = GTSym0
-      Compare_0123456789876543210 (F _ _ _ _) (C _ _ _ _) = GTSym0
-      Compare_0123456789876543210 (F _ _ _ _) (D _ _ _ _) = GTSym0
-      Compare_0123456789876543210 (F _ _ _ _) (E _ _ _ _) = GTSym0
-    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210) (a0123456789876543210 :: Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210) =
-        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
-    data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210) :: (~>) (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210) Ordering
-      where
-        Compare_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                               a0123456789876543210
-                                                               arg. SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
-    data Compare_0123456789876543210Sym0 :: forall a0123456789876543210
-                                                   b0123456789876543210
-                                                   c0123456789876543210
-                                                   d0123456789876543210.
-                                            (~>) (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210) ((~>) (Foo a0123456789876543210 b0123456789876543210 c0123456789876543210 d0123456789876543210) Ordering)
-      where
-        Compare_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                               arg. SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
-                                                        Compare_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
-    instance POrd (Foo a b c d) where
-      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
-    type family Equals_0123456789876543210 (a :: Nat) (b :: Nat) :: Bool where
-      Equals_0123456789876543210 Zero Zero = TrueSym0
-      Equals_0123456789876543210 (Succ a) (Succ b) = (==) a b
-      Equals_0123456789876543210 (_ :: Nat) (_ :: Nat) = FalseSym0
-    instance PEq Nat where
-      type (==) a b = Equals_0123456789876543210 a b
-    type family Equals_0123456789876543210 (a :: Foo a b c d) (b :: Foo a b c d) :: Bool where
-      Equals_0123456789876543210 (A a a a a) (A b b b b) = (&&) ((==) a b) ((&&) ((==) a b) ((&&) ((==) a b) ((==) a b)))
-      Equals_0123456789876543210 (B a a a a) (B b b b b) = (&&) ((==) a b) ((&&) ((==) a b) ((&&) ((==) a b) ((==) a b)))
-      Equals_0123456789876543210 (C a a a a) (C b b b b) = (&&) ((==) a b) ((&&) ((==) a b) ((&&) ((==) a b) ((==) a b)))
-      Equals_0123456789876543210 (D a a a a) (D b b b b) = (&&) ((==) a b) ((&&) ((==) a b) ((&&) ((==) a b) ((==) a b)))
-      Equals_0123456789876543210 (E a a a a) (E b b b b) = (&&) ((==) a b) ((&&) ((==) a b) ((&&) ((==) a b) ((==) a b)))
-      Equals_0123456789876543210 (F a a a a) (F b b b b) = (&&) ((==) a b) ((&&) ((==) a b) ((&&) ((==) a b) ((==) a b)))
-      Equals_0123456789876543210 (_ :: Foo a b c d) (_ :: Foo a b c d) = FalseSym0
-    instance PEq (Foo a b c d) where
-      type (==) a b = Equals_0123456789876543210 a b
-    data SNat :: Nat -> GHC.Types.Type
-      where
-        SZero :: SNat Zero
-        SSucc :: forall (n :: Nat). (Sing (n :: Nat)) -> SNat (Succ n)
-    type instance Sing @Nat = SNat
-    instance SingKind Nat where
-      type Demote Nat = Nat
-      fromSing SZero = Zero
-      fromSing (SSucc b) = Succ (fromSing b)
-      toSing Zero = SomeSing SZero
-      toSing (Succ (b :: Demote Nat))
-        = case toSing b :: SomeSing Nat of {
-            SomeSing c -> SomeSing (SSucc c) }
-    data SFoo :: forall a b c d. Foo a b c d -> GHC.Types.Type
-      where
-        SA :: forall a b c d (n :: a) (n :: b) (n :: c) (n :: d).
-              (Sing (n :: a))
-              -> (Sing (n :: b))
-                 -> (Sing (n :: c)) -> (Sing (n :: d)) -> SFoo (A n n n n)
-        SB :: forall a b c d (n :: a) (n :: b) (n :: c) (n :: d).
-              (Sing (n :: a))
-              -> (Sing (n :: b))
-                 -> (Sing (n :: c)) -> (Sing (n :: d)) -> SFoo (B n n n n)
-        SC :: forall a b c d (n :: a) (n :: b) (n :: c) (n :: d).
-              (Sing (n :: a))
-              -> (Sing (n :: b))
-                 -> (Sing (n :: c)) -> (Sing (n :: d)) -> SFoo (C n n n n)
-        SD :: forall a b c d (n :: a) (n :: b) (n :: c) (n :: d).
-              (Sing (n :: a))
-              -> (Sing (n :: b))
-                 -> (Sing (n :: c)) -> (Sing (n :: d)) -> SFoo (D n n n n)
-        SE :: forall a b c d (n :: a) (n :: b) (n :: c) (n :: d).
-              (Sing (n :: a))
-              -> (Sing (n :: b))
-                 -> (Sing (n :: c)) -> (Sing (n :: d)) -> SFoo (E n n n n)
-        SF :: forall a b c d (n :: a) (n :: b) (n :: c) (n :: d).
-              (Sing (n :: a))
-              -> (Sing (n :: b))
-                 -> (Sing (n :: c)) -> (Sing (n :: d)) -> SFoo (F n n n n)
-    type instance Sing @(Foo a b c d) = SFoo
-    instance (SingKind a, SingKind b, SingKind c, SingKind d) =>
-             SingKind (Foo a b c d) where
-      type Demote (Foo a b c d) = Foo (Demote a) (Demote b) (Demote c) (Demote d)
-      fromSing (SA b b b b)
-        = (((A (fromSing b)) (fromSing b)) (fromSing b)) (fromSing b)
-      fromSing (SB b b b b)
-        = (((B (fromSing b)) (fromSing b)) (fromSing b)) (fromSing b)
-      fromSing (SC b b b b)
-        = (((C (fromSing b)) (fromSing b)) (fromSing b)) (fromSing b)
-      fromSing (SD b b b b)
-        = (((D (fromSing b)) (fromSing b)) (fromSing b)) (fromSing b)
-      fromSing (SE b b b b)
-        = (((E (fromSing b)) (fromSing b)) (fromSing b)) (fromSing b)
-      fromSing (SF b b b b)
-        = (((F (fromSing b)) (fromSing b)) (fromSing b)) (fromSing b)
-      toSing
-        (A (b :: Demote a) (b :: Demote b) (b :: Demote c) (b :: Demote d))
-        = case
-              ((((,,,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b))
-                 (toSing b :: SomeSing c))
-                (toSing b :: SomeSing d)
-          of {
-            (,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)
-              -> SomeSing ((((SA c) c) c) c) }
-      toSing
-        (B (b :: Demote a) (b :: Demote b) (b :: Demote c) (b :: Demote d))
-        = case
-              ((((,,,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b))
-                 (toSing b :: SomeSing c))
-                (toSing b :: SomeSing d)
-          of {
-            (,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)
-              -> SomeSing ((((SB c) c) c) c) }
-      toSing
-        (C (b :: Demote a) (b :: Demote b) (b :: Demote c) (b :: Demote d))
-        = case
-              ((((,,,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b))
-                 (toSing b :: SomeSing c))
-                (toSing b :: SomeSing d)
-          of {
-            (,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)
-              -> SomeSing ((((SC c) c) c) c) }
-      toSing
-        (D (b :: Demote a) (b :: Demote b) (b :: Demote c) (b :: Demote d))
-        = case
-              ((((,,,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b))
-                 (toSing b :: SomeSing c))
-                (toSing b :: SomeSing d)
-          of {
-            (,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)
-              -> SomeSing ((((SD c) c) c) c) }
-      toSing
-        (E (b :: Demote a) (b :: Demote b) (b :: Demote c) (b :: Demote d))
-        = case
-              ((((,,,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b))
-                 (toSing b :: SomeSing c))
-                (toSing b :: SomeSing d)
-          of {
-            (,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)
-              -> SomeSing ((((SE c) c) c) c) }
-      toSing
-        (F (b :: Demote a) (b :: Demote b) (b :: Demote c) (b :: Demote d))
-        = case
-              ((((,,,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b))
-                 (toSing b :: SomeSing c))
-                (toSing b :: SomeSing d)
-          of {
-            (,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)
-              -> SomeSing ((((SF c) c) c) c) }
-    instance SOrd Nat => SOrd Nat where
-      sCompare ::
-        forall (t1 :: Nat) (t2 :: Nat).
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply (CompareSym0 :: TyFun Nat ((~>) Nat Ordering)
-                                                 -> GHC.Types.Type) t1) t2)
-      sCompare SZero SZero
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            SNil
-      sCompare
-        (SSucc (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        (SSucc (sB_0123456789876543210 :: Sing b_0123456789876543210))
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            ((applySing
-                ((applySing ((singFun2 @(:@#@$)) SCons))
-                   ((applySing
-                       ((applySing ((singFun2 @CompareSym0) sCompare))
-                          sA_0123456789876543210))
-                      sB_0123456789876543210)))
-               SNil)
-      sCompare SZero (SSucc _) = SLT
-      sCompare (SSucc _) SZero = SGT
-    instance (SOrd a, SOrd b, SOrd c, SOrd d) =>
-             SOrd (Foo a b c d) where
-      sCompare ::
-        forall (t1 :: Foo a b c d) (t2 :: Foo a b c d).
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply (CompareSym0 :: TyFun (Foo a b c d) ((~>) (Foo a b c d) Ordering)
-                                                 -> GHC.Types.Type) t1) t2)
-      sCompare
-        (SA (sA_0123456789876543210 :: Sing a_0123456789876543210)
-            (sA_0123456789876543210 :: Sing a_0123456789876543210)
-            (sA_0123456789876543210 :: Sing a_0123456789876543210)
-            (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        (SA (sB_0123456789876543210 :: Sing b_0123456789876543210)
-            (sB_0123456789876543210 :: Sing b_0123456789876543210)
-            (sB_0123456789876543210 :: Sing b_0123456789876543210)
-            (sB_0123456789876543210 :: Sing b_0123456789876543210))
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            ((applySing
-                ((applySing ((singFun2 @(:@#@$)) SCons))
-                   ((applySing
-                       ((applySing ((singFun2 @CompareSym0) sCompare))
-                          sA_0123456789876543210))
-                      sB_0123456789876543210)))
-               ((applySing
-                   ((applySing ((singFun2 @(:@#@$)) SCons))
-                      ((applySing
-                          ((applySing ((singFun2 @CompareSym0) sCompare))
-                             sA_0123456789876543210))
-                         sB_0123456789876543210)))
-                  ((applySing
-                      ((applySing ((singFun2 @(:@#@$)) SCons))
-                         ((applySing
-                             ((applySing ((singFun2 @CompareSym0) sCompare))
-                                sA_0123456789876543210))
-                            sB_0123456789876543210)))
-                     ((applySing
-                         ((applySing ((singFun2 @(:@#@$)) SCons))
-                            ((applySing
-                                ((applySing ((singFun2 @CompareSym0) sCompare))
-                                   sA_0123456789876543210))
-                               sB_0123456789876543210)))
-                        SNil))))
-      sCompare
-        (SB (sA_0123456789876543210 :: Sing a_0123456789876543210)
-            (sA_0123456789876543210 :: Sing a_0123456789876543210)
-            (sA_0123456789876543210 :: Sing a_0123456789876543210)
-            (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        (SB (sB_0123456789876543210 :: Sing b_0123456789876543210)
-            (sB_0123456789876543210 :: Sing b_0123456789876543210)
-            (sB_0123456789876543210 :: Sing b_0123456789876543210)
-            (sB_0123456789876543210 :: Sing b_0123456789876543210))
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            ((applySing
-                ((applySing ((singFun2 @(:@#@$)) SCons))
-                   ((applySing
-                       ((applySing ((singFun2 @CompareSym0) sCompare))
-                          sA_0123456789876543210))
-                      sB_0123456789876543210)))
-               ((applySing
-                   ((applySing ((singFun2 @(:@#@$)) SCons))
-                      ((applySing
-                          ((applySing ((singFun2 @CompareSym0) sCompare))
-                             sA_0123456789876543210))
-                         sB_0123456789876543210)))
-                  ((applySing
-                      ((applySing ((singFun2 @(:@#@$)) SCons))
-                         ((applySing
-                             ((applySing ((singFun2 @CompareSym0) sCompare))
-                                sA_0123456789876543210))
-                            sB_0123456789876543210)))
-                     ((applySing
-                         ((applySing ((singFun2 @(:@#@$)) SCons))
-                            ((applySing
-                                ((applySing ((singFun2 @CompareSym0) sCompare))
-                                   sA_0123456789876543210))
-                               sB_0123456789876543210)))
-                        SNil))))
-      sCompare
-        (SC (sA_0123456789876543210 :: Sing a_0123456789876543210)
-            (sA_0123456789876543210 :: Sing a_0123456789876543210)
-            (sA_0123456789876543210 :: Sing a_0123456789876543210)
-            (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        (SC (sB_0123456789876543210 :: Sing b_0123456789876543210)
-            (sB_0123456789876543210 :: Sing b_0123456789876543210)
-            (sB_0123456789876543210 :: Sing b_0123456789876543210)
-            (sB_0123456789876543210 :: Sing b_0123456789876543210))
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            ((applySing
-                ((applySing ((singFun2 @(:@#@$)) SCons))
-                   ((applySing
-                       ((applySing ((singFun2 @CompareSym0) sCompare))
-                          sA_0123456789876543210))
-                      sB_0123456789876543210)))
-               ((applySing
-                   ((applySing ((singFun2 @(:@#@$)) SCons))
-                      ((applySing
-                          ((applySing ((singFun2 @CompareSym0) sCompare))
-                             sA_0123456789876543210))
-                         sB_0123456789876543210)))
-                  ((applySing
-                      ((applySing ((singFun2 @(:@#@$)) SCons))
-                         ((applySing
-                             ((applySing ((singFun2 @CompareSym0) sCompare))
-                                sA_0123456789876543210))
-                            sB_0123456789876543210)))
-                     ((applySing
-                         ((applySing ((singFun2 @(:@#@$)) SCons))
-                            ((applySing
-                                ((applySing ((singFun2 @CompareSym0) sCompare))
-                                   sA_0123456789876543210))
-                               sB_0123456789876543210)))
-                        SNil))))
-      sCompare
-        (SD (sA_0123456789876543210 :: Sing a_0123456789876543210)
-            (sA_0123456789876543210 :: Sing a_0123456789876543210)
-            (sA_0123456789876543210 :: Sing a_0123456789876543210)
-            (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        (SD (sB_0123456789876543210 :: Sing b_0123456789876543210)
-            (sB_0123456789876543210 :: Sing b_0123456789876543210)
-            (sB_0123456789876543210 :: Sing b_0123456789876543210)
-            (sB_0123456789876543210 :: Sing b_0123456789876543210))
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            ((applySing
-                ((applySing ((singFun2 @(:@#@$)) SCons))
-                   ((applySing
-                       ((applySing ((singFun2 @CompareSym0) sCompare))
-                          sA_0123456789876543210))
-                      sB_0123456789876543210)))
-               ((applySing
-                   ((applySing ((singFun2 @(:@#@$)) SCons))
-                      ((applySing
-                          ((applySing ((singFun2 @CompareSym0) sCompare))
-                             sA_0123456789876543210))
-                         sB_0123456789876543210)))
-                  ((applySing
-                      ((applySing ((singFun2 @(:@#@$)) SCons))
-                         ((applySing
-                             ((applySing ((singFun2 @CompareSym0) sCompare))
-                                sA_0123456789876543210))
-                            sB_0123456789876543210)))
-                     ((applySing
-                         ((applySing ((singFun2 @(:@#@$)) SCons))
-                            ((applySing
-                                ((applySing ((singFun2 @CompareSym0) sCompare))
-                                   sA_0123456789876543210))
-                               sB_0123456789876543210)))
-                        SNil))))
-      sCompare
-        (SE (sA_0123456789876543210 :: Sing a_0123456789876543210)
-            (sA_0123456789876543210 :: Sing a_0123456789876543210)
-            (sA_0123456789876543210 :: Sing a_0123456789876543210)
-            (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        (SE (sB_0123456789876543210 :: Sing b_0123456789876543210)
-            (sB_0123456789876543210 :: Sing b_0123456789876543210)
-            (sB_0123456789876543210 :: Sing b_0123456789876543210)
-            (sB_0123456789876543210 :: Sing b_0123456789876543210))
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            ((applySing
-                ((applySing ((singFun2 @(:@#@$)) SCons))
-                   ((applySing
-                       ((applySing ((singFun2 @CompareSym0) sCompare))
-                          sA_0123456789876543210))
-                      sB_0123456789876543210)))
-               ((applySing
-                   ((applySing ((singFun2 @(:@#@$)) SCons))
-                      ((applySing
-                          ((applySing ((singFun2 @CompareSym0) sCompare))
-                             sA_0123456789876543210))
-                         sB_0123456789876543210)))
-                  ((applySing
-                      ((applySing ((singFun2 @(:@#@$)) SCons))
-                         ((applySing
-                             ((applySing ((singFun2 @CompareSym0) sCompare))
-                                sA_0123456789876543210))
-                            sB_0123456789876543210)))
-                     ((applySing
-                         ((applySing ((singFun2 @(:@#@$)) SCons))
-                            ((applySing
-                                ((applySing ((singFun2 @CompareSym0) sCompare))
-                                   sA_0123456789876543210))
-                               sB_0123456789876543210)))
-                        SNil))))
-      sCompare
-        (SF (sA_0123456789876543210 :: Sing a_0123456789876543210)
-            (sA_0123456789876543210 :: Sing a_0123456789876543210)
-            (sA_0123456789876543210 :: Sing a_0123456789876543210)
-            (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        (SF (sB_0123456789876543210 :: Sing b_0123456789876543210)
-            (sB_0123456789876543210 :: Sing b_0123456789876543210)
-            (sB_0123456789876543210 :: Sing b_0123456789876543210)
-            (sB_0123456789876543210 :: Sing b_0123456789876543210))
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            ((applySing
-                ((applySing ((singFun2 @(:@#@$)) SCons))
-                   ((applySing
-                       ((applySing ((singFun2 @CompareSym0) sCompare))
-                          sA_0123456789876543210))
-                      sB_0123456789876543210)))
-               ((applySing
-                   ((applySing ((singFun2 @(:@#@$)) SCons))
-                      ((applySing
-                          ((applySing ((singFun2 @CompareSym0) sCompare))
-                             sA_0123456789876543210))
-                         sB_0123456789876543210)))
-                  ((applySing
-                      ((applySing ((singFun2 @(:@#@$)) SCons))
-                         ((applySing
-                             ((applySing ((singFun2 @CompareSym0) sCompare))
-                                sA_0123456789876543210))
-                            sB_0123456789876543210)))
-                     ((applySing
-                         ((applySing ((singFun2 @(:@#@$)) SCons))
-                            ((applySing
-                                ((applySing ((singFun2 @CompareSym0) sCompare))
-                                   sA_0123456789876543210))
-                               sB_0123456789876543210)))
-                        SNil))))
-      sCompare (SA _ _ _ _) (SB _ _ _ _) = SLT
-      sCompare (SA _ _ _ _) (SC _ _ _ _) = SLT
-      sCompare (SA _ _ _ _) (SD _ _ _ _) = SLT
-      sCompare (SA _ _ _ _) (SE _ _ _ _) = SLT
-      sCompare (SA _ _ _ _) (SF _ _ _ _) = SLT
-      sCompare (SB _ _ _ _) (SA _ _ _ _) = SGT
-      sCompare (SB _ _ _ _) (SC _ _ _ _) = SLT
-      sCompare (SB _ _ _ _) (SD _ _ _ _) = SLT
-      sCompare (SB _ _ _ _) (SE _ _ _ _) = SLT
-      sCompare (SB _ _ _ _) (SF _ _ _ _) = SLT
-      sCompare (SC _ _ _ _) (SA _ _ _ _) = SGT
-      sCompare (SC _ _ _ _) (SB _ _ _ _) = SGT
-      sCompare (SC _ _ _ _) (SD _ _ _ _) = SLT
-      sCompare (SC _ _ _ _) (SE _ _ _ _) = SLT
-      sCompare (SC _ _ _ _) (SF _ _ _ _) = SLT
-      sCompare (SD _ _ _ _) (SA _ _ _ _) = SGT
-      sCompare (SD _ _ _ _) (SB _ _ _ _) = SGT
-      sCompare (SD _ _ _ _) (SC _ _ _ _) = SGT
-      sCompare (SD _ _ _ _) (SE _ _ _ _) = SLT
-      sCompare (SD _ _ _ _) (SF _ _ _ _) = SLT
-      sCompare (SE _ _ _ _) (SA _ _ _ _) = SGT
-      sCompare (SE _ _ _ _) (SB _ _ _ _) = SGT
-      sCompare (SE _ _ _ _) (SC _ _ _ _) = SGT
-      sCompare (SE _ _ _ _) (SD _ _ _ _) = SGT
-      sCompare (SE _ _ _ _) (SF _ _ _ _) = SLT
-      sCompare (SF _ _ _ _) (SA _ _ _ _) = SGT
-      sCompare (SF _ _ _ _) (SB _ _ _ _) = SGT
-      sCompare (SF _ _ _ _) (SC _ _ _ _) = SGT
-      sCompare (SF _ _ _ _) (SD _ _ _ _) = SGT
-      sCompare (SF _ _ _ _) (SE _ _ _ _) = SGT
-    instance SEq Nat => SEq Nat where
-      (%==) SZero SZero = STrue
-      (%==) SZero (SSucc _) = SFalse
-      (%==) (SSucc _) SZero = SFalse
-      (%==) (SSucc a) (SSucc b) = ((%==) a) b
-    instance SDecide Nat => SDecide Nat where
-      (%~) SZero SZero = Proved Refl
-      (%~) SZero (SSucc _) = Disproved (\ x -> case x of)
-      (%~) (SSucc _) SZero = Disproved (\ x -> case x of)
-      (%~) (SSucc a) (SSucc b)
-        = case ((%~) a) b of
-            Proved Refl -> Proved Refl
-            Disproved contra
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-    instance SDecide Nat =>
-             Data.Type.Equality.TestEquality (SNat :: Nat
-                                                      -> GHC.Types.Type) where
-      Data.Type.Equality.testEquality
-        = Data.Singletons.Decide.decideEquality
-    instance SDecide Nat =>
-             Data.Type.Coercion.TestCoercion (SNat :: Nat
-                                                      -> GHC.Types.Type) where
-      Data.Type.Coercion.testCoercion
-        = Data.Singletons.Decide.decideCoercion
-    instance (SEq a, SEq b, SEq c, SEq d) => SEq (Foo a b c d) where
-      (%==) (SA a a a a) (SA b b b b)
-        = ((%&&) (((%==) a) b))
-            (((%&&) (((%==) a) b)) (((%&&) (((%==) a) b)) (((%==) a) b)))
-      (%==) (SA _ _ _ _) (SB _ _ _ _) = SFalse
-      (%==) (SA _ _ _ _) (SC _ _ _ _) = SFalse
-      (%==) (SA _ _ _ _) (SD _ _ _ _) = SFalse
-      (%==) (SA _ _ _ _) (SE _ _ _ _) = SFalse
-      (%==) (SA _ _ _ _) (SF _ _ _ _) = SFalse
-      (%==) (SB _ _ _ _) (SA _ _ _ _) = SFalse
-      (%==) (SB a a a a) (SB b b b b)
-        = ((%&&) (((%==) a) b))
-            (((%&&) (((%==) a) b)) (((%&&) (((%==) a) b)) (((%==) a) b)))
-      (%==) (SB _ _ _ _) (SC _ _ _ _) = SFalse
-      (%==) (SB _ _ _ _) (SD _ _ _ _) = SFalse
-      (%==) (SB _ _ _ _) (SE _ _ _ _) = SFalse
-      (%==) (SB _ _ _ _) (SF _ _ _ _) = SFalse
-      (%==) (SC _ _ _ _) (SA _ _ _ _) = SFalse
-      (%==) (SC _ _ _ _) (SB _ _ _ _) = SFalse
-      (%==) (SC a a a a) (SC b b b b)
-        = ((%&&) (((%==) a) b))
-            (((%&&) (((%==) a) b)) (((%&&) (((%==) a) b)) (((%==) a) b)))
-      (%==) (SC _ _ _ _) (SD _ _ _ _) = SFalse
-      (%==) (SC _ _ _ _) (SE _ _ _ _) = SFalse
-      (%==) (SC _ _ _ _) (SF _ _ _ _) = SFalse
-      (%==) (SD _ _ _ _) (SA _ _ _ _) = SFalse
-      (%==) (SD _ _ _ _) (SB _ _ _ _) = SFalse
-      (%==) (SD _ _ _ _) (SC _ _ _ _) = SFalse
-      (%==) (SD a a a a) (SD b b b b)
-        = ((%&&) (((%==) a) b))
-            (((%&&) (((%==) a) b)) (((%&&) (((%==) a) b)) (((%==) a) b)))
-      (%==) (SD _ _ _ _) (SE _ _ _ _) = SFalse
-      (%==) (SD _ _ _ _) (SF _ _ _ _) = SFalse
-      (%==) (SE _ _ _ _) (SA _ _ _ _) = SFalse
-      (%==) (SE _ _ _ _) (SB _ _ _ _) = SFalse
-      (%==) (SE _ _ _ _) (SC _ _ _ _) = SFalse
-      (%==) (SE _ _ _ _) (SD _ _ _ _) = SFalse
-      (%==) (SE a a a a) (SE b b b b)
-        = ((%&&) (((%==) a) b))
-            (((%&&) (((%==) a) b)) (((%&&) (((%==) a) b)) (((%==) a) b)))
-      (%==) (SE _ _ _ _) (SF _ _ _ _) = SFalse
-      (%==) (SF _ _ _ _) (SA _ _ _ _) = SFalse
-      (%==) (SF _ _ _ _) (SB _ _ _ _) = SFalse
-      (%==) (SF _ _ _ _) (SC _ _ _ _) = SFalse
-      (%==) (SF _ _ _ _) (SD _ _ _ _) = SFalse
-      (%==) (SF _ _ _ _) (SE _ _ _ _) = SFalse
-      (%==) (SF a a a a) (SF b b b b)
-        = ((%&&) (((%==) a) b))
-            (((%&&) (((%==) a) b)) (((%&&) (((%==) a) b)) (((%==) a) b)))
-    instance (SDecide a, SDecide b, SDecide c, SDecide d) =>
-             SDecide (Foo a b c d) where
-      (%~) (SA a a a a) (SA b b b b)
-        = case
-              ((((,,,) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)
-          of
-            (,,,) (Proved Refl) (Proved Refl) (Proved Refl) (Proved Refl)
-              -> Proved Refl
-            (,,,) (Disproved contra) _ _ _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,,,) _ (Disproved contra) _ _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,,,) _ _ (Disproved contra) _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,,,) _ _ _ (Disproved contra)
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-      (%~) (SA _ _ _ _) (SB _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SA _ _ _ _) (SC _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SA _ _ _ _) (SD _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SA _ _ _ _) (SE _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SA _ _ _ _) (SF _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SB _ _ _ _) (SA _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SB a a a a) (SB b b b b)
-        = case
-              ((((,,,) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)
-          of
-            (,,,) (Proved Refl) (Proved Refl) (Proved Refl) (Proved Refl)
-              -> Proved Refl
-            (,,,) (Disproved contra) _ _ _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,,,) _ (Disproved contra) _ _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,,,) _ _ (Disproved contra) _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,,,) _ _ _ (Disproved contra)
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-      (%~) (SB _ _ _ _) (SC _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SB _ _ _ _) (SD _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SB _ _ _ _) (SE _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SB _ _ _ _) (SF _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SC _ _ _ _) (SA _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SC _ _ _ _) (SB _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SC a a a a) (SC b b b b)
-        = case
-              ((((,,,) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)
-          of
-            (,,,) (Proved Refl) (Proved Refl) (Proved Refl) (Proved Refl)
-              -> Proved Refl
-            (,,,) (Disproved contra) _ _ _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,,,) _ (Disproved contra) _ _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,,,) _ _ (Disproved contra) _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,,,) _ _ _ (Disproved contra)
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-      (%~) (SC _ _ _ _) (SD _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SC _ _ _ _) (SE _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SC _ _ _ _) (SF _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SD _ _ _ _) (SA _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SD _ _ _ _) (SB _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SD _ _ _ _) (SC _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SD a a a a) (SD b b b b)
-        = case
-              ((((,,,) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)
-          of
-            (,,,) (Proved Refl) (Proved Refl) (Proved Refl) (Proved Refl)
-              -> Proved Refl
-            (,,,) (Disproved contra) _ _ _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,,,) _ (Disproved contra) _ _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,,,) _ _ (Disproved contra) _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,,,) _ _ _ (Disproved contra)
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-      (%~) (SD _ _ _ _) (SE _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SD _ _ _ _) (SF _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SE _ _ _ _) (SA _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SE _ _ _ _) (SB _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SE _ _ _ _) (SC _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SE _ _ _ _) (SD _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SE a a a a) (SE b b b b)
-        = case
-              ((((,,,) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)
-          of
-            (,,,) (Proved Refl) (Proved Refl) (Proved Refl) (Proved Refl)
-              -> Proved Refl
-            (,,,) (Disproved contra) _ _ _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,,,) _ (Disproved contra) _ _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,,,) _ _ (Disproved contra) _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,,,) _ _ _ (Disproved contra)
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-      (%~) (SE _ _ _ _) (SF _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SF _ _ _ _) (SA _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SF _ _ _ _) (SB _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SF _ _ _ _) (SC _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SF _ _ _ _) (SD _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SF _ _ _ _) (SE _ _ _ _) = Disproved (\ x -> case x of)
-      (%~) (SF a a a a) (SF b b b b)
-        = case
-              ((((,,,) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)
-          of
-            (,,,) (Proved Refl) (Proved Refl) (Proved Refl) (Proved Refl)
-              -> Proved Refl
-            (,,,) (Disproved contra) _ _ _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,,,) _ (Disproved contra) _ _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,,,) _ _ (Disproved contra) _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,,,) _ _ _ (Disproved contra)
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-    instance (SDecide a, SDecide b, SDecide c, SDecide d) =>
-             Data.Type.Equality.TestEquality (SFoo :: Foo a b c d
-                                                      -> GHC.Types.Type) where
-      Data.Type.Equality.testEquality
-        = Data.Singletons.Decide.decideEquality
-    instance (SDecide a, SDecide b, SDecide c, SDecide d) =>
-             Data.Type.Coercion.TestCoercion (SFoo :: Foo a b c d
-                                                      -> GHC.Types.Type) where
-      Data.Type.Coercion.testCoercion
-        = Data.Singletons.Decide.decideCoercion
-    instance SingI Zero where
-      sing = SZero
-    instance SingI n => SingI (Succ (n :: Nat)) where
-      sing = SSucc sing
-    instance SingI (SuccSym0 :: (~>) Nat Nat) where
-      sing = (singFun1 @SuccSym0) SSucc
-    instance (SingI n, SingI n, SingI n, SingI n) =>
-             SingI (A (n :: a) (n :: b) (n :: c) (n :: d)) where
-      sing = (((SA sing) sing) sing) sing
-    instance SingI (ASym0 :: (~>) a ((~>) b ((~>) c ((~>) d (Foo a b c d))))) where
-      sing = (singFun4 @ASym0) SA
-    instance SingI d =>
-             SingI (ASym1 (d :: a) :: (~>) b ((~>) c ((~>) d (Foo a b c d)))) where
-      sing = (singFun3 @(ASym1 (d :: a))) (SA (sing @d))
-    instance (SingI d, SingI d) =>
-             SingI (ASym2 (d :: a) (d :: b) :: (~>) c ((~>) d (Foo a b c d))) where
-      sing
-        = (singFun2 @(ASym2 (d :: a) (d :: b))) ((SA (sing @d)) (sing @d))
-    instance (SingI d, SingI d, SingI d) =>
-             SingI (ASym3 (d :: a) (d :: b) (d :: c) :: (~>) d (Foo a b c d)) where
-      sing
-        = (singFun1 @(ASym3 (d :: a) (d :: b) (d :: c)))
-            (((SA (sing @d)) (sing @d)) (sing @d))
-    instance (SingI n, SingI n, SingI n, SingI n) =>
-             SingI (B (n :: a) (n :: b) (n :: c) (n :: d)) where
-      sing = (((SB sing) sing) sing) sing
-    instance SingI (BSym0 :: (~>) a ((~>) b ((~>) c ((~>) d (Foo a b c d))))) where
-      sing = (singFun4 @BSym0) SB
-    instance SingI d =>
-             SingI (BSym1 (d :: a) :: (~>) b ((~>) c ((~>) d (Foo a b c d)))) where
-      sing = (singFun3 @(BSym1 (d :: a))) (SB (sing @d))
-    instance (SingI d, SingI d) =>
-             SingI (BSym2 (d :: a) (d :: b) :: (~>) c ((~>) d (Foo a b c d))) where
-      sing
-        = (singFun2 @(BSym2 (d :: a) (d :: b))) ((SB (sing @d)) (sing @d))
-    instance (SingI d, SingI d, SingI d) =>
-             SingI (BSym3 (d :: a) (d :: b) (d :: c) :: (~>) d (Foo a b c d)) where
-      sing
-        = (singFun1 @(BSym3 (d :: a) (d :: b) (d :: c)))
-            (((SB (sing @d)) (sing @d)) (sing @d))
-    instance (SingI n, SingI n, SingI n, SingI n) =>
-             SingI (C (n :: a) (n :: b) (n :: c) (n :: d)) where
-      sing = (((SC sing) sing) sing) sing
-    instance SingI (CSym0 :: (~>) a ((~>) b ((~>) c ((~>) d (Foo a b c d))))) where
-      sing = (singFun4 @CSym0) SC
-    instance SingI d =>
-             SingI (CSym1 (d :: a) :: (~>) b ((~>) c ((~>) d (Foo a b c d)))) where
-      sing = (singFun3 @(CSym1 (d :: a))) (SC (sing @d))
-    instance (SingI d, SingI d) =>
-             SingI (CSym2 (d :: a) (d :: b) :: (~>) c ((~>) d (Foo a b c d))) where
-      sing
-        = (singFun2 @(CSym2 (d :: a) (d :: b))) ((SC (sing @d)) (sing @d))
-    instance (SingI d, SingI d, SingI d) =>
-             SingI (CSym3 (d :: a) (d :: b) (d :: c) :: (~>) d (Foo a b c d)) where
-      sing
-        = (singFun1 @(CSym3 (d :: a) (d :: b) (d :: c)))
-            (((SC (sing @d)) (sing @d)) (sing @d))
-    instance (SingI n, SingI n, SingI n, SingI n) =>
-             SingI (D (n :: a) (n :: b) (n :: c) (n :: d)) where
-      sing = (((SD sing) sing) sing) sing
-    instance SingI (DSym0 :: (~>) a ((~>) b ((~>) c ((~>) d (Foo a b c d))))) where
-      sing = (singFun4 @DSym0) SD
-    instance SingI d =>
-             SingI (DSym1 (d :: a) :: (~>) b ((~>) c ((~>) d (Foo a b c d)))) where
-      sing = (singFun3 @(DSym1 (d :: a))) (SD (sing @d))
-    instance (SingI d, SingI d) =>
-             SingI (DSym2 (d :: a) (d :: b) :: (~>) c ((~>) d (Foo a b c d))) where
-      sing
-        = (singFun2 @(DSym2 (d :: a) (d :: b))) ((SD (sing @d)) (sing @d))
-    instance (SingI d, SingI d, SingI d) =>
-             SingI (DSym3 (d :: a) (d :: b) (d :: c) :: (~>) d (Foo a b c d)) where
-      sing
-        = (singFun1 @(DSym3 (d :: a) (d :: b) (d :: c)))
-            (((SD (sing @d)) (sing @d)) (sing @d))
-    instance (SingI n, SingI n, SingI n, SingI n) =>
-             SingI (E (n :: a) (n :: b) (n :: c) (n :: d)) where
-      sing = (((SE sing) sing) sing) sing
-    instance SingI (ESym0 :: (~>) a ((~>) b ((~>) c ((~>) d (Foo a b c d))))) where
-      sing = (singFun4 @ESym0) SE
-    instance SingI d =>
-             SingI (ESym1 (d :: a) :: (~>) b ((~>) c ((~>) d (Foo a b c d)))) where
-      sing = (singFun3 @(ESym1 (d :: a))) (SE (sing @d))
-    instance (SingI d, SingI d) =>
-             SingI (ESym2 (d :: a) (d :: b) :: (~>) c ((~>) d (Foo a b c d))) where
-      sing
-        = (singFun2 @(ESym2 (d :: a) (d :: b))) ((SE (sing @d)) (sing @d))
-    instance (SingI d, SingI d, SingI d) =>
-             SingI (ESym3 (d :: a) (d :: b) (d :: c) :: (~>) d (Foo a b c d)) where
-      sing
-        = (singFun1 @(ESym3 (d :: a) (d :: b) (d :: c)))
-            (((SE (sing @d)) (sing @d)) (sing @d))
-    instance (SingI n, SingI n, SingI n, SingI n) =>
-             SingI (F (n :: a) (n :: b) (n :: c) (n :: d)) where
-      sing = (((SF sing) sing) sing) sing
-    instance SingI (FSym0 :: (~>) a ((~>) b ((~>) c ((~>) d (Foo a b c d))))) where
-      sing = (singFun4 @FSym0) SF
-    instance SingI d =>
-             SingI (FSym1 (d :: a) :: (~>) b ((~>) c ((~>) d (Foo a b c d)))) where
-      sing = (singFun3 @(FSym1 (d :: a))) (SF (sing @d))
-    instance (SingI d, SingI d) =>
-             SingI (FSym2 (d :: a) (d :: b) :: (~>) c ((~>) d (Foo a b c d))) where
-      sing
-        = (singFun2 @(FSym2 (d :: a) (d :: b))) ((SF (sing @d)) (sing @d))
-    instance (SingI d, SingI d, SingI d) =>
-             SingI (FSym3 (d :: a) (d :: b) (d :: c) :: (~>) d (Foo a b c d)) where
-      sing
-        = (singFun1 @(FSym3 (d :: a) (d :: b) (d :: c)))
-            (((SF (sing @d)) (sing @d)) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/OrdDeriving.golden b/tests/compile-and-dump/Singletons/OrdDeriving.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/OrdDeriving.golden
@@ -0,0 +1,1086 @@
+Singletons/OrdDeriving.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| data Nat
+            = Zero | Succ Nat
+            deriving (Eq, Ord)
+          data Foo a b c d
+            = A a b c d |
+              B a b c d |
+              C a b c d |
+              D a b c d |
+              E a b c d |
+              F a b c d
+            deriving (Eq, Ord) |]
+  ======>
+    data Nat
+      = Zero | Succ Nat
+      deriving (Eq, Ord)
+    data Foo a b c d
+      = A a b c d |
+        B a b c d |
+        C a b c d |
+        D a b c d |
+        E a b c d |
+        F a b c d
+      deriving (Eq, Ord)
+    type ZeroSym0 = Zero :: Nat
+    type SuccSym0 :: (~>) Nat Nat
+    data SuccSym0 a0123456789876543210
+      where
+        SuccSym0KindInference :: SameKind (Apply SuccSym0 arg) (SuccSym1 arg) =>
+                                 SuccSym0 a0123456789876543210
+    type instance Apply SuccSym0 a0123456789876543210 = SuccSym1 a0123456789876543210
+    instance SuppressUnusedWarnings SuccSym0 where
+      suppressUnusedWarnings = snd (((,) SuccSym0KindInference) ())
+    type SuccSym1 (a0123456789876543210 :: Nat) =
+        Succ a0123456789876543210 :: Nat
+    type ASym0 :: forall a b c d.
+                  (~>) a ((~>) b ((~>) c ((~>) d (Foo a b c d))))
+    data ASym0 a0123456789876543210
+      where
+        ASym0KindInference :: SameKind (Apply ASym0 arg) (ASym1 arg) =>
+                              ASym0 a0123456789876543210
+    type instance Apply ASym0 a0123456789876543210 = ASym1 a0123456789876543210
+    instance SuppressUnusedWarnings ASym0 where
+      suppressUnusedWarnings = snd (((,) ASym0KindInference) ())
+    type ASym1 :: forall a b c d.
+                  a -> (~>) b ((~>) c ((~>) d (Foo a b c d)))
+    data ASym1 a0123456789876543210 a0123456789876543210
+      where
+        ASym1KindInference :: SameKind (Apply (ASym1 a0123456789876543210) arg) (ASym2 a0123456789876543210 arg) =>
+                              ASym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ASym1 a0123456789876543210) a0123456789876543210 = ASym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ASym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) ASym1KindInference) ())
+    type ASym2 :: forall a b c d.
+                  a -> b -> (~>) c ((~>) d (Foo a b c d))
+    data ASym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ASym2KindInference :: SameKind (Apply (ASym2 a0123456789876543210 a0123456789876543210) arg) (ASym3 a0123456789876543210 a0123456789876543210 arg) =>
+                              ASym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ASym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ASym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ASym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) ASym2KindInference) ())
+    type ASym3 :: forall a b c d. a -> b -> c -> (~>) d (Foo a b c d)
+    data ASym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ASym3KindInference :: SameKind (Apply (ASym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) arg) (ASym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 arg) =>
+                              ASym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ASym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ASym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ASym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) ASym3KindInference) ())
+    type ASym4 (a0123456789876543210 :: a) (a0123456789876543210 :: b) (a0123456789876543210 :: c) (a0123456789876543210 :: d) =
+        A a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Foo a b c d
+    type BSym0 :: forall a b c d.
+                  (~>) a ((~>) b ((~>) c ((~>) d (Foo a b c d))))
+    data BSym0 a0123456789876543210
+      where
+        BSym0KindInference :: SameKind (Apply BSym0 arg) (BSym1 arg) =>
+                              BSym0 a0123456789876543210
+    type instance Apply BSym0 a0123456789876543210 = BSym1 a0123456789876543210
+    instance SuppressUnusedWarnings BSym0 where
+      suppressUnusedWarnings = snd (((,) BSym0KindInference) ())
+    type BSym1 :: forall a b c d.
+                  a -> (~>) b ((~>) c ((~>) d (Foo a b c d)))
+    data BSym1 a0123456789876543210 a0123456789876543210
+      where
+        BSym1KindInference :: SameKind (Apply (BSym1 a0123456789876543210) arg) (BSym2 a0123456789876543210 arg) =>
+                              BSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (BSym1 a0123456789876543210) a0123456789876543210 = BSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (BSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) BSym1KindInference) ())
+    type BSym2 :: forall a b c d.
+                  a -> b -> (~>) c ((~>) d (Foo a b c d))
+    data BSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        BSym2KindInference :: SameKind (Apply (BSym2 a0123456789876543210 a0123456789876543210) arg) (BSym3 a0123456789876543210 a0123456789876543210 arg) =>
+                              BSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (BSym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = BSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (BSym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) BSym2KindInference) ())
+    type BSym3 :: forall a b c d. a -> b -> c -> (~>) d (Foo a b c d)
+    data BSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        BSym3KindInference :: SameKind (Apply (BSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) arg) (BSym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 arg) =>
+                              BSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (BSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) a0123456789876543210 = BSym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (BSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) BSym3KindInference) ())
+    type BSym4 (a0123456789876543210 :: a) (a0123456789876543210 :: b) (a0123456789876543210 :: c) (a0123456789876543210 :: d) =
+        B a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Foo a b c d
+    type CSym0 :: forall a b c d.
+                  (~>) a ((~>) b ((~>) c ((~>) d (Foo a b c d))))
+    data CSym0 a0123456789876543210
+      where
+        CSym0KindInference :: SameKind (Apply CSym0 arg) (CSym1 arg) =>
+                              CSym0 a0123456789876543210
+    type instance Apply CSym0 a0123456789876543210 = CSym1 a0123456789876543210
+    instance SuppressUnusedWarnings CSym0 where
+      suppressUnusedWarnings = snd (((,) CSym0KindInference) ())
+    type CSym1 :: forall a b c d.
+                  a -> (~>) b ((~>) c ((~>) d (Foo a b c d)))
+    data CSym1 a0123456789876543210 a0123456789876543210
+      where
+        CSym1KindInference :: SameKind (Apply (CSym1 a0123456789876543210) arg) (CSym2 a0123456789876543210 arg) =>
+                              CSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (CSym1 a0123456789876543210) a0123456789876543210 = CSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (CSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) CSym1KindInference) ())
+    type CSym2 :: forall a b c d.
+                  a -> b -> (~>) c ((~>) d (Foo a b c d))
+    data CSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        CSym2KindInference :: SameKind (Apply (CSym2 a0123456789876543210 a0123456789876543210) arg) (CSym3 a0123456789876543210 a0123456789876543210 arg) =>
+                              CSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (CSym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = CSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (CSym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) CSym2KindInference) ())
+    type CSym3 :: forall a b c d. a -> b -> c -> (~>) d (Foo a b c d)
+    data CSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        CSym3KindInference :: SameKind (Apply (CSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) arg) (CSym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 arg) =>
+                              CSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (CSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) a0123456789876543210 = CSym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (CSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) CSym3KindInference) ())
+    type CSym4 (a0123456789876543210 :: a) (a0123456789876543210 :: b) (a0123456789876543210 :: c) (a0123456789876543210 :: d) =
+        C a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Foo a b c d
+    type DSym0 :: forall a b c d.
+                  (~>) a ((~>) b ((~>) c ((~>) d (Foo a b c d))))
+    data DSym0 a0123456789876543210
+      where
+        DSym0KindInference :: SameKind (Apply DSym0 arg) (DSym1 arg) =>
+                              DSym0 a0123456789876543210
+    type instance Apply DSym0 a0123456789876543210 = DSym1 a0123456789876543210
+    instance SuppressUnusedWarnings DSym0 where
+      suppressUnusedWarnings = snd (((,) DSym0KindInference) ())
+    type DSym1 :: forall a b c d.
+                  a -> (~>) b ((~>) c ((~>) d (Foo a b c d)))
+    data DSym1 a0123456789876543210 a0123456789876543210
+      where
+        DSym1KindInference :: SameKind (Apply (DSym1 a0123456789876543210) arg) (DSym2 a0123456789876543210 arg) =>
+                              DSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (DSym1 a0123456789876543210) a0123456789876543210 = DSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (DSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) DSym1KindInference) ())
+    type DSym2 :: forall a b c d.
+                  a -> b -> (~>) c ((~>) d (Foo a b c d))
+    data DSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        DSym2KindInference :: SameKind (Apply (DSym2 a0123456789876543210 a0123456789876543210) arg) (DSym3 a0123456789876543210 a0123456789876543210 arg) =>
+                              DSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (DSym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = DSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (DSym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) DSym2KindInference) ())
+    type DSym3 :: forall a b c d. a -> b -> c -> (~>) d (Foo a b c d)
+    data DSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        DSym3KindInference :: SameKind (Apply (DSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) arg) (DSym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 arg) =>
+                              DSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (DSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) a0123456789876543210 = DSym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (DSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) DSym3KindInference) ())
+    type DSym4 (a0123456789876543210 :: a) (a0123456789876543210 :: b) (a0123456789876543210 :: c) (a0123456789876543210 :: d) =
+        D a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Foo a b c d
+    type ESym0 :: forall a b c d.
+                  (~>) a ((~>) b ((~>) c ((~>) d (Foo a b c d))))
+    data ESym0 a0123456789876543210
+      where
+        ESym0KindInference :: SameKind (Apply ESym0 arg) (ESym1 arg) =>
+                              ESym0 a0123456789876543210
+    type instance Apply ESym0 a0123456789876543210 = ESym1 a0123456789876543210
+    instance SuppressUnusedWarnings ESym0 where
+      suppressUnusedWarnings = snd (((,) ESym0KindInference) ())
+    type ESym1 :: forall a b c d.
+                  a -> (~>) b ((~>) c ((~>) d (Foo a b c d)))
+    data ESym1 a0123456789876543210 a0123456789876543210
+      where
+        ESym1KindInference :: SameKind (Apply (ESym1 a0123456789876543210) arg) (ESym2 a0123456789876543210 arg) =>
+                              ESym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ESym1 a0123456789876543210) a0123456789876543210 = ESym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ESym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) ESym1KindInference) ())
+    type ESym2 :: forall a b c d.
+                  a -> b -> (~>) c ((~>) d (Foo a b c d))
+    data ESym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ESym2KindInference :: SameKind (Apply (ESym2 a0123456789876543210 a0123456789876543210) arg) (ESym3 a0123456789876543210 a0123456789876543210 arg) =>
+                              ESym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ESym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ESym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ESym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) ESym2KindInference) ())
+    type ESym3 :: forall a b c d. a -> b -> c -> (~>) d (Foo a b c d)
+    data ESym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ESym3KindInference :: SameKind (Apply (ESym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) arg) (ESym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 arg) =>
+                              ESym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ESym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ESym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ESym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) ESym3KindInference) ())
+    type ESym4 (a0123456789876543210 :: a) (a0123456789876543210 :: b) (a0123456789876543210 :: c) (a0123456789876543210 :: d) =
+        E a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Foo a b c d
+    type FSym0 :: forall a b c d.
+                  (~>) a ((~>) b ((~>) c ((~>) d (Foo a b c d))))
+    data FSym0 a0123456789876543210
+      where
+        FSym0KindInference :: SameKind (Apply FSym0 arg) (FSym1 arg) =>
+                              FSym0 a0123456789876543210
+    type instance Apply FSym0 a0123456789876543210 = FSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FSym0 where
+      suppressUnusedWarnings = snd (((,) FSym0KindInference) ())
+    type FSym1 :: forall a b c d.
+                  a -> (~>) b ((~>) c ((~>) d (Foo a b c d)))
+    data FSym1 a0123456789876543210 a0123456789876543210
+      where
+        FSym1KindInference :: SameKind (Apply (FSym1 a0123456789876543210) arg) (FSym2 a0123456789876543210 arg) =>
+                              FSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (FSym1 a0123456789876543210) a0123456789876543210 = FSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (FSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) FSym1KindInference) ())
+    type FSym2 :: forall a b c d.
+                  a -> b -> (~>) c ((~>) d (Foo a b c d))
+    data FSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        FSym2KindInference :: SameKind (Apply (FSym2 a0123456789876543210 a0123456789876543210) arg) (FSym3 a0123456789876543210 a0123456789876543210 arg) =>
+                              FSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (FSym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = FSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (FSym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) FSym2KindInference) ())
+    type FSym3 :: forall a b c d. a -> b -> c -> (~>) d (Foo a b c d)
+    data FSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        FSym3KindInference :: SameKind (Apply (FSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) arg) (FSym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 arg) =>
+                              FSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (FSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) a0123456789876543210 = FSym4 a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (FSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) FSym3KindInference) ())
+    type FSym4 (a0123456789876543210 :: a) (a0123456789876543210 :: b) (a0123456789876543210 :: c) (a0123456789876543210 :: d) =
+        F a0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Foo a b c d
+    type Compare_0123456789876543210 :: Nat -> Nat -> Ordering
+    type family Compare_0123456789876543210 a a where
+      Compare_0123456789876543210 Zero Zero = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) NilSym0
+      Compare_0123456789876543210 (Succ a_0123456789876543210) (Succ b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0)
+      Compare_0123456789876543210 Zero (Succ _) = LTSym0
+      Compare_0123456789876543210 (Succ _) Zero = GTSym0
+    type Compare_0123456789876543210Sym0 :: (~>) Nat ((~>) Nat Ordering)
+    data Compare_0123456789876543210Sym0 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
+                                                        Compare_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
+    type Compare_0123456789876543210Sym1 :: Nat -> (~>) Nat Ordering
+    data Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
+    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
+        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    instance POrd Nat where
+      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
+    type Compare_0123456789876543210 :: Foo a b c d
+                                        -> Foo a b c d -> Ordering
+    type family Compare_0123456789876543210 a a where
+      Compare_0123456789876543210 (A a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) (A b_0123456789876543210 b_0123456789876543210 b_0123456789876543210 b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0))))
+      Compare_0123456789876543210 (B a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) (B b_0123456789876543210 b_0123456789876543210 b_0123456789876543210 b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0))))
+      Compare_0123456789876543210 (C a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) (C b_0123456789876543210 b_0123456789876543210 b_0123456789876543210 b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0))))
+      Compare_0123456789876543210 (D a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) (D b_0123456789876543210 b_0123456789876543210 b_0123456789876543210 b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0))))
+      Compare_0123456789876543210 (E a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) (E b_0123456789876543210 b_0123456789876543210 b_0123456789876543210 b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0))))
+      Compare_0123456789876543210 (F a_0123456789876543210 a_0123456789876543210 a_0123456789876543210 a_0123456789876543210) (F b_0123456789876543210 b_0123456789876543210 b_0123456789876543210 b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0))))
+      Compare_0123456789876543210 (A _ _ _ _) (B _ _ _ _) = LTSym0
+      Compare_0123456789876543210 (A _ _ _ _) (C _ _ _ _) = LTSym0
+      Compare_0123456789876543210 (A _ _ _ _) (D _ _ _ _) = LTSym0
+      Compare_0123456789876543210 (A _ _ _ _) (E _ _ _ _) = LTSym0
+      Compare_0123456789876543210 (A _ _ _ _) (F _ _ _ _) = LTSym0
+      Compare_0123456789876543210 (B _ _ _ _) (A _ _ _ _) = GTSym0
+      Compare_0123456789876543210 (B _ _ _ _) (C _ _ _ _) = LTSym0
+      Compare_0123456789876543210 (B _ _ _ _) (D _ _ _ _) = LTSym0
+      Compare_0123456789876543210 (B _ _ _ _) (E _ _ _ _) = LTSym0
+      Compare_0123456789876543210 (B _ _ _ _) (F _ _ _ _) = LTSym0
+      Compare_0123456789876543210 (C _ _ _ _) (A _ _ _ _) = GTSym0
+      Compare_0123456789876543210 (C _ _ _ _) (B _ _ _ _) = GTSym0
+      Compare_0123456789876543210 (C _ _ _ _) (D _ _ _ _) = LTSym0
+      Compare_0123456789876543210 (C _ _ _ _) (E _ _ _ _) = LTSym0
+      Compare_0123456789876543210 (C _ _ _ _) (F _ _ _ _) = LTSym0
+      Compare_0123456789876543210 (D _ _ _ _) (A _ _ _ _) = GTSym0
+      Compare_0123456789876543210 (D _ _ _ _) (B _ _ _ _) = GTSym0
+      Compare_0123456789876543210 (D _ _ _ _) (C _ _ _ _) = GTSym0
+      Compare_0123456789876543210 (D _ _ _ _) (E _ _ _ _) = LTSym0
+      Compare_0123456789876543210 (D _ _ _ _) (F _ _ _ _) = LTSym0
+      Compare_0123456789876543210 (E _ _ _ _) (A _ _ _ _) = GTSym0
+      Compare_0123456789876543210 (E _ _ _ _) (B _ _ _ _) = GTSym0
+      Compare_0123456789876543210 (E _ _ _ _) (C _ _ _ _) = GTSym0
+      Compare_0123456789876543210 (E _ _ _ _) (D _ _ _ _) = GTSym0
+      Compare_0123456789876543210 (E _ _ _ _) (F _ _ _ _) = LTSym0
+      Compare_0123456789876543210 (F _ _ _ _) (A _ _ _ _) = GTSym0
+      Compare_0123456789876543210 (F _ _ _ _) (B _ _ _ _) = GTSym0
+      Compare_0123456789876543210 (F _ _ _ _) (C _ _ _ _) = GTSym0
+      Compare_0123456789876543210 (F _ _ _ _) (D _ _ _ _) = GTSym0
+      Compare_0123456789876543210 (F _ _ _ _) (E _ _ _ _) = GTSym0
+    type Compare_0123456789876543210Sym0 :: (~>) (Foo a b c d) ((~>) (Foo a b c d) Ordering)
+    data Compare_0123456789876543210Sym0 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
+                                                        Compare_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
+    type Compare_0123456789876543210Sym1 :: Foo a b c d
+                                            -> (~>) (Foo a b c d) Ordering
+    data Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
+    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Foo a b c d) (a0123456789876543210 :: Foo a b c d) =
+        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    instance POrd (Foo a b c d) where
+      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
+    type Equals_0123456789876543210 :: Nat -> Nat -> Bool
+    type family Equals_0123456789876543210 a b where
+      Equals_0123456789876543210 Zero Zero = TrueSym0
+      Equals_0123456789876543210 (Succ a) (Succ b) = (==) a b
+      Equals_0123456789876543210 (_ :: Nat) (_ :: Nat) = FalseSym0
+    instance PEq Nat where
+      type (==) a b = Equals_0123456789876543210 a b
+    type Equals_0123456789876543210 :: Foo a b c d
+                                       -> Foo a b c d -> Bool
+    type family Equals_0123456789876543210 a b where
+      Equals_0123456789876543210 (A a a a a) (A b b b b) = (&&) ((==) a b) ((&&) ((==) a b) ((&&) ((==) a b) ((==) a b)))
+      Equals_0123456789876543210 (B a a a a) (B b b b b) = (&&) ((==) a b) ((&&) ((==) a b) ((&&) ((==) a b) ((==) a b)))
+      Equals_0123456789876543210 (C a a a a) (C b b b b) = (&&) ((==) a b) ((&&) ((==) a b) ((&&) ((==) a b) ((==) a b)))
+      Equals_0123456789876543210 (D a a a a) (D b b b b) = (&&) ((==) a b) ((&&) ((==) a b) ((&&) ((==) a b) ((==) a b)))
+      Equals_0123456789876543210 (E a a a a) (E b b b b) = (&&) ((==) a b) ((&&) ((==) a b) ((&&) ((==) a b) ((==) a b)))
+      Equals_0123456789876543210 (F a a a a) (F b b b b) = (&&) ((==) a b) ((&&) ((==) a b) ((&&) ((==) a b) ((==) a b)))
+      Equals_0123456789876543210 (_ :: Foo a b c d) (_ :: Foo a b c d) = FalseSym0
+    instance PEq (Foo a b c d) where
+      type (==) a b = Equals_0123456789876543210 a b
+    data SNat :: Nat -> GHC.Types.Type
+      where
+        SZero :: SNat (Zero :: Nat)
+        SSucc :: forall (n :: Nat). (Sing n) -> SNat (Succ n :: Nat)
+    type instance Sing @Nat = SNat
+    instance SingKind Nat where
+      type Demote Nat = Nat
+      fromSing SZero = Zero
+      fromSing (SSucc b) = Succ (fromSing b)
+      toSing Zero = SomeSing SZero
+      toSing (Succ (b :: Demote Nat))
+        = case toSing b :: SomeSing Nat of {
+            SomeSing c -> SomeSing (SSucc c) }
+    data SFoo :: forall a b c d. Foo a b c d -> GHC.Types.Type
+      where
+        SA :: forall a b c d (n :: a) (n :: b) (n :: c) (n :: d).
+              (Sing n)
+              -> (Sing n)
+                 -> (Sing n) -> (Sing n) -> SFoo (A n n n n :: Foo a b c d)
+        SB :: forall a b c d (n :: a) (n :: b) (n :: c) (n :: d).
+              (Sing n)
+              -> (Sing n)
+                 -> (Sing n) -> (Sing n) -> SFoo (B n n n n :: Foo a b c d)
+        SC :: forall a b c d (n :: a) (n :: b) (n :: c) (n :: d).
+              (Sing n)
+              -> (Sing n)
+                 -> (Sing n) -> (Sing n) -> SFoo (C n n n n :: Foo a b c d)
+        SD :: forall a b c d (n :: a) (n :: b) (n :: c) (n :: d).
+              (Sing n)
+              -> (Sing n)
+                 -> (Sing n) -> (Sing n) -> SFoo (D n n n n :: Foo a b c d)
+        SE :: forall a b c d (n :: a) (n :: b) (n :: c) (n :: d).
+              (Sing n)
+              -> (Sing n)
+                 -> (Sing n) -> (Sing n) -> SFoo (E n n n n :: Foo a b c d)
+        SF :: forall a b c d (n :: a) (n :: b) (n :: c) (n :: d).
+              (Sing n)
+              -> (Sing n)
+                 -> (Sing n) -> (Sing n) -> SFoo (F n n n n :: Foo a b c d)
+    type instance Sing @(Foo a b c d) = SFoo
+    instance (SingKind a, SingKind b, SingKind c, SingKind d) =>
+             SingKind (Foo a b c d) where
+      type Demote (Foo a b c d) = Foo (Demote a) (Demote b) (Demote c) (Demote d)
+      fromSing (SA b b b b)
+        = (((A (fromSing b)) (fromSing b)) (fromSing b)) (fromSing b)
+      fromSing (SB b b b b)
+        = (((B (fromSing b)) (fromSing b)) (fromSing b)) (fromSing b)
+      fromSing (SC b b b b)
+        = (((C (fromSing b)) (fromSing b)) (fromSing b)) (fromSing b)
+      fromSing (SD b b b b)
+        = (((D (fromSing b)) (fromSing b)) (fromSing b)) (fromSing b)
+      fromSing (SE b b b b)
+        = (((E (fromSing b)) (fromSing b)) (fromSing b)) (fromSing b)
+      fromSing (SF b b b b)
+        = (((F (fromSing b)) (fromSing b)) (fromSing b)) (fromSing b)
+      toSing
+        (A (b :: Demote a) (b :: Demote b) (b :: Demote c) (b :: Demote d))
+        = case
+              ((((,,,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b))
+                 (toSing b :: SomeSing c))
+                (toSing b :: SomeSing d)
+          of {
+            (,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)
+              -> SomeSing ((((SA c) c) c) c) }
+      toSing
+        (B (b :: Demote a) (b :: Demote b) (b :: Demote c) (b :: Demote d))
+        = case
+              ((((,,,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b))
+                 (toSing b :: SomeSing c))
+                (toSing b :: SomeSing d)
+          of {
+            (,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)
+              -> SomeSing ((((SB c) c) c) c) }
+      toSing
+        (C (b :: Demote a) (b :: Demote b) (b :: Demote c) (b :: Demote d))
+        = case
+              ((((,,,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b))
+                 (toSing b :: SomeSing c))
+                (toSing b :: SomeSing d)
+          of {
+            (,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)
+              -> SomeSing ((((SC c) c) c) c) }
+      toSing
+        (D (b :: Demote a) (b :: Demote b) (b :: Demote c) (b :: Demote d))
+        = case
+              ((((,,,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b))
+                 (toSing b :: SomeSing c))
+                (toSing b :: SomeSing d)
+          of {
+            (,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)
+              -> SomeSing ((((SD c) c) c) c) }
+      toSing
+        (E (b :: Demote a) (b :: Demote b) (b :: Demote c) (b :: Demote d))
+        = case
+              ((((,,,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b))
+                 (toSing b :: SomeSing c))
+                (toSing b :: SomeSing d)
+          of {
+            (,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)
+              -> SomeSing ((((SE c) c) c) c) }
+      toSing
+        (F (b :: Demote a) (b :: Demote b) (b :: Demote c) (b :: Demote d))
+        = case
+              ((((,,,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b))
+                 (toSing b :: SomeSing c))
+                (toSing b :: SomeSing d)
+          of {
+            (,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)
+              -> SomeSing ((((SF c) c) c) c) }
+    instance SOrd Nat => SOrd Nat where
+      sCompare ::
+        forall (t1 :: Nat) (t2 :: Nat).
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply (CompareSym0 :: TyFun Nat ((~>) Nat Ordering)
+                                                 -> GHC.Types.Type) t1) t2)
+      sCompare SZero SZero
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            SNil
+      sCompare
+        (SSucc (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        (SSucc (sB_0123456789876543210 :: Sing b_0123456789876543210))
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            ((applySing
+                ((applySing ((singFun2 @(:@#@$)) SCons))
+                   ((applySing
+                       ((applySing ((singFun2 @CompareSym0) sCompare))
+                          sA_0123456789876543210))
+                      sB_0123456789876543210)))
+               SNil)
+      sCompare SZero (SSucc _) = SLT
+      sCompare (SSucc _) SZero = SGT
+    instance (SOrd a, SOrd b, SOrd c, SOrd d) =>
+             SOrd (Foo a b c d) where
+      sCompare ::
+        forall (t1 :: Foo a b c d) (t2 :: Foo a b c d).
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply (CompareSym0 :: TyFun (Foo a b c d) ((~>) (Foo a b c d) Ordering)
+                                                 -> GHC.Types.Type) t1) t2)
+      sCompare
+        (SA (sA_0123456789876543210 :: Sing a_0123456789876543210)
+            (sA_0123456789876543210 :: Sing a_0123456789876543210)
+            (sA_0123456789876543210 :: Sing a_0123456789876543210)
+            (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        (SA (sB_0123456789876543210 :: Sing b_0123456789876543210)
+            (sB_0123456789876543210 :: Sing b_0123456789876543210)
+            (sB_0123456789876543210 :: Sing b_0123456789876543210)
+            (sB_0123456789876543210 :: Sing b_0123456789876543210))
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            ((applySing
+                ((applySing ((singFun2 @(:@#@$)) SCons))
+                   ((applySing
+                       ((applySing ((singFun2 @CompareSym0) sCompare))
+                          sA_0123456789876543210))
+                      sB_0123456789876543210)))
+               ((applySing
+                   ((applySing ((singFun2 @(:@#@$)) SCons))
+                      ((applySing
+                          ((applySing ((singFun2 @CompareSym0) sCompare))
+                             sA_0123456789876543210))
+                         sB_0123456789876543210)))
+                  ((applySing
+                      ((applySing ((singFun2 @(:@#@$)) SCons))
+                         ((applySing
+                             ((applySing ((singFun2 @CompareSym0) sCompare))
+                                sA_0123456789876543210))
+                            sB_0123456789876543210)))
+                     ((applySing
+                         ((applySing ((singFun2 @(:@#@$)) SCons))
+                            ((applySing
+                                ((applySing ((singFun2 @CompareSym0) sCompare))
+                                   sA_0123456789876543210))
+                               sB_0123456789876543210)))
+                        SNil))))
+      sCompare
+        (SB (sA_0123456789876543210 :: Sing a_0123456789876543210)
+            (sA_0123456789876543210 :: Sing a_0123456789876543210)
+            (sA_0123456789876543210 :: Sing a_0123456789876543210)
+            (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        (SB (sB_0123456789876543210 :: Sing b_0123456789876543210)
+            (sB_0123456789876543210 :: Sing b_0123456789876543210)
+            (sB_0123456789876543210 :: Sing b_0123456789876543210)
+            (sB_0123456789876543210 :: Sing b_0123456789876543210))
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            ((applySing
+                ((applySing ((singFun2 @(:@#@$)) SCons))
+                   ((applySing
+                       ((applySing ((singFun2 @CompareSym0) sCompare))
+                          sA_0123456789876543210))
+                      sB_0123456789876543210)))
+               ((applySing
+                   ((applySing ((singFun2 @(:@#@$)) SCons))
+                      ((applySing
+                          ((applySing ((singFun2 @CompareSym0) sCompare))
+                             sA_0123456789876543210))
+                         sB_0123456789876543210)))
+                  ((applySing
+                      ((applySing ((singFun2 @(:@#@$)) SCons))
+                         ((applySing
+                             ((applySing ((singFun2 @CompareSym0) sCompare))
+                                sA_0123456789876543210))
+                            sB_0123456789876543210)))
+                     ((applySing
+                         ((applySing ((singFun2 @(:@#@$)) SCons))
+                            ((applySing
+                                ((applySing ((singFun2 @CompareSym0) sCompare))
+                                   sA_0123456789876543210))
+                               sB_0123456789876543210)))
+                        SNil))))
+      sCompare
+        (SC (sA_0123456789876543210 :: Sing a_0123456789876543210)
+            (sA_0123456789876543210 :: Sing a_0123456789876543210)
+            (sA_0123456789876543210 :: Sing a_0123456789876543210)
+            (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        (SC (sB_0123456789876543210 :: Sing b_0123456789876543210)
+            (sB_0123456789876543210 :: Sing b_0123456789876543210)
+            (sB_0123456789876543210 :: Sing b_0123456789876543210)
+            (sB_0123456789876543210 :: Sing b_0123456789876543210))
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            ((applySing
+                ((applySing ((singFun2 @(:@#@$)) SCons))
+                   ((applySing
+                       ((applySing ((singFun2 @CompareSym0) sCompare))
+                          sA_0123456789876543210))
+                      sB_0123456789876543210)))
+               ((applySing
+                   ((applySing ((singFun2 @(:@#@$)) SCons))
+                      ((applySing
+                          ((applySing ((singFun2 @CompareSym0) sCompare))
+                             sA_0123456789876543210))
+                         sB_0123456789876543210)))
+                  ((applySing
+                      ((applySing ((singFun2 @(:@#@$)) SCons))
+                         ((applySing
+                             ((applySing ((singFun2 @CompareSym0) sCompare))
+                                sA_0123456789876543210))
+                            sB_0123456789876543210)))
+                     ((applySing
+                         ((applySing ((singFun2 @(:@#@$)) SCons))
+                            ((applySing
+                                ((applySing ((singFun2 @CompareSym0) sCompare))
+                                   sA_0123456789876543210))
+                               sB_0123456789876543210)))
+                        SNil))))
+      sCompare
+        (SD (sA_0123456789876543210 :: Sing a_0123456789876543210)
+            (sA_0123456789876543210 :: Sing a_0123456789876543210)
+            (sA_0123456789876543210 :: Sing a_0123456789876543210)
+            (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        (SD (sB_0123456789876543210 :: Sing b_0123456789876543210)
+            (sB_0123456789876543210 :: Sing b_0123456789876543210)
+            (sB_0123456789876543210 :: Sing b_0123456789876543210)
+            (sB_0123456789876543210 :: Sing b_0123456789876543210))
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            ((applySing
+                ((applySing ((singFun2 @(:@#@$)) SCons))
+                   ((applySing
+                       ((applySing ((singFun2 @CompareSym0) sCompare))
+                          sA_0123456789876543210))
+                      sB_0123456789876543210)))
+               ((applySing
+                   ((applySing ((singFun2 @(:@#@$)) SCons))
+                      ((applySing
+                          ((applySing ((singFun2 @CompareSym0) sCompare))
+                             sA_0123456789876543210))
+                         sB_0123456789876543210)))
+                  ((applySing
+                      ((applySing ((singFun2 @(:@#@$)) SCons))
+                         ((applySing
+                             ((applySing ((singFun2 @CompareSym0) sCompare))
+                                sA_0123456789876543210))
+                            sB_0123456789876543210)))
+                     ((applySing
+                         ((applySing ((singFun2 @(:@#@$)) SCons))
+                            ((applySing
+                                ((applySing ((singFun2 @CompareSym0) sCompare))
+                                   sA_0123456789876543210))
+                               sB_0123456789876543210)))
+                        SNil))))
+      sCompare
+        (SE (sA_0123456789876543210 :: Sing a_0123456789876543210)
+            (sA_0123456789876543210 :: Sing a_0123456789876543210)
+            (sA_0123456789876543210 :: Sing a_0123456789876543210)
+            (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        (SE (sB_0123456789876543210 :: Sing b_0123456789876543210)
+            (sB_0123456789876543210 :: Sing b_0123456789876543210)
+            (sB_0123456789876543210 :: Sing b_0123456789876543210)
+            (sB_0123456789876543210 :: Sing b_0123456789876543210))
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            ((applySing
+                ((applySing ((singFun2 @(:@#@$)) SCons))
+                   ((applySing
+                       ((applySing ((singFun2 @CompareSym0) sCompare))
+                          sA_0123456789876543210))
+                      sB_0123456789876543210)))
+               ((applySing
+                   ((applySing ((singFun2 @(:@#@$)) SCons))
+                      ((applySing
+                          ((applySing ((singFun2 @CompareSym0) sCompare))
+                             sA_0123456789876543210))
+                         sB_0123456789876543210)))
+                  ((applySing
+                      ((applySing ((singFun2 @(:@#@$)) SCons))
+                         ((applySing
+                             ((applySing ((singFun2 @CompareSym0) sCompare))
+                                sA_0123456789876543210))
+                            sB_0123456789876543210)))
+                     ((applySing
+                         ((applySing ((singFun2 @(:@#@$)) SCons))
+                            ((applySing
+                                ((applySing ((singFun2 @CompareSym0) sCompare))
+                                   sA_0123456789876543210))
+                               sB_0123456789876543210)))
+                        SNil))))
+      sCompare
+        (SF (sA_0123456789876543210 :: Sing a_0123456789876543210)
+            (sA_0123456789876543210 :: Sing a_0123456789876543210)
+            (sA_0123456789876543210 :: Sing a_0123456789876543210)
+            (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        (SF (sB_0123456789876543210 :: Sing b_0123456789876543210)
+            (sB_0123456789876543210 :: Sing b_0123456789876543210)
+            (sB_0123456789876543210 :: Sing b_0123456789876543210)
+            (sB_0123456789876543210 :: Sing b_0123456789876543210))
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            ((applySing
+                ((applySing ((singFun2 @(:@#@$)) SCons))
+                   ((applySing
+                       ((applySing ((singFun2 @CompareSym0) sCompare))
+                          sA_0123456789876543210))
+                      sB_0123456789876543210)))
+               ((applySing
+                   ((applySing ((singFun2 @(:@#@$)) SCons))
+                      ((applySing
+                          ((applySing ((singFun2 @CompareSym0) sCompare))
+                             sA_0123456789876543210))
+                         sB_0123456789876543210)))
+                  ((applySing
+                      ((applySing ((singFun2 @(:@#@$)) SCons))
+                         ((applySing
+                             ((applySing ((singFun2 @CompareSym0) sCompare))
+                                sA_0123456789876543210))
+                            sB_0123456789876543210)))
+                     ((applySing
+                         ((applySing ((singFun2 @(:@#@$)) SCons))
+                            ((applySing
+                                ((applySing ((singFun2 @CompareSym0) sCompare))
+                                   sA_0123456789876543210))
+                               sB_0123456789876543210)))
+                        SNil))))
+      sCompare (SA _ _ _ _) (SB _ _ _ _) = SLT
+      sCompare (SA _ _ _ _) (SC _ _ _ _) = SLT
+      sCompare (SA _ _ _ _) (SD _ _ _ _) = SLT
+      sCompare (SA _ _ _ _) (SE _ _ _ _) = SLT
+      sCompare (SA _ _ _ _) (SF _ _ _ _) = SLT
+      sCompare (SB _ _ _ _) (SA _ _ _ _) = SGT
+      sCompare (SB _ _ _ _) (SC _ _ _ _) = SLT
+      sCompare (SB _ _ _ _) (SD _ _ _ _) = SLT
+      sCompare (SB _ _ _ _) (SE _ _ _ _) = SLT
+      sCompare (SB _ _ _ _) (SF _ _ _ _) = SLT
+      sCompare (SC _ _ _ _) (SA _ _ _ _) = SGT
+      sCompare (SC _ _ _ _) (SB _ _ _ _) = SGT
+      sCompare (SC _ _ _ _) (SD _ _ _ _) = SLT
+      sCompare (SC _ _ _ _) (SE _ _ _ _) = SLT
+      sCompare (SC _ _ _ _) (SF _ _ _ _) = SLT
+      sCompare (SD _ _ _ _) (SA _ _ _ _) = SGT
+      sCompare (SD _ _ _ _) (SB _ _ _ _) = SGT
+      sCompare (SD _ _ _ _) (SC _ _ _ _) = SGT
+      sCompare (SD _ _ _ _) (SE _ _ _ _) = SLT
+      sCompare (SD _ _ _ _) (SF _ _ _ _) = SLT
+      sCompare (SE _ _ _ _) (SA _ _ _ _) = SGT
+      sCompare (SE _ _ _ _) (SB _ _ _ _) = SGT
+      sCompare (SE _ _ _ _) (SC _ _ _ _) = SGT
+      sCompare (SE _ _ _ _) (SD _ _ _ _) = SGT
+      sCompare (SE _ _ _ _) (SF _ _ _ _) = SLT
+      sCompare (SF _ _ _ _) (SA _ _ _ _) = SGT
+      sCompare (SF _ _ _ _) (SB _ _ _ _) = SGT
+      sCompare (SF _ _ _ _) (SC _ _ _ _) = SGT
+      sCompare (SF _ _ _ _) (SD _ _ _ _) = SGT
+      sCompare (SF _ _ _ _) (SE _ _ _ _) = SGT
+    instance SEq Nat => SEq Nat where
+      (%==) SZero SZero = STrue
+      (%==) SZero (SSucc _) = SFalse
+      (%==) (SSucc _) SZero = SFalse
+      (%==) (SSucc a) (SSucc b) = ((%==) a) b
+    instance SDecide Nat => SDecide Nat where
+      (%~) SZero SZero = Proved Refl
+      (%~) SZero (SSucc _) = Disproved (\ x -> case x of)
+      (%~) (SSucc _) SZero = Disproved (\ x -> case x of)
+      (%~) (SSucc a) (SSucc b)
+        = case ((%~) a) b of
+            Proved Refl -> Proved Refl
+            Disproved contra
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+    instance SDecide Nat =>
+             Data.Type.Equality.TestEquality (SNat :: Nat
+                                                      -> GHC.Types.Type) where
+      Data.Type.Equality.testEquality
+        = Data.Singletons.Decide.decideEquality
+    instance SDecide Nat =>
+             Data.Type.Coercion.TestCoercion (SNat :: Nat
+                                                      -> GHC.Types.Type) where
+      Data.Type.Coercion.testCoercion
+        = Data.Singletons.Decide.decideCoercion
+    instance (SEq a, SEq b, SEq c, SEq d) => SEq (Foo a b c d) where
+      (%==) (SA a a a a) (SA b b b b)
+        = ((%&&) (((%==) a) b))
+            (((%&&) (((%==) a) b)) (((%&&) (((%==) a) b)) (((%==) a) b)))
+      (%==) (SA _ _ _ _) (SB _ _ _ _) = SFalse
+      (%==) (SA _ _ _ _) (SC _ _ _ _) = SFalse
+      (%==) (SA _ _ _ _) (SD _ _ _ _) = SFalse
+      (%==) (SA _ _ _ _) (SE _ _ _ _) = SFalse
+      (%==) (SA _ _ _ _) (SF _ _ _ _) = SFalse
+      (%==) (SB _ _ _ _) (SA _ _ _ _) = SFalse
+      (%==) (SB a a a a) (SB b b b b)
+        = ((%&&) (((%==) a) b))
+            (((%&&) (((%==) a) b)) (((%&&) (((%==) a) b)) (((%==) a) b)))
+      (%==) (SB _ _ _ _) (SC _ _ _ _) = SFalse
+      (%==) (SB _ _ _ _) (SD _ _ _ _) = SFalse
+      (%==) (SB _ _ _ _) (SE _ _ _ _) = SFalse
+      (%==) (SB _ _ _ _) (SF _ _ _ _) = SFalse
+      (%==) (SC _ _ _ _) (SA _ _ _ _) = SFalse
+      (%==) (SC _ _ _ _) (SB _ _ _ _) = SFalse
+      (%==) (SC a a a a) (SC b b b b)
+        = ((%&&) (((%==) a) b))
+            (((%&&) (((%==) a) b)) (((%&&) (((%==) a) b)) (((%==) a) b)))
+      (%==) (SC _ _ _ _) (SD _ _ _ _) = SFalse
+      (%==) (SC _ _ _ _) (SE _ _ _ _) = SFalse
+      (%==) (SC _ _ _ _) (SF _ _ _ _) = SFalse
+      (%==) (SD _ _ _ _) (SA _ _ _ _) = SFalse
+      (%==) (SD _ _ _ _) (SB _ _ _ _) = SFalse
+      (%==) (SD _ _ _ _) (SC _ _ _ _) = SFalse
+      (%==) (SD a a a a) (SD b b b b)
+        = ((%&&) (((%==) a) b))
+            (((%&&) (((%==) a) b)) (((%&&) (((%==) a) b)) (((%==) a) b)))
+      (%==) (SD _ _ _ _) (SE _ _ _ _) = SFalse
+      (%==) (SD _ _ _ _) (SF _ _ _ _) = SFalse
+      (%==) (SE _ _ _ _) (SA _ _ _ _) = SFalse
+      (%==) (SE _ _ _ _) (SB _ _ _ _) = SFalse
+      (%==) (SE _ _ _ _) (SC _ _ _ _) = SFalse
+      (%==) (SE _ _ _ _) (SD _ _ _ _) = SFalse
+      (%==) (SE a a a a) (SE b b b b)
+        = ((%&&) (((%==) a) b))
+            (((%&&) (((%==) a) b)) (((%&&) (((%==) a) b)) (((%==) a) b)))
+      (%==) (SE _ _ _ _) (SF _ _ _ _) = SFalse
+      (%==) (SF _ _ _ _) (SA _ _ _ _) = SFalse
+      (%==) (SF _ _ _ _) (SB _ _ _ _) = SFalse
+      (%==) (SF _ _ _ _) (SC _ _ _ _) = SFalse
+      (%==) (SF _ _ _ _) (SD _ _ _ _) = SFalse
+      (%==) (SF _ _ _ _) (SE _ _ _ _) = SFalse
+      (%==) (SF a a a a) (SF b b b b)
+        = ((%&&) (((%==) a) b))
+            (((%&&) (((%==) a) b)) (((%&&) (((%==) a) b)) (((%==) a) b)))
+    instance (SDecide a, SDecide b, SDecide c, SDecide d) =>
+             SDecide (Foo a b c d) where
+      (%~) (SA a a a a) (SA b b b b)
+        = case
+              ((((,,,) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)
+          of
+            (,,,) (Proved Refl) (Proved Refl) (Proved Refl) (Proved Refl)
+              -> Proved Refl
+            (,,,) (Disproved contra) _ _ _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,,,) _ (Disproved contra) _ _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,,,) _ _ (Disproved contra) _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,,,) _ _ _ (Disproved contra)
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+      (%~) (SA _ _ _ _) (SB _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SA _ _ _ _) (SC _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SA _ _ _ _) (SD _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SA _ _ _ _) (SE _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SA _ _ _ _) (SF _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SB _ _ _ _) (SA _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SB a a a a) (SB b b b b)
+        = case
+              ((((,,,) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)
+          of
+            (,,,) (Proved Refl) (Proved Refl) (Proved Refl) (Proved Refl)
+              -> Proved Refl
+            (,,,) (Disproved contra) _ _ _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,,,) _ (Disproved contra) _ _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,,,) _ _ (Disproved contra) _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,,,) _ _ _ (Disproved contra)
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+      (%~) (SB _ _ _ _) (SC _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SB _ _ _ _) (SD _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SB _ _ _ _) (SE _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SB _ _ _ _) (SF _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SC _ _ _ _) (SA _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SC _ _ _ _) (SB _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SC a a a a) (SC b b b b)
+        = case
+              ((((,,,) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)
+          of
+            (,,,) (Proved Refl) (Proved Refl) (Proved Refl) (Proved Refl)
+              -> Proved Refl
+            (,,,) (Disproved contra) _ _ _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,,,) _ (Disproved contra) _ _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,,,) _ _ (Disproved contra) _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,,,) _ _ _ (Disproved contra)
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+      (%~) (SC _ _ _ _) (SD _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SC _ _ _ _) (SE _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SC _ _ _ _) (SF _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SD _ _ _ _) (SA _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SD _ _ _ _) (SB _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SD _ _ _ _) (SC _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SD a a a a) (SD b b b b)
+        = case
+              ((((,,,) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)
+          of
+            (,,,) (Proved Refl) (Proved Refl) (Proved Refl) (Proved Refl)
+              -> Proved Refl
+            (,,,) (Disproved contra) _ _ _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,,,) _ (Disproved contra) _ _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,,,) _ _ (Disproved contra) _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,,,) _ _ _ (Disproved contra)
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+      (%~) (SD _ _ _ _) (SE _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SD _ _ _ _) (SF _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SE _ _ _ _) (SA _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SE _ _ _ _) (SB _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SE _ _ _ _) (SC _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SE _ _ _ _) (SD _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SE a a a a) (SE b b b b)
+        = case
+              ((((,,,) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)
+          of
+            (,,,) (Proved Refl) (Proved Refl) (Proved Refl) (Proved Refl)
+              -> Proved Refl
+            (,,,) (Disproved contra) _ _ _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,,,) _ (Disproved contra) _ _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,,,) _ _ (Disproved contra) _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,,,) _ _ _ (Disproved contra)
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+      (%~) (SE _ _ _ _) (SF _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SF _ _ _ _) (SA _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SF _ _ _ _) (SB _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SF _ _ _ _) (SC _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SF _ _ _ _) (SD _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SF _ _ _ _) (SE _ _ _ _) = Disproved (\ x -> case x of)
+      (%~) (SF a a a a) (SF b b b b)
+        = case
+              ((((,,,) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)) (((%~) a) b)
+          of
+            (,,,) (Proved Refl) (Proved Refl) (Proved Refl) (Proved Refl)
+              -> Proved Refl
+            (,,,) (Disproved contra) _ _ _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,,,) _ (Disproved contra) _ _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,,,) _ _ (Disproved contra) _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,,,) _ _ _ (Disproved contra)
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+    instance (SDecide a, SDecide b, SDecide c, SDecide d) =>
+             Data.Type.Equality.TestEquality (SFoo :: Foo a b c d
+                                                      -> GHC.Types.Type) where
+      Data.Type.Equality.testEquality
+        = Data.Singletons.Decide.decideEquality
+    instance (SDecide a, SDecide b, SDecide c, SDecide d) =>
+             Data.Type.Coercion.TestCoercion (SFoo :: Foo a b c d
+                                                      -> GHC.Types.Type) where
+      Data.Type.Coercion.testCoercion
+        = Data.Singletons.Decide.decideCoercion
+    instance SingI Zero where
+      sing = SZero
+    instance SingI n => SingI (Succ (n :: Nat)) where
+      sing = SSucc sing
+    instance SingI (SuccSym0 :: (~>) Nat Nat) where
+      sing = (singFun1 @SuccSym0) SSucc
+    instance (SingI n, SingI n, SingI n, SingI n) =>
+             SingI (A (n :: a) (n :: b) (n :: c) (n :: d)) where
+      sing = (((SA sing) sing) sing) sing
+    instance SingI (ASym0 :: (~>) a ((~>) b ((~>) c ((~>) d (Foo a b c d))))) where
+      sing = (singFun4 @ASym0) SA
+    instance SingI d =>
+             SingI (ASym1 (d :: a) :: (~>) b ((~>) c ((~>) d (Foo a b c d)))) where
+      sing = (singFun3 @(ASym1 (d :: a))) (SA (sing @d))
+    instance (SingI d, SingI d) =>
+             SingI (ASym2 (d :: a) (d :: b) :: (~>) c ((~>) d (Foo a b c d))) where
+      sing
+        = (singFun2 @(ASym2 (d :: a) (d :: b))) ((SA (sing @d)) (sing @d))
+    instance (SingI d, SingI d, SingI d) =>
+             SingI (ASym3 (d :: a) (d :: b) (d :: c) :: (~>) d (Foo a b c d)) where
+      sing
+        = (singFun1 @(ASym3 (d :: a) (d :: b) (d :: c)))
+            (((SA (sing @d)) (sing @d)) (sing @d))
+    instance (SingI n, SingI n, SingI n, SingI n) =>
+             SingI (B (n :: a) (n :: b) (n :: c) (n :: d)) where
+      sing = (((SB sing) sing) sing) sing
+    instance SingI (BSym0 :: (~>) a ((~>) b ((~>) c ((~>) d (Foo a b c d))))) where
+      sing = (singFun4 @BSym0) SB
+    instance SingI d =>
+             SingI (BSym1 (d :: a) :: (~>) b ((~>) c ((~>) d (Foo a b c d)))) where
+      sing = (singFun3 @(BSym1 (d :: a))) (SB (sing @d))
+    instance (SingI d, SingI d) =>
+             SingI (BSym2 (d :: a) (d :: b) :: (~>) c ((~>) d (Foo a b c d))) where
+      sing
+        = (singFun2 @(BSym2 (d :: a) (d :: b))) ((SB (sing @d)) (sing @d))
+    instance (SingI d, SingI d, SingI d) =>
+             SingI (BSym3 (d :: a) (d :: b) (d :: c) :: (~>) d (Foo a b c d)) where
+      sing
+        = (singFun1 @(BSym3 (d :: a) (d :: b) (d :: c)))
+            (((SB (sing @d)) (sing @d)) (sing @d))
+    instance (SingI n, SingI n, SingI n, SingI n) =>
+             SingI (C (n :: a) (n :: b) (n :: c) (n :: d)) where
+      sing = (((SC sing) sing) sing) sing
+    instance SingI (CSym0 :: (~>) a ((~>) b ((~>) c ((~>) d (Foo a b c d))))) where
+      sing = (singFun4 @CSym0) SC
+    instance SingI d =>
+             SingI (CSym1 (d :: a) :: (~>) b ((~>) c ((~>) d (Foo a b c d)))) where
+      sing = (singFun3 @(CSym1 (d :: a))) (SC (sing @d))
+    instance (SingI d, SingI d) =>
+             SingI (CSym2 (d :: a) (d :: b) :: (~>) c ((~>) d (Foo a b c d))) where
+      sing
+        = (singFun2 @(CSym2 (d :: a) (d :: b))) ((SC (sing @d)) (sing @d))
+    instance (SingI d, SingI d, SingI d) =>
+             SingI (CSym3 (d :: a) (d :: b) (d :: c) :: (~>) d (Foo a b c d)) where
+      sing
+        = (singFun1 @(CSym3 (d :: a) (d :: b) (d :: c)))
+            (((SC (sing @d)) (sing @d)) (sing @d))
+    instance (SingI n, SingI n, SingI n, SingI n) =>
+             SingI (D (n :: a) (n :: b) (n :: c) (n :: d)) where
+      sing = (((SD sing) sing) sing) sing
+    instance SingI (DSym0 :: (~>) a ((~>) b ((~>) c ((~>) d (Foo a b c d))))) where
+      sing = (singFun4 @DSym0) SD
+    instance SingI d =>
+             SingI (DSym1 (d :: a) :: (~>) b ((~>) c ((~>) d (Foo a b c d)))) where
+      sing = (singFun3 @(DSym1 (d :: a))) (SD (sing @d))
+    instance (SingI d, SingI d) =>
+             SingI (DSym2 (d :: a) (d :: b) :: (~>) c ((~>) d (Foo a b c d))) where
+      sing
+        = (singFun2 @(DSym2 (d :: a) (d :: b))) ((SD (sing @d)) (sing @d))
+    instance (SingI d, SingI d, SingI d) =>
+             SingI (DSym3 (d :: a) (d :: b) (d :: c) :: (~>) d (Foo a b c d)) where
+      sing
+        = (singFun1 @(DSym3 (d :: a) (d :: b) (d :: c)))
+            (((SD (sing @d)) (sing @d)) (sing @d))
+    instance (SingI n, SingI n, SingI n, SingI n) =>
+             SingI (E (n :: a) (n :: b) (n :: c) (n :: d)) where
+      sing = (((SE sing) sing) sing) sing
+    instance SingI (ESym0 :: (~>) a ((~>) b ((~>) c ((~>) d (Foo a b c d))))) where
+      sing = (singFun4 @ESym0) SE
+    instance SingI d =>
+             SingI (ESym1 (d :: a) :: (~>) b ((~>) c ((~>) d (Foo a b c d)))) where
+      sing = (singFun3 @(ESym1 (d :: a))) (SE (sing @d))
+    instance (SingI d, SingI d) =>
+             SingI (ESym2 (d :: a) (d :: b) :: (~>) c ((~>) d (Foo a b c d))) where
+      sing
+        = (singFun2 @(ESym2 (d :: a) (d :: b))) ((SE (sing @d)) (sing @d))
+    instance (SingI d, SingI d, SingI d) =>
+             SingI (ESym3 (d :: a) (d :: b) (d :: c) :: (~>) d (Foo a b c d)) where
+      sing
+        = (singFun1 @(ESym3 (d :: a) (d :: b) (d :: c)))
+            (((SE (sing @d)) (sing @d)) (sing @d))
+    instance (SingI n, SingI n, SingI n, SingI n) =>
+             SingI (F (n :: a) (n :: b) (n :: c) (n :: d)) where
+      sing = (((SF sing) sing) sing) sing
+    instance SingI (FSym0 :: (~>) a ((~>) b ((~>) c ((~>) d (Foo a b c d))))) where
+      sing = (singFun4 @FSym0) SF
+    instance SingI d =>
+             SingI (FSym1 (d :: a) :: (~>) b ((~>) c ((~>) d (Foo a b c d)))) where
+      sing = (singFun3 @(FSym1 (d :: a))) (SF (sing @d))
+    instance (SingI d, SingI d) =>
+             SingI (FSym2 (d :: a) (d :: b) :: (~>) c ((~>) d (Foo a b c d))) where
+      sing
+        = (singFun2 @(FSym2 (d :: a) (d :: b))) ((SF (sing @d)) (sing @d))
+    instance (SingI d, SingI d, SingI d) =>
+             SingI (FSym3 (d :: a) (d :: b) (d :: c) :: (~>) d (Foo a b c d)) where
+      sing
+        = (singFun1 @(FSym3 (d :: a) (d :: b) (d :: c)))
+            (((SF (sing @d)) (sing @d)) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/OverloadedStrings.ghc88.template b/tests/compile-and-dump/Singletons/OverloadedStrings.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/OverloadedStrings.ghc88.template
+++ /dev/null
@@ -1,35 +0,0 @@
-Singletons/OverloadedStrings.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| symId :: Symbol -> Symbol
-          symId x = x
-          foo :: Symbol
-          foo = symId "foo" |]
-  ======>
-    symId :: Symbol -> Symbol
-    symId x = x
-    foo :: Symbol
-    foo = symId "foo"
-    type FooSym0 = Foo
-    type SymIdSym1 (a0123456789876543210 :: Symbol) =
-        SymId a0123456789876543210
-    instance SuppressUnusedWarnings SymIdSym0 where
-      suppressUnusedWarnings = snd (((,) SymIdSym0KindInference) ())
-    data SymIdSym0 :: (~>) Symbol Symbol
-      where
-        SymIdSym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply SymIdSym0 arg) (SymIdSym1 arg) =>
-                                  SymIdSym0 a0123456789876543210
-    type instance Apply SymIdSym0 a0123456789876543210 = SymId a0123456789876543210
-    type family Foo :: Symbol where
-      Foo = Apply SymIdSym0 (Data.Singletons.Prelude.IsString.FromString "foo")
-    type family SymId (a :: Symbol) :: Symbol where
-      SymId x = x
-    sFoo :: Sing (FooSym0 :: Symbol)
-    sSymId ::
-      forall (t :: Symbol). Sing t -> Sing (Apply SymIdSym0 t :: Symbol)
-    sFoo
-      = (applySing ((singFun1 @SymIdSym0) sSymId))
-          (Data.Singletons.Prelude.IsString.sFromString (sing :: Sing "foo"))
-    sSymId (sX :: Sing x) = sX
-    instance SingI (SymIdSym0 :: (~>) Symbol Symbol) where
-      sing = (singFun1 @SymIdSym0) sSymId
diff --git a/tests/compile-and-dump/Singletons/OverloadedStrings.golden b/tests/compile-and-dump/Singletons/OverloadedStrings.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/OverloadedStrings.golden
@@ -0,0 +1,37 @@
+Singletons/OverloadedStrings.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| symId :: Symbol -> Symbol
+          symId x = x
+          foo :: Symbol
+          foo = symId "foo" |]
+  ======>
+    symId :: Symbol -> Symbol
+    symId x = x
+    foo :: Symbol
+    foo = symId "foo"
+    type FooSym0 = Foo :: Symbol
+    type SymIdSym0 :: (~>) Symbol Symbol
+    data SymIdSym0 a0123456789876543210
+      where
+        SymIdSym0KindInference :: SameKind (Apply SymIdSym0 arg) (SymIdSym1 arg) =>
+                                  SymIdSym0 a0123456789876543210
+    type instance Apply SymIdSym0 a0123456789876543210 = SymIdSym1 a0123456789876543210
+    instance SuppressUnusedWarnings SymIdSym0 where
+      suppressUnusedWarnings = snd (((,) SymIdSym0KindInference) ())
+    type SymIdSym1 (a0123456789876543210 :: Symbol) =
+        SymId a0123456789876543210 :: Symbol
+    type Foo :: Symbol
+    type family Foo where
+      Foo = Apply SymIdSym0 (Data.Singletons.Prelude.IsString.FromString "foo")
+    type SymId :: Symbol -> Symbol
+    type family SymId a where
+      SymId x = x
+    sFoo :: Sing (FooSym0 :: Symbol)
+    sSymId ::
+      forall (t :: Symbol). Sing t -> Sing (Apply SymIdSym0 t :: Symbol)
+    sFoo
+      = (applySing ((singFun1 @SymIdSym0) sSymId))
+          (Data.Singletons.Prelude.IsString.sFromString (sing :: Sing "foo"))
+    sSymId (sX :: Sing x) = sX
+    instance SingI (SymIdSym0 :: (~>) Symbol Symbol) where
+      sing = (singFun1 @SymIdSym0) sSymId
diff --git a/tests/compile-and-dump/Singletons/PatternMatching.ghc88.template b/tests/compile-and-dump/Singletons/PatternMatching.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/PatternMatching.ghc88.template
+++ /dev/null
@@ -1,587 +0,0 @@
-Singletons/PatternMatching.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| pr = Pair (Succ Zero) ([Zero])
-          complex = Pair (Pair (Just Zero) Zero) False
-          tuple = (False, Just Zero, True)
-          aList = [Zero, Succ Zero, Succ (Succ Zero)]
-          
-          data Pair a b
-            = Pair a b
-            deriving Show |]
-  ======>
-    data Pair a b
-      = Pair a b
-      deriving Show
-    pr = (Pair (Succ Zero)) [Zero]
-    complex = (Pair ((Pair (Just Zero)) Zero)) False
-    tuple = (False, Just Zero, True)
-    aList = [Zero, Succ Zero, Succ (Succ Zero)]
-    type PairSym2 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) =
-        Pair t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (PairSym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) PairSym1KindInference) ())
-    data PairSym1 (t0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                    (~>) b0123456789876543210 (Pair a0123456789876543210 b0123456789876543210)
-      where
-        PairSym1KindInference :: forall t0123456789876543210
-                                        t0123456789876543210
-                                        arg. SameKind (Apply (PairSym1 t0123456789876543210) arg) (PairSym2 t0123456789876543210 arg) =>
-                                 PairSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (PairSym1 t0123456789876543210) t0123456789876543210 = Pair t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings PairSym0 where
-      suppressUnusedWarnings = snd (((,) PairSym0KindInference) ())
-    data PairSym0 :: forall a0123456789876543210 b0123456789876543210.
-                     (~>) a0123456789876543210 ((~>) b0123456789876543210 (Pair a0123456789876543210 b0123456789876543210))
-      where
-        PairSym0KindInference :: forall t0123456789876543210
-                                        arg. SameKind (Apply PairSym0 arg) (PairSym1 arg) =>
-                                 PairSym0 t0123456789876543210
-    type instance Apply PairSym0 t0123456789876543210 = PairSym1 t0123456789876543210
-    type AListSym0 = AList
-    type TupleSym0 = Tuple
-    type ComplexSym0 = Complex
-    type PrSym0 = Pr
-    type family AList where
-      AList = Apply (Apply (:@#@$) ZeroSym0) (Apply (Apply (:@#@$) (Apply SuccSym0 ZeroSym0)) (Apply (Apply (:@#@$) (Apply SuccSym0 (Apply SuccSym0 ZeroSym0))) '[]))
-    type family Tuple where
-      Tuple = Apply (Apply (Apply Tuple3Sym0 FalseSym0) (Apply JustSym0 ZeroSym0)) TrueSym0
-    type family Complex where
-      Complex = Apply (Apply PairSym0 (Apply (Apply PairSym0 (Apply JustSym0 ZeroSym0)) ZeroSym0)) FalseSym0
-    type family Pr where
-      Pr = Apply (Apply PairSym0 (Apply SuccSym0 ZeroSym0)) (Apply (Apply (:@#@$) ZeroSym0) '[])
-    type family ShowsPrec_0123456789876543210 (a :: GHC.Types.Nat) (a :: Pair a b) (a :: Symbol) :: Symbol where
-      ShowsPrec_0123456789876543210 p_0123456789876543210 (Pair arg_0123456789876543210 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Pair ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowSpaceSym0) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))))) a_0123456789876543210
-    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Pair a0123456789876543210 b0123456789876543210) (a0123456789876543210 :: Symbol) =
-        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
-    data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Pair a0123456789876543210 b0123456789876543210) :: (~>) Symbol Symbol
-      where
-        ShowsPrec_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
-    data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) :: forall a0123456789876543210
-                                                                                             b0123456789876543210.
-                                                                                      (~>) (Pair a0123456789876543210 b0123456789876543210) ((~>) Symbol Symbol)
-      where
-        ShowsPrec_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
-    data ShowsPrec_0123456789876543210Sym0 :: forall a0123456789876543210
-                                                     b0123456789876543210.
-                                              (~>) GHC.Types.Nat ((~>) (Pair a0123456789876543210 b0123456789876543210) ((~>) Symbol Symbol))
-      where
-        ShowsPrec_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
-    instance PShow (Pair a b) where
-      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
-    sAList :: Sing AListSym0
-    sTuple :: Sing TupleSym0
-    sComplex :: Sing ComplexSym0
-    sPr :: Sing PrSym0
-    sAList
-      = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SZero))
-          ((applySing
-              ((applySing ((singFun2 @(:@#@$)) SCons))
-                 ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
-             ((applySing
-                 ((applySing ((singFun2 @(:@#@$)) SCons))
-                    ((applySing ((singFun1 @SuccSym0) SSucc))
-                       ((applySing ((singFun1 @SuccSym0) SSucc)) SZero))))
-                SNil))
-    sTuple
-      = (applySing
-           ((applySing ((applySing ((singFun3 @Tuple3Sym0) STuple3)) SFalse))
-              ((applySing ((singFun1 @JustSym0) SJust)) SZero)))
-          STrue
-    sComplex
-      = (applySing
-           ((applySing ((singFun2 @PairSym0) SPair))
-              ((applySing
-                  ((applySing ((singFun2 @PairSym0) SPair))
-                     ((applySing ((singFun1 @JustSym0) SJust)) SZero)))
-                 SZero)))
-          SFalse
-    sPr
-      = (applySing
-           ((applySing ((singFun2 @PairSym0) SPair))
-              ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
-          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SZero)) SNil)
-    data SPair :: forall a b. Pair a b -> GHC.Types.Type
-      where
-        SPair :: forall a b (n :: a) (n :: b).
-                 (Sing (n :: a)) -> (Sing (n :: b)) -> SPair (Pair n n)
-    type instance Sing @(Pair a b) = SPair
-    instance (SingKind a, SingKind b) => SingKind (Pair a b) where
-      type Demote (Pair a b) = Pair (Demote a) (Demote b)
-      fromSing (SPair b b) = (Pair (fromSing b)) (fromSing b)
-      toSing (Pair (b :: Demote a) (b :: Demote b))
-        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b) of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SPair c) c) }
-    instance (SShow a, SShow b) => SShow (Pair a b) where
-      sShowsPrec ::
-        forall (t1 :: GHC.Types.Nat) (t2 :: Pair a b) (t3 :: Symbol).
-        Sing t1
-        -> Sing t2
-           -> Sing t3
-              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) (Pair a b) ((~>) Symbol Symbol))
-                                                             -> GHC.Types.Type) t1) t2) t3)
-      sShowsPrec
-        (sP_0123456789876543210 :: Sing p_0123456789876543210)
-        (SPair (sArg_0123456789876543210 :: Sing arg_0123456789876543210)
-               (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
-                    ((applySing
-                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
-                       (sFromInteger (sing :: Sing 10)))))
-                ((applySing
-                    ((applySing ((singFun3 @(.@#@$)) (%.)))
-                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                          (sing :: Sing "Pair "))))
-                   ((applySing
-                       ((applySing ((singFun3 @(.@#@$)) (%.)))
-                          ((applySing
-                              ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                                 (sFromInteger (sing :: Sing 11))))
-                             sArg_0123456789876543210)))
-                      ((applySing
-                          ((applySing ((singFun3 @(.@#@$)) (%.)))
-                             ((singFun1 @ShowSpaceSym0) sShowSpace)))
-                         ((applySing
-                             ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                                (sFromInteger (sing :: Sing 11))))
-                            sArg_0123456789876543210))))))
-            sA_0123456789876543210
-    instance (Data.Singletons.ShowSing.ShowSing a,
-              Data.Singletons.ShowSing.ShowSing b) =>
-             Show (SPair (z :: Pair a b)) where
-      showsPrec
-        p_0123456789876543210
-        (SPair (arg_0123456789876543210 :: Sing argTy_0123456789876543210)
-               (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
-        = (showParen (((>) p_0123456789876543210) 10))
-            (((.) (showString "SPair "))
-               (((.) ((showsPrec 11) arg_0123456789876543210))
-                  (((.) GHC.Show.showSpace)
-                     ((showsPrec 11) arg_0123456789876543210)))) ::
-            (Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210,
-             Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210) =>
-            ShowS
-    instance (SingI n, SingI n) => SingI (Pair (n :: a) (n :: b)) where
-      sing = (SPair sing) sing
-    instance SingI (PairSym0 :: (~>) a ((~>) b (Pair a b))) where
-      sing = (singFun2 @PairSym0) SPair
-    instance SingI d =>
-             SingI (PairSym1 (d :: a) :: (~>) b (Pair a b)) where
-      sing = (singFun1 @(PairSym1 (d :: a))) (SPair (sing @d))
-Singletons/PatternMatching.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| Pair sz lz = pr
-          Pair (Pair jz zz) fls = complex
-          (tf, tjz, tt) = tuple
-          [_, lsz, (Succ blimy)] = aList
-          lsz :: Nat
-          fls :: Bool
-          foo1 :: (a, b) -> a
-          foo1 (x, y) = (\ _ -> x) y
-          foo2 :: (# a, b #) -> a
-          foo2 t@(# x, y #) = case t of { (# a, b #) -> (\ _ -> a) b }
-          silly :: a -> ()
-          silly x = case x of { _ -> () } |]
-  ======>
-    Pair sz lz = pr
-    Pair (Pair jz zz) fls = complex
-    (tf, tjz, tt) = tuple
-    [_, lsz, Succ blimy] = aList
-    lsz :: Nat
-    fls :: Bool
-    foo1 :: (a, b) -> a
-    foo1 (x, y) = (\ _ -> x) y
-    foo2 :: (# a, b #) -> a
-    foo2 t@(# x, y #) = case t of { (# a, b #) -> (\ _ -> a) b }
-    silly :: a -> ()
-    silly x = case x of { _ -> () }
-    type family Case_0123456789876543210 x t where
-      Case_0123456789876543210 x _ = Tuple0Sym0
-    type Let0123456789876543210TSym2 x0123456789876543210 y0123456789876543210 =
-        Let0123456789876543210T x0123456789876543210 y0123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210TSym1 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210TSym1KindInference) ())
-    data Let0123456789876543210TSym1 x0123456789876543210 y0123456789876543210
-      where
-        Let0123456789876543210TSym1KindInference :: forall x0123456789876543210
-                                                           y0123456789876543210
-                                                           arg. SameKind (Apply (Let0123456789876543210TSym1 x0123456789876543210) arg) (Let0123456789876543210TSym2 x0123456789876543210 arg) =>
-                                                    Let0123456789876543210TSym1 x0123456789876543210 y0123456789876543210
-    type instance Apply (Let0123456789876543210TSym1 x0123456789876543210) y0123456789876543210 = Let0123456789876543210T x0123456789876543210 y0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210TSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210TSym0KindInference) ())
-    data Let0123456789876543210TSym0 x0123456789876543210
-      where
-        Let0123456789876543210TSym0KindInference :: forall x0123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210TSym0 arg) (Let0123456789876543210TSym1 arg) =>
-                                                    Let0123456789876543210TSym0 x0123456789876543210
-    type instance Apply Let0123456789876543210TSym0 x0123456789876543210 = Let0123456789876543210TSym1 x0123456789876543210
-    type family Let0123456789876543210T x y where
-      Let0123456789876543210T x y = Apply (Apply Tuple2Sym0 x) y
-    type family Case_0123456789876543210 arg_0123456789876543210 a b x y t where
-      Case_0123456789876543210 arg_0123456789876543210 a b x y _ = a
-    type family Lambda_0123456789876543210 a b x y t where
-      Lambda_0123456789876543210 a b x y arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 a b x y arg_0123456789876543210
-    type Lambda_0123456789876543210Sym5 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 y0123456789876543210 x0123456789876543210 b0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
-    data Lambda_0123456789876543210Sym4 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym4KindInference :: forall a0123456789876543210
-                                                              b0123456789876543210
-                                                              x0123456789876543210
-                                                              y0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym4 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210) arg) (Lambda_0123456789876543210Sym5 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym4 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym4 y0123456789876543210 x0123456789876543210 b0123456789876543210 a0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 y0123456789876543210 x0123456789876543210 b0123456789876543210 a0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 x0123456789876543210 b0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
-    data Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210
-      where
-        Lambda_0123456789876543210Sym3KindInference :: forall a0123456789876543210
-                                                              b0123456789876543210
-                                                              x0123456789876543210
-                                                              y0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 x0123456789876543210) arg) (Lambda_0123456789876543210Sym4 a0123456789876543210 b0123456789876543210 x0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym3 x0123456789876543210 b0123456789876543210 a0123456789876543210) y0123456789876543210 = Lambda_0123456789876543210Sym4 x0123456789876543210 b0123456789876543210 a0123456789876543210 y0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 b0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210 x0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                              b0123456789876543210
-                                                              x0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210) arg) (Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210 x0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 b0123456789876543210 a0123456789876543210) x0123456789876543210 = Lambda_0123456789876543210Sym3 b0123456789876543210 a0123456789876543210 x0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                              b0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 a0123456789876543210) arg) (Lambda_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 a0123456789876543210) b0123456789876543210 = Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 a0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 a0123456789876543210 = Lambda_0123456789876543210Sym1 a0123456789876543210
-    type family Case_0123456789876543210 x y t where
-      Case_0123456789876543210 x y '(a,
-                                     b) = Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 a) b) x) y) b
-    type family Case_0123456789876543210 arg_0123456789876543210 x y t where
-      Case_0123456789876543210 arg_0123456789876543210 x y _ = x
-    type family Lambda_0123456789876543210 x y t where
-      Lambda_0123456789876543210 x y arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 x y arg_0123456789876543210
-    type Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 x0123456789876543210 y0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall x0123456789876543210
-                                                              y0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) arg) (Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 y0123456789876543210 x0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 y0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall x0123456789876543210
-                                                              y0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) y0123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 x0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall x0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
-    type family Case_0123456789876543210 t where
-      Case_0123456789876543210 '[_,
-                                 _,
-                                 'Succ y_0123456789876543210] = y_0123456789876543210
-    type family Case_0123456789876543210 t where
-      Case_0123456789876543210 '[_,
-                                 y_0123456789876543210,
-                                 'Succ _] = y_0123456789876543210
-    type family Case_0123456789876543210 t where
-      Case_0123456789876543210 '(_,
-                                 _,
-                                 y_0123456789876543210) = y_0123456789876543210
-    type family Case_0123456789876543210 t where
-      Case_0123456789876543210 '(_,
-                                 y_0123456789876543210,
-                                 _) = y_0123456789876543210
-    type family Case_0123456789876543210 t where
-      Case_0123456789876543210 '(y_0123456789876543210,
-                                 _,
-                                 _) = y_0123456789876543210
-    type family Case_0123456789876543210 t where
-      Case_0123456789876543210 ('Pair ('Pair _ _) y_0123456789876543210) = y_0123456789876543210
-    type family Case_0123456789876543210 t where
-      Case_0123456789876543210 ('Pair ('Pair _ y_0123456789876543210) _) = y_0123456789876543210
-    type family Case_0123456789876543210 t where
-      Case_0123456789876543210 ('Pair ('Pair y_0123456789876543210 _) _) = y_0123456789876543210
-    type family Case_0123456789876543210 t where
-      Case_0123456789876543210 ('Pair _ y_0123456789876543210) = y_0123456789876543210
-    type family Case_0123456789876543210 t where
-      Case_0123456789876543210 ('Pair y_0123456789876543210 _) = y_0123456789876543210
-    type SillySym1 (a0123456789876543210 :: a0123456789876543210) =
-        Silly a0123456789876543210
-    instance SuppressUnusedWarnings SillySym0 where
-      suppressUnusedWarnings = snd (((,) SillySym0KindInference) ())
-    data SillySym0 :: forall a0123456789876543210.
-                      (~>) a0123456789876543210 ()
-      where
-        SillySym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply SillySym0 arg) (SillySym1 arg) =>
-                                  SillySym0 a0123456789876543210
-    type instance Apply SillySym0 a0123456789876543210 = Silly a0123456789876543210
-    type Foo2Sym1 (a0123456789876543210 :: (a0123456789876543210,
-                                            b0123456789876543210)) =
-        Foo2 a0123456789876543210
-    instance SuppressUnusedWarnings Foo2Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo2Sym0KindInference) ())
-    data Foo2Sym0 :: forall a0123456789876543210 b0123456789876543210.
-                     (~>) (a0123456789876543210,
-                           b0123456789876543210) a0123456789876543210
-      where
-        Foo2Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo2Sym0 arg) (Foo2Sym1 arg) =>
-                                 Foo2Sym0 a0123456789876543210
-    type instance Apply Foo2Sym0 a0123456789876543210 = Foo2 a0123456789876543210
-    type Foo1Sym1 (a0123456789876543210 :: (a0123456789876543210,
-                                            b0123456789876543210)) =
-        Foo1 a0123456789876543210
-    instance SuppressUnusedWarnings Foo1Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo1Sym0KindInference) ())
-    data Foo1Sym0 :: forall a0123456789876543210 b0123456789876543210.
-                     (~>) (a0123456789876543210,
-                           b0123456789876543210) a0123456789876543210
-      where
-        Foo1Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo1Sym0 arg) (Foo1Sym1 arg) =>
-                                 Foo1Sym0 a0123456789876543210
-    type instance Apply Foo1Sym0 a0123456789876543210 = Foo1 a0123456789876543210
-    type BlimySym0 = Blimy
-    type LszSym0 = Lsz
-    type X_0123456789876543210Sym0 = X_0123456789876543210
-    type TtSym0 = Tt
-    type TjzSym0 = Tjz
-    type TfSym0 = Tf
-    type X_0123456789876543210Sym0 = X_0123456789876543210
-    type FlsSym0 = Fls
-    type ZzSym0 = Zz
-    type JzSym0 = Jz
-    type X_0123456789876543210Sym0 = X_0123456789876543210
-    type LzSym0 = Lz
-    type SzSym0 = Sz
-    type X_0123456789876543210Sym0 = X_0123456789876543210
-    type family Silly (a :: a) :: () where
-      Silly x = Case_0123456789876543210 x x
-    type family Foo2 (a :: (a, b)) :: a where
-      Foo2 '(x,
-             y) = Case_0123456789876543210 x y (Let0123456789876543210TSym2 x y)
-    type family Foo1 (a :: (a, b)) :: a where
-      Foo1 '(x,
-             y) = Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) y) y
-    type family Blimy where
-      Blimy = Case_0123456789876543210 X_0123456789876543210Sym0
-    type family Lsz :: Nat where
-      Lsz = Case_0123456789876543210 X_0123456789876543210Sym0
-    type family X_0123456789876543210 where
-      X_0123456789876543210 = AListSym0
-    type family Tt where
-      Tt = Case_0123456789876543210 X_0123456789876543210Sym0
-    type family Tjz where
-      Tjz = Case_0123456789876543210 X_0123456789876543210Sym0
-    type family Tf where
-      Tf = Case_0123456789876543210 X_0123456789876543210Sym0
-    type family X_0123456789876543210 where
-      X_0123456789876543210 = TupleSym0
-    type family Fls :: Bool where
-      Fls = Case_0123456789876543210 X_0123456789876543210Sym0
-    type family Zz where
-      Zz = Case_0123456789876543210 X_0123456789876543210Sym0
-    type family Jz where
-      Jz = Case_0123456789876543210 X_0123456789876543210Sym0
-    type family X_0123456789876543210 where
-      X_0123456789876543210 = ComplexSym0
-    type family Lz where
-      Lz = Case_0123456789876543210 X_0123456789876543210Sym0
-    type family Sz where
-      Sz = Case_0123456789876543210 X_0123456789876543210Sym0
-    type family X_0123456789876543210 where
-      X_0123456789876543210 = PrSym0
-    sSilly ::
-      forall a (t :: a). Sing t -> Sing (Apply SillySym0 t :: ())
-    sFoo2 ::
-      forall a b (t :: (a, b)). Sing t -> Sing (Apply Foo2Sym0 t :: a)
-    sFoo1 ::
-      forall a b (t :: (a, b)). Sing t -> Sing (Apply Foo1Sym0 t :: a)
-    sBlimy :: Sing BlimySym0
-    sLsz :: Sing (LszSym0 :: Nat)
-    sX_0123456789876543210 :: Sing X_0123456789876543210Sym0
-    sTt :: Sing TtSym0
-    sTjz :: Sing TjzSym0
-    sTf :: Sing TfSym0
-    sX_0123456789876543210 :: Sing X_0123456789876543210Sym0
-    sFls :: Sing (FlsSym0 :: Bool)
-    sZz :: Sing ZzSym0
-    sJz :: Sing JzSym0
-    sX_0123456789876543210 :: Sing X_0123456789876543210Sym0
-    sLz :: Sing LzSym0
-    sSz :: Sing SzSym0
-    sX_0123456789876543210 :: Sing X_0123456789876543210Sym0
-    sSilly (sX :: Sing x)
-      = (id @(Sing (Case_0123456789876543210 x x :: ())))
-          (case sX of { _ -> STuple0 })
-    sFoo2 (STuple2 (sX :: Sing x) (sY :: Sing y))
-      = let
-          sT :: Sing (Let0123456789876543210TSym2 x y)
-          sT
-            = (applySing ((applySing ((singFun2 @Tuple2Sym0) STuple2)) sX)) sY
-        in
-          (id
-             @(Sing (Case_0123456789876543210 x y (Let0123456789876543210TSym2 x y) :: a)))
-            (case sT of {
-               STuple2 (sA :: Sing a) (sB :: Sing b)
-                 -> (applySing
-                       ((singFun1
-                           @(Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 a) b) x) y))
-                          (\ sArg_0123456789876543210
-                             -> case sArg_0123456789876543210 of {
-                                  (_ :: Sing arg_0123456789876543210)
-                                    -> (id
-                                          @(Sing (Case_0123456789876543210 arg_0123456789876543210 a b x y arg_0123456789876543210)))
-                                         (case sArg_0123456789876543210 of { _ -> sA }) })))
-                      sB })
-    sFoo1 (STuple2 (sX :: Sing x) (sY :: Sing y))
-      = (applySing
-           ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 x) y))
-              (\ sArg_0123456789876543210
-                 -> case sArg_0123456789876543210 of {
-                      (_ :: Sing arg_0123456789876543210)
-                        -> (id
-                              @(Sing (Case_0123456789876543210 arg_0123456789876543210 x y arg_0123456789876543210)))
-                             (case sArg_0123456789876543210 of { _ -> sX }) })))
-          sY
-    sBlimy
-      = (id @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0)))
-          (case sX_0123456789876543210 of {
-             SCons _
-                   (SCons _
-                          (SCons (SSucc (sY_0123456789876543210 :: Sing y_0123456789876543210))
-                                 SNil))
-               -> sY_0123456789876543210 })
-    sLsz
-      = (id
-           @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0 :: Nat)))
-          (case sX_0123456789876543210 of {
-             SCons _
-                   (SCons (sY_0123456789876543210 :: Sing y_0123456789876543210)
-                          (SCons (SSucc _) SNil))
-               -> sY_0123456789876543210 })
-    sX_0123456789876543210 = sAList
-    sTt
-      = (id @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0)))
-          (case sX_0123456789876543210 of {
-             STuple3 _ _ (sY_0123456789876543210 :: Sing y_0123456789876543210)
-               -> sY_0123456789876543210 })
-    sTjz
-      = (id @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0)))
-          (case sX_0123456789876543210 of {
-             STuple3 _ (sY_0123456789876543210 :: Sing y_0123456789876543210) _
-               -> sY_0123456789876543210 })
-    sTf
-      = (id @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0)))
-          (case sX_0123456789876543210 of {
-             STuple3 (sY_0123456789876543210 :: Sing y_0123456789876543210) _ _
-               -> sY_0123456789876543210 })
-    sX_0123456789876543210 = sTuple
-    sFls
-      = (id
-           @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0 :: Bool)))
-          (case sX_0123456789876543210 of {
-             SPair (SPair _ _)
-                   (sY_0123456789876543210 :: Sing y_0123456789876543210)
-               -> sY_0123456789876543210 })
-    sZz
-      = (id @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0)))
-          (case sX_0123456789876543210 of {
-             SPair (SPair _
-                          (sY_0123456789876543210 :: Sing y_0123456789876543210))
-                   _
-               -> sY_0123456789876543210 })
-    sJz
-      = (id @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0)))
-          (case sX_0123456789876543210 of {
-             SPair (SPair (sY_0123456789876543210 :: Sing y_0123456789876543210)
-                          _)
-                   _
-               -> sY_0123456789876543210 })
-    sX_0123456789876543210 = sComplex
-    sLz
-      = (id @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0)))
-          (case sX_0123456789876543210 of {
-             SPair _ (sY_0123456789876543210 :: Sing y_0123456789876543210)
-               -> sY_0123456789876543210 })
-    sSz
-      = (id @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0)))
-          (case sX_0123456789876543210 of {
-             SPair (sY_0123456789876543210 :: Sing y_0123456789876543210) _
-               -> sY_0123456789876543210 })
-    sX_0123456789876543210 = sPr
-    instance SingI (SillySym0 :: (~>) a ()) where
-      sing = (singFun1 @SillySym0) sSilly
-    instance SingI (Foo2Sym0 :: (~>) (a, b) a) where
-      sing = (singFun1 @Foo2Sym0) sFoo2
-    instance SingI (Foo1Sym0 :: (~>) (a, b) a) where
-      sing = (singFun1 @Foo1Sym0) sFoo1
diff --git a/tests/compile-and-dump/Singletons/PatternMatching.golden b/tests/compile-and-dump/Singletons/PatternMatching.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/PatternMatching.golden
@@ -0,0 +1,555 @@
+Singletons/PatternMatching.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| pr = Pair (Succ Zero) ([Zero])
+          complex = Pair (Pair (Just Zero) Zero) False
+          tuple = (False, Just Zero, True)
+          aList = [Zero, Succ Zero, Succ (Succ Zero)]
+          
+          data Pair a b
+            = Pair a b
+            deriving Show |]
+  ======>
+    data Pair a b
+      = Pair a b
+      deriving Show
+    pr = (Pair (Succ Zero)) [Zero]
+    complex = (Pair ((Pair (Just Zero)) Zero)) False
+    tuple = (False, Just Zero, True)
+    aList = [Zero, Succ Zero, Succ (Succ Zero)]
+    type PairSym0 :: forall a b. (~>) a ((~>) b (Pair a b))
+    data PairSym0 a0123456789876543210
+      where
+        PairSym0KindInference :: SameKind (Apply PairSym0 arg) (PairSym1 arg) =>
+                                 PairSym0 a0123456789876543210
+    type instance Apply PairSym0 a0123456789876543210 = PairSym1 a0123456789876543210
+    instance SuppressUnusedWarnings PairSym0 where
+      suppressUnusedWarnings = snd (((,) PairSym0KindInference) ())
+    type PairSym1 :: forall a b. a -> (~>) b (Pair a b)
+    data PairSym1 a0123456789876543210 a0123456789876543210
+      where
+        PairSym1KindInference :: SameKind (Apply (PairSym1 a0123456789876543210) arg) (PairSym2 a0123456789876543210 arg) =>
+                                 PairSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (PairSym1 a0123456789876543210) a0123456789876543210 = PairSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (PairSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) PairSym1KindInference) ())
+    type PairSym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        Pair a0123456789876543210 a0123456789876543210 :: Pair a b
+    type AListSym0 = AList
+    type TupleSym0 = Tuple
+    type ComplexSym0 = Complex
+    type PrSym0 = Pr
+    type family AList where
+      AList = Apply (Apply (:@#@$) ZeroSym0) (Apply (Apply (:@#@$) (Apply SuccSym0 ZeroSym0)) (Apply (Apply (:@#@$) (Apply SuccSym0 (Apply SuccSym0 ZeroSym0))) NilSym0))
+    type family Tuple where
+      Tuple = Apply (Apply (Apply Tuple3Sym0 FalseSym0) (Apply JustSym0 ZeroSym0)) TrueSym0
+    type family Complex where
+      Complex = Apply (Apply PairSym0 (Apply (Apply PairSym0 (Apply JustSym0 ZeroSym0)) ZeroSym0)) FalseSym0
+    type family Pr where
+      Pr = Apply (Apply PairSym0 (Apply SuccSym0 ZeroSym0)) (Apply (Apply (:@#@$) ZeroSym0) NilSym0)
+    type ShowsPrec_0123456789876543210 :: GHC.Types.Nat
+                                          -> Pair a b -> Symbol -> Symbol
+    type family ShowsPrec_0123456789876543210 a a a where
+      ShowsPrec_0123456789876543210 p_0123456789876543210 (Pair arg_0123456789876543210 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Pair ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowSpaceSym0) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))))) a_0123456789876543210
+    type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) (Pair a b) ((~>) Symbol Symbol))
+    data ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
+    type ShowsPrec_0123456789876543210Sym1 :: GHC.Types.Nat
+                                              -> (~>) (Pair a b) ((~>) Symbol Symbol)
+    data ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
+    type ShowsPrec_0123456789876543210Sym2 :: GHC.Types.Nat
+                                              -> Pair a b -> (~>) Symbol Symbol
+    data ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
+    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Pair a b) (a0123456789876543210 :: Symbol) =
+        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Symbol
+    instance PShow (Pair a b) where
+      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
+    sAList :: Sing @_ AListSym0
+    sTuple :: Sing @_ TupleSym0
+    sComplex :: Sing @_ ComplexSym0
+    sPr :: Sing @_ PrSym0
+    sAList
+      = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SZero))
+          ((applySing
+              ((applySing ((singFun2 @(:@#@$)) SCons))
+                 ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
+             ((applySing
+                 ((applySing ((singFun2 @(:@#@$)) SCons))
+                    ((applySing ((singFun1 @SuccSym0) SSucc))
+                       ((applySing ((singFun1 @SuccSym0) SSucc)) SZero))))
+                SNil))
+    sTuple
+      = (applySing
+           ((applySing ((applySing ((singFun3 @Tuple3Sym0) STuple3)) SFalse))
+              ((applySing ((singFun1 @JustSym0) SJust)) SZero)))
+          STrue
+    sComplex
+      = (applySing
+           ((applySing ((singFun2 @PairSym0) SPair))
+              ((applySing
+                  ((applySing ((singFun2 @PairSym0) SPair))
+                     ((applySing ((singFun1 @JustSym0) SJust)) SZero)))
+                 SZero)))
+          SFalse
+    sPr
+      = (applySing
+           ((applySing ((singFun2 @PairSym0) SPair))
+              ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
+          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SZero)) SNil)
+    data SPair :: forall a b. Pair a b -> GHC.Types.Type
+      where
+        SPair :: forall a b (n :: a) (n :: b).
+                 (Sing n) -> (Sing n) -> SPair (Pair n n :: Pair a b)
+    type instance Sing @(Pair a b) = SPair
+    instance (SingKind a, SingKind b) => SingKind (Pair a b) where
+      type Demote (Pair a b) = Pair (Demote a) (Demote b)
+      fromSing (SPair b b) = (Pair (fromSing b)) (fromSing b)
+      toSing (Pair (b :: Demote a) (b :: Demote b))
+        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b) of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SPair c) c) }
+    instance (SShow a, SShow b) => SShow (Pair a b) where
+      sShowsPrec ::
+        forall (t1 :: GHC.Types.Nat) (t2 :: Pair a b) (t3 :: Symbol).
+        Sing t1
+        -> Sing t2
+           -> Sing t3
+              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) (Pair a b) ((~>) Symbol Symbol))
+                                                             -> GHC.Types.Type) t1) t2) t3)
+      sShowsPrec
+        (sP_0123456789876543210 :: Sing p_0123456789876543210)
+        (SPair (sArg_0123456789876543210 :: Sing arg_0123456789876543210)
+               (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
+                    ((applySing
+                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
+                       (sFromInteger (sing :: Sing 10)))))
+                ((applySing
+                    ((applySing ((singFun3 @(.@#@$)) (%.)))
+                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                          (sing :: Sing "Pair "))))
+                   ((applySing
+                       ((applySing ((singFun3 @(.@#@$)) (%.)))
+                          ((applySing
+                              ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                                 (sFromInteger (sing :: Sing 11))))
+                             sArg_0123456789876543210)))
+                      ((applySing
+                          ((applySing ((singFun3 @(.@#@$)) (%.)))
+                             ((singFun1 @ShowSpaceSym0) sShowSpace)))
+                         ((applySing
+                             ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                                (sFromInteger (sing :: Sing 11))))
+                            sArg_0123456789876543210))))))
+            sA_0123456789876543210
+    instance (Data.Singletons.ShowSing.ShowSing a,
+              Data.Singletons.ShowSing.ShowSing b) =>
+             Show (SPair (z :: Pair a b)) where
+      showsPrec
+        p_0123456789876543210
+        (SPair (arg_0123456789876543210 :: Sing argTy_0123456789876543210)
+               (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
+        = (showParen (((>) p_0123456789876543210) 10))
+            (((.) (showString "SPair "))
+               (((.) ((showsPrec 11) arg_0123456789876543210))
+                  (((.) GHC.Show.showSpace)
+                     ((showsPrec 11) arg_0123456789876543210)))) ::
+            (Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210,
+             Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210) =>
+            ShowS
+    instance (SingI n, SingI n) => SingI (Pair (n :: a) (n :: b)) where
+      sing = (SPair sing) sing
+    instance SingI (PairSym0 :: (~>) a ((~>) b (Pair a b))) where
+      sing = (singFun2 @PairSym0) SPair
+    instance SingI d =>
+             SingI (PairSym1 (d :: a) :: (~>) b (Pair a b)) where
+      sing = (singFun1 @(PairSym1 (d :: a))) (SPair (sing @d))
+Singletons/PatternMatching.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| Pair sz lz = pr
+          Pair (Pair jz zz) fls = complex
+          (tf, tjz, tt) = tuple
+          [_, lsz, (Succ blimy)] = aList
+          lsz :: Nat
+          fls :: Bool
+          foo1 :: (a, b) -> a
+          foo1 (x, y) = (\ _ -> x) y
+          foo2 :: (# a, b #) -> a
+          foo2 t@(# x, y #) = case t of { (# a, b #) -> (\ _ -> a) b }
+          silly :: a -> ()
+          silly x = case x of { _ -> () } |]
+  ======>
+    Pair sz lz = pr
+    Pair (Pair jz zz) fls = complex
+    (tf, tjz, tt) = tuple
+    [_, lsz, Succ blimy] = aList
+    lsz :: Nat
+    fls :: Bool
+    foo1 :: (a, b) -> a
+    foo1 (x, y) = (\ _ -> x) y
+    foo2 :: (# a, b #) -> a
+    foo2 t@(# x, y #) = case t of { (# a, b #) -> (\ _ -> a) b }
+    silly :: a -> ()
+    silly x = case x of { _ -> () }
+    type family Case_0123456789876543210 x t where
+      Case_0123456789876543210 x _ = Tuple0Sym0
+    data Let0123456789876543210TSym0 x0123456789876543210
+      where
+        Let0123456789876543210TSym0KindInference :: SameKind (Apply Let0123456789876543210TSym0 arg) (Let0123456789876543210TSym1 arg) =>
+                                                    Let0123456789876543210TSym0 x0123456789876543210
+    type instance Apply Let0123456789876543210TSym0 x0123456789876543210 = Let0123456789876543210TSym1 x0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210TSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210TSym0KindInference) ())
+    data Let0123456789876543210TSym1 x0123456789876543210 y0123456789876543210
+      where
+        Let0123456789876543210TSym1KindInference :: SameKind (Apply (Let0123456789876543210TSym1 x0123456789876543210) arg) (Let0123456789876543210TSym2 x0123456789876543210 arg) =>
+                                                    Let0123456789876543210TSym1 x0123456789876543210 y0123456789876543210
+    type instance Apply (Let0123456789876543210TSym1 x0123456789876543210) y0123456789876543210 = Let0123456789876543210TSym2 x0123456789876543210 y0123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210TSym1 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210TSym1KindInference) ())
+    type Let0123456789876543210TSym2 x0123456789876543210 y0123456789876543210 =
+        Let0123456789876543210T x0123456789876543210 y0123456789876543210
+    type family Let0123456789876543210T x y where
+      Let0123456789876543210T x y = Apply (Apply Tuple2Sym0 x) y
+    type family Case_0123456789876543210 arg_0123456789876543210 a b x y t where
+      Case_0123456789876543210 arg_0123456789876543210 a b x y _ = a
+    type family Lambda_0123456789876543210 a b x y arg_0123456789876543210 where
+      Lambda_0123456789876543210 a b x y arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 a b x y arg_0123456789876543210
+    data Lambda_0123456789876543210Sym0 a0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 a0123456789876543210 = Lambda_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 a0123456789876543210) arg) (Lambda_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 a0123456789876543210 b0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 a0123456789876543210) b0123456789876543210 = Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210) arg) (Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210 x0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210) x0123456789876543210 = Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 x0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 a0123456789876543210 b0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    data Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210
+      where
+        Lambda_0123456789876543210Sym3KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 x0123456789876543210) arg) (Lambda_0123456789876543210Sym4 a0123456789876543210 b0123456789876543210 x0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 x0123456789876543210) y0123456789876543210 = Lambda_0123456789876543210Sym4 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 a0123456789876543210 b0123456789876543210 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
+    data Lambda_0123456789876543210Sym4 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym4KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym4 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210) arg) (Lambda_0123456789876543210Sym5 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym4 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym4 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210) arg_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym5 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym4 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym4KindInference) ())
+    type Lambda_0123456789876543210Sym5 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 a0123456789876543210 b0123456789876543210 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210
+    type family Case_0123456789876543210 x y t where
+      Case_0123456789876543210 x y '(a,
+                                     b) = Apply (Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 a) b) x) y) b
+    type family Case_0123456789876543210 arg_0123456789876543210 x y t where
+      Case_0123456789876543210 arg_0123456789876543210 x y _ = x
+    type family Lambda_0123456789876543210 x y arg_0123456789876543210 where
+      Lambda_0123456789876543210 x y arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 x y arg_0123456789876543210
+    data Lambda_0123456789876543210Sym0 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 y0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) y0123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) arg) (Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) arg_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 x0123456789876543210 y0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    type Lambda_0123456789876543210Sym3 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 x0123456789876543210 y0123456789876543210 arg_01234567898765432100123456789876543210
+    type family Case_0123456789876543210 t where
+      Case_0123456789876543210 '[_,
+                                 _,
+                                 'Succ y_0123456789876543210] = y_0123456789876543210
+    type family Case_0123456789876543210 t where
+      Case_0123456789876543210 '[_,
+                                 y_0123456789876543210,
+                                 'Succ _] = y_0123456789876543210
+    type family Case_0123456789876543210 t where
+      Case_0123456789876543210 '(_,
+                                 _,
+                                 y_0123456789876543210) = y_0123456789876543210
+    type family Case_0123456789876543210 t where
+      Case_0123456789876543210 '(_,
+                                 y_0123456789876543210,
+                                 _) = y_0123456789876543210
+    type family Case_0123456789876543210 t where
+      Case_0123456789876543210 '(y_0123456789876543210,
+                                 _,
+                                 _) = y_0123456789876543210
+    type family Case_0123456789876543210 t where
+      Case_0123456789876543210 ('Pair ('Pair _ _) y_0123456789876543210) = y_0123456789876543210
+    type family Case_0123456789876543210 t where
+      Case_0123456789876543210 ('Pair ('Pair _ y_0123456789876543210) _) = y_0123456789876543210
+    type family Case_0123456789876543210 t where
+      Case_0123456789876543210 ('Pair ('Pair y_0123456789876543210 _) _) = y_0123456789876543210
+    type family Case_0123456789876543210 t where
+      Case_0123456789876543210 ('Pair _ y_0123456789876543210) = y_0123456789876543210
+    type family Case_0123456789876543210 t where
+      Case_0123456789876543210 ('Pair y_0123456789876543210 _) = y_0123456789876543210
+    type SillySym0 :: (~>) a ()
+    data SillySym0 a0123456789876543210
+      where
+        SillySym0KindInference :: SameKind (Apply SillySym0 arg) (SillySym1 arg) =>
+                                  SillySym0 a0123456789876543210
+    type instance Apply SillySym0 a0123456789876543210 = SillySym1 a0123456789876543210
+    instance SuppressUnusedWarnings SillySym0 where
+      suppressUnusedWarnings = snd (((,) SillySym0KindInference) ())
+    type SillySym1 (a0123456789876543210 :: a) =
+        Silly a0123456789876543210 :: ()
+    type Foo2Sym0 :: (~>) (a, b) a
+    data Foo2Sym0 a0123456789876543210
+      where
+        Foo2Sym0KindInference :: SameKind (Apply Foo2Sym0 arg) (Foo2Sym1 arg) =>
+                                 Foo2Sym0 a0123456789876543210
+    type instance Apply Foo2Sym0 a0123456789876543210 = Foo2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo2Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo2Sym0KindInference) ())
+    type Foo2Sym1 (a0123456789876543210 :: (a, b)) =
+        Foo2 a0123456789876543210 :: a
+    type Foo1Sym0 :: (~>) (a, b) a
+    data Foo1Sym0 a0123456789876543210
+      where
+        Foo1Sym0KindInference :: SameKind (Apply Foo1Sym0 arg) (Foo1Sym1 arg) =>
+                                 Foo1Sym0 a0123456789876543210
+    type instance Apply Foo1Sym0 a0123456789876543210 = Foo1Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo1Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo1Sym0KindInference) ())
+    type Foo1Sym1 (a0123456789876543210 :: (a, b)) =
+        Foo1 a0123456789876543210 :: a
+    type BlimySym0 = Blimy
+    type LszSym0 = Lsz :: Nat
+    type X_0123456789876543210Sym0 = X_0123456789876543210
+    type TtSym0 = Tt
+    type TjzSym0 = Tjz
+    type TfSym0 = Tf
+    type X_0123456789876543210Sym0 = X_0123456789876543210
+    type FlsSym0 = Fls :: Bool
+    type ZzSym0 = Zz
+    type JzSym0 = Jz
+    type X_0123456789876543210Sym0 = X_0123456789876543210
+    type LzSym0 = Lz
+    type SzSym0 = Sz
+    type X_0123456789876543210Sym0 = X_0123456789876543210
+    type Silly :: a -> ()
+    type family Silly a where
+      Silly x = Case_0123456789876543210 x x
+    type Foo2 :: (a, b) -> a
+    type family Foo2 a where
+      Foo2 '(x,
+             y) = Case_0123456789876543210 x y (Let0123456789876543210TSym2 x y)
+    type Foo1 :: (a, b) -> a
+    type family Foo1 a where
+      Foo1 '(x,
+             y) = Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) y) y
+    type family Blimy where
+      Blimy = Case_0123456789876543210 X_0123456789876543210Sym0
+    type Lsz :: Nat
+    type family Lsz where
+      Lsz = Case_0123456789876543210 X_0123456789876543210Sym0
+    type family X_0123456789876543210 where
+      X_0123456789876543210 = AListSym0
+    type family Tt where
+      Tt = Case_0123456789876543210 X_0123456789876543210Sym0
+    type family Tjz where
+      Tjz = Case_0123456789876543210 X_0123456789876543210Sym0
+    type family Tf where
+      Tf = Case_0123456789876543210 X_0123456789876543210Sym0
+    type family X_0123456789876543210 where
+      X_0123456789876543210 = TupleSym0
+    type Fls :: Bool
+    type family Fls where
+      Fls = Case_0123456789876543210 X_0123456789876543210Sym0
+    type family Zz where
+      Zz = Case_0123456789876543210 X_0123456789876543210Sym0
+    type family Jz where
+      Jz = Case_0123456789876543210 X_0123456789876543210Sym0
+    type family X_0123456789876543210 where
+      X_0123456789876543210 = ComplexSym0
+    type family Lz where
+      Lz = Case_0123456789876543210 X_0123456789876543210Sym0
+    type family Sz where
+      Sz = Case_0123456789876543210 X_0123456789876543210Sym0
+    type family X_0123456789876543210 where
+      X_0123456789876543210 = PrSym0
+    sSilly ::
+      forall a (t :: a). Sing t -> Sing (Apply SillySym0 t :: ())
+    sFoo2 ::
+      forall a b (t :: (a, b)). Sing t -> Sing (Apply Foo2Sym0 t :: a)
+    sFoo1 ::
+      forall a b (t :: (a, b)). Sing t -> Sing (Apply Foo1Sym0 t :: a)
+    sBlimy :: Sing @_ BlimySym0
+    sLsz :: Sing (LszSym0 :: Nat)
+    sX_0123456789876543210 :: Sing @_ X_0123456789876543210Sym0
+    sTt :: Sing @_ TtSym0
+    sTjz :: Sing @_ TjzSym0
+    sTf :: Sing @_ TfSym0
+    sX_0123456789876543210 :: Sing @_ X_0123456789876543210Sym0
+    sFls :: Sing (FlsSym0 :: Bool)
+    sZz :: Sing @_ ZzSym0
+    sJz :: Sing @_ JzSym0
+    sX_0123456789876543210 :: Sing @_ X_0123456789876543210Sym0
+    sLz :: Sing @_ LzSym0
+    sSz :: Sing @_ SzSym0
+    sX_0123456789876543210 :: Sing @_ X_0123456789876543210Sym0
+    sSilly (sX :: Sing x)
+      = (id @(Sing (Case_0123456789876543210 x x :: ())))
+          (case sX of { _ -> STuple0 })
+    sFoo2 (STuple2 (sX :: Sing x) (sY :: Sing y))
+      = let
+          sT :: Sing @_ (Let0123456789876543210TSym2 x y)
+          sT
+            = (applySing ((applySing ((singFun2 @Tuple2Sym0) STuple2)) sX)) sY
+        in
+          (id
+             @(Sing (Case_0123456789876543210 x y (Let0123456789876543210TSym2 x y) :: a)))
+            (case sT of {
+               STuple2 (sA :: Sing a) (sB :: Sing b)
+                 -> (applySing
+                       ((singFun1
+                           @(Apply (Apply (Apply (Apply Lambda_0123456789876543210Sym0 a) b) x) y))
+                          (\ sArg_0123456789876543210
+                             -> case sArg_0123456789876543210 of {
+                                  (_ :: Sing arg_0123456789876543210)
+                                    -> (id
+                                          @(Sing (Case_0123456789876543210 arg_0123456789876543210 a b x y arg_0123456789876543210)))
+                                         (case sArg_0123456789876543210 of { _ -> sA }) })))
+                      sB })
+    sFoo1 (STuple2 (sX :: Sing x) (sY :: Sing y))
+      = (applySing
+           ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 x) y))
+              (\ sArg_0123456789876543210
+                 -> case sArg_0123456789876543210 of {
+                      (_ :: Sing arg_0123456789876543210)
+                        -> (id
+                              @(Sing (Case_0123456789876543210 arg_0123456789876543210 x y arg_0123456789876543210)))
+                             (case sArg_0123456789876543210 of { _ -> sX }) })))
+          sY
+    sBlimy
+      = (id @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0)))
+          (case sX_0123456789876543210 of {
+             SCons _
+                   (SCons _
+                          (SCons (SSucc (sY_0123456789876543210 :: Sing y_0123456789876543210))
+                                 SNil))
+               -> sY_0123456789876543210 })
+    sLsz
+      = (id
+           @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0 :: Nat)))
+          (case sX_0123456789876543210 of {
+             SCons _
+                   (SCons (sY_0123456789876543210 :: Sing y_0123456789876543210)
+                          (SCons (SSucc _) SNil))
+               -> sY_0123456789876543210 })
+    sX_0123456789876543210 = sAList
+    sTt
+      = (id @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0)))
+          (case sX_0123456789876543210 of {
+             STuple3 _ _ (sY_0123456789876543210 :: Sing y_0123456789876543210)
+               -> sY_0123456789876543210 })
+    sTjz
+      = (id @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0)))
+          (case sX_0123456789876543210 of {
+             STuple3 _ (sY_0123456789876543210 :: Sing y_0123456789876543210) _
+               -> sY_0123456789876543210 })
+    sTf
+      = (id @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0)))
+          (case sX_0123456789876543210 of {
+             STuple3 (sY_0123456789876543210 :: Sing y_0123456789876543210) _ _
+               -> sY_0123456789876543210 })
+    sX_0123456789876543210 = sTuple
+    sFls
+      = (id
+           @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0 :: Bool)))
+          (case sX_0123456789876543210 of {
+             SPair (SPair _ _)
+                   (sY_0123456789876543210 :: Sing y_0123456789876543210)
+               -> sY_0123456789876543210 })
+    sZz
+      = (id @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0)))
+          (case sX_0123456789876543210 of {
+             SPair (SPair _
+                          (sY_0123456789876543210 :: Sing y_0123456789876543210))
+                   _
+               -> sY_0123456789876543210 })
+    sJz
+      = (id @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0)))
+          (case sX_0123456789876543210 of {
+             SPair (SPair (sY_0123456789876543210 :: Sing y_0123456789876543210)
+                          _)
+                   _
+               -> sY_0123456789876543210 })
+    sX_0123456789876543210 = sComplex
+    sLz
+      = (id @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0)))
+          (case sX_0123456789876543210 of {
+             SPair _ (sY_0123456789876543210 :: Sing y_0123456789876543210)
+               -> sY_0123456789876543210 })
+    sSz
+      = (id @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0)))
+          (case sX_0123456789876543210 of {
+             SPair (sY_0123456789876543210 :: Sing y_0123456789876543210) _
+               -> sY_0123456789876543210 })
+    sX_0123456789876543210 = sPr
+    instance SingI (SillySym0 :: (~>) a ()) where
+      sing = (singFun1 @SillySym0) sSilly
+    instance SingI (Foo2Sym0 :: (~>) (a, b) a) where
+      sing = (singFun1 @Foo2Sym0) sFoo2
+    instance SingI (Foo1Sym0 :: (~>) (a, b) a) where
+      sing = (singFun1 @Foo1Sym0) sFoo1
diff --git a/tests/compile-and-dump/Singletons/PolyKinds.ghc88.template b/tests/compile-and-dump/Singletons/PolyKinds.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/PolyKinds.ghc88.template
+++ /dev/null
@@ -1,28 +0,0 @@
-Singletons/PolyKinds.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| class Cls (a :: k) where
-            fff :: Proxy (a :: k) -> () |]
-  ======>
-    class Cls (a :: k) where
-      fff :: Proxy (a :: k) -> ()
-    type FffSym1 (arg0123456789876543210 :: Proxy (a0123456789876543210 :: k0123456789876543210)) =
-        Fff arg0123456789876543210
-    instance SuppressUnusedWarnings FffSym0 where
-      suppressUnusedWarnings = snd (((,) FffSym0KindInference) ())
-    data FffSym0 :: forall k0123456789876543210
-                           (a0123456789876543210 :: k0123456789876543210).
-                    (~>) (Proxy (a0123456789876543210 :: k0123456789876543210)) ()
-      where
-        FffSym0KindInference :: forall arg0123456789876543210
-                                       arg. SameKind (Apply FffSym0 arg) (FffSym1 arg) =>
-                                FffSym0 arg0123456789876543210
-    type instance Apply FffSym0 arg0123456789876543210 = Fff arg0123456789876543210
-    class PCls (a :: k) where
-      type Fff (arg :: Proxy (a :: k)) :: ()
-    class SCls (a :: k) where
-      sFff ::
-        forall (t :: Proxy (a :: k)).
-        Sing t -> Sing (Apply FffSym0 t :: ())
-    instance SCls a =>
-             SingI (FffSym0 :: (~>) (Proxy (a :: k)) ()) where
-      sing = (singFun1 @FffSym0) sFff
diff --git a/tests/compile-and-dump/Singletons/PolyKinds.golden b/tests/compile-and-dump/Singletons/PolyKinds.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/PolyKinds.golden
@@ -0,0 +1,26 @@
+Singletons/PolyKinds.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| class Cls (a :: k) where
+            fff :: Proxy (a :: k) -> () |]
+  ======>
+    class Cls (a :: k) where
+      fff :: Proxy (a :: k) -> ()
+    type FffSym0 :: forall k (a :: k). (~>) (Proxy (a :: k)) ()
+    data FffSym0 a0123456789876543210
+      where
+        FffSym0KindInference :: SameKind (Apply FffSym0 arg) (FffSym1 arg) =>
+                                FffSym0 a0123456789876543210
+    type instance Apply FffSym0 a0123456789876543210 = FffSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FffSym0 where
+      suppressUnusedWarnings = snd (((,) FffSym0KindInference) ())
+    type FffSym1 (a0123456789876543210 :: Proxy (a :: k)) =
+        Fff a0123456789876543210 :: ()
+    class PCls (a :: k) where
+      type Fff (arg :: Proxy (a :: k)) :: ()
+    class SCls (a :: k) where
+      sFff ::
+        forall (t :: Proxy (a :: k)).
+        Sing t -> Sing (Apply FffSym0 t :: ())
+    instance SCls a =>
+             SingI (FffSym0 :: (~>) (Proxy (a :: k)) ()) where
+      sing = (singFun1 @FffSym0) sFff
diff --git a/tests/compile-and-dump/Singletons/PolyKindsApp.ghc88.template b/tests/compile-and-dump/Singletons/PolyKindsApp.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/PolyKindsApp.ghc88.template
+++ /dev/null
@@ -1,12 +0,0 @@
-Singletons/PolyKindsApp.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| class Cls (a :: k -> Type) where
-            fff :: (a :: k -> Type) (b :: k) |]
-  ======>
-    class Cls (a :: k -> Type) where
-      fff :: (a :: k -> Type) (b :: k)
-    type FffSym0 = Fff
-    class PCls (a :: k -> Type) where
-      type Fff :: (a :: k -> Type) (b :: k)
-    class SCls (a :: k -> Type) where
-      sFff :: forall b. Sing (FffSym0 :: (a :: k -> Type) (b :: k))
diff --git a/tests/compile-and-dump/Singletons/PolyKindsApp.golden b/tests/compile-and-dump/Singletons/PolyKindsApp.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/PolyKindsApp.golden
@@ -0,0 +1,13 @@
+Singletons/PolyKindsApp.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| class Cls (a :: k -> Type) where
+            fff :: (a :: k -> Type) (b :: k) |]
+  ======>
+    class Cls (a :: k -> Type) where
+      fff :: (a :: k -> Type) (b :: k)
+    type FffSym0 = Fff :: (a :: k -> Type) (b :: k)
+    class PCls (a :: k -> Type) where
+      type Fff :: (a :: k -> Type) (b :: k)
+    class SCls (a :: k -> Type) where
+      sFff ::
+        forall (b :: k). Sing (FffSym0 :: (a :: k -> Type) (b :: k))
diff --git a/tests/compile-and-dump/Singletons/Records.ghc88.template b/tests/compile-and-dump/Singletons/Records.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/Records.ghc88.template
+++ /dev/null
@@ -1,73 +0,0 @@
-Singletons/Records.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| data Record a = MkRecord {field1 :: a, field2 :: Bool} |]
-  ======>
-    data Record a = MkRecord {field1 :: a, field2 :: Bool}
-    type Field2Sym1 (a0123456789876543210 :: Record a0123456789876543210) =
-        Field2 a0123456789876543210
-    instance SuppressUnusedWarnings Field2Sym0 where
-      suppressUnusedWarnings = snd (((,) Field2Sym0KindInference) ())
-    data Field2Sym0 :: forall a0123456789876543210.
-                       (~>) (Record a0123456789876543210) Bool
-      where
-        Field2Sym0KindInference :: forall a0123456789876543210
-                                          arg. SameKind (Apply Field2Sym0 arg) (Field2Sym1 arg) =>
-                                   Field2Sym0 a0123456789876543210
-    type instance Apply Field2Sym0 a0123456789876543210 = Field2 a0123456789876543210
-    type Field1Sym1 (a0123456789876543210 :: Record a0123456789876543210) =
-        Field1 a0123456789876543210
-    instance SuppressUnusedWarnings Field1Sym0 where
-      suppressUnusedWarnings = snd (((,) Field1Sym0KindInference) ())
-    data Field1Sym0 :: forall a0123456789876543210.
-                       (~>) (Record a0123456789876543210) a0123456789876543210
-      where
-        Field1Sym0KindInference :: forall a0123456789876543210
-                                          arg. SameKind (Apply Field1Sym0 arg) (Field1Sym1 arg) =>
-                                   Field1Sym0 a0123456789876543210
-    type instance Apply Field1Sym0 a0123456789876543210 = Field1 a0123456789876543210
-    type family Field2 (a :: Record a) :: Bool where
-      Field2 (MkRecord _ field) = field
-    type family Field1 (a :: Record a) :: a where
-      Field1 (MkRecord field _) = field
-    type MkRecordSym2 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: Bool) =
-        MkRecord t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (MkRecordSym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) MkRecordSym1KindInference) ())
-    data MkRecordSym1 (t0123456789876543210 :: a0123456789876543210) :: (~>) Bool (Record a0123456789876543210)
-      where
-        MkRecordSym1KindInference :: forall t0123456789876543210
-                                            t0123456789876543210
-                                            arg. SameKind (Apply (MkRecordSym1 t0123456789876543210) arg) (MkRecordSym2 t0123456789876543210 arg) =>
-                                     MkRecordSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (MkRecordSym1 t0123456789876543210) t0123456789876543210 = MkRecord t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings MkRecordSym0 where
-      suppressUnusedWarnings = snd (((,) MkRecordSym0KindInference) ())
-    data MkRecordSym0 :: forall a0123456789876543210.
-                         (~>) a0123456789876543210 ((~>) Bool (Record a0123456789876543210))
-      where
-        MkRecordSym0KindInference :: forall t0123456789876543210
-                                            arg. SameKind (Apply MkRecordSym0 arg) (MkRecordSym1 arg) =>
-                                     MkRecordSym0 t0123456789876543210
-    type instance Apply MkRecordSym0 t0123456789876543210 = MkRecordSym1 t0123456789876543210
-    data SRecord :: forall a. Record a -> GHC.Types.Type
-      where
-        SMkRecord :: forall a (n :: a) (n :: Bool).
-                     {sField1 :: (Sing (n :: a)), sField2 :: (Sing (n :: Bool))}
-                     -> SRecord (MkRecord n n)
-    type instance Sing @(Record a) = SRecord
-    instance SingKind a => SingKind (Record a) where
-      type Demote (Record a) = Record (Demote a)
-      fromSing (SMkRecord b b) = (MkRecord (fromSing b)) (fromSing b)
-      toSing (MkRecord (b :: Demote a) (b :: Demote Bool))
-        = case
-              ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing Bool)
-          of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SMkRecord c) c) }
-    instance (SingI n, SingI n) =>
-             SingI (MkRecord (n :: a) (n :: Bool)) where
-      sing = (SMkRecord sing) sing
-    instance SingI (MkRecordSym0 :: (~>) a ((~>) Bool (Record a))) where
-      sing = (singFun2 @MkRecordSym0) SMkRecord
-    instance SingI d =>
-             SingI (MkRecordSym1 (d :: a) :: (~>) Bool (Record a)) where
-      sing = (singFun1 @(MkRecordSym1 (d :: a))) (SMkRecord (sing @d))
diff --git a/tests/compile-and-dump/Singletons/Records.golden b/tests/compile-and-dump/Singletons/Records.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/Records.golden
@@ -0,0 +1,81 @@
+Singletons/Records.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| data Record a = MkRecord {field1 :: a, field2 :: Bool} |]
+  ======>
+    data Record a = MkRecord {field1 :: a, field2 :: Bool}
+    type MkRecordSym0 :: forall a. (~>) a ((~>) Bool (Record a))
+    data MkRecordSym0 a0123456789876543210
+      where
+        MkRecordSym0KindInference :: SameKind (Apply MkRecordSym0 arg) (MkRecordSym1 arg) =>
+                                     MkRecordSym0 a0123456789876543210
+    type instance Apply MkRecordSym0 a0123456789876543210 = MkRecordSym1 a0123456789876543210
+    instance SuppressUnusedWarnings MkRecordSym0 where
+      suppressUnusedWarnings = snd (((,) MkRecordSym0KindInference) ())
+    type MkRecordSym1 :: forall a. a -> (~>) Bool (Record a)
+    data MkRecordSym1 a0123456789876543210 a0123456789876543210
+      where
+        MkRecordSym1KindInference :: SameKind (Apply (MkRecordSym1 a0123456789876543210) arg) (MkRecordSym2 a0123456789876543210 arg) =>
+                                     MkRecordSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (MkRecordSym1 a0123456789876543210) a0123456789876543210 = MkRecordSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (MkRecordSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) MkRecordSym1KindInference) ())
+    type MkRecordSym2 (a0123456789876543210 :: a) (a0123456789876543210 :: Bool) =
+        MkRecord a0123456789876543210 a0123456789876543210 :: Record a
+    type Field2Sym0 :: forall a. (~>) (Record a) Bool
+    data Field2Sym0 a0123456789876543210
+      where
+        Field2Sym0KindInference :: SameKind (Apply Field2Sym0 arg) (Field2Sym1 arg) =>
+                                   Field2Sym0 a0123456789876543210
+    type instance Apply Field2Sym0 a0123456789876543210 = Field2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Field2Sym0 where
+      suppressUnusedWarnings = snd (((,) Field2Sym0KindInference) ())
+    type Field2Sym1 (a0123456789876543210 :: Record a) =
+        Field2 a0123456789876543210 :: Bool
+    type Field1Sym0 :: forall a. (~>) (Record a) a
+    data Field1Sym0 a0123456789876543210
+      where
+        Field1Sym0KindInference :: SameKind (Apply Field1Sym0 arg) (Field1Sym1 arg) =>
+                                   Field1Sym0 a0123456789876543210
+    type instance Apply Field1Sym0 a0123456789876543210 = Field1Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Field1Sym0 where
+      suppressUnusedWarnings = snd (((,) Field1Sym0KindInference) ())
+    type Field1Sym1 (a0123456789876543210 :: Record a) =
+        Field1 a0123456789876543210 :: a
+    type Field2 :: forall a. Record a -> Bool
+    type family Field2 a where
+      Field2 (MkRecord _ field) = field
+    type Field1 :: forall a. Record a -> a
+    type family Field1 a where
+      Field1 (MkRecord field _) = field
+    sField2 ::
+      forall a (t :: Record a).
+      Sing t -> Sing (Apply Field2Sym0 t :: Bool)
+    sField1 ::
+      forall a (t :: Record a). Sing t -> Sing (Apply Field1Sym0 t :: a)
+    sField2 (SMkRecord _ (sField :: Sing field)) = sField
+    sField1 (SMkRecord (sField :: Sing field) _) = sField
+    instance SingI (Field2Sym0 :: (~>) (Record a) Bool) where
+      sing = (singFun1 @Field2Sym0) sField2
+    instance SingI (Field1Sym0 :: (~>) (Record a) a) where
+      sing = (singFun1 @Field1Sym0) sField1
+    data SRecord :: forall a. Record a -> GHC.Types.Type
+      where
+        SMkRecord :: forall a (n :: a) (n :: Bool).
+                     (Sing n) -> (Sing n) -> SRecord (MkRecord n n :: Record a)
+    type instance Sing @(Record a) = SRecord
+    instance SingKind a => SingKind (Record a) where
+      type Demote (Record a) = Record (Demote a)
+      fromSing (SMkRecord b b) = (MkRecord (fromSing b)) (fromSing b)
+      toSing (MkRecord (b :: Demote a) (b :: Demote Bool))
+        = case
+              ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing Bool)
+          of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SMkRecord c) c) }
+    instance (SingI n, SingI n) =>
+             SingI (MkRecord (n :: a) (n :: Bool)) where
+      sing = (SMkRecord sing) sing
+    instance SingI (MkRecordSym0 :: (~>) a ((~>) Bool (Record a))) where
+      sing = (singFun2 @MkRecordSym0) SMkRecord
+    instance SingI d =>
+             SingI (MkRecordSym1 (d :: a) :: (~>) Bool (Record a)) where
+      sing = (singFun1 @(MkRecordSym1 (d :: a))) (SMkRecord (sing @d))
diff --git a/tests/compile-and-dump/Singletons/ReturnFunc.ghc88.template b/tests/compile-and-dump/Singletons/ReturnFunc.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/ReturnFunc.ghc88.template
+++ /dev/null
@@ -1,98 +0,0 @@
-Singletons/ReturnFunc.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| returnFunc :: Nat -> Nat -> Nat
-          returnFunc _ = Succ
-          id :: a -> a
-          id x = x
-          idFoo :: c -> a -> a
-          idFoo _ = id |]
-  ======>
-    returnFunc :: Nat -> Nat -> Nat
-    returnFunc _ = Succ
-    id :: a -> a
-    id x = x
-    idFoo :: c -> a -> a
-    idFoo _ = id
-    type IdFooSym2 (a0123456789876543210 :: c0123456789876543210) (a0123456789876543210 :: a0123456789876543210) =
-        IdFoo a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (IdFooSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) IdFooSym1KindInference) ())
-    data IdFooSym1 (a0123456789876543210 :: c0123456789876543210) :: forall a0123456789876543210.
-                                                                     (~>) a0123456789876543210 a0123456789876543210
-      where
-        IdFooSym1KindInference :: forall a0123456789876543210
-                                         a0123456789876543210
-                                         arg. SameKind (Apply (IdFooSym1 a0123456789876543210) arg) (IdFooSym2 a0123456789876543210 arg) =>
-                                  IdFooSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (IdFooSym1 a0123456789876543210) a0123456789876543210 = IdFoo a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings IdFooSym0 where
-      suppressUnusedWarnings = snd (((,) IdFooSym0KindInference) ())
-    data IdFooSym0 :: forall c0123456789876543210 a0123456789876543210.
-                      (~>) c0123456789876543210 ((~>) a0123456789876543210 a0123456789876543210)
-      where
-        IdFooSym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply IdFooSym0 arg) (IdFooSym1 arg) =>
-                                  IdFooSym0 a0123456789876543210
-    type instance Apply IdFooSym0 a0123456789876543210 = IdFooSym1 a0123456789876543210
-    type IdSym1 (a0123456789876543210 :: a0123456789876543210) =
-        Id a0123456789876543210
-    instance SuppressUnusedWarnings IdSym0 where
-      suppressUnusedWarnings = snd (((,) IdSym0KindInference) ())
-    data IdSym0 :: forall a0123456789876543210.
-                   (~>) a0123456789876543210 a0123456789876543210
-      where
-        IdSym0KindInference :: forall a0123456789876543210
-                                      arg. SameKind (Apply IdSym0 arg) (IdSym1 arg) =>
-                               IdSym0 a0123456789876543210
-    type instance Apply IdSym0 a0123456789876543210 = Id a0123456789876543210
-    type ReturnFuncSym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
-        ReturnFunc a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ReturnFuncSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) ReturnFuncSym1KindInference) ())
-    data ReturnFuncSym1 (a0123456789876543210 :: Nat) :: (~>) Nat Nat
-      where
-        ReturnFuncSym1KindInference :: forall a0123456789876543210
-                                              a0123456789876543210
-                                              arg. SameKind (Apply (ReturnFuncSym1 a0123456789876543210) arg) (ReturnFuncSym2 a0123456789876543210 arg) =>
-                                       ReturnFuncSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ReturnFuncSym1 a0123456789876543210) a0123456789876543210 = ReturnFunc a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ReturnFuncSym0 where
-      suppressUnusedWarnings = snd (((,) ReturnFuncSym0KindInference) ())
-    data ReturnFuncSym0 :: (~>) Nat ((~>) Nat Nat)
-      where
-        ReturnFuncSym0KindInference :: forall a0123456789876543210
-                                              arg. SameKind (Apply ReturnFuncSym0 arg) (ReturnFuncSym1 arg) =>
-                                       ReturnFuncSym0 a0123456789876543210
-    type instance Apply ReturnFuncSym0 a0123456789876543210 = ReturnFuncSym1 a0123456789876543210
-    type family IdFoo (a :: c) (a :: a) :: a where
-      IdFoo _ a_0123456789876543210 = Apply IdSym0 a_0123456789876543210
-    type family Id (a :: a) :: a where
-      Id x = x
-    type family ReturnFunc (a :: Nat) (a :: Nat) :: Nat where
-      ReturnFunc _ a_0123456789876543210 = Apply SuccSym0 a_0123456789876543210
-    sIdFoo ::
-      forall c a (t :: c) (t :: a).
-      Sing t -> Sing t -> Sing (Apply (Apply IdFooSym0 t) t :: a)
-    sId :: forall a (t :: a). Sing t -> Sing (Apply IdSym0 t :: a)
-    sReturnFunc ::
-      forall (t :: Nat) (t :: Nat).
-      Sing t -> Sing t -> Sing (Apply (Apply ReturnFuncSym0 t) t :: Nat)
-    sIdFoo _ (sA_0123456789876543210 :: Sing a_0123456789876543210)
-      = (applySing ((singFun1 @IdSym0) sId)) sA_0123456789876543210
-    sId (sX :: Sing x) = sX
-    sReturnFunc
-      _
-      (sA_0123456789876543210 :: Sing a_0123456789876543210)
-      = (applySing ((singFun1 @SuccSym0) SSucc)) sA_0123456789876543210
-    instance SingI (IdFooSym0 :: (~>) c ((~>) a a)) where
-      sing = (singFun2 @IdFooSym0) sIdFoo
-    instance SingI d => SingI (IdFooSym1 (d :: c) :: (~>) a a) where
-      sing = (singFun1 @(IdFooSym1 (d :: c))) (sIdFoo (sing @d))
-    instance SingI (IdSym0 :: (~>) a a) where
-      sing = (singFun1 @IdSym0) sId
-    instance SingI (ReturnFuncSym0 :: (~>) Nat ((~>) Nat Nat)) where
-      sing = (singFun2 @ReturnFuncSym0) sReturnFunc
-    instance SingI d =>
-             SingI (ReturnFuncSym1 (d :: Nat) :: (~>) Nat Nat) where
-      sing
-        = (singFun1 @(ReturnFuncSym1 (d :: Nat))) (sReturnFunc (sing @d))
diff --git a/tests/compile-and-dump/Singletons/ReturnFunc.golden b/tests/compile-and-dump/Singletons/ReturnFunc.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/ReturnFunc.golden
@@ -0,0 +1,96 @@
+Singletons/ReturnFunc.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| returnFunc :: Nat -> Nat -> Nat
+          returnFunc _ = Succ
+          id :: a -> a
+          id x = x
+          idFoo :: c -> a -> a
+          idFoo _ = id |]
+  ======>
+    returnFunc :: Nat -> Nat -> Nat
+    returnFunc _ = Succ
+    id :: a -> a
+    id x = x
+    idFoo :: c -> a -> a
+    idFoo _ = id
+    type IdFooSym0 :: (~>) c ((~>) a a)
+    data IdFooSym0 a0123456789876543210
+      where
+        IdFooSym0KindInference :: SameKind (Apply IdFooSym0 arg) (IdFooSym1 arg) =>
+                                  IdFooSym0 a0123456789876543210
+    type instance Apply IdFooSym0 a0123456789876543210 = IdFooSym1 a0123456789876543210
+    instance SuppressUnusedWarnings IdFooSym0 where
+      suppressUnusedWarnings = snd (((,) IdFooSym0KindInference) ())
+    type IdFooSym1 :: c -> (~>) a a
+    data IdFooSym1 a0123456789876543210 a0123456789876543210
+      where
+        IdFooSym1KindInference :: SameKind (Apply (IdFooSym1 a0123456789876543210) arg) (IdFooSym2 a0123456789876543210 arg) =>
+                                  IdFooSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (IdFooSym1 a0123456789876543210) a0123456789876543210 = IdFooSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (IdFooSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) IdFooSym1KindInference) ())
+    type IdFooSym2 (a0123456789876543210 :: c) (a0123456789876543210 :: a) =
+        IdFoo a0123456789876543210 a0123456789876543210 :: a
+    type IdSym0 :: (~>) a a
+    data IdSym0 a0123456789876543210
+      where
+        IdSym0KindInference :: SameKind (Apply IdSym0 arg) (IdSym1 arg) =>
+                               IdSym0 a0123456789876543210
+    type instance Apply IdSym0 a0123456789876543210 = IdSym1 a0123456789876543210
+    instance SuppressUnusedWarnings IdSym0 where
+      suppressUnusedWarnings = snd (((,) IdSym0KindInference) ())
+    type IdSym1 (a0123456789876543210 :: a) =
+        Id a0123456789876543210 :: a
+    type ReturnFuncSym0 :: (~>) Nat ((~>) Nat Nat)
+    data ReturnFuncSym0 a0123456789876543210
+      where
+        ReturnFuncSym0KindInference :: SameKind (Apply ReturnFuncSym0 arg) (ReturnFuncSym1 arg) =>
+                                       ReturnFuncSym0 a0123456789876543210
+    type instance Apply ReturnFuncSym0 a0123456789876543210 = ReturnFuncSym1 a0123456789876543210
+    instance SuppressUnusedWarnings ReturnFuncSym0 where
+      suppressUnusedWarnings = snd (((,) ReturnFuncSym0KindInference) ())
+    type ReturnFuncSym1 :: Nat -> (~>) Nat Nat
+    data ReturnFuncSym1 a0123456789876543210 a0123456789876543210
+      where
+        ReturnFuncSym1KindInference :: SameKind (Apply (ReturnFuncSym1 a0123456789876543210) arg) (ReturnFuncSym2 a0123456789876543210 arg) =>
+                                       ReturnFuncSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ReturnFuncSym1 a0123456789876543210) a0123456789876543210 = ReturnFuncSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ReturnFuncSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) ReturnFuncSym1KindInference) ())
+    type ReturnFuncSym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
+        ReturnFunc a0123456789876543210 a0123456789876543210 :: Nat
+    type IdFoo :: c -> a -> a
+    type family IdFoo a a where
+      IdFoo _ a_0123456789876543210 = Apply IdSym0 a_0123456789876543210
+    type Id :: a -> a
+    type family Id a where
+      Id x = x
+    type ReturnFunc :: Nat -> Nat -> Nat
+    type family ReturnFunc a a where
+      ReturnFunc _ a_0123456789876543210 = Apply SuccSym0 a_0123456789876543210
+    sIdFoo ::
+      forall c a (t :: c) (t :: a).
+      Sing t -> Sing t -> Sing (Apply (Apply IdFooSym0 t) t :: a)
+    sId :: forall a (t :: a). Sing t -> Sing (Apply IdSym0 t :: a)
+    sReturnFunc ::
+      forall (t :: Nat) (t :: Nat).
+      Sing t -> Sing t -> Sing (Apply (Apply ReturnFuncSym0 t) t :: Nat)
+    sIdFoo _ (sA_0123456789876543210 :: Sing a_0123456789876543210)
+      = (applySing ((singFun1 @IdSym0) sId)) sA_0123456789876543210
+    sId (sX :: Sing x) = sX
+    sReturnFunc
+      _
+      (sA_0123456789876543210 :: Sing a_0123456789876543210)
+      = (applySing ((singFun1 @SuccSym0) SSucc)) sA_0123456789876543210
+    instance SingI (IdFooSym0 :: (~>) c ((~>) a a)) where
+      sing = (singFun2 @IdFooSym0) sIdFoo
+    instance SingI d => SingI (IdFooSym1 (d :: c) :: (~>) a a) where
+      sing = (singFun1 @(IdFooSym1 (d :: c))) (sIdFoo (sing @d))
+    instance SingI (IdSym0 :: (~>) a a) where
+      sing = (singFun1 @IdSym0) sId
+    instance SingI (ReturnFuncSym0 :: (~>) Nat ((~>) Nat Nat)) where
+      sing = (singFun2 @ReturnFuncSym0) sReturnFunc
+    instance SingI d =>
+             SingI (ReturnFuncSym1 (d :: Nat) :: (~>) Nat Nat) where
+      sing
+        = (singFun1 @(ReturnFuncSym1 (d :: Nat))) (sReturnFunc (sing @d))
diff --git a/tests/compile-and-dump/Singletons/Sections.ghc88.template b/tests/compile-and-dump/Singletons/Sections.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/Sections.ghc88.template
+++ /dev/null
@@ -1,122 +0,0 @@
-Singletons/Sections.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| (+) :: Nat -> Nat -> Nat
-          Zero + m = m
-          (Succ n) + m = Succ (n + m)
-          foo1 :: [Nat]
-          foo1 = map ((Succ Zero) +) [Zero, Succ Zero]
-          foo2 :: [Nat]
-          foo2 = map (+ (Succ Zero)) [Zero, Succ Zero]
-          foo3 :: [Nat]
-          foo3 = zipWith (+) [Succ Zero, Succ Zero] [Zero, Succ Zero] |]
-  ======>
-    (+) :: Nat -> Nat -> Nat
-    (+) Zero m = m
-    (+) (Succ n) m = Succ (n + m)
-    foo1 :: [Nat]
-    foo1 = (map (Succ Zero +)) [Zero, Succ Zero]
-    foo2 :: [Nat]
-    foo2 = (map (+ Succ Zero)) [Zero, Succ Zero]
-    foo3 :: [Nat]
-    foo3 = ((zipWith (+)) [Succ Zero, Succ Zero]) [Zero, Succ Zero]
-    type family Lambda_0123456789876543210 t where
-      Lambda_0123456789876543210 lhs_0123456789876543210 = Apply (Apply (+@#@$) lhs_0123456789876543210) (Apply SuccSym0 ZeroSym0)
-    type Lambda_0123456789876543210Sym1 t0123456789876543210 =
-        Lambda_0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall t0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 t0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 t0123456789876543210 = Lambda_0123456789876543210 t0123456789876543210
-    type Foo3Sym0 = Foo3
-    type Foo2Sym0 = Foo2
-    type Foo1Sym0 = Foo1
-    type (+@#@$$$) (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
-        (+) a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ((+@#@$$) a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (:+@#@$$###)) ())
-    data (+@#@$$) (a0123456789876543210 :: Nat) :: (~>) Nat Nat
-      where
-        (:+@#@$$###) :: forall a0123456789876543210
-                               a0123456789876543210
-                               arg. SameKind (Apply ((+@#@$$) a0123456789876543210) arg) ((+@#@$$$) a0123456789876543210 arg) =>
-                        (+@#@$$) a0123456789876543210 a0123456789876543210
-    type instance Apply ((+@#@$$) a0123456789876543210) a0123456789876543210 = (+) a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (+@#@$) where
-      suppressUnusedWarnings = snd (((,) (:+@#@$###)) ())
-    data (+@#@$) :: (~>) Nat ((~>) Nat Nat)
-      where
-        (:+@#@$###) :: forall a0123456789876543210
-                              arg. SameKind (Apply (+@#@$) arg) ((+@#@$$) arg) =>
-                       (+@#@$) a0123456789876543210
-    type instance Apply (+@#@$) a0123456789876543210 = (+@#@$$) a0123456789876543210
-    type family Foo3 :: [Nat] where
-      Foo3 = Apply (Apply (Apply ZipWithSym0 (+@#@$)) (Apply (Apply (:@#@$) (Apply SuccSym0 ZeroSym0)) (Apply (Apply (:@#@$) (Apply SuccSym0 ZeroSym0)) '[]))) (Apply (Apply (:@#@$) ZeroSym0) (Apply (Apply (:@#@$) (Apply SuccSym0 ZeroSym0)) '[]))
-    type family Foo2 :: [Nat] where
-      Foo2 = Apply (Apply MapSym0 Lambda_0123456789876543210Sym0) (Apply (Apply (:@#@$) ZeroSym0) (Apply (Apply (:@#@$) (Apply SuccSym0 ZeroSym0)) '[]))
-    type family Foo1 :: [Nat] where
-      Foo1 = Apply (Apply MapSym0 (Apply (+@#@$) (Apply SuccSym0 ZeroSym0))) (Apply (Apply (:@#@$) ZeroSym0) (Apply (Apply (:@#@$) (Apply SuccSym0 ZeroSym0)) '[]))
-    type family (+) (a :: Nat) (a :: Nat) :: Nat where
-      (+) 'Zero m = m
-      (+) ('Succ n) m = Apply SuccSym0 (Apply (Apply (+@#@$) n) m)
-    sFoo3 :: Sing (Foo3Sym0 :: [Nat])
-    sFoo2 :: Sing (Foo2Sym0 :: [Nat])
-    sFoo1 :: Sing (Foo1Sym0 :: [Nat])
-    (%+) ::
-      forall (t :: Nat) (t :: Nat).
-      Sing t -> Sing t -> Sing (Apply (Apply (+@#@$) t) t :: Nat)
-    sFoo3
-      = (applySing
-           ((applySing
-               ((applySing ((singFun3 @ZipWithSym0) sZipWith))
-                  ((singFun2 @(+@#@$)) (%+))))
-              ((applySing
-                  ((applySing ((singFun2 @(:@#@$)) SCons))
-                     ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
-                 ((applySing
-                     ((applySing ((singFun2 @(:@#@$)) SCons))
-                        ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
-                    SNil))))
-          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SZero))
-             ((applySing
-                 ((applySing ((singFun2 @(:@#@$)) SCons))
-                    ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
-                SNil))
-    sFoo2
-      = (applySing
-           ((applySing ((singFun2 @MapSym0) sMap))
-              ((singFun1 @Lambda_0123456789876543210Sym0)
-                 (\ sLhs_0123456789876543210
-                    -> case sLhs_0123456789876543210 of {
-                         (_ :: Sing lhs_0123456789876543210)
-                           -> (applySing
-                                 ((applySing ((singFun2 @(+@#@$)) (%+))) sLhs_0123456789876543210))
-                                ((applySing ((singFun1 @SuccSym0) SSucc)) SZero) }))))
-          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SZero))
-             ((applySing
-                 ((applySing ((singFun2 @(:@#@$)) SCons))
-                    ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
-                SNil))
-    sFoo1
-      = (applySing
-           ((applySing ((singFun2 @MapSym0) sMap))
-              ((applySing ((singFun2 @(+@#@$)) (%+)))
-                 ((applySing ((singFun1 @SuccSym0) SSucc)) SZero))))
-          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SZero))
-             ((applySing
-                 ((applySing ((singFun2 @(:@#@$)) SCons))
-                    ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
-                SNil))
-    (%+) SZero (sM :: Sing m) = sM
-    (%+) (SSucc (sN :: Sing n)) (sM :: Sing m)
-      = (applySing ((singFun1 @SuccSym0) SSucc))
-          ((applySing ((applySing ((singFun2 @(+@#@$)) (%+))) sN)) sM)
-    instance SingI ((+@#@$) :: (~>) Nat ((~>) Nat Nat)) where
-      sing = (singFun2 @(+@#@$)) (%+)
-    instance SingI d =>
-             SingI ((+@#@$$) (d :: Nat) :: (~>) Nat Nat) where
-      sing = (singFun1 @((+@#@$$) (d :: Nat))) ((%+) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/Sections.golden b/tests/compile-and-dump/Singletons/Sections.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/Sections.golden
@@ -0,0 +1,124 @@
+Singletons/Sections.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| (+) :: Nat -> Nat -> Nat
+          Zero + m = m
+          (Succ n) + m = Succ (n + m)
+          foo1 :: [Nat]
+          foo1 = map ((Succ Zero) +) [Zero, Succ Zero]
+          foo2 :: [Nat]
+          foo2 = map (+ (Succ Zero)) [Zero, Succ Zero]
+          foo3 :: [Nat]
+          foo3 = zipWith (+) [Succ Zero, Succ Zero] [Zero, Succ Zero] |]
+  ======>
+    (+) :: Nat -> Nat -> Nat
+    (+) Zero m = m
+    (+) (Succ n) m = Succ (n + m)
+    foo1 :: [Nat]
+    foo1 = (map (Succ Zero +)) [Zero, Succ Zero]
+    foo2 :: [Nat]
+    foo2 = (map (+ Succ Zero)) [Zero, Succ Zero]
+    foo3 :: [Nat]
+    foo3 = ((zipWith (+)) [Succ Zero, Succ Zero]) [Zero, Succ Zero]
+    type family Lambda_0123456789876543210 lhs_0123456789876543210 where
+      Lambda_0123456789876543210 lhs_0123456789876543210 = Apply (Apply (+@#@$) lhs_0123456789876543210) (Apply SuccSym0 ZeroSym0)
+    data Lambda_0123456789876543210Sym0 lhs_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 lhs_01234567898765432100123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 lhs_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 lhs_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    type Lambda_0123456789876543210Sym1 lhs_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 lhs_01234567898765432100123456789876543210
+    type Foo3Sym0 = Foo3 :: [Nat]
+    type Foo2Sym0 = Foo2 :: [Nat]
+    type Foo1Sym0 = Foo1 :: [Nat]
+    type (+@#@$) :: (~>) Nat ((~>) Nat Nat)
+    data (+@#@$) a0123456789876543210
+      where
+        (:+@#@$###) :: SameKind (Apply (+@#@$) arg) ((+@#@$$) arg) =>
+                       (+@#@$) a0123456789876543210
+    type instance Apply (+@#@$) a0123456789876543210 = (+@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (+@#@$) where
+      suppressUnusedWarnings = snd (((,) (:+@#@$###)) ())
+    type (+@#@$$) :: Nat -> (~>) Nat Nat
+    data (+@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (:+@#@$$###) :: SameKind (Apply ((+@#@$$) a0123456789876543210) arg) ((+@#@$$$) a0123456789876543210 arg) =>
+                        (+@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((+@#@$$) a0123456789876543210) a0123456789876543210 = (+@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((+@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (:+@#@$$###)) ())
+    type (+@#@$$$) (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
+        (+) a0123456789876543210 a0123456789876543210 :: Nat
+    type Foo3 :: [Nat]
+    type family Foo3 where
+      Foo3 = Apply (Apply (Apply ZipWithSym0 (+@#@$)) (Apply (Apply (:@#@$) (Apply SuccSym0 ZeroSym0)) (Apply (Apply (:@#@$) (Apply SuccSym0 ZeroSym0)) NilSym0))) (Apply (Apply (:@#@$) ZeroSym0) (Apply (Apply (:@#@$) (Apply SuccSym0 ZeroSym0)) NilSym0))
+    type Foo2 :: [Nat]
+    type family Foo2 where
+      Foo2 = Apply (Apply MapSym0 Lambda_0123456789876543210Sym0) (Apply (Apply (:@#@$) ZeroSym0) (Apply (Apply (:@#@$) (Apply SuccSym0 ZeroSym0)) NilSym0))
+    type Foo1 :: [Nat]
+    type family Foo1 where
+      Foo1 = Apply (Apply MapSym0 (Apply (+@#@$) (Apply SuccSym0 ZeroSym0))) (Apply (Apply (:@#@$) ZeroSym0) (Apply (Apply (:@#@$) (Apply SuccSym0 ZeroSym0)) NilSym0))
+    type (+) :: Nat -> Nat -> Nat
+    type family (+) a a where
+      (+) 'Zero m = m
+      (+) ('Succ n) m = Apply SuccSym0 (Apply (Apply (+@#@$) n) m)
+    sFoo3 :: Sing (Foo3Sym0 :: [Nat])
+    sFoo2 :: Sing (Foo2Sym0 :: [Nat])
+    sFoo1 :: Sing (Foo1Sym0 :: [Nat])
+    (%+) ::
+      forall (t :: Nat) (t :: Nat).
+      Sing t -> Sing t -> Sing (Apply (Apply (+@#@$) t) t :: Nat)
+    sFoo3
+      = (applySing
+           ((applySing
+               ((applySing ((singFun3 @ZipWithSym0) sZipWith))
+                  ((singFun2 @(+@#@$)) (%+))))
+              ((applySing
+                  ((applySing ((singFun2 @(:@#@$)) SCons))
+                     ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
+                 ((applySing
+                     ((applySing ((singFun2 @(:@#@$)) SCons))
+                        ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
+                    SNil))))
+          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SZero))
+             ((applySing
+                 ((applySing ((singFun2 @(:@#@$)) SCons))
+                    ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
+                SNil))
+    sFoo2
+      = (applySing
+           ((applySing ((singFun2 @MapSym0) sMap))
+              ((singFun1 @Lambda_0123456789876543210Sym0)
+                 (\ sLhs_0123456789876543210
+                    -> case sLhs_0123456789876543210 of {
+                         (_ :: Sing lhs_0123456789876543210)
+                           -> (applySing
+                                 ((applySing ((singFun2 @(+@#@$)) (%+))) sLhs_0123456789876543210))
+                                ((applySing ((singFun1 @SuccSym0) SSucc)) SZero) }))))
+          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SZero))
+             ((applySing
+                 ((applySing ((singFun2 @(:@#@$)) SCons))
+                    ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
+                SNil))
+    sFoo1
+      = (applySing
+           ((applySing ((singFun2 @MapSym0) sMap))
+              ((applySing ((singFun2 @(+@#@$)) (%+)))
+                 ((applySing ((singFun1 @SuccSym0) SSucc)) SZero))))
+          ((applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SZero))
+             ((applySing
+                 ((applySing ((singFun2 @(:@#@$)) SCons))
+                    ((applySing ((singFun1 @SuccSym0) SSucc)) SZero)))
+                SNil))
+    (%+) SZero (sM :: Sing m) = sM
+    (%+) (SSucc (sN :: Sing n)) (sM :: Sing m)
+      = (applySing ((singFun1 @SuccSym0) SSucc))
+          ((applySing ((applySing ((singFun2 @(+@#@$)) (%+))) sN)) sM)
+    instance SingI ((+@#@$) :: (~>) Nat ((~>) Nat Nat)) where
+      sing = (singFun2 @(+@#@$)) (%+)
+    instance SingI d =>
+             SingI ((+@#@$$) (d :: Nat) :: (~>) Nat Nat) where
+      sing = (singFun1 @((+@#@$$) (d :: Nat))) ((%+) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/ShowDeriving.ghc88.template b/tests/compile-and-dump/Singletons/ShowDeriving.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/ShowDeriving.ghc88.template
+++ /dev/null
@@ -1,618 +0,0 @@
-Singletons/ShowDeriving.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| infixl 5 `MkFoo2b`, :*:, :&:
-          
-          data Foo1
-            = MkFoo1
-            deriving Show
-          data Foo2 a
-            = MkFoo2a a a | a `MkFoo2b` a | (:*:) a a | a :&: a
-            deriving Show
-          data Foo3
-            = MkFoo3 {getFoo3a :: Bool, *** :: Bool}
-            deriving Show |]
-  ======>
-    data Foo1
-      = MkFoo1
-      deriving Show
-    infixl 5 `MkFoo2b`
-    infixl 5 :*:
-    infixl 5 :&:
-    data Foo2 a
-      = MkFoo2a a a | a `MkFoo2b` a | (:*:) a a | a :&: a
-      deriving Show
-    data Foo3
-      = MkFoo3 {getFoo3a :: Bool, *** :: Bool}
-      deriving Show
-    type (***@#@$$) (a0123456789876543210 :: Foo3) =
-        (***) a0123456789876543210
-    instance SuppressUnusedWarnings (***@#@$) where
-      suppressUnusedWarnings = snd (((,) (:***@#@$###)) ())
-    data (***@#@$) :: (~>) Foo3 Bool
-      where
-        (:***@#@$###) :: forall a0123456789876543210
-                                arg. SameKind (Apply (***@#@$) arg) ((***@#@$$) arg) =>
-                         (***@#@$) a0123456789876543210
-    type instance Apply (***@#@$) a0123456789876543210 = (***) a0123456789876543210
-    type GetFoo3aSym1 (a0123456789876543210 :: Foo3) =
-        GetFoo3a a0123456789876543210
-    instance SuppressUnusedWarnings GetFoo3aSym0 where
-      suppressUnusedWarnings = snd (((,) GetFoo3aSym0KindInference) ())
-    data GetFoo3aSym0 :: (~>) Foo3 Bool
-      where
-        GetFoo3aSym0KindInference :: forall a0123456789876543210
-                                            arg. SameKind (Apply GetFoo3aSym0 arg) (GetFoo3aSym1 arg) =>
-                                     GetFoo3aSym0 a0123456789876543210
-    type instance Apply GetFoo3aSym0 a0123456789876543210 = GetFoo3a a0123456789876543210
-    type family (***) (a :: Foo3) :: Bool where
-      (***) (MkFoo3 _ field) = field
-    type family GetFoo3a (a :: Foo3) :: Bool where
-      GetFoo3a (MkFoo3 field _) = field
-    type MkFoo1Sym0 = MkFoo1
-    type MkFoo2aSym2 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: a0123456789876543210) =
-        MkFoo2a t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (MkFoo2aSym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) MkFoo2aSym1KindInference) ())
-    data MkFoo2aSym1 (t0123456789876543210 :: a0123456789876543210) :: (~>) a0123456789876543210 (Foo2 a0123456789876543210)
-      where
-        MkFoo2aSym1KindInference :: forall t0123456789876543210
-                                           t0123456789876543210
-                                           arg. SameKind (Apply (MkFoo2aSym1 t0123456789876543210) arg) (MkFoo2aSym2 t0123456789876543210 arg) =>
-                                    MkFoo2aSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (MkFoo2aSym1 t0123456789876543210) t0123456789876543210 = MkFoo2a t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings MkFoo2aSym0 where
-      suppressUnusedWarnings = snd (((,) MkFoo2aSym0KindInference) ())
-    data MkFoo2aSym0 :: forall a0123456789876543210.
-                        (~>) a0123456789876543210 ((~>) a0123456789876543210 (Foo2 a0123456789876543210))
-      where
-        MkFoo2aSym0KindInference :: forall t0123456789876543210
-                                           arg. SameKind (Apply MkFoo2aSym0 arg) (MkFoo2aSym1 arg) =>
-                                    MkFoo2aSym0 t0123456789876543210
-    type instance Apply MkFoo2aSym0 t0123456789876543210 = MkFoo2aSym1 t0123456789876543210
-    type MkFoo2bSym2 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: a0123456789876543210) =
-        MkFoo2b t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (MkFoo2bSym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) MkFoo2bSym1KindInference) ())
-    data MkFoo2bSym1 (t0123456789876543210 :: a0123456789876543210) :: (~>) a0123456789876543210 (Foo2 a0123456789876543210)
-      where
-        MkFoo2bSym1KindInference :: forall t0123456789876543210
-                                           t0123456789876543210
-                                           arg. SameKind (Apply (MkFoo2bSym1 t0123456789876543210) arg) (MkFoo2bSym2 t0123456789876543210 arg) =>
-                                    MkFoo2bSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (MkFoo2bSym1 t0123456789876543210) t0123456789876543210 = MkFoo2b t0123456789876543210 t0123456789876543210
-    infixl 5 `MkFoo2bSym1`
-    instance SuppressUnusedWarnings MkFoo2bSym0 where
-      suppressUnusedWarnings = snd (((,) MkFoo2bSym0KindInference) ())
-    data MkFoo2bSym0 :: forall a0123456789876543210.
-                        (~>) a0123456789876543210 ((~>) a0123456789876543210 (Foo2 a0123456789876543210))
-      where
-        MkFoo2bSym0KindInference :: forall t0123456789876543210
-                                           arg. SameKind (Apply MkFoo2bSym0 arg) (MkFoo2bSym1 arg) =>
-                                    MkFoo2bSym0 t0123456789876543210
-    type instance Apply MkFoo2bSym0 t0123456789876543210 = MkFoo2bSym1 t0123456789876543210
-    infixl 5 `MkFoo2bSym0`
-    type (:*:@#@$$$) (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: a0123456789876543210) =
-        (:*:) t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings ((:*:@#@$$) t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (::*:@#@$$###)) ())
-    data (:*:@#@$$) (t0123456789876543210 :: a0123456789876543210) :: (~>) a0123456789876543210 (Foo2 a0123456789876543210)
-      where
-        (::*:@#@$$###) :: forall t0123456789876543210
-                                 t0123456789876543210
-                                 arg. SameKind (Apply ((:*:@#@$$) t0123456789876543210) arg) ((:*:@#@$$$) t0123456789876543210 arg) =>
-                          (:*:@#@$$) t0123456789876543210 t0123456789876543210
-    type instance Apply ((:*:@#@$$) t0123456789876543210) t0123456789876543210 = (:*:) t0123456789876543210 t0123456789876543210
-    infixl 5 :*:@#@$$
-    instance SuppressUnusedWarnings (:*:@#@$) where
-      suppressUnusedWarnings = snd (((,) (::*:@#@$###)) ())
-    data (:*:@#@$) :: forall a0123456789876543210.
-                      (~>) a0123456789876543210 ((~>) a0123456789876543210 (Foo2 a0123456789876543210))
-      where
-        (::*:@#@$###) :: forall t0123456789876543210
-                                arg. SameKind (Apply (:*:@#@$) arg) ((:*:@#@$$) arg) =>
-                         (:*:@#@$) t0123456789876543210
-    type instance Apply (:*:@#@$) t0123456789876543210 = (:*:@#@$$) t0123456789876543210
-    infixl 5 :*:@#@$
-    type (:&:@#@$$$) (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: a0123456789876543210) =
-        (:&:) t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings ((:&:@#@$$) t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (::&:@#@$$###)) ())
-    data (:&:@#@$$) (t0123456789876543210 :: a0123456789876543210) :: (~>) a0123456789876543210 (Foo2 a0123456789876543210)
-      where
-        (::&:@#@$$###) :: forall t0123456789876543210
-                                 t0123456789876543210
-                                 arg. SameKind (Apply ((:&:@#@$$) t0123456789876543210) arg) ((:&:@#@$$$) t0123456789876543210 arg) =>
-                          (:&:@#@$$) t0123456789876543210 t0123456789876543210
-    type instance Apply ((:&:@#@$$) t0123456789876543210) t0123456789876543210 = (:&:) t0123456789876543210 t0123456789876543210
-    infixl 5 :&:@#@$$
-    instance SuppressUnusedWarnings (:&:@#@$) where
-      suppressUnusedWarnings = snd (((,) (::&:@#@$###)) ())
-    data (:&:@#@$) :: forall a0123456789876543210.
-                      (~>) a0123456789876543210 ((~>) a0123456789876543210 (Foo2 a0123456789876543210))
-      where
-        (::&:@#@$###) :: forall t0123456789876543210
-                                arg. SameKind (Apply (:&:@#@$) arg) ((:&:@#@$$) arg) =>
-                         (:&:@#@$) t0123456789876543210
-    type instance Apply (:&:@#@$) t0123456789876543210 = (:&:@#@$$) t0123456789876543210
-    infixl 5 :&:@#@$
-    type MkFoo3Sym2 (t0123456789876543210 :: Bool) (t0123456789876543210 :: Bool) =
-        MkFoo3 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (MkFoo3Sym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) MkFoo3Sym1KindInference) ())
-    data MkFoo3Sym1 (t0123456789876543210 :: Bool) :: (~>) Bool Foo3
-      where
-        MkFoo3Sym1KindInference :: forall t0123456789876543210
-                                          t0123456789876543210
-                                          arg. SameKind (Apply (MkFoo3Sym1 t0123456789876543210) arg) (MkFoo3Sym2 t0123456789876543210 arg) =>
-                                   MkFoo3Sym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (MkFoo3Sym1 t0123456789876543210) t0123456789876543210 = MkFoo3 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings MkFoo3Sym0 where
-      suppressUnusedWarnings = snd (((,) MkFoo3Sym0KindInference) ())
-    data MkFoo3Sym0 :: (~>) Bool ((~>) Bool Foo3)
-      where
-        MkFoo3Sym0KindInference :: forall t0123456789876543210
-                                          arg. SameKind (Apply MkFoo3Sym0 arg) (MkFoo3Sym1 arg) =>
-                                   MkFoo3Sym0 t0123456789876543210
-    type instance Apply MkFoo3Sym0 t0123456789876543210 = MkFoo3Sym1 t0123456789876543210
-    type family ShowsPrec_0123456789876543210 (a :: GHC.Types.Nat) (a :: Foo1) (a :: Symbol) :: Symbol where
-      ShowsPrec_0123456789876543210 _ MkFoo1 a_0123456789876543210 = Apply (Apply ShowStringSym0 "MkFoo1") a_0123456789876543210
-    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Foo1) (a0123456789876543210 :: Symbol) =
-        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
-    data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Foo1) :: (~>) Symbol Symbol
-      where
-        ShowsPrec_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
-    data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) :: (~>) Foo1 ((~>) Symbol Symbol)
-      where
-        ShowsPrec_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
-    data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) Foo1 ((~>) Symbol Symbol))
-      where
-        ShowsPrec_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
-    instance PShow Foo1 where
-      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
-    type family ShowsPrec_0123456789876543210 (a :: GHC.Types.Nat) (a :: Foo2 a) (a :: Symbol) :: Symbol where
-      ShowsPrec_0123456789876543210 p_0123456789876543210 (MkFoo2a arg_0123456789876543210 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "MkFoo2a ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowSpaceSym0) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))))) a_0123456789876543210
-      ShowsPrec_0123456789876543210 p_0123456789876543210 (MkFoo2b argL_0123456789876543210 argR_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 5))) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 6)) argL_0123456789876543210)) (Apply (Apply (.@#@$) (Apply ShowStringSym0 " `MkFoo2b` ")) (Apply (Apply ShowsPrecSym0 (FromInteger 6)) argR_0123456789876543210)))) a_0123456789876543210
-      ShowsPrec_0123456789876543210 p_0123456789876543210 ((:*:) arg_0123456789876543210 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "(:*:) ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowSpaceSym0) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))))) a_0123456789876543210
-      ShowsPrec_0123456789876543210 p_0123456789876543210 ((:&:) argL_0123456789876543210 argR_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 5))) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 6)) argL_0123456789876543210)) (Apply (Apply (.@#@$) (Apply ShowStringSym0 " :&: ")) (Apply (Apply ShowsPrecSym0 (FromInteger 6)) argR_0123456789876543210)))) a_0123456789876543210
-    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Foo2 a0123456789876543210) (a0123456789876543210 :: Symbol) =
-        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
-    data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Foo2 a0123456789876543210) :: (~>) Symbol Symbol
-      where
-        ShowsPrec_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
-    data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) :: forall a0123456789876543210.
-                                                                                      (~>) (Foo2 a0123456789876543210) ((~>) Symbol Symbol)
-      where
-        ShowsPrec_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
-    data ShowsPrec_0123456789876543210Sym0 :: forall a0123456789876543210.
-                                              (~>) GHC.Types.Nat ((~>) (Foo2 a0123456789876543210) ((~>) Symbol Symbol))
-      where
-        ShowsPrec_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
-    instance PShow (Foo2 a) where
-      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
-    type family ShowsPrec_0123456789876543210 (a :: GHC.Types.Nat) (a :: Foo3) (a :: Symbol) :: Symbol where
-      ShowsPrec_0123456789876543210 p_0123456789876543210 (MkFoo3 arg_0123456789876543210 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "MkFoo3 ")) (Apply (Apply (.@#@$) (Apply ShowCharSym0 "{")) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "getFoo3a = ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 0)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowCommaSpaceSym0) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "(***) = ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 0)) arg_0123456789876543210)) (Apply ShowCharSym0 "}"))))))))) a_0123456789876543210
-    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Foo3) (a0123456789876543210 :: Symbol) =
-        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
-    data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Foo3) :: (~>) Symbol Symbol
-      where
-        ShowsPrec_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
-    data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) :: (~>) Foo3 ((~>) Symbol Symbol)
-      where
-        ShowsPrec_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
-    data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) Foo3 ((~>) Symbol Symbol))
-      where
-        ShowsPrec_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
-    instance PShow Foo3 where
-      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
-    infixl 5 :%&:
-    infixl 5 :%*:
-    infixl 5 `SMkFoo2b`
-    data SFoo1 :: Foo1 -> GHC.Types.Type where SMkFoo1 :: SFoo1 MkFoo1
-    type instance Sing @Foo1 = SFoo1
-    instance SingKind Foo1 where
-      type Demote Foo1 = Foo1
-      fromSing SMkFoo1 = MkFoo1
-      toSing MkFoo1 = SomeSing SMkFoo1
-    data SFoo2 :: forall a. Foo2 a -> GHC.Types.Type
-      where
-        SMkFoo2a :: forall a (n :: a) (n :: a).
-                    (Sing (n :: a)) -> (Sing (n :: a)) -> SFoo2 (MkFoo2a n n)
-        SMkFoo2b :: forall a (n :: a) (n :: a).
-                    (Sing (n :: a)) -> (Sing (n :: a)) -> SFoo2 (MkFoo2b n n)
-        (:%*:) :: forall a (n :: a) (n :: a).
-                  (Sing (n :: a)) -> (Sing (n :: a)) -> SFoo2 ((:*:) n n)
-        (:%&:) :: forall a (n :: a) (n :: a).
-                  (Sing (n :: a)) -> (Sing (n :: a)) -> SFoo2 ((:&:) n n)
-    type instance Sing @(Foo2 a) = SFoo2
-    instance SingKind a => SingKind (Foo2 a) where
-      type Demote (Foo2 a) = Foo2 (Demote a)
-      fromSing (SMkFoo2a b b) = (MkFoo2a (fromSing b)) (fromSing b)
-      fromSing (SMkFoo2b b b) = (MkFoo2b (fromSing b)) (fromSing b)
-      fromSing ((:%*:) b b) = ((:*:) (fromSing b)) (fromSing b)
-      fromSing ((:%&:) b b) = ((:&:) (fromSing b)) (fromSing b)
-      toSing (MkFoo2a (b :: Demote a) (b :: Demote a))
-        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing a) of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SMkFoo2a c) c) }
-      toSing (MkFoo2b (b :: Demote a) (b :: Demote a))
-        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing a) of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SMkFoo2b c) c) }
-      toSing ((:*:) (b :: Demote a) (b :: Demote a))
-        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing a) of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:%*:) c) c) }
-      toSing ((:&:) (b :: Demote a) (b :: Demote a))
-        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing a) of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:%&:) c) c) }
-    data SFoo3 :: Foo3 -> GHC.Types.Type
-      where
-        SMkFoo3 :: forall (n :: Bool) (n :: Bool).
-                   {sGetFoo3a :: (Sing (n :: Bool)), %*** :: (Sing (n :: Bool))}
-                   -> SFoo3 (MkFoo3 n n)
-    type instance Sing @Foo3 = SFoo3
-    instance SingKind Foo3 where
-      type Demote Foo3 = Foo3
-      fromSing (SMkFoo3 b b) = (MkFoo3 (fromSing b)) (fromSing b)
-      toSing (MkFoo3 (b :: Demote Bool) (b :: Demote Bool))
-        = case
-              ((,) (toSing b :: SomeSing Bool)) (toSing b :: SomeSing Bool)
-          of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SMkFoo3 c) c) }
-    instance SShow Foo1 where
-      sShowsPrec ::
-        forall (t1 :: GHC.Types.Nat) (t2 :: Foo1) (t3 :: Symbol).
-        Sing t1
-        -> Sing t2
-           -> Sing t3
-              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) Foo1 ((~>) Symbol Symbol))
-                                                             -> GHC.Types.Type) t1) t2) t3)
-      sShowsPrec
-        _
-        SMkFoo1
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "MkFoo1")))
-            sA_0123456789876543210
-    instance SShow a => SShow (Foo2 a) where
-      sShowsPrec ::
-        forall (t1 :: GHC.Types.Nat) (t2 :: Foo2 a) (t3 :: Symbol).
-        Sing t1
-        -> Sing t2
-           -> Sing t3
-              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) (Foo2 a) ((~>) Symbol Symbol))
-                                                             -> GHC.Types.Type) t1) t2) t3)
-      sShowsPrec
-        (sP_0123456789876543210 :: Sing p_0123456789876543210)
-        (SMkFoo2a (sArg_0123456789876543210 :: Sing arg_0123456789876543210)
-                  (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
-                    ((applySing
-                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
-                       (sFromInteger (sing :: Sing 10)))))
-                ((applySing
-                    ((applySing ((singFun3 @(.@#@$)) (%.)))
-                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                          (sing :: Sing "MkFoo2a "))))
-                   ((applySing
-                       ((applySing ((singFun3 @(.@#@$)) (%.)))
-                          ((applySing
-                              ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                                 (sFromInteger (sing :: Sing 11))))
-                             sArg_0123456789876543210)))
-                      ((applySing
-                          ((applySing ((singFun3 @(.@#@$)) (%.)))
-                             ((singFun1 @ShowSpaceSym0) sShowSpace)))
-                         ((applySing
-                             ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                                (sFromInteger (sing :: Sing 11))))
-                            sArg_0123456789876543210))))))
-            sA_0123456789876543210
-      sShowsPrec
-        (sP_0123456789876543210 :: Sing p_0123456789876543210)
-        (SMkFoo2b (sArgL_0123456789876543210 :: Sing argL_0123456789876543210)
-                  (sArgR_0123456789876543210 :: Sing argR_0123456789876543210))
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
-                    ((applySing
-                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
-                       (sFromInteger (sing :: Sing 5)))))
-                ((applySing
-                    ((applySing ((singFun3 @(.@#@$)) (%.)))
-                       ((applySing
-                           ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                              (sFromInteger (sing :: Sing 6))))
-                          sArgL_0123456789876543210)))
-                   ((applySing
-                       ((applySing ((singFun3 @(.@#@$)) (%.)))
-                          ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                             (sing :: Sing " `MkFoo2b` "))))
-                      ((applySing
-                          ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                             (sFromInteger (sing :: Sing 6))))
-                         sArgR_0123456789876543210)))))
-            sA_0123456789876543210
-      sShowsPrec
-        (sP_0123456789876543210 :: Sing p_0123456789876543210)
-        ((:%*:) (sArg_0123456789876543210 :: Sing arg_0123456789876543210)
-                (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
-                    ((applySing
-                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
-                       (sFromInteger (sing :: Sing 10)))))
-                ((applySing
-                    ((applySing ((singFun3 @(.@#@$)) (%.)))
-                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                          (sing :: Sing "(:*:) "))))
-                   ((applySing
-                       ((applySing ((singFun3 @(.@#@$)) (%.)))
-                          ((applySing
-                              ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                                 (sFromInteger (sing :: Sing 11))))
-                             sArg_0123456789876543210)))
-                      ((applySing
-                          ((applySing ((singFun3 @(.@#@$)) (%.)))
-                             ((singFun1 @ShowSpaceSym0) sShowSpace)))
-                         ((applySing
-                             ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                                (sFromInteger (sing :: Sing 11))))
-                            sArg_0123456789876543210))))))
-            sA_0123456789876543210
-      sShowsPrec
-        (sP_0123456789876543210 :: Sing p_0123456789876543210)
-        ((:%&:) (sArgL_0123456789876543210 :: Sing argL_0123456789876543210)
-                (sArgR_0123456789876543210 :: Sing argR_0123456789876543210))
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
-                    ((applySing
-                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
-                       (sFromInteger (sing :: Sing 5)))))
-                ((applySing
-                    ((applySing ((singFun3 @(.@#@$)) (%.)))
-                       ((applySing
-                           ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                              (sFromInteger (sing :: Sing 6))))
-                          sArgL_0123456789876543210)))
-                   ((applySing
-                       ((applySing ((singFun3 @(.@#@$)) (%.)))
-                          ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                             (sing :: Sing " :&: "))))
-                      ((applySing
-                          ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                             (sFromInteger (sing :: Sing 6))))
-                         sArgR_0123456789876543210)))))
-            sA_0123456789876543210
-    instance SShow Bool => SShow Foo3 where
-      sShowsPrec ::
-        forall (t1 :: GHC.Types.Nat) (t2 :: Foo3) (t3 :: Symbol).
-        Sing t1
-        -> Sing t2
-           -> Sing t3
-              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) Foo3 ((~>) Symbol Symbol))
-                                                             -> GHC.Types.Type) t1) t2) t3)
-      sShowsPrec
-        (sP_0123456789876543210 :: Sing p_0123456789876543210)
-        (SMkFoo3 (sArg_0123456789876543210 :: Sing arg_0123456789876543210)
-                 (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
-                    ((applySing
-                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
-                       (sFromInteger (sing :: Sing 10)))))
-                ((applySing
-                    ((applySing ((singFun3 @(.@#@$)) (%.)))
-                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                          (sing :: Sing "MkFoo3 "))))
-                   ((applySing
-                       ((applySing ((singFun3 @(.@#@$)) (%.)))
-                          ((applySing ((singFun2 @ShowCharSym0) sShowChar))
-                             (sing :: Sing "{"))))
-                      ((applySing
-                          ((applySing ((singFun3 @(.@#@$)) (%.)))
-                             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                                (sing :: Sing "getFoo3a = "))))
-                         ((applySing
-                             ((applySing ((singFun3 @(.@#@$)) (%.)))
-                                ((applySing
-                                    ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                                       (sFromInteger (sing :: Sing 0))))
-                                   sArg_0123456789876543210)))
-                            ((applySing
-                                ((applySing ((singFun3 @(.@#@$)) (%.)))
-                                   ((singFun1 @ShowCommaSpaceSym0) sShowCommaSpace)))
-                               ((applySing
-                                   ((applySing ((singFun3 @(.@#@$)) (%.)))
-                                      ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                                         (sing :: Sing "(***) = "))))
-                                  ((applySing
-                                      ((applySing ((singFun3 @(.@#@$)) (%.)))
-                                         ((applySing
-                                             ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                                                (sFromInteger (sing :: Sing 0))))
-                                            sArg_0123456789876543210)))
-                                     ((applySing ((singFun2 @ShowCharSym0) sShowChar))
-                                        (sing :: Sing "}")))))))))))
-            sA_0123456789876543210
-    instance Show (SFoo1 (z :: Foo1)) where
-      showsPrec _ SMkFoo1 = showString "SMkFoo1"
-    instance Data.Singletons.ShowSing.ShowSing a =>
-             Show (SFoo2 (z :: Foo2 a)) where
-      showsPrec
-        p_0123456789876543210
-        (SMkFoo2a (arg_0123456789876543210 :: Sing argTy_0123456789876543210)
-                  (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
-        = (showParen (((>) p_0123456789876543210) 10))
-            (((.) (showString "SMkFoo2a "))
-               (((.) ((showsPrec 11) arg_0123456789876543210))
-                  (((.) GHC.Show.showSpace)
-                     ((showsPrec 11) arg_0123456789876543210)))) ::
-            (Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210,
-             Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210) =>
-            ShowS
-      showsPrec
-        p_0123456789876543210
-        (SMkFoo2b (argL_0123456789876543210 :: Sing argTyL_0123456789876543210)
-                  (argR_0123456789876543210 :: Sing argTyR_0123456789876543210))
-        = (showParen (((>) p_0123456789876543210) 9))
-            (((.) ((showsPrec 10) argL_0123456789876543210))
-               (((.) (showString " `SMkFoo2b` "))
-                  ((showsPrec 10) argR_0123456789876543210))) ::
-            (Data.Singletons.ShowSing.ShowSing' argTyL_0123456789876543210,
-             Data.Singletons.ShowSing.ShowSing' argTyR_0123456789876543210) =>
-            ShowS
-      showsPrec
-        p_0123456789876543210
-        ((:%*:) (arg_0123456789876543210 :: Sing argTy_0123456789876543210)
-                (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
-        = (showParen (((>) p_0123456789876543210) 10))
-            (((.) (showString "(:%*:) "))
-               (((.) ((showsPrec 11) arg_0123456789876543210))
-                  (((.) GHC.Show.showSpace)
-                     ((showsPrec 11) arg_0123456789876543210)))) ::
-            (Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210,
-             Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210) =>
-            ShowS
-      showsPrec
-        p_0123456789876543210
-        ((:%&:) (argL_0123456789876543210 :: Sing argTyL_0123456789876543210)
-                (argR_0123456789876543210 :: Sing argTyR_0123456789876543210))
-        = (showParen (((>) p_0123456789876543210) 9))
-            (((.) ((showsPrec 10) argL_0123456789876543210))
-               (((.) (showString " :%&: "))
-                  ((showsPrec 10) argR_0123456789876543210))) ::
-            (Data.Singletons.ShowSing.ShowSing' argTyL_0123456789876543210,
-             Data.Singletons.ShowSing.ShowSing' argTyR_0123456789876543210) =>
-            ShowS
-    instance Data.Singletons.ShowSing.ShowSing Bool =>
-             Show (SFoo3 (z :: Foo3)) where
-      showsPrec
-        p_0123456789876543210
-        (SMkFoo3 (arg_0123456789876543210 :: Sing argTy_0123456789876543210)
-                 (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
-        = (showParen (((>) p_0123456789876543210) 10))
-            (((.) (showString "SMkFoo3 "))
-               (((.) (showChar '{'))
-                  (((.) (showString "sGetFoo3a = "))
-                     (((.) ((showsPrec 0) arg_0123456789876543210))
-                        (((.) GHC.Show.showCommaSpace)
-                           (((.) (showString "(%***) = "))
-                              (((.) ((showsPrec 0) arg_0123456789876543210))
-                                 (showChar '}')))))))) ::
-            (Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210,
-             Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210) =>
-            ShowS
-    instance SingI MkFoo1 where
-      sing = SMkFoo1
-    instance (SingI n, SingI n) =>
-             SingI (MkFoo2a (n :: a) (n :: a)) where
-      sing = (SMkFoo2a sing) sing
-    instance SingI (MkFoo2aSym0 :: (~>) a ((~>) a (Foo2 a))) where
-      sing = (singFun2 @MkFoo2aSym0) SMkFoo2a
-    instance SingI d =>
-             SingI (MkFoo2aSym1 (d :: a) :: (~>) a (Foo2 a)) where
-      sing = (singFun1 @(MkFoo2aSym1 (d :: a))) (SMkFoo2a (sing @d))
-    instance (SingI n, SingI n) =>
-             SingI (MkFoo2b (n :: a) (n :: a)) where
-      sing = (SMkFoo2b sing) sing
-    instance SingI (MkFoo2bSym0 :: (~>) a ((~>) a (Foo2 a))) where
-      sing = (singFun2 @MkFoo2bSym0) SMkFoo2b
-    instance SingI d =>
-             SingI (MkFoo2bSym1 (d :: a) :: (~>) a (Foo2 a)) where
-      sing = (singFun1 @(MkFoo2bSym1 (d :: a))) (SMkFoo2b (sing @d))
-    instance (SingI n, SingI n) =>
-             SingI ((:*:) (n :: a) (n :: a)) where
-      sing = ((:%*:) sing) sing
-    instance SingI ((:*:@#@$) :: (~>) a ((~>) a (Foo2 a))) where
-      sing = (singFun2 @(:*:@#@$)) (:%*:)
-    instance SingI d =>
-             SingI ((:*:@#@$$) (d :: a) :: (~>) a (Foo2 a)) where
-      sing = (singFun1 @((:*:@#@$$) (d :: a))) ((:%*:) (sing @d))
-    instance (SingI n, SingI n) =>
-             SingI ((:&:) (n :: a) (n :: a)) where
-      sing = ((:%&:) sing) sing
-    instance SingI ((:&:@#@$) :: (~>) a ((~>) a (Foo2 a))) where
-      sing = (singFun2 @(:&:@#@$)) (:%&:)
-    instance SingI d =>
-             SingI ((:&:@#@$$) (d :: a) :: (~>) a (Foo2 a)) where
-      sing = (singFun1 @((:&:@#@$$) (d :: a))) ((:%&:) (sing @d))
-    instance (SingI n, SingI n) =>
-             SingI (MkFoo3 (n :: Bool) (n :: Bool)) where
-      sing = (SMkFoo3 sing) sing
-    instance SingI (MkFoo3Sym0 :: (~>) Bool ((~>) Bool Foo3)) where
-      sing = (singFun2 @MkFoo3Sym0) SMkFoo3
-    instance SingI d =>
-             SingI (MkFoo3Sym1 (d :: Bool) :: (~>) Bool Foo3) where
-      sing = (singFun1 @(MkFoo3Sym1 (d :: Bool))) (SMkFoo3 (sing @d))
diff --git a/tests/compile-and-dump/Singletons/ShowDeriving.golden b/tests/compile-and-dump/Singletons/ShowDeriving.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/ShowDeriving.golden
@@ -0,0 +1,625 @@
+Singletons/ShowDeriving.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| infixl 5 `MkFoo2b`, :*:, :&:
+          
+          data Foo1
+            = MkFoo1
+            deriving Show
+          data Foo2 a
+            = MkFoo2a a a | a `MkFoo2b` a | (:*:) a a | a :&: a
+            deriving Show
+          data Foo3
+            = MkFoo3 {getFoo3a :: Bool, *** :: Bool}
+            deriving Show |]
+  ======>
+    data Foo1
+      = MkFoo1
+      deriving Show
+    infixl 5 `MkFoo2b`
+    infixl 5 :*:
+    infixl 5 :&:
+    data Foo2 a
+      = MkFoo2a a a | a `MkFoo2b` a | (:*:) a a | a :&: a
+      deriving Show
+    data Foo3
+      = MkFoo3 {getFoo3a :: Bool, *** :: Bool}
+      deriving Show
+    type MkFoo1Sym0 = MkFoo1 :: Foo1
+    type MkFoo2aSym0 :: forall a. (~>) a ((~>) a (Foo2 a))
+    data MkFoo2aSym0 a0123456789876543210
+      where
+        MkFoo2aSym0KindInference :: SameKind (Apply MkFoo2aSym0 arg) (MkFoo2aSym1 arg) =>
+                                    MkFoo2aSym0 a0123456789876543210
+    type instance Apply MkFoo2aSym0 a0123456789876543210 = MkFoo2aSym1 a0123456789876543210
+    instance SuppressUnusedWarnings MkFoo2aSym0 where
+      suppressUnusedWarnings = snd (((,) MkFoo2aSym0KindInference) ())
+    type MkFoo2aSym1 :: forall a. a -> (~>) a (Foo2 a)
+    data MkFoo2aSym1 a0123456789876543210 a0123456789876543210
+      where
+        MkFoo2aSym1KindInference :: SameKind (Apply (MkFoo2aSym1 a0123456789876543210) arg) (MkFoo2aSym2 a0123456789876543210 arg) =>
+                                    MkFoo2aSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (MkFoo2aSym1 a0123456789876543210) a0123456789876543210 = MkFoo2aSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (MkFoo2aSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) MkFoo2aSym1KindInference) ())
+    type MkFoo2aSym2 (a0123456789876543210 :: a) (a0123456789876543210 :: a) =
+        MkFoo2a a0123456789876543210 a0123456789876543210 :: Foo2 a
+    type MkFoo2bSym0 :: forall a. (~>) a ((~>) a (Foo2 a))
+    data MkFoo2bSym0 a0123456789876543210
+      where
+        MkFoo2bSym0KindInference :: SameKind (Apply MkFoo2bSym0 arg) (MkFoo2bSym1 arg) =>
+                                    MkFoo2bSym0 a0123456789876543210
+    type instance Apply MkFoo2bSym0 a0123456789876543210 = MkFoo2bSym1 a0123456789876543210
+    instance SuppressUnusedWarnings MkFoo2bSym0 where
+      suppressUnusedWarnings = snd (((,) MkFoo2bSym0KindInference) ())
+    infixl 5 `MkFoo2bSym0`
+    type MkFoo2bSym1 :: forall a. a -> (~>) a (Foo2 a)
+    data MkFoo2bSym1 a0123456789876543210 a0123456789876543210
+      where
+        MkFoo2bSym1KindInference :: SameKind (Apply (MkFoo2bSym1 a0123456789876543210) arg) (MkFoo2bSym2 a0123456789876543210 arg) =>
+                                    MkFoo2bSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (MkFoo2bSym1 a0123456789876543210) a0123456789876543210 = MkFoo2bSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (MkFoo2bSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) MkFoo2bSym1KindInference) ())
+    infixl 5 `MkFoo2bSym1`
+    type MkFoo2bSym2 (a0123456789876543210 :: a) (a0123456789876543210 :: a) =
+        MkFoo2b a0123456789876543210 a0123456789876543210 :: Foo2 a
+    infixl 5 `MkFoo2bSym2`
+    type (:*:@#@$) :: forall a. (~>) a ((~>) a (Foo2 a))
+    data (:*:@#@$) a0123456789876543210
+      where
+        (::*:@#@$###) :: SameKind (Apply (:*:@#@$) arg) ((:*:@#@$$) arg) =>
+                         (:*:@#@$) a0123456789876543210
+    type instance Apply (:*:@#@$) a0123456789876543210 = (:*:@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (:*:@#@$) where
+      suppressUnusedWarnings = snd (((,) (::*:@#@$###)) ())
+    infixl 5 :*:@#@$
+    type (:*:@#@$$) :: forall a. a -> (~>) a (Foo2 a)
+    data (:*:@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (::*:@#@$$###) :: SameKind (Apply ((:*:@#@$$) a0123456789876543210) arg) ((:*:@#@$$$) a0123456789876543210 arg) =>
+                          (:*:@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((:*:@#@$$) a0123456789876543210) a0123456789876543210 = (:*:@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((:*:@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (::*:@#@$$###)) ())
+    infixl 5 :*:@#@$$
+    type (:*:@#@$$$) (a0123456789876543210 :: a) (a0123456789876543210 :: a) =
+        (:*:) a0123456789876543210 a0123456789876543210 :: Foo2 a
+    infixl 5 :*:@#@$$$
+    type (:&:@#@$) :: forall a. (~>) a ((~>) a (Foo2 a))
+    data (:&:@#@$) a0123456789876543210
+      where
+        (::&:@#@$###) :: SameKind (Apply (:&:@#@$) arg) ((:&:@#@$$) arg) =>
+                         (:&:@#@$) a0123456789876543210
+    type instance Apply (:&:@#@$) a0123456789876543210 = (:&:@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (:&:@#@$) where
+      suppressUnusedWarnings = snd (((,) (::&:@#@$###)) ())
+    infixl 5 :&:@#@$
+    type (:&:@#@$$) :: forall a. a -> (~>) a (Foo2 a)
+    data (:&:@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (::&:@#@$$###) :: SameKind (Apply ((:&:@#@$$) a0123456789876543210) arg) ((:&:@#@$$$) a0123456789876543210 arg) =>
+                          (:&:@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((:&:@#@$$) a0123456789876543210) a0123456789876543210 = (:&:@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((:&:@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (::&:@#@$$###)) ())
+    infixl 5 :&:@#@$$
+    type (:&:@#@$$$) (a0123456789876543210 :: a) (a0123456789876543210 :: a) =
+        (:&:) a0123456789876543210 a0123456789876543210 :: Foo2 a
+    infixl 5 :&:@#@$$$
+    type MkFoo3Sym0 :: (~>) Bool ((~>) Bool Foo3)
+    data MkFoo3Sym0 a0123456789876543210
+      where
+        MkFoo3Sym0KindInference :: SameKind (Apply MkFoo3Sym0 arg) (MkFoo3Sym1 arg) =>
+                                   MkFoo3Sym0 a0123456789876543210
+    type instance Apply MkFoo3Sym0 a0123456789876543210 = MkFoo3Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings MkFoo3Sym0 where
+      suppressUnusedWarnings = snd (((,) MkFoo3Sym0KindInference) ())
+    type MkFoo3Sym1 :: Bool -> (~>) Bool Foo3
+    data MkFoo3Sym1 a0123456789876543210 a0123456789876543210
+      where
+        MkFoo3Sym1KindInference :: SameKind (Apply (MkFoo3Sym1 a0123456789876543210) arg) (MkFoo3Sym2 a0123456789876543210 arg) =>
+                                   MkFoo3Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (MkFoo3Sym1 a0123456789876543210) a0123456789876543210 = MkFoo3Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (MkFoo3Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) MkFoo3Sym1KindInference) ())
+    type MkFoo3Sym2 (a0123456789876543210 :: Bool) (a0123456789876543210 :: Bool) =
+        MkFoo3 a0123456789876543210 a0123456789876543210 :: Foo3
+    type (***@#@$) :: (~>) Foo3 Bool
+    data (***@#@$) a0123456789876543210
+      where
+        (:***@#@$###) :: SameKind (Apply (***@#@$) arg) ((***@#@$$) arg) =>
+                         (***@#@$) a0123456789876543210
+    type instance Apply (***@#@$) a0123456789876543210 = (***@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (***@#@$) where
+      suppressUnusedWarnings = snd (((,) (:***@#@$###)) ())
+    type (***@#@$$) (a0123456789876543210 :: Foo3) =
+        (***) a0123456789876543210 :: Bool
+    type GetFoo3aSym0 :: (~>) Foo3 Bool
+    data GetFoo3aSym0 a0123456789876543210
+      where
+        GetFoo3aSym0KindInference :: SameKind (Apply GetFoo3aSym0 arg) (GetFoo3aSym1 arg) =>
+                                     GetFoo3aSym0 a0123456789876543210
+    type instance Apply GetFoo3aSym0 a0123456789876543210 = GetFoo3aSym1 a0123456789876543210
+    instance SuppressUnusedWarnings GetFoo3aSym0 where
+      suppressUnusedWarnings = snd (((,) GetFoo3aSym0KindInference) ())
+    type GetFoo3aSym1 (a0123456789876543210 :: Foo3) =
+        GetFoo3a a0123456789876543210 :: Bool
+    type (***) :: Foo3 -> Bool
+    type family (***) a where
+      (***) (MkFoo3 _ field) = field
+    type GetFoo3a :: Foo3 -> Bool
+    type family GetFoo3a a where
+      GetFoo3a (MkFoo3 field _) = field
+    type ShowsPrec_0123456789876543210 :: GHC.Types.Nat
+                                          -> Foo1 -> Symbol -> Symbol
+    type family ShowsPrec_0123456789876543210 a a a where
+      ShowsPrec_0123456789876543210 _ MkFoo1 a_0123456789876543210 = Apply (Apply ShowStringSym0 "MkFoo1") a_0123456789876543210
+    type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) Foo1 ((~>) Symbol Symbol))
+    data ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
+    type ShowsPrec_0123456789876543210Sym1 :: GHC.Types.Nat
+                                              -> (~>) Foo1 ((~>) Symbol Symbol)
+    data ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
+    type ShowsPrec_0123456789876543210Sym2 :: GHC.Types.Nat
+                                              -> Foo1 -> (~>) Symbol Symbol
+    data ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
+    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Foo1) (a0123456789876543210 :: Symbol) =
+        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Symbol
+    instance PShow Foo1 where
+      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
+    type ShowsPrec_0123456789876543210 :: GHC.Types.Nat
+                                          -> Foo2 a -> Symbol -> Symbol
+    type family ShowsPrec_0123456789876543210 a a a where
+      ShowsPrec_0123456789876543210 p_0123456789876543210 (MkFoo2a arg_0123456789876543210 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "MkFoo2a ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowSpaceSym0) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))))) a_0123456789876543210
+      ShowsPrec_0123456789876543210 p_0123456789876543210 (MkFoo2b argL_0123456789876543210 argR_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 5))) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 6)) argL_0123456789876543210)) (Apply (Apply (.@#@$) (Apply ShowStringSym0 " `MkFoo2b` ")) (Apply (Apply ShowsPrecSym0 (FromInteger 6)) argR_0123456789876543210)))) a_0123456789876543210
+      ShowsPrec_0123456789876543210 p_0123456789876543210 ((:*:) arg_0123456789876543210 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "(:*:) ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowSpaceSym0) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))))) a_0123456789876543210
+      ShowsPrec_0123456789876543210 p_0123456789876543210 ((:&:) argL_0123456789876543210 argR_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 5))) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 6)) argL_0123456789876543210)) (Apply (Apply (.@#@$) (Apply ShowStringSym0 " :&: ")) (Apply (Apply ShowsPrecSym0 (FromInteger 6)) argR_0123456789876543210)))) a_0123456789876543210
+    type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) (Foo2 a) ((~>) Symbol Symbol))
+    data ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
+    type ShowsPrec_0123456789876543210Sym1 :: GHC.Types.Nat
+                                              -> (~>) (Foo2 a) ((~>) Symbol Symbol)
+    data ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
+    type ShowsPrec_0123456789876543210Sym2 :: GHC.Types.Nat
+                                              -> Foo2 a -> (~>) Symbol Symbol
+    data ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
+    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Foo2 a) (a0123456789876543210 :: Symbol) =
+        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Symbol
+    instance PShow (Foo2 a) where
+      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
+    type ShowsPrec_0123456789876543210 :: GHC.Types.Nat
+                                          -> Foo3 -> Symbol -> Symbol
+    type family ShowsPrec_0123456789876543210 a a a where
+      ShowsPrec_0123456789876543210 p_0123456789876543210 (MkFoo3 arg_0123456789876543210 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "MkFoo3 ")) (Apply (Apply (.@#@$) (Apply ShowCharSym0 "{")) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "getFoo3a = ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 0)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowCommaSpaceSym0) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "(***) = ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 0)) arg_0123456789876543210)) (Apply ShowCharSym0 "}"))))))))) a_0123456789876543210
+    type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) Foo3 ((~>) Symbol Symbol))
+    data ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
+    type ShowsPrec_0123456789876543210Sym1 :: GHC.Types.Nat
+                                              -> (~>) Foo3 ((~>) Symbol Symbol)
+    data ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
+    type ShowsPrec_0123456789876543210Sym2 :: GHC.Types.Nat
+                                              -> Foo3 -> (~>) Symbol Symbol
+    data ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
+    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Foo3) (a0123456789876543210 :: Symbol) =
+        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Symbol
+    instance PShow Foo3 where
+      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
+    infixl 5 :%&:
+    infixl 5 :%*:
+    infixl 5 `SMkFoo2b`
+    (%***) ::
+      forall (t :: Foo3). Sing t -> Sing (Apply (***@#@$) t :: Bool)
+    sGetFoo3a ::
+      forall (t :: Foo3). Sing t -> Sing (Apply GetFoo3aSym0 t :: Bool)
+    (%***) (SMkFoo3 _ (sField :: Sing field)) = sField
+    sGetFoo3a (SMkFoo3 (sField :: Sing field) _) = sField
+    instance SingI ((***@#@$) :: (~>) Foo3 Bool) where
+      sing = (singFun1 @(***@#@$)) (%***)
+    instance SingI (GetFoo3aSym0 :: (~>) Foo3 Bool) where
+      sing = (singFun1 @GetFoo3aSym0) sGetFoo3a
+    data SFoo1 :: Foo1 -> GHC.Types.Type
+      where SMkFoo1 :: SFoo1 (MkFoo1 :: Foo1)
+    type instance Sing @Foo1 = SFoo1
+    instance SingKind Foo1 where
+      type Demote Foo1 = Foo1
+      fromSing SMkFoo1 = MkFoo1
+      toSing MkFoo1 = SomeSing SMkFoo1
+    data SFoo2 :: forall a. Foo2 a -> GHC.Types.Type
+      where
+        SMkFoo2a :: forall a (n :: a) (n :: a).
+                    (Sing n) -> (Sing n) -> SFoo2 (MkFoo2a n n :: Foo2 a)
+        SMkFoo2b :: forall a (n :: a) (n :: a).
+                    (Sing n) -> (Sing n) -> SFoo2 (MkFoo2b n n :: Foo2 a)
+        (:%*:) :: forall a (n :: a) (n :: a).
+                  (Sing n) -> (Sing n) -> SFoo2 ((:*:) n n :: Foo2 a)
+        (:%&:) :: forall a (n :: a) (n :: a).
+                  (Sing n) -> (Sing n) -> SFoo2 ((:&:) n n :: Foo2 a)
+    type instance Sing @(Foo2 a) = SFoo2
+    instance SingKind a => SingKind (Foo2 a) where
+      type Demote (Foo2 a) = Foo2 (Demote a)
+      fromSing (SMkFoo2a b b) = (MkFoo2a (fromSing b)) (fromSing b)
+      fromSing (SMkFoo2b b b) = (MkFoo2b (fromSing b)) (fromSing b)
+      fromSing ((:%*:) b b) = ((:*:) (fromSing b)) (fromSing b)
+      fromSing ((:%&:) b b) = ((:&:) (fromSing b)) (fromSing b)
+      toSing (MkFoo2a (b :: Demote a) (b :: Demote a))
+        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing a) of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SMkFoo2a c) c) }
+      toSing (MkFoo2b (b :: Demote a) (b :: Demote a))
+        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing a) of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SMkFoo2b c) c) }
+      toSing ((:*:) (b :: Demote a) (b :: Demote a))
+        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing a) of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:%*:) c) c) }
+      toSing ((:&:) (b :: Demote a) (b :: Demote a))
+        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing a) of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:%&:) c) c) }
+    data SFoo3 :: Foo3 -> GHC.Types.Type
+      where
+        SMkFoo3 :: forall (n :: Bool) (n :: Bool).
+                   (Sing n) -> (Sing n) -> SFoo3 (MkFoo3 n n :: Foo3)
+    type instance Sing @Foo3 = SFoo3
+    instance SingKind Foo3 where
+      type Demote Foo3 = Foo3
+      fromSing (SMkFoo3 b b) = (MkFoo3 (fromSing b)) (fromSing b)
+      toSing (MkFoo3 (b :: Demote Bool) (b :: Demote Bool))
+        = case
+              ((,) (toSing b :: SomeSing Bool)) (toSing b :: SomeSing Bool)
+          of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SMkFoo3 c) c) }
+    instance SShow Foo1 where
+      sShowsPrec ::
+        forall (t1 :: GHC.Types.Nat) (t2 :: Foo1) (t3 :: Symbol).
+        Sing t1
+        -> Sing t2
+           -> Sing t3
+              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) Foo1 ((~>) Symbol Symbol))
+                                                             -> GHC.Types.Type) t1) t2) t3)
+      sShowsPrec
+        _
+        SMkFoo1
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "MkFoo1")))
+            sA_0123456789876543210
+    instance SShow a => SShow (Foo2 a) where
+      sShowsPrec ::
+        forall (t1 :: GHC.Types.Nat) (t2 :: Foo2 a) (t3 :: Symbol).
+        Sing t1
+        -> Sing t2
+           -> Sing t3
+              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) (Foo2 a) ((~>) Symbol Symbol))
+                                                             -> GHC.Types.Type) t1) t2) t3)
+      sShowsPrec
+        (sP_0123456789876543210 :: Sing p_0123456789876543210)
+        (SMkFoo2a (sArg_0123456789876543210 :: Sing arg_0123456789876543210)
+                  (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
+                    ((applySing
+                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
+                       (sFromInteger (sing :: Sing 10)))))
+                ((applySing
+                    ((applySing ((singFun3 @(.@#@$)) (%.)))
+                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                          (sing :: Sing "MkFoo2a "))))
+                   ((applySing
+                       ((applySing ((singFun3 @(.@#@$)) (%.)))
+                          ((applySing
+                              ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                                 (sFromInteger (sing :: Sing 11))))
+                             sArg_0123456789876543210)))
+                      ((applySing
+                          ((applySing ((singFun3 @(.@#@$)) (%.)))
+                             ((singFun1 @ShowSpaceSym0) sShowSpace)))
+                         ((applySing
+                             ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                                (sFromInteger (sing :: Sing 11))))
+                            sArg_0123456789876543210))))))
+            sA_0123456789876543210
+      sShowsPrec
+        (sP_0123456789876543210 :: Sing p_0123456789876543210)
+        (SMkFoo2b (sArgL_0123456789876543210 :: Sing argL_0123456789876543210)
+                  (sArgR_0123456789876543210 :: Sing argR_0123456789876543210))
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
+                    ((applySing
+                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
+                       (sFromInteger (sing :: Sing 5)))))
+                ((applySing
+                    ((applySing ((singFun3 @(.@#@$)) (%.)))
+                       ((applySing
+                           ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                              (sFromInteger (sing :: Sing 6))))
+                          sArgL_0123456789876543210)))
+                   ((applySing
+                       ((applySing ((singFun3 @(.@#@$)) (%.)))
+                          ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                             (sing :: Sing " `MkFoo2b` "))))
+                      ((applySing
+                          ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                             (sFromInteger (sing :: Sing 6))))
+                         sArgR_0123456789876543210)))))
+            sA_0123456789876543210
+      sShowsPrec
+        (sP_0123456789876543210 :: Sing p_0123456789876543210)
+        ((:%*:) (sArg_0123456789876543210 :: Sing arg_0123456789876543210)
+                (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
+                    ((applySing
+                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
+                       (sFromInteger (sing :: Sing 10)))))
+                ((applySing
+                    ((applySing ((singFun3 @(.@#@$)) (%.)))
+                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                          (sing :: Sing "(:*:) "))))
+                   ((applySing
+                       ((applySing ((singFun3 @(.@#@$)) (%.)))
+                          ((applySing
+                              ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                                 (sFromInteger (sing :: Sing 11))))
+                             sArg_0123456789876543210)))
+                      ((applySing
+                          ((applySing ((singFun3 @(.@#@$)) (%.)))
+                             ((singFun1 @ShowSpaceSym0) sShowSpace)))
+                         ((applySing
+                             ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                                (sFromInteger (sing :: Sing 11))))
+                            sArg_0123456789876543210))))))
+            sA_0123456789876543210
+      sShowsPrec
+        (sP_0123456789876543210 :: Sing p_0123456789876543210)
+        ((:%&:) (sArgL_0123456789876543210 :: Sing argL_0123456789876543210)
+                (sArgR_0123456789876543210 :: Sing argR_0123456789876543210))
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
+                    ((applySing
+                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
+                       (sFromInteger (sing :: Sing 5)))))
+                ((applySing
+                    ((applySing ((singFun3 @(.@#@$)) (%.)))
+                       ((applySing
+                           ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                              (sFromInteger (sing :: Sing 6))))
+                          sArgL_0123456789876543210)))
+                   ((applySing
+                       ((applySing ((singFun3 @(.@#@$)) (%.)))
+                          ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                             (sing :: Sing " :&: "))))
+                      ((applySing
+                          ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                             (sFromInteger (sing :: Sing 6))))
+                         sArgR_0123456789876543210)))))
+            sA_0123456789876543210
+    instance SShow Bool => SShow Foo3 where
+      sShowsPrec ::
+        forall (t1 :: GHC.Types.Nat) (t2 :: Foo3) (t3 :: Symbol).
+        Sing t1
+        -> Sing t2
+           -> Sing t3
+              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) Foo3 ((~>) Symbol Symbol))
+                                                             -> GHC.Types.Type) t1) t2) t3)
+      sShowsPrec
+        (sP_0123456789876543210 :: Sing p_0123456789876543210)
+        (SMkFoo3 (sArg_0123456789876543210 :: Sing arg_0123456789876543210)
+                 (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
+                    ((applySing
+                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
+                       (sFromInteger (sing :: Sing 10)))))
+                ((applySing
+                    ((applySing ((singFun3 @(.@#@$)) (%.)))
+                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                          (sing :: Sing "MkFoo3 "))))
+                   ((applySing
+                       ((applySing ((singFun3 @(.@#@$)) (%.)))
+                          ((applySing ((singFun2 @ShowCharSym0) sShowChar))
+                             (sing :: Sing "{"))))
+                      ((applySing
+                          ((applySing ((singFun3 @(.@#@$)) (%.)))
+                             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                                (sing :: Sing "getFoo3a = "))))
+                         ((applySing
+                             ((applySing ((singFun3 @(.@#@$)) (%.)))
+                                ((applySing
+                                    ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                                       (sFromInteger (sing :: Sing 0))))
+                                   sArg_0123456789876543210)))
+                            ((applySing
+                                ((applySing ((singFun3 @(.@#@$)) (%.)))
+                                   ((singFun1 @ShowCommaSpaceSym0) sShowCommaSpace)))
+                               ((applySing
+                                   ((applySing ((singFun3 @(.@#@$)) (%.)))
+                                      ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                                         (sing :: Sing "(***) = "))))
+                                  ((applySing
+                                      ((applySing ((singFun3 @(.@#@$)) (%.)))
+                                         ((applySing
+                                             ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                                                (sFromInteger (sing :: Sing 0))))
+                                            sArg_0123456789876543210)))
+                                     ((applySing ((singFun2 @ShowCharSym0) sShowChar))
+                                        (sing :: Sing "}")))))))))))
+            sA_0123456789876543210
+    instance Show (SFoo1 (z :: Foo1)) where
+      showsPrec _ SMkFoo1 = showString "SMkFoo1"
+    instance Data.Singletons.ShowSing.ShowSing a =>
+             Show (SFoo2 (z :: Foo2 a)) where
+      showsPrec
+        p_0123456789876543210
+        (SMkFoo2a (arg_0123456789876543210 :: Sing argTy_0123456789876543210)
+                  (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
+        = (showParen (((>) p_0123456789876543210) 10))
+            (((.) (showString "SMkFoo2a "))
+               (((.) ((showsPrec 11) arg_0123456789876543210))
+                  (((.) GHC.Show.showSpace)
+                     ((showsPrec 11) arg_0123456789876543210)))) ::
+            (Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210,
+             Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210) =>
+            ShowS
+      showsPrec
+        p_0123456789876543210
+        (SMkFoo2b (argL_0123456789876543210 :: Sing argTyL_0123456789876543210)
+                  (argR_0123456789876543210 :: Sing argTyR_0123456789876543210))
+        = (showParen (((>) p_0123456789876543210) 9))
+            (((.) ((showsPrec 10) argL_0123456789876543210))
+               (((.) (showString " `SMkFoo2b` "))
+                  ((showsPrec 10) argR_0123456789876543210))) ::
+            (Data.Singletons.ShowSing.ShowSing' argTyL_0123456789876543210,
+             Data.Singletons.ShowSing.ShowSing' argTyR_0123456789876543210) =>
+            ShowS
+      showsPrec
+        p_0123456789876543210
+        ((:%*:) (arg_0123456789876543210 :: Sing argTy_0123456789876543210)
+                (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
+        = (showParen (((>) p_0123456789876543210) 10))
+            (((.) (showString "(:%*:) "))
+               (((.) ((showsPrec 11) arg_0123456789876543210))
+                  (((.) GHC.Show.showSpace)
+                     ((showsPrec 11) arg_0123456789876543210)))) ::
+            (Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210,
+             Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210) =>
+            ShowS
+      showsPrec
+        p_0123456789876543210
+        ((:%&:) (argL_0123456789876543210 :: Sing argTyL_0123456789876543210)
+                (argR_0123456789876543210 :: Sing argTyR_0123456789876543210))
+        = (showParen (((>) p_0123456789876543210) 9))
+            (((.) ((showsPrec 10) argL_0123456789876543210))
+               (((.) (showString " :%&: "))
+                  ((showsPrec 10) argR_0123456789876543210))) ::
+            (Data.Singletons.ShowSing.ShowSing' argTyL_0123456789876543210,
+             Data.Singletons.ShowSing.ShowSing' argTyR_0123456789876543210) =>
+            ShowS
+    instance Data.Singletons.ShowSing.ShowSing Bool =>
+             Show (SFoo3 (z :: Foo3)) where
+      showsPrec
+        p_0123456789876543210
+        (SMkFoo3 (arg_0123456789876543210 :: Sing argTy_0123456789876543210)
+                 (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
+        = (showParen (((>) p_0123456789876543210) 10))
+            (((.) (showString "SMkFoo3 "))
+               (((.) (showChar '{'))
+                  (((.) (showString "sGetFoo3a = "))
+                     (((.) ((showsPrec 0) arg_0123456789876543210))
+                        (((.) GHC.Show.showCommaSpace)
+                           (((.) (showString "(%***) = "))
+                              (((.) ((showsPrec 0) arg_0123456789876543210))
+                                 (showChar '}')))))))) ::
+            (Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210,
+             Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210) =>
+            ShowS
+    instance SingI MkFoo1 where
+      sing = SMkFoo1
+    instance (SingI n, SingI n) =>
+             SingI (MkFoo2a (n :: a) (n :: a)) where
+      sing = (SMkFoo2a sing) sing
+    instance SingI (MkFoo2aSym0 :: (~>) a ((~>) a (Foo2 a))) where
+      sing = (singFun2 @MkFoo2aSym0) SMkFoo2a
+    instance SingI d =>
+             SingI (MkFoo2aSym1 (d :: a) :: (~>) a (Foo2 a)) where
+      sing = (singFun1 @(MkFoo2aSym1 (d :: a))) (SMkFoo2a (sing @d))
+    instance (SingI n, SingI n) =>
+             SingI (MkFoo2b (n :: a) (n :: a)) where
+      sing = (SMkFoo2b sing) sing
+    instance SingI (MkFoo2bSym0 :: (~>) a ((~>) a (Foo2 a))) where
+      sing = (singFun2 @MkFoo2bSym0) SMkFoo2b
+    instance SingI d =>
+             SingI (MkFoo2bSym1 (d :: a) :: (~>) a (Foo2 a)) where
+      sing = (singFun1 @(MkFoo2bSym1 (d :: a))) (SMkFoo2b (sing @d))
+    instance (SingI n, SingI n) =>
+             SingI ((:*:) (n :: a) (n :: a)) where
+      sing = ((:%*:) sing) sing
+    instance SingI ((:*:@#@$) :: (~>) a ((~>) a (Foo2 a))) where
+      sing = (singFun2 @(:*:@#@$)) (:%*:)
+    instance SingI d =>
+             SingI ((:*:@#@$$) (d :: a) :: (~>) a (Foo2 a)) where
+      sing = (singFun1 @((:*:@#@$$) (d :: a))) ((:%*:) (sing @d))
+    instance (SingI n, SingI n) =>
+             SingI ((:&:) (n :: a) (n :: a)) where
+      sing = ((:%&:) sing) sing
+    instance SingI ((:&:@#@$) :: (~>) a ((~>) a (Foo2 a))) where
+      sing = (singFun2 @(:&:@#@$)) (:%&:)
+    instance SingI d =>
+             SingI ((:&:@#@$$) (d :: a) :: (~>) a (Foo2 a)) where
+      sing = (singFun1 @((:&:@#@$$) (d :: a))) ((:%&:) (sing @d))
+    instance (SingI n, SingI n) =>
+             SingI (MkFoo3 (n :: Bool) (n :: Bool)) where
+      sing = (SMkFoo3 sing) sing
+    instance SingI (MkFoo3Sym0 :: (~>) Bool ((~>) Bool Foo3)) where
+      sing = (singFun2 @MkFoo3Sym0) SMkFoo3
+    instance SingI d =>
+             SingI (MkFoo3Sym1 (d :: Bool) :: (~>) Bool Foo3) where
+      sing = (singFun1 @(MkFoo3Sym1 (d :: Bool))) (SMkFoo3 (sing @d))
diff --git a/tests/compile-and-dump/Singletons/StandaloneDeriving.ghc88.template b/tests/compile-and-dump/Singletons/StandaloneDeriving.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/StandaloneDeriving.ghc88.template
+++ /dev/null
@@ -1,475 +0,0 @@
-Singletons/StandaloneDeriving.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| infixl 6 :*:
-          
-          data T a b = a :*: b
-          data S = S1 | S2
-          
-          deriving instance Enum S
-          deriving instance Bounded S
-          deriving instance Show S
-          deriving instance Ord S
-          deriving instance Eq S
-          deriving instance Show a => Show (T a ())
-          deriving instance Ord a => Ord (T a ())
-          deriving instance Eq a => Eq (T a ()) |]
-  ======>
-    infixl 6 :*:
-    data T a b = a :*: b
-    data S = S1 | S2
-    deriving instance Eq a => Eq (T a ())
-    deriving instance Ord a => Ord (T a ())
-    deriving instance Show a => Show (T a ())
-    deriving instance Eq S
-    deriving instance Ord S
-    deriving instance Show S
-    deriving instance Bounded S
-    deriving instance Enum S
-    type (:*:@#@$$$) (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) =
-        (:*:) t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings ((:*:@#@$$) t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (::*:@#@$$###)) ())
-    data (:*:@#@$$) (t0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                      (~>) b0123456789876543210 (T a0123456789876543210 b0123456789876543210)
-      where
-        (::*:@#@$$###) :: forall t0123456789876543210
-                                 t0123456789876543210
-                                 arg. SameKind (Apply ((:*:@#@$$) t0123456789876543210) arg) ((:*:@#@$$$) t0123456789876543210 arg) =>
-                          (:*:@#@$$) t0123456789876543210 t0123456789876543210
-    type instance Apply ((:*:@#@$$) t0123456789876543210) t0123456789876543210 = (:*:) t0123456789876543210 t0123456789876543210
-    infixl 6 :*:@#@$$
-    instance SuppressUnusedWarnings (:*:@#@$) where
-      suppressUnusedWarnings = snd (((,) (::*:@#@$###)) ())
-    data (:*:@#@$) :: forall a0123456789876543210 b0123456789876543210.
-                      (~>) a0123456789876543210 ((~>) b0123456789876543210 (T a0123456789876543210 b0123456789876543210))
-      where
-        (::*:@#@$###) :: forall t0123456789876543210
-                                arg. SameKind (Apply (:*:@#@$) arg) ((:*:@#@$$) arg) =>
-                         (:*:@#@$) t0123456789876543210
-    type instance Apply (:*:@#@$) t0123456789876543210 = (:*:@#@$$) t0123456789876543210
-    infixl 6 :*:@#@$
-    type S1Sym0 = S1
-    type S2Sym0 = S2
-    type family Compare_0123456789876543210 (a :: T a ()) (a :: T a ()) :: Ordering where
-      Compare_0123456789876543210 ((:*:) a_0123456789876543210 a_0123456789876543210) ((:*:) b_0123456789876543210 b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) '[]))
-    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: T a0123456789876543210 ()) (a0123456789876543210 :: T a0123456789876543210 ()) =
-        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
-    data Compare_0123456789876543210Sym1 (a0123456789876543210 :: T a0123456789876543210 ()) :: (~>) (T a0123456789876543210 ()) Ordering
-      where
-        Compare_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                               a0123456789876543210
-                                                               arg. SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
-    data Compare_0123456789876543210Sym0 :: forall a0123456789876543210.
-                                            (~>) (T a0123456789876543210 ()) ((~>) (T a0123456789876543210 ()) Ordering)
-      where
-        Compare_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                               arg. SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
-                                                        Compare_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
-    instance POrd (T a ()) where
-      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
-    type family ShowsPrec_0123456789876543210 (a :: GHC.Types.Nat) (a :: T a ()) (a :: Symbol) :: Symbol where
-      ShowsPrec_0123456789876543210 p_0123456789876543210 ((:*:) argL_0123456789876543210 argR_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 6))) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 7)) argL_0123456789876543210)) (Apply (Apply (.@#@$) (Apply ShowStringSym0 " :*: ")) (Apply (Apply ShowsPrecSym0 (FromInteger 7)) argR_0123456789876543210)))) a_0123456789876543210
-    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: T a0123456789876543210 ()) (a0123456789876543210 :: Symbol) =
-        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
-    data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: T a0123456789876543210 ()) :: (~>) Symbol Symbol
-      where
-        ShowsPrec_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
-    data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) :: forall a0123456789876543210.
-                                                                                      (~>) (T a0123456789876543210 ()) ((~>) Symbol Symbol)
-      where
-        ShowsPrec_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
-    data ShowsPrec_0123456789876543210Sym0 :: forall a0123456789876543210.
-                                              (~>) GHC.Types.Nat ((~>) (T a0123456789876543210 ()) ((~>) Symbol Symbol))
-      where
-        ShowsPrec_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
-    instance PShow (T a ()) where
-      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
-    type family Compare_0123456789876543210 (a :: S) (a :: S) :: Ordering where
-      Compare_0123456789876543210 S1 S1 = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) '[]
-      Compare_0123456789876543210 S2 S2 = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) '[]
-      Compare_0123456789876543210 S1 S2 = LTSym0
-      Compare_0123456789876543210 S2 S1 = GTSym0
-    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: S) (a0123456789876543210 :: S) =
-        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
-    data Compare_0123456789876543210Sym1 (a0123456789876543210 :: S) :: (~>) S Ordering
-      where
-        Compare_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                               a0123456789876543210
-                                                               arg. SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
-    data Compare_0123456789876543210Sym0 :: (~>) S ((~>) S Ordering)
-      where
-        Compare_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                               arg. SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
-                                                        Compare_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
-    instance POrd S where
-      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
-    type family ShowsPrec_0123456789876543210 (a :: GHC.Types.Nat) (a :: S) (a :: Symbol) :: Symbol where
-      ShowsPrec_0123456789876543210 _ S1 a_0123456789876543210 = Apply (Apply ShowStringSym0 "S1") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ S2 a_0123456789876543210 = Apply (Apply ShowStringSym0 "S2") a_0123456789876543210
-    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: S) (a0123456789876543210 :: Symbol) =
-        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
-    data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: S) :: (~>) Symbol Symbol
-      where
-        ShowsPrec_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
-    data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) :: (~>) S ((~>) Symbol Symbol)
-      where
-        ShowsPrec_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
-    data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) S ((~>) Symbol Symbol))
-      where
-        ShowsPrec_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
-    instance PShow S where
-      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
-    type family MinBound_0123456789876543210 :: S where
-      MinBound_0123456789876543210 = S1Sym0
-    type MinBound_0123456789876543210Sym0 =
-        MinBound_0123456789876543210
-    type family MaxBound_0123456789876543210 :: S where
-      MaxBound_0123456789876543210 = S2Sym0
-    type MaxBound_0123456789876543210Sym0 =
-        MaxBound_0123456789876543210
-    instance PBounded S where
-      type MinBound = MinBound_0123456789876543210Sym0
-      type MaxBound = MaxBound_0123456789876543210Sym0
-    type family Case_0123456789876543210 n t where
-      Case_0123456789876543210 n 'True = S2Sym0
-      Case_0123456789876543210 n 'False = Apply ErrorSym0 "toEnum: bad argument"
-    type family Case_0123456789876543210 n t where
-      Case_0123456789876543210 n 'True = S1Sym0
-      Case_0123456789876543210 n 'False = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (FromInteger 1))
-    type family ToEnum_0123456789876543210 (a :: GHC.Types.Nat) :: S where
-      ToEnum_0123456789876543210 n = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (FromInteger 0))
-    type ToEnum_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) =
-        ToEnum_0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ToEnum_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ToEnum_0123456789876543210Sym0KindInference) ())
-    data ToEnum_0123456789876543210Sym0 :: (~>) GHC.Types.Nat S
-      where
-        ToEnum_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                              arg. SameKind (Apply ToEnum_0123456789876543210Sym0 arg) (ToEnum_0123456789876543210Sym1 arg) =>
-                                                       ToEnum_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ToEnum_0123456789876543210Sym0 a0123456789876543210 = ToEnum_0123456789876543210 a0123456789876543210
-    type family FromEnum_0123456789876543210 (a :: S) :: GHC.Types.Nat where
-      FromEnum_0123456789876543210 S1 = FromInteger 0
-      FromEnum_0123456789876543210 S2 = FromInteger 1
-    type FromEnum_0123456789876543210Sym1 (a0123456789876543210 :: S) =
-        FromEnum_0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings FromEnum_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) FromEnum_0123456789876543210Sym0KindInference) ())
-    data FromEnum_0123456789876543210Sym0 :: (~>) S GHC.Types.Nat
-      where
-        FromEnum_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                arg. SameKind (Apply FromEnum_0123456789876543210Sym0 arg) (FromEnum_0123456789876543210Sym1 arg) =>
-                                                         FromEnum_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply FromEnum_0123456789876543210Sym0 a0123456789876543210 = FromEnum_0123456789876543210 a0123456789876543210
-    instance PEnum S where
-      type ToEnum a = Apply ToEnum_0123456789876543210Sym0 a
-      type FromEnum a = Apply FromEnum_0123456789876543210Sym0 a
-    type family Equals_0123456789876543210 (a :: T a ()) (b :: T a ()) :: Bool where
-      Equals_0123456789876543210 ((:*:) a a) ((:*:) b b) = (&&) ((==) a b) ((==) a b)
-      Equals_0123456789876543210 (_ :: T a ()) (_ :: T a ()) = FalseSym0
-    instance PEq (T a ()) where
-      type (==) a b = Equals_0123456789876543210 a b
-    type family Equals_0123456789876543210 (a :: S) (b :: S) :: Bool where
-      Equals_0123456789876543210 S1 S1 = TrueSym0
-      Equals_0123456789876543210 S2 S2 = TrueSym0
-      Equals_0123456789876543210 (_ :: S) (_ :: S) = FalseSym0
-    instance PEq S where
-      type (==) a b = Equals_0123456789876543210 a b
-    infixl 6 :%*:
-    data ST :: forall a b. T a b -> GHC.Types.Type
-      where
-        (:%*:) :: forall a b (n :: a) (n :: b).
-                  (Sing (n :: a)) -> (Sing (n :: b)) -> ST ((:*:) n n)
-    type instance Sing @(T a b) = ST
-    instance (SingKind a, SingKind b) => SingKind (T a b) where
-      type Demote (T a b) = T (Demote a) (Demote b)
-      fromSing ((:%*:) b b) = ((:*:) (fromSing b)) (fromSing b)
-      toSing ((:*:) (b :: Demote a) (b :: Demote b))
-        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b) of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:%*:) c) c) }
-    data SS :: S -> GHC.Types.Type
-      where
-        SS1 :: SS S1
-        SS2 :: SS S2
-    type instance Sing @S = SS
-    instance SingKind S where
-      type Demote S = S
-      fromSing SS1 = S1
-      fromSing SS2 = S2
-      toSing S1 = SomeSing SS1
-      toSing S2 = SomeSing SS2
-    instance SOrd a => SOrd (T a ()) where
-      sCompare ::
-        forall (t1 :: T a ()) (t2 :: T a ()).
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply (CompareSym0 :: TyFun (T a ()) ((~>) (T a ()) Ordering)
-                                                 -> GHC.Types.Type) t1) t2)
-      sCompare
-        ((:%*:) (sA_0123456789876543210 :: Sing a_0123456789876543210)
-                (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        ((:%*:) (sB_0123456789876543210 :: Sing b_0123456789876543210)
-                (sB_0123456789876543210 :: Sing b_0123456789876543210))
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            ((applySing
-                ((applySing ((singFun2 @(:@#@$)) SCons))
-                   ((applySing
-                       ((applySing ((singFun2 @CompareSym0) sCompare))
-                          sA_0123456789876543210))
-                      sB_0123456789876543210)))
-               ((applySing
-                   ((applySing ((singFun2 @(:@#@$)) SCons))
-                      ((applySing
-                          ((applySing ((singFun2 @CompareSym0) sCompare))
-                             sA_0123456789876543210))
-                         sB_0123456789876543210)))
-                  SNil))
-    instance SShow a => SShow (T a ()) where
-      sShowsPrec ::
-        forall (t1 :: GHC.Types.Nat) (t2 :: T a ()) (t3 :: Symbol).
-        Sing t1
-        -> Sing t2
-           -> Sing t3
-              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) (T a ()) ((~>) Symbol Symbol))
-                                                             -> GHC.Types.Type) t1) t2) t3)
-      sShowsPrec
-        (sP_0123456789876543210 :: Sing p_0123456789876543210)
-        ((:%*:) (sArgL_0123456789876543210 :: Sing argL_0123456789876543210)
-                (sArgR_0123456789876543210 :: Sing argR_0123456789876543210))
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
-                    ((applySing
-                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
-                       (sFromInteger (sing :: Sing 6)))))
-                ((applySing
-                    ((applySing ((singFun3 @(.@#@$)) (%.)))
-                       ((applySing
-                           ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                              (sFromInteger (sing :: Sing 7))))
-                          sArgL_0123456789876543210)))
-                   ((applySing
-                       ((applySing ((singFun3 @(.@#@$)) (%.)))
-                          ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                             (sing :: Sing " :*: "))))
-                      ((applySing
-                          ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                             (sFromInteger (sing :: Sing 7))))
-                         sArgR_0123456789876543210)))))
-            sA_0123456789876543210
-    instance SOrd S where
-      sCompare ::
-        forall (t1 :: S) (t2 :: S).
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply (CompareSym0 :: TyFun S ((~>) S Ordering)
-                                                 -> GHC.Types.Type) t1) t2)
-      sCompare SS1 SS1
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            SNil
-      sCompare SS2 SS2
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            SNil
-      sCompare SS1 SS2 = SLT
-      sCompare SS2 SS1 = SGT
-    instance SShow S where
-      sShowsPrec ::
-        forall (t1 :: GHC.Types.Nat) (t2 :: S) (t3 :: Symbol).
-        Sing t1
-        -> Sing t2
-           -> Sing t3
-              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) S ((~>) Symbol Symbol))
-                                                             -> GHC.Types.Type) t1) t2) t3)
-      sShowsPrec
-        _
-        SS1
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "S1")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SS2
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "S2")))
-            sA_0123456789876543210
-    instance SBounded S where
-      sMinBound :: Sing (MinBoundSym0 :: S)
-      sMaxBound :: Sing (MaxBoundSym0 :: S)
-      sMinBound = SS1
-      sMaxBound = SS2
-    instance SEnum S where
-      sToEnum ::
-        forall (t :: GHC.Types.Nat).
-        Sing t
-        -> Sing (Apply (ToEnumSym0 :: TyFun GHC.Types.Nat S
-                                      -> GHC.Types.Type) t)
-      sFromEnum ::
-        forall (t :: S).
-        Sing t
-        -> Sing (Apply (FromEnumSym0 :: TyFun S GHC.Types.Nat
-                                        -> GHC.Types.Type) t)
-      sToEnum (sN :: Sing n)
-        = (id
-             @(Sing (Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (FromInteger 0)))))
-            (case
-                 (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sN))
-                   (sFromInteger (sing :: Sing 0))
-             of
-               STrue -> SS1
-               SFalse
-                 -> (id
-                       @(Sing (Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (FromInteger 1)))))
-                      (case
-                           (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sN))
-                             (sFromInteger (sing :: Sing 1))
-                       of
-                         STrue -> SS2
-                         SFalse -> sError (sing :: Sing "toEnum: bad argument")))
-      sFromEnum SS1 = sFromInteger (sing :: Sing 0)
-      sFromEnum SS2 = sFromInteger (sing :: Sing 1)
-    instance SEq a => SEq (T a ()) where
-      (%==) ((:%*:) a a) ((:%*:) b b)
-        = ((%&&) (((%==) a) b)) (((%==) a) b)
-    instance SDecide a => SDecide (T a ()) where
-      (%~) ((:%*:) a a) ((:%*:) b b)
-        = case ((,) (((%~) a) b)) (((%~) a) b) of
-            (,) (Proved Refl) (Proved Refl) -> Proved Refl
-            (,) (Disproved contra) _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,) _ (Disproved contra)
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-    instance SDecide a =>
-             Data.Type.Equality.TestEquality (ST :: T a ()
-                                                    -> GHC.Types.Type) where
-      Data.Type.Equality.testEquality
-        = Data.Singletons.Decide.decideEquality
-    instance SDecide a =>
-             Data.Type.Coercion.TestCoercion (ST :: T a ()
-                                                    -> GHC.Types.Type) where
-      Data.Type.Coercion.testCoercion
-        = Data.Singletons.Decide.decideCoercion
-    instance SEq S where
-      (%==) SS1 SS1 = STrue
-      (%==) SS1 SS2 = SFalse
-      (%==) SS2 SS1 = SFalse
-      (%==) SS2 SS2 = STrue
-    instance SDecide S where
-      (%~) SS1 SS1 = Proved Refl
-      (%~) SS1 SS2 = Disproved (\ x -> case x of)
-      (%~) SS2 SS1 = Disproved (\ x -> case x of)
-      (%~) SS2 SS2 = Proved Refl
-    instance Data.Type.Equality.TestEquality (SS :: S
-                                                    -> GHC.Types.Type) where
-      Data.Type.Equality.testEquality
-        = Data.Singletons.Decide.decideEquality
-    instance Data.Type.Coercion.TestCoercion (SS :: S
-                                                    -> GHC.Types.Type) where
-      Data.Type.Coercion.testCoercion
-        = Data.Singletons.Decide.decideCoercion
-    instance Data.Singletons.ShowSing.ShowSing a =>
-             Show (ST (z :: T a ())) where
-      showsPrec
-        p_0123456789876543210
-        ((:%*:) (argL_0123456789876543210 :: Sing argTyL_0123456789876543210)
-                (argR_0123456789876543210 :: Sing argTyR_0123456789876543210))
-        = (showParen (((>) p_0123456789876543210) 9))
-            (((.) ((showsPrec 10) argL_0123456789876543210))
-               (((.) (showString " :%*: "))
-                  ((showsPrec 10) argR_0123456789876543210))) ::
-            (Data.Singletons.ShowSing.ShowSing' argTyL_0123456789876543210,
-             Data.Singletons.ShowSing.ShowSing' argTyR_0123456789876543210) =>
-            ShowS
-    instance Show (SS (z :: S)) where
-      showsPrec _ SS1 = showString "SS1"
-      showsPrec _ SS2 = showString "SS2"
-    instance (SingI n, SingI n) =>
-             SingI ((:*:) (n :: a) (n :: b)) where
-      sing = ((:%*:) sing) sing
-    instance SingI ((:*:@#@$) :: (~>) a ((~>) b (T a b))) where
-      sing = (singFun2 @(:*:@#@$)) (:%*:)
-    instance SingI d =>
-             SingI ((:*:@#@$$) (d :: a) :: (~>) b (T a b)) where
-      sing = (singFun1 @((:*:@#@$$) (d :: a))) ((:%*:) (sing @d))
-    instance SingI S1 where
-      sing = SS1
-    instance SingI S2 where
-      sing = SS2
diff --git a/tests/compile-and-dump/Singletons/StandaloneDeriving.golden b/tests/compile-and-dump/Singletons/StandaloneDeriving.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/StandaloneDeriving.golden
@@ -0,0 +1,479 @@
+Singletons/StandaloneDeriving.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| infixl 6 :*:
+          
+          data T a b = a :*: b
+          data S = S1 | S2
+          
+          deriving instance Enum S
+          deriving instance Bounded S
+          deriving instance Show S
+          deriving instance Ord S
+          deriving instance Eq S
+          deriving instance Show a => Show (T a ())
+          deriving instance Ord a => Ord (T a ())
+          deriving instance Eq a => Eq (T a ()) |]
+  ======>
+    infixl 6 :*:
+    data T a b = a :*: b
+    data S = S1 | S2
+    deriving instance Eq a => Eq (T a ())
+    deriving instance Ord a => Ord (T a ())
+    deriving instance Show a => Show (T a ())
+    deriving instance Eq S
+    deriving instance Ord S
+    deriving instance Show S
+    deriving instance Bounded S
+    deriving instance Enum S
+    type (:*:@#@$) :: forall a b. (~>) a ((~>) b (T a b))
+    data (:*:@#@$) a0123456789876543210
+      where
+        (::*:@#@$###) :: SameKind (Apply (:*:@#@$) arg) ((:*:@#@$$) arg) =>
+                         (:*:@#@$) a0123456789876543210
+    type instance Apply (:*:@#@$) a0123456789876543210 = (:*:@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (:*:@#@$) where
+      suppressUnusedWarnings = snd (((,) (::*:@#@$###)) ())
+    infixl 6 :*:@#@$
+    type (:*:@#@$$) :: forall a b. a -> (~>) b (T a b)
+    data (:*:@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (::*:@#@$$###) :: SameKind (Apply ((:*:@#@$$) a0123456789876543210) arg) ((:*:@#@$$$) a0123456789876543210 arg) =>
+                          (:*:@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((:*:@#@$$) a0123456789876543210) a0123456789876543210 = (:*:@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((:*:@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (::*:@#@$$###)) ())
+    infixl 6 :*:@#@$$
+    type (:*:@#@$$$) (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        (:*:) a0123456789876543210 a0123456789876543210 :: T a b
+    infixl 6 :*:@#@$$$
+    type S1Sym0 = S1 :: S
+    type S2Sym0 = S2 :: S
+    type Compare_0123456789876543210 :: T a () -> T a () -> Ordering
+    type family Compare_0123456789876543210 a a where
+      Compare_0123456789876543210 ((:*:) a_0123456789876543210 a_0123456789876543210) ((:*:) b_0123456789876543210 b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0))
+    type Compare_0123456789876543210Sym0 :: (~>) (T a ()) ((~>) (T a ()) Ordering)
+    data Compare_0123456789876543210Sym0 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
+                                                        Compare_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
+    type Compare_0123456789876543210Sym1 :: T a ()
+                                            -> (~>) (T a ()) Ordering
+    data Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
+    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: T a ()) (a0123456789876543210 :: T a ()) =
+        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    instance POrd (T a ()) where
+      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
+    type ShowsPrec_0123456789876543210 :: GHC.Types.Nat
+                                          -> T a () -> Symbol -> Symbol
+    type family ShowsPrec_0123456789876543210 a a a where
+      ShowsPrec_0123456789876543210 p_0123456789876543210 ((:*:) argL_0123456789876543210 argR_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 6))) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 7)) argL_0123456789876543210)) (Apply (Apply (.@#@$) (Apply ShowStringSym0 " :*: ")) (Apply (Apply ShowsPrecSym0 (FromInteger 7)) argR_0123456789876543210)))) a_0123456789876543210
+    type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) (T a ()) ((~>) Symbol Symbol))
+    data ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
+    type ShowsPrec_0123456789876543210Sym1 :: GHC.Types.Nat
+                                              -> (~>) (T a ()) ((~>) Symbol Symbol)
+    data ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
+    type ShowsPrec_0123456789876543210Sym2 :: GHC.Types.Nat
+                                              -> T a () -> (~>) Symbol Symbol
+    data ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
+    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: T a ()) (a0123456789876543210 :: Symbol) =
+        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Symbol
+    instance PShow (T a ()) where
+      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
+    type Compare_0123456789876543210 :: S -> S -> Ordering
+    type family Compare_0123456789876543210 a a where
+      Compare_0123456789876543210 S1 S1 = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) NilSym0
+      Compare_0123456789876543210 S2 S2 = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) NilSym0
+      Compare_0123456789876543210 S1 S2 = LTSym0
+      Compare_0123456789876543210 S2 S1 = GTSym0
+    type Compare_0123456789876543210Sym0 :: (~>) S ((~>) S Ordering)
+    data Compare_0123456789876543210Sym0 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
+                                                        Compare_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
+    type Compare_0123456789876543210Sym1 :: S -> (~>) S Ordering
+    data Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
+    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: S) (a0123456789876543210 :: S) =
+        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    instance POrd S where
+      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
+    type ShowsPrec_0123456789876543210 :: GHC.Types.Nat
+                                          -> S -> Symbol -> Symbol
+    type family ShowsPrec_0123456789876543210 a a a where
+      ShowsPrec_0123456789876543210 _ S1 a_0123456789876543210 = Apply (Apply ShowStringSym0 "S1") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ S2 a_0123456789876543210 = Apply (Apply ShowStringSym0 "S2") a_0123456789876543210
+    type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) S ((~>) Symbol Symbol))
+    data ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
+    type ShowsPrec_0123456789876543210Sym1 :: GHC.Types.Nat
+                                              -> (~>) S ((~>) Symbol Symbol)
+    data ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
+    type ShowsPrec_0123456789876543210Sym2 :: GHC.Types.Nat
+                                              -> S -> (~>) Symbol Symbol
+    data ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
+    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: S) (a0123456789876543210 :: Symbol) =
+        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Symbol
+    instance PShow S where
+      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
+    type MinBound_0123456789876543210 :: S
+    type family MinBound_0123456789876543210 where
+      MinBound_0123456789876543210 = S1Sym0
+    type MinBound_0123456789876543210Sym0 =
+        MinBound_0123456789876543210 :: S
+    type MaxBound_0123456789876543210 :: S
+    type family MaxBound_0123456789876543210 where
+      MaxBound_0123456789876543210 = S2Sym0
+    type MaxBound_0123456789876543210Sym0 =
+        MaxBound_0123456789876543210 :: S
+    instance PBounded S where
+      type MinBound = MinBound_0123456789876543210Sym0
+      type MaxBound = MaxBound_0123456789876543210Sym0
+    type family Case_0123456789876543210 n t where
+      Case_0123456789876543210 n 'True = S2Sym0
+      Case_0123456789876543210 n 'False = Apply ErrorSym0 "toEnum: bad argument"
+    type family Case_0123456789876543210 n t where
+      Case_0123456789876543210 n 'True = S1Sym0
+      Case_0123456789876543210 n 'False = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (FromInteger 1))
+    type ToEnum_0123456789876543210 :: GHC.Types.Nat -> S
+    type family ToEnum_0123456789876543210 a where
+      ToEnum_0123456789876543210 n = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (FromInteger 0))
+    type ToEnum_0123456789876543210Sym0 :: (~>) GHC.Types.Nat S
+    data ToEnum_0123456789876543210Sym0 a0123456789876543210
+      where
+        ToEnum_0123456789876543210Sym0KindInference :: SameKind (Apply ToEnum_0123456789876543210Sym0 arg) (ToEnum_0123456789876543210Sym1 arg) =>
+                                                       ToEnum_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ToEnum_0123456789876543210Sym0 a0123456789876543210 = ToEnum_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ToEnum_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ToEnum_0123456789876543210Sym0KindInference) ())
+    type ToEnum_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) =
+        ToEnum_0123456789876543210 a0123456789876543210 :: S
+    type FromEnum_0123456789876543210 :: S -> GHC.Types.Nat
+    type family FromEnum_0123456789876543210 a where
+      FromEnum_0123456789876543210 S1 = FromInteger 0
+      FromEnum_0123456789876543210 S2 = FromInteger 1
+    type FromEnum_0123456789876543210Sym0 :: (~>) S GHC.Types.Nat
+    data FromEnum_0123456789876543210Sym0 a0123456789876543210
+      where
+        FromEnum_0123456789876543210Sym0KindInference :: SameKind (Apply FromEnum_0123456789876543210Sym0 arg) (FromEnum_0123456789876543210Sym1 arg) =>
+                                                         FromEnum_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply FromEnum_0123456789876543210Sym0 a0123456789876543210 = FromEnum_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings FromEnum_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) FromEnum_0123456789876543210Sym0KindInference) ())
+    type FromEnum_0123456789876543210Sym1 (a0123456789876543210 :: S) =
+        FromEnum_0123456789876543210 a0123456789876543210 :: GHC.Types.Nat
+    instance PEnum S where
+      type ToEnum a = Apply ToEnum_0123456789876543210Sym0 a
+      type FromEnum a = Apply FromEnum_0123456789876543210Sym0 a
+    type Equals_0123456789876543210 :: T a () -> T a () -> Bool
+    type family Equals_0123456789876543210 a b where
+      Equals_0123456789876543210 ((:*:) a a) ((:*:) b b) = (&&) ((==) a b) ((==) a b)
+      Equals_0123456789876543210 (_ :: T a ()) (_ :: T a ()) = FalseSym0
+    instance PEq (T a ()) where
+      type (==) a b = Equals_0123456789876543210 a b
+    type Equals_0123456789876543210 :: S -> S -> Bool
+    type family Equals_0123456789876543210 a b where
+      Equals_0123456789876543210 S1 S1 = TrueSym0
+      Equals_0123456789876543210 S2 S2 = TrueSym0
+      Equals_0123456789876543210 (_ :: S) (_ :: S) = FalseSym0
+    instance PEq S where
+      type (==) a b = Equals_0123456789876543210 a b
+    infixl 6 :%*:
+    data ST :: forall a b. T a b -> GHC.Types.Type
+      where
+        (:%*:) :: forall a b (n :: a) (n :: b).
+                  (Sing n) -> (Sing n) -> ST ((:*:) n n :: T a b)
+    type instance Sing @(T a b) = ST
+    instance (SingKind a, SingKind b) => SingKind (T a b) where
+      type Demote (T a b) = T (Demote a) (Demote b)
+      fromSing ((:%*:) b b) = ((:*:) (fromSing b)) (fromSing b)
+      toSing ((:*:) (b :: Demote a) (b :: Demote b))
+        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b) of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:%*:) c) c) }
+    data SS :: S -> GHC.Types.Type
+      where
+        SS1 :: SS (S1 :: S)
+        SS2 :: SS (S2 :: S)
+    type instance Sing @S = SS
+    instance SingKind S where
+      type Demote S = S
+      fromSing SS1 = S1
+      fromSing SS2 = S2
+      toSing S1 = SomeSing SS1
+      toSing S2 = SomeSing SS2
+    instance SOrd a => SOrd (T a ()) where
+      sCompare ::
+        forall (t1 :: T a ()) (t2 :: T a ()).
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply (CompareSym0 :: TyFun (T a ()) ((~>) (T a ()) Ordering)
+                                                 -> GHC.Types.Type) t1) t2)
+      sCompare
+        ((:%*:) (sA_0123456789876543210 :: Sing a_0123456789876543210)
+                (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        ((:%*:) (sB_0123456789876543210 :: Sing b_0123456789876543210)
+                (sB_0123456789876543210 :: Sing b_0123456789876543210))
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            ((applySing
+                ((applySing ((singFun2 @(:@#@$)) SCons))
+                   ((applySing
+                       ((applySing ((singFun2 @CompareSym0) sCompare))
+                          sA_0123456789876543210))
+                      sB_0123456789876543210)))
+               ((applySing
+                   ((applySing ((singFun2 @(:@#@$)) SCons))
+                      ((applySing
+                          ((applySing ((singFun2 @CompareSym0) sCompare))
+                             sA_0123456789876543210))
+                         sB_0123456789876543210)))
+                  SNil))
+    instance SShow a => SShow (T a ()) where
+      sShowsPrec ::
+        forall (t1 :: GHC.Types.Nat) (t2 :: T a ()) (t3 :: Symbol).
+        Sing t1
+        -> Sing t2
+           -> Sing t3
+              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) (T a ()) ((~>) Symbol Symbol))
+                                                             -> GHC.Types.Type) t1) t2) t3)
+      sShowsPrec
+        (sP_0123456789876543210 :: Sing p_0123456789876543210)
+        ((:%*:) (sArgL_0123456789876543210 :: Sing argL_0123456789876543210)
+                (sArgR_0123456789876543210 :: Sing argR_0123456789876543210))
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
+                    ((applySing
+                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
+                       (sFromInteger (sing :: Sing 6)))))
+                ((applySing
+                    ((applySing ((singFun3 @(.@#@$)) (%.)))
+                       ((applySing
+                           ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                              (sFromInteger (sing :: Sing 7))))
+                          sArgL_0123456789876543210)))
+                   ((applySing
+                       ((applySing ((singFun3 @(.@#@$)) (%.)))
+                          ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                             (sing :: Sing " :*: "))))
+                      ((applySing
+                          ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                             (sFromInteger (sing :: Sing 7))))
+                         sArgR_0123456789876543210)))))
+            sA_0123456789876543210
+    instance SOrd S where
+      sCompare ::
+        forall (t1 :: S) (t2 :: S).
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply (CompareSym0 :: TyFun S ((~>) S Ordering)
+                                                 -> GHC.Types.Type) t1) t2)
+      sCompare SS1 SS1
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            SNil
+      sCompare SS2 SS2
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            SNil
+      sCompare SS1 SS2 = SLT
+      sCompare SS2 SS1 = SGT
+    instance SShow S where
+      sShowsPrec ::
+        forall (t1 :: GHC.Types.Nat) (t2 :: S) (t3 :: Symbol).
+        Sing t1
+        -> Sing t2
+           -> Sing t3
+              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) S ((~>) Symbol Symbol))
+                                                             -> GHC.Types.Type) t1) t2) t3)
+      sShowsPrec
+        _
+        SS1
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "S1")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SS2
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "S2")))
+            sA_0123456789876543210
+    instance SBounded S where
+      sMinBound :: Sing (MinBoundSym0 :: S)
+      sMaxBound :: Sing (MaxBoundSym0 :: S)
+      sMinBound = SS1
+      sMaxBound = SS2
+    instance SEnum S where
+      sToEnum ::
+        forall (t :: GHC.Types.Nat).
+        Sing t
+        -> Sing (Apply (ToEnumSym0 :: TyFun GHC.Types.Nat S
+                                      -> GHC.Types.Type) t)
+      sFromEnum ::
+        forall (t :: S).
+        Sing t
+        -> Sing (Apply (FromEnumSym0 :: TyFun S GHC.Types.Nat
+                                        -> GHC.Types.Type) t)
+      sToEnum (sN :: Sing n)
+        = (id
+             @(Sing (Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (FromInteger 0)))))
+            (case
+                 (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sN))
+                   (sFromInteger (sing :: Sing 0))
+             of
+               STrue -> SS1
+               SFalse
+                 -> (id
+                       @(Sing (Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (FromInteger 1)))))
+                      (case
+                           (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sN))
+                             (sFromInteger (sing :: Sing 1))
+                       of
+                         STrue -> SS2
+                         SFalse -> sError (sing :: Sing "toEnum: bad argument")))
+      sFromEnum SS1 = sFromInteger (sing :: Sing 0)
+      sFromEnum SS2 = sFromInteger (sing :: Sing 1)
+    instance SEq a => SEq (T a ()) where
+      (%==) ((:%*:) a a) ((:%*:) b b)
+        = ((%&&) (((%==) a) b)) (((%==) a) b)
+    instance SDecide a => SDecide (T a ()) where
+      (%~) ((:%*:) a a) ((:%*:) b b)
+        = case ((,) (((%~) a) b)) (((%~) a) b) of
+            (,) (Proved Refl) (Proved Refl) -> Proved Refl
+            (,) (Disproved contra) _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,) _ (Disproved contra)
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+    instance SDecide a =>
+             Data.Type.Equality.TestEquality (ST :: T a ()
+                                                    -> GHC.Types.Type) where
+      Data.Type.Equality.testEquality
+        = Data.Singletons.Decide.decideEquality
+    instance SDecide a =>
+             Data.Type.Coercion.TestCoercion (ST :: T a ()
+                                                    -> GHC.Types.Type) where
+      Data.Type.Coercion.testCoercion
+        = Data.Singletons.Decide.decideCoercion
+    instance SEq S where
+      (%==) SS1 SS1 = STrue
+      (%==) SS1 SS2 = SFalse
+      (%==) SS2 SS1 = SFalse
+      (%==) SS2 SS2 = STrue
+    instance SDecide S where
+      (%~) SS1 SS1 = Proved Refl
+      (%~) SS1 SS2 = Disproved (\ x -> case x of)
+      (%~) SS2 SS1 = Disproved (\ x -> case x of)
+      (%~) SS2 SS2 = Proved Refl
+    instance Data.Type.Equality.TestEquality (SS :: S
+                                                    -> GHC.Types.Type) where
+      Data.Type.Equality.testEquality
+        = Data.Singletons.Decide.decideEquality
+    instance Data.Type.Coercion.TestCoercion (SS :: S
+                                                    -> GHC.Types.Type) where
+      Data.Type.Coercion.testCoercion
+        = Data.Singletons.Decide.decideCoercion
+    instance Data.Singletons.ShowSing.ShowSing a =>
+             Show (ST (z :: T a ())) where
+      showsPrec
+        p_0123456789876543210
+        ((:%*:) (argL_0123456789876543210 :: Sing argTyL_0123456789876543210)
+                (argR_0123456789876543210 :: Sing argTyR_0123456789876543210))
+        = (showParen (((>) p_0123456789876543210) 9))
+            (((.) ((showsPrec 10) argL_0123456789876543210))
+               (((.) (showString " :%*: "))
+                  ((showsPrec 10) argR_0123456789876543210))) ::
+            (Data.Singletons.ShowSing.ShowSing' argTyL_0123456789876543210,
+             Data.Singletons.ShowSing.ShowSing' argTyR_0123456789876543210) =>
+            ShowS
+    instance Show (SS (z :: S)) where
+      showsPrec _ SS1 = showString "SS1"
+      showsPrec _ SS2 = showString "SS2"
+    instance (SingI n, SingI n) =>
+             SingI ((:*:) (n :: a) (n :: b)) where
+      sing = ((:%*:) sing) sing
+    instance SingI ((:*:@#@$) :: (~>) a ((~>) b (T a b))) where
+      sing = (singFun2 @(:*:@#@$)) (:%*:)
+    instance SingI d =>
+             SingI ((:*:@#@$$) (d :: a) :: (~>) b (T a b)) where
+      sing = (singFun1 @((:*:@#@$$) (d :: a))) ((:%*:) (sing @d))
+    instance SingI S1 where
+      sing = SS1
+    instance SingI S2 where
+      sing = SS2
diff --git a/tests/compile-and-dump/Singletons/Star.ghc88.template b/tests/compile-and-dump/Singletons/Star.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/Star.ghc88.template
+++ /dev/null
@@ -1,421 +0,0 @@
-Singletons/Star.hs:0:0:: Splicing declarations
-    singletonStar [''Nat, ''Int, ''String, ''Maybe, ''Vec]
-  ======>
-    data Rep :: Type
-      where
-        Singletons.Star.Nat :: Rep
-        Singletons.Star.Int :: Rep
-        Singletons.Star.String :: Rep
-        Singletons.Star.Maybe :: Rep -> Rep
-        Singletons.Star.Vec :: Rep -> Nat -> Rep
-      deriving (Eq, Ord, Read, Show)
-    type NatSym0 = Nat
-    type IntSym0 = Int
-    type StringSym0 = String
-    type MaybeSym1 (t0123456789876543210 :: Type) =
-        Maybe t0123456789876543210
-    instance SuppressUnusedWarnings MaybeSym0 where
-      suppressUnusedWarnings = snd (((,) MaybeSym0KindInference) ())
-    data MaybeSym0 :: (~>) Type Type
-      where
-        MaybeSym0KindInference :: forall t0123456789876543210
-                                         arg. SameKind (Apply MaybeSym0 arg) (MaybeSym1 arg) =>
-                                  MaybeSym0 t0123456789876543210
-    type instance Apply MaybeSym0 t0123456789876543210 = Maybe t0123456789876543210
-    type VecSym2 (t0123456789876543210 :: Type) (t0123456789876543210 :: Nat) =
-        Vec t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (VecSym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) VecSym1KindInference) ())
-    data VecSym1 (t0123456789876543210 :: Type) :: (~>) Nat Type
-      where
-        VecSym1KindInference :: forall t0123456789876543210
-                                       t0123456789876543210
-                                       arg. SameKind (Apply (VecSym1 t0123456789876543210) arg) (VecSym2 t0123456789876543210 arg) =>
-                                VecSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (VecSym1 t0123456789876543210) t0123456789876543210 = Vec t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings VecSym0 where
-      suppressUnusedWarnings = snd (((,) VecSym0KindInference) ())
-    data VecSym0 :: (~>) Type ((~>) Nat Type)
-      where
-        VecSym0KindInference :: forall t0123456789876543210
-                                       arg. SameKind (Apply VecSym0 arg) (VecSym1 arg) =>
-                                VecSym0 t0123456789876543210
-    type instance Apply VecSym0 t0123456789876543210 = VecSym1 t0123456789876543210
-    type family Equals_0123456789876543210 (a :: Type) (b :: Type) :: Bool where
-      Equals_0123456789876543210 Nat Nat = TrueSym0
-      Equals_0123456789876543210 Int Int = TrueSym0
-      Equals_0123456789876543210 String String = TrueSym0
-      Equals_0123456789876543210 (Maybe a) (Maybe b) = (==) a b
-      Equals_0123456789876543210 (Vec a a) (Vec b b) = (&&) ((==) a b) ((==) a b)
-      Equals_0123456789876543210 (_ :: Type) (_ :: Type) = FalseSym0
-    instance PEq Type where
-      type (==) a b = Equals_0123456789876543210 a b
-    type family Compare_0123456789876543210 (a :: Type) (a :: Type) :: Ordering where
-      Compare_0123456789876543210 Nat Nat = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) '[]
-      Compare_0123456789876543210 Int Int = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) '[]
-      Compare_0123456789876543210 String String = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) '[]
-      Compare_0123456789876543210 (Maybe a_0123456789876543210) (Maybe b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) '[])
-      Compare_0123456789876543210 (Vec a_0123456789876543210 a_0123456789876543210) (Vec b_0123456789876543210 b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) '[]))
-      Compare_0123456789876543210 Nat Int = LTSym0
-      Compare_0123456789876543210 Nat String = LTSym0
-      Compare_0123456789876543210 Nat (Maybe _) = LTSym0
-      Compare_0123456789876543210 Nat (Vec _ _) = LTSym0
-      Compare_0123456789876543210 Int Nat = GTSym0
-      Compare_0123456789876543210 Int String = LTSym0
-      Compare_0123456789876543210 Int (Maybe _) = LTSym0
-      Compare_0123456789876543210 Int (Vec _ _) = LTSym0
-      Compare_0123456789876543210 String Nat = GTSym0
-      Compare_0123456789876543210 String Int = GTSym0
-      Compare_0123456789876543210 String (Maybe _) = LTSym0
-      Compare_0123456789876543210 String (Vec _ _) = LTSym0
-      Compare_0123456789876543210 (Maybe _) Nat = GTSym0
-      Compare_0123456789876543210 (Maybe _) Int = GTSym0
-      Compare_0123456789876543210 (Maybe _) String = GTSym0
-      Compare_0123456789876543210 (Maybe _) (Vec _ _) = LTSym0
-      Compare_0123456789876543210 (Vec _ _) Nat = GTSym0
-      Compare_0123456789876543210 (Vec _ _) Int = GTSym0
-      Compare_0123456789876543210 (Vec _ _) String = GTSym0
-      Compare_0123456789876543210 (Vec _ _) (Maybe _) = GTSym0
-    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Type) (a0123456789876543210 :: Type) =
-        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
-    data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Type) :: (~>) Type Ordering
-      where
-        Compare_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                               a0123456789876543210
-                                                               arg. SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
-    data Compare_0123456789876543210Sym0 :: (~>) Type ((~>) Type Ordering)
-      where
-        Compare_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                               arg. SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
-                                                        Compare_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
-    instance POrd Type where
-      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
-    type family ShowsPrec_0123456789876543210 (a :: GHC.Types.Nat) (a :: Type) (a :: Symbol) :: Symbol where
-      ShowsPrec_0123456789876543210 _ Nat a_0123456789876543210 = Apply (Apply ShowStringSym0 "Nat") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ Int a_0123456789876543210 = Apply (Apply ShowStringSym0 "Int") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ String a_0123456789876543210 = Apply (Apply ShowStringSym0 "String") a_0123456789876543210
-      ShowsPrec_0123456789876543210 p_0123456789876543210 (Maybe arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Maybe ")) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))) a_0123456789876543210
-      ShowsPrec_0123456789876543210 p_0123456789876543210 (Vec arg_0123456789876543210 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Vec ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowSpaceSym0) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))))) a_0123456789876543210
-    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Type) (a0123456789876543210 :: Symbol) =
-        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
-    data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Type) :: (~>) Symbol Symbol
-      where
-        ShowsPrec_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
-    data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) :: (~>) Type ((~>) Symbol Symbol)
-      where
-        ShowsPrec_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
-    data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) Type ((~>) Symbol Symbol))
-      where
-        ShowsPrec_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
-    instance PShow Type where
-      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
-    data SRep :: Type -> Type
-      where
-        SNat :: SRep Nat
-        SInt :: SRep Int
-        SString :: SRep String
-        SMaybe :: forall (n :: Type). (Sing (n :: Type)) -> SRep (Maybe n)
-        SVec :: forall (n :: Type) (n :: Nat).
-                (Sing (n :: Type)) -> (Sing (n :: Nat)) -> SRep (Vec n n)
-    type instance Sing @Type = SRep
-    instance SingKind Type where
-      type Demote Type = Rep
-      fromSing SNat = Singletons.Star.Nat
-      fromSing SInt = Singletons.Star.Int
-      fromSing SString = Singletons.Star.String
-      fromSing (SMaybe b) = Singletons.Star.Maybe (fromSing b)
-      fromSing (SVec b b)
-        = (Singletons.Star.Vec (fromSing b)) (fromSing b)
-      toSing Singletons.Star.Nat = SomeSing SNat
-      toSing Singletons.Star.Int = SomeSing SInt
-      toSing Singletons.Star.String = SomeSing SString
-      toSing (Singletons.Star.Maybe (b :: Demote Type))
-        = case toSing b :: SomeSing Type of {
-            SomeSing c -> SomeSing (SMaybe c) }
-      toSing (Singletons.Star.Vec (b :: Demote Type) (b :: Demote Nat))
-        = case
-              ((,) (toSing b :: SomeSing Type)) (toSing b :: SomeSing Nat)
-          of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SVec c) c) }
-    instance (SEq Type, SEq Nat) => SEq Type where
-      (%==) SNat SNat = STrue
-      (%==) SNat SInt = SFalse
-      (%==) SNat SString = SFalse
-      (%==) SNat (SMaybe _) = SFalse
-      (%==) SNat (SVec _ _) = SFalse
-      (%==) SInt SNat = SFalse
-      (%==) SInt SInt = STrue
-      (%==) SInt SString = SFalse
-      (%==) SInt (SMaybe _) = SFalse
-      (%==) SInt (SVec _ _) = SFalse
-      (%==) SString SNat = SFalse
-      (%==) SString SInt = SFalse
-      (%==) SString SString = STrue
-      (%==) SString (SMaybe _) = SFalse
-      (%==) SString (SVec _ _) = SFalse
-      (%==) (SMaybe _) SNat = SFalse
-      (%==) (SMaybe _) SInt = SFalse
-      (%==) (SMaybe _) SString = SFalse
-      (%==) (SMaybe a) (SMaybe b) = ((%==) a) b
-      (%==) (SMaybe _) (SVec _ _) = SFalse
-      (%==) (SVec _ _) SNat = SFalse
-      (%==) (SVec _ _) SInt = SFalse
-      (%==) (SVec _ _) SString = SFalse
-      (%==) (SVec _ _) (SMaybe _) = SFalse
-      (%==) (SVec a a) (SVec b b) = ((%&&) (((%==) a) b)) (((%==) a) b)
-    instance (SDecide Type, SDecide Nat) => SDecide Type where
-      (%~) SNat SNat = Proved Refl
-      (%~) SNat SInt = Disproved (\ x -> case x of)
-      (%~) SNat SString = Disproved (\ x -> case x of)
-      (%~) SNat (SMaybe _) = Disproved (\ x -> case x of)
-      (%~) SNat (SVec _ _) = Disproved (\ x -> case x of)
-      (%~) SInt SNat = Disproved (\ x -> case x of)
-      (%~) SInt SInt = Proved Refl
-      (%~) SInt SString = Disproved (\ x -> case x of)
-      (%~) SInt (SMaybe _) = Disproved (\ x -> case x of)
-      (%~) SInt (SVec _ _) = Disproved (\ x -> case x of)
-      (%~) SString SNat = Disproved (\ x -> case x of)
-      (%~) SString SInt = Disproved (\ x -> case x of)
-      (%~) SString SString = Proved Refl
-      (%~) SString (SMaybe _) = Disproved (\ x -> case x of)
-      (%~) SString (SVec _ _) = Disproved (\ x -> case x of)
-      (%~) (SMaybe _) SNat = Disproved (\ x -> case x of)
-      (%~) (SMaybe _) SInt = Disproved (\ x -> case x of)
-      (%~) (SMaybe _) SString = Disproved (\ x -> case x of)
-      (%~) (SMaybe a) (SMaybe b)
-        = case ((%~) a) b of
-            Proved Refl -> Proved Refl
-            Disproved contra
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-      (%~) (SMaybe _) (SVec _ _) = Disproved (\ x -> case x of)
-      (%~) (SVec _ _) SNat = Disproved (\ x -> case x of)
-      (%~) (SVec _ _) SInt = Disproved (\ x -> case x of)
-      (%~) (SVec _ _) SString = Disproved (\ x -> case x of)
-      (%~) (SVec _ _) (SMaybe _) = Disproved (\ x -> case x of)
-      (%~) (SVec a a) (SVec b b)
-        = case ((,) (((%~) a) b)) (((%~) a) b) of
-            (,) (Proved Refl) (Proved Refl) -> Proved Refl
-            (,) (Disproved contra) _
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-            (,) _ (Disproved contra)
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-    instance (SDecide Type, SDecide Nat) =>
-             Data.Type.Equality.TestEquality (SRep :: Type -> Type) where
-      Data.Type.Equality.testEquality = decideEquality
-    instance (SDecide Type, SDecide Nat) =>
-             Data.Type.Coercion.TestCoercion (SRep :: Type -> Type) where
-      Data.Type.Coercion.testCoercion = decideCoercion
-    instance (SOrd Type, SOrd Nat) => SOrd Type where
-      sCompare ::
-        forall (t1 :: Type) (t2 :: Type).
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply (CompareSym0 :: TyFun Type ((~>) Type Ordering)
-                                                 -> Type) t1) t2)
-      sCompare SNat SNat
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            SNil
-      sCompare SInt SInt
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            SNil
-      sCompare SString SString
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            SNil
-      sCompare
-        (SMaybe (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        (SMaybe (sB_0123456789876543210 :: Sing b_0123456789876543210))
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            ((applySing
-                ((applySing ((singFun2 @(:@#@$)) SCons))
-                   ((applySing
-                       ((applySing ((singFun2 @CompareSym0) sCompare))
-                          sA_0123456789876543210))
-                      sB_0123456789876543210)))
-               SNil)
-      sCompare
-        (SVec (sA_0123456789876543210 :: Sing a_0123456789876543210)
-              (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        (SVec (sB_0123456789876543210 :: Sing b_0123456789876543210)
-              (sB_0123456789876543210 :: Sing b_0123456789876543210))
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            ((applySing
-                ((applySing ((singFun2 @(:@#@$)) SCons))
-                   ((applySing
-                       ((applySing ((singFun2 @CompareSym0) sCompare))
-                          sA_0123456789876543210))
-                      sB_0123456789876543210)))
-               ((applySing
-                   ((applySing ((singFun2 @(:@#@$)) SCons))
-                      ((applySing
-                          ((applySing ((singFun2 @CompareSym0) sCompare))
-                             sA_0123456789876543210))
-                         sB_0123456789876543210)))
-                  SNil))
-      sCompare SNat SInt = SLT
-      sCompare SNat SString = SLT
-      sCompare SNat (SMaybe _) = SLT
-      sCompare SNat (SVec _ _) = SLT
-      sCompare SInt SNat = SGT
-      sCompare SInt SString = SLT
-      sCompare SInt (SMaybe _) = SLT
-      sCompare SInt (SVec _ _) = SLT
-      sCompare SString SNat = SGT
-      sCompare SString SInt = SGT
-      sCompare SString (SMaybe _) = SLT
-      sCompare SString (SVec _ _) = SLT
-      sCompare (SMaybe _) SNat = SGT
-      sCompare (SMaybe _) SInt = SGT
-      sCompare (SMaybe _) SString = SGT
-      sCompare (SMaybe _) (SVec _ _) = SLT
-      sCompare (SVec _ _) SNat = SGT
-      sCompare (SVec _ _) SInt = SGT
-      sCompare (SVec _ _) SString = SGT
-      sCompare (SVec _ _) (SMaybe _) = SGT
-    instance (SShow Type, SShow Nat) => SShow Type where
-      sShowsPrec ::
-        forall (t1 :: GHC.Types.Nat) (t2 :: Type) (t3 :: Symbol).
-        Sing t1
-        -> Sing t2
-           -> Sing t3
-              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) Type ((~>) Symbol Symbol))
-                                                             -> Type) t1) t2) t3)
-      sShowsPrec
-        _
-        SNat
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "Nat")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SInt
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "Int")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SString
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "String")))
-            sA_0123456789876543210
-      sShowsPrec
-        (sP_0123456789876543210 :: Sing p_0123456789876543210)
-        (SMaybe (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
-                    ((applySing
-                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
-                       (sFromInteger (sing :: Sing 10)))))
-                ((applySing
-                    ((applySing ((singFun3 @(.@#@$)) (%.)))
-                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                          (sing :: Sing "Maybe "))))
-                   ((applySing
-                       ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                          (sFromInteger (sing :: Sing 11))))
-                      sArg_0123456789876543210))))
-            sA_0123456789876543210
-      sShowsPrec
-        (sP_0123456789876543210 :: Sing p_0123456789876543210)
-        (SVec (sArg_0123456789876543210 :: Sing arg_0123456789876543210)
-              (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
-                    ((applySing
-                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
-                       (sFromInteger (sing :: Sing 10)))))
-                ((applySing
-                    ((applySing ((singFun3 @(.@#@$)) (%.)))
-                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                          (sing :: Sing "Vec "))))
-                   ((applySing
-                       ((applySing ((singFun3 @(.@#@$)) (%.)))
-                          ((applySing
-                              ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                                 (sFromInteger (sing :: Sing 11))))
-                             sArg_0123456789876543210)))
-                      ((applySing
-                          ((applySing ((singFun3 @(.@#@$)) (%.)))
-                             ((singFun1 @ShowSpaceSym0) sShowSpace)))
-                         ((applySing
-                             ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                                (sFromInteger (sing :: Sing 11))))
-                            sArg_0123456789876543210))))))
-            sA_0123456789876543210
-    instance SingI Nat where
-      sing = SNat
-    instance SingI Int where
-      sing = SInt
-    instance SingI String where
-      sing = SString
-    instance SingI n => SingI (Maybe (n :: Type)) where
-      sing = SMaybe sing
-    instance SingI (MaybeSym0 :: (~>) Type Type) where
-      sing = (singFun1 @MaybeSym0) SMaybe
-    instance (SingI n, SingI n) =>
-             SingI (Vec (n :: Type) (n :: Nat)) where
-      sing = (SVec sing) sing
-    instance SingI (VecSym0 :: (~>) Type ((~>) Nat Type)) where
-      sing = (singFun2 @VecSym0) SVec
-    instance SingI d =>
-             SingI (VecSym1 (d :: Type) :: (~>) Nat Type) where
-      sing = (singFun1 @(VecSym1 (d :: Type))) (SVec (sing @d))
diff --git a/tests/compile-and-dump/Singletons/Star.golden b/tests/compile-and-dump/Singletons/Star.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/Star.golden
@@ -0,0 +1,422 @@
+Singletons/Star.hs:0:0:: Splicing declarations
+    singletonStar [''Nat, ''Int, ''String, ''Maybe, ''Vec]
+  ======>
+    data Rep :: Type
+      where
+        Singletons.Star.Nat :: Rep
+        Singletons.Star.Int :: Rep
+        Singletons.Star.String :: Rep
+        Singletons.Star.Maybe :: Rep -> Rep
+        Singletons.Star.Vec :: Rep -> Nat -> Rep
+      deriving (Eq, Ord, Read, Show)
+    type NatSym0 = Nat :: Type
+    type IntSym0 = Int :: Type
+    type StringSym0 = String :: Type
+    type MaybeSym0 :: (~>) Type Type
+    data MaybeSym0 a0123456789876543210
+      where
+        MaybeSym0KindInference :: SameKind (Apply MaybeSym0 arg) (MaybeSym1 arg) =>
+                                  MaybeSym0 a0123456789876543210
+    type instance Apply MaybeSym0 a0123456789876543210 = MaybeSym1 a0123456789876543210
+    instance SuppressUnusedWarnings MaybeSym0 where
+      suppressUnusedWarnings = snd (((,) MaybeSym0KindInference) ())
+    type MaybeSym1 (a0123456789876543210 :: Type) =
+        Maybe a0123456789876543210 :: Type
+    type VecSym0 :: (~>) Type ((~>) Nat Type)
+    data VecSym0 a0123456789876543210
+      where
+        VecSym0KindInference :: SameKind (Apply VecSym0 arg) (VecSym1 arg) =>
+                                VecSym0 a0123456789876543210
+    type instance Apply VecSym0 a0123456789876543210 = VecSym1 a0123456789876543210
+    instance SuppressUnusedWarnings VecSym0 where
+      suppressUnusedWarnings = snd (((,) VecSym0KindInference) ())
+    type VecSym1 :: Type -> (~>) Nat Type
+    data VecSym1 a0123456789876543210 a0123456789876543210
+      where
+        VecSym1KindInference :: SameKind (Apply (VecSym1 a0123456789876543210) arg) (VecSym2 a0123456789876543210 arg) =>
+                                VecSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (VecSym1 a0123456789876543210) a0123456789876543210 = VecSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (VecSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) VecSym1KindInference) ())
+    type VecSym2 (a0123456789876543210 :: Type) (a0123456789876543210 :: Nat) =
+        Vec a0123456789876543210 a0123456789876543210 :: Type
+    type Equals_0123456789876543210 :: Type -> Type -> Bool
+    type family Equals_0123456789876543210 a b where
+      Equals_0123456789876543210 Nat Nat = TrueSym0
+      Equals_0123456789876543210 Int Int = TrueSym0
+      Equals_0123456789876543210 String String = TrueSym0
+      Equals_0123456789876543210 (Maybe a) (Maybe b) = (==) a b
+      Equals_0123456789876543210 (Vec a a) (Vec b b) = (&&) ((==) a b) ((==) a b)
+      Equals_0123456789876543210 (_ :: Type) (_ :: Type) = FalseSym0
+    instance PEq Type where
+      type (==) a b = Equals_0123456789876543210 a b
+    type Compare_0123456789876543210 :: Type -> Type -> Ordering
+    type family Compare_0123456789876543210 a a where
+      Compare_0123456789876543210 Nat Nat = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) NilSym0
+      Compare_0123456789876543210 Int Int = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) NilSym0
+      Compare_0123456789876543210 String String = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) NilSym0
+      Compare_0123456789876543210 (Maybe a_0123456789876543210) (Maybe b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0)
+      Compare_0123456789876543210 (Vec a_0123456789876543210 a_0123456789876543210) (Vec b_0123456789876543210 b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0))
+      Compare_0123456789876543210 Nat Int = LTSym0
+      Compare_0123456789876543210 Nat String = LTSym0
+      Compare_0123456789876543210 Nat (Maybe _) = LTSym0
+      Compare_0123456789876543210 Nat (Vec _ _) = LTSym0
+      Compare_0123456789876543210 Int Nat = GTSym0
+      Compare_0123456789876543210 Int String = LTSym0
+      Compare_0123456789876543210 Int (Maybe _) = LTSym0
+      Compare_0123456789876543210 Int (Vec _ _) = LTSym0
+      Compare_0123456789876543210 String Nat = GTSym0
+      Compare_0123456789876543210 String Int = GTSym0
+      Compare_0123456789876543210 String (Maybe _) = LTSym0
+      Compare_0123456789876543210 String (Vec _ _) = LTSym0
+      Compare_0123456789876543210 (Maybe _) Nat = GTSym0
+      Compare_0123456789876543210 (Maybe _) Int = GTSym0
+      Compare_0123456789876543210 (Maybe _) String = GTSym0
+      Compare_0123456789876543210 (Maybe _) (Vec _ _) = LTSym0
+      Compare_0123456789876543210 (Vec _ _) Nat = GTSym0
+      Compare_0123456789876543210 (Vec _ _) Int = GTSym0
+      Compare_0123456789876543210 (Vec _ _) String = GTSym0
+      Compare_0123456789876543210 (Vec _ _) (Maybe _) = GTSym0
+    type Compare_0123456789876543210Sym0 :: (~>) Type ((~>) Type Ordering)
+    data Compare_0123456789876543210Sym0 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
+                                                        Compare_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
+    type Compare_0123456789876543210Sym1 :: Type -> (~>) Type Ordering
+    data Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
+    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Type) (a0123456789876543210 :: Type) =
+        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    instance POrd Type where
+      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
+    type ShowsPrec_0123456789876543210 :: GHC.Types.Nat
+                                          -> Type -> Symbol -> Symbol
+    type family ShowsPrec_0123456789876543210 a a a where
+      ShowsPrec_0123456789876543210 _ Nat a_0123456789876543210 = Apply (Apply ShowStringSym0 "Nat") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ Int a_0123456789876543210 = Apply (Apply ShowStringSym0 "Int") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ String a_0123456789876543210 = Apply (Apply ShowStringSym0 "String") a_0123456789876543210
+      ShowsPrec_0123456789876543210 p_0123456789876543210 (Maybe arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Maybe ")) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))) a_0123456789876543210
+      ShowsPrec_0123456789876543210 p_0123456789876543210 (Vec arg_0123456789876543210 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Vec ")) (Apply (Apply (.@#@$) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210)) (Apply (Apply (.@#@$) ShowSpaceSym0) (Apply (Apply ShowsPrecSym0 (FromInteger 11)) arg_0123456789876543210))))) a_0123456789876543210
+    type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) Type ((~>) Symbol Symbol))
+    data ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
+    type ShowsPrec_0123456789876543210Sym1 :: GHC.Types.Nat
+                                              -> (~>) Type ((~>) Symbol Symbol)
+    data ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
+    type ShowsPrec_0123456789876543210Sym2 :: GHC.Types.Nat
+                                              -> Type -> (~>) Symbol Symbol
+    data ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
+    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Type) (a0123456789876543210 :: Symbol) =
+        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Symbol
+    instance PShow Type where
+      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
+    data SRep :: Type -> Type
+      where
+        SNat :: SRep (Nat :: Type)
+        SInt :: SRep (Int :: Type)
+        SString :: SRep (String :: Type)
+        SMaybe :: forall (n :: Type). (Sing n) -> SRep (Maybe n :: Type)
+        SVec :: forall (n :: Type) (n :: Nat).
+                (Sing n) -> (Sing n) -> SRep (Vec n n :: Type)
+    type instance Sing @Type = SRep
+    instance SingKind Type where
+      type Demote Type = Rep
+      fromSing SNat = Singletons.Star.Nat
+      fromSing SInt = Singletons.Star.Int
+      fromSing SString = Singletons.Star.String
+      fromSing (SMaybe b) = Singletons.Star.Maybe (fromSing b)
+      fromSing (SVec b b)
+        = (Singletons.Star.Vec (fromSing b)) (fromSing b)
+      toSing Singletons.Star.Nat = SomeSing SNat
+      toSing Singletons.Star.Int = SomeSing SInt
+      toSing Singletons.Star.String = SomeSing SString
+      toSing (Singletons.Star.Maybe (b :: Demote Type))
+        = case toSing b :: SomeSing Type of {
+            SomeSing c -> SomeSing (SMaybe c) }
+      toSing (Singletons.Star.Vec (b :: Demote Type) (b :: Demote Nat))
+        = case
+              ((,) (toSing b :: SomeSing Type)) (toSing b :: SomeSing Nat)
+          of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SVec c) c) }
+    instance (SEq Type, SEq Nat) => SEq Type where
+      (%==) SNat SNat = STrue
+      (%==) SNat SInt = SFalse
+      (%==) SNat SString = SFalse
+      (%==) SNat (SMaybe _) = SFalse
+      (%==) SNat (SVec _ _) = SFalse
+      (%==) SInt SNat = SFalse
+      (%==) SInt SInt = STrue
+      (%==) SInt SString = SFalse
+      (%==) SInt (SMaybe _) = SFalse
+      (%==) SInt (SVec _ _) = SFalse
+      (%==) SString SNat = SFalse
+      (%==) SString SInt = SFalse
+      (%==) SString SString = STrue
+      (%==) SString (SMaybe _) = SFalse
+      (%==) SString (SVec _ _) = SFalse
+      (%==) (SMaybe _) SNat = SFalse
+      (%==) (SMaybe _) SInt = SFalse
+      (%==) (SMaybe _) SString = SFalse
+      (%==) (SMaybe a) (SMaybe b) = ((%==) a) b
+      (%==) (SMaybe _) (SVec _ _) = SFalse
+      (%==) (SVec _ _) SNat = SFalse
+      (%==) (SVec _ _) SInt = SFalse
+      (%==) (SVec _ _) SString = SFalse
+      (%==) (SVec _ _) (SMaybe _) = SFalse
+      (%==) (SVec a a) (SVec b b) = ((%&&) (((%==) a) b)) (((%==) a) b)
+    instance (SDecide Type, SDecide Nat) => SDecide Type where
+      (%~) SNat SNat = Proved Refl
+      (%~) SNat SInt = Disproved (\ x -> case x of)
+      (%~) SNat SString = Disproved (\ x -> case x of)
+      (%~) SNat (SMaybe _) = Disproved (\ x -> case x of)
+      (%~) SNat (SVec _ _) = Disproved (\ x -> case x of)
+      (%~) SInt SNat = Disproved (\ x -> case x of)
+      (%~) SInt SInt = Proved Refl
+      (%~) SInt SString = Disproved (\ x -> case x of)
+      (%~) SInt (SMaybe _) = Disproved (\ x -> case x of)
+      (%~) SInt (SVec _ _) = Disproved (\ x -> case x of)
+      (%~) SString SNat = Disproved (\ x -> case x of)
+      (%~) SString SInt = Disproved (\ x -> case x of)
+      (%~) SString SString = Proved Refl
+      (%~) SString (SMaybe _) = Disproved (\ x -> case x of)
+      (%~) SString (SVec _ _) = Disproved (\ x -> case x of)
+      (%~) (SMaybe _) SNat = Disproved (\ x -> case x of)
+      (%~) (SMaybe _) SInt = Disproved (\ x -> case x of)
+      (%~) (SMaybe _) SString = Disproved (\ x -> case x of)
+      (%~) (SMaybe a) (SMaybe b)
+        = case ((%~) a) b of
+            Proved Refl -> Proved Refl
+            Disproved contra
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+      (%~) (SMaybe _) (SVec _ _) = Disproved (\ x -> case x of)
+      (%~) (SVec _ _) SNat = Disproved (\ x -> case x of)
+      (%~) (SVec _ _) SInt = Disproved (\ x -> case x of)
+      (%~) (SVec _ _) SString = Disproved (\ x -> case x of)
+      (%~) (SVec _ _) (SMaybe _) = Disproved (\ x -> case x of)
+      (%~) (SVec a a) (SVec b b)
+        = case ((,) (((%~) a) b)) (((%~) a) b) of
+            (,) (Proved Refl) (Proved Refl) -> Proved Refl
+            (,) (Disproved contra) _
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+            (,) _ (Disproved contra)
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+    instance (SDecide Type, SDecide Nat) =>
+             Data.Type.Equality.TestEquality (SRep :: Type -> Type) where
+      Data.Type.Equality.testEquality = decideEquality
+    instance (SDecide Type, SDecide Nat) =>
+             Data.Type.Coercion.TestCoercion (SRep :: Type -> Type) where
+      Data.Type.Coercion.testCoercion = decideCoercion
+    instance (SOrd Type, SOrd Nat) => SOrd Type where
+      sCompare ::
+        forall (t1 :: Type) (t2 :: Type).
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply (CompareSym0 :: TyFun Type ((~>) Type Ordering)
+                                                 -> Type) t1) t2)
+      sCompare SNat SNat
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            SNil
+      sCompare SInt SInt
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            SNil
+      sCompare SString SString
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            SNil
+      sCompare
+        (SMaybe (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        (SMaybe (sB_0123456789876543210 :: Sing b_0123456789876543210))
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            ((applySing
+                ((applySing ((singFun2 @(:@#@$)) SCons))
+                   ((applySing
+                       ((applySing ((singFun2 @CompareSym0) sCompare))
+                          sA_0123456789876543210))
+                      sB_0123456789876543210)))
+               SNil)
+      sCompare
+        (SVec (sA_0123456789876543210 :: Sing a_0123456789876543210)
+              (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        (SVec (sB_0123456789876543210 :: Sing b_0123456789876543210)
+              (sB_0123456789876543210 :: Sing b_0123456789876543210))
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            ((applySing
+                ((applySing ((singFun2 @(:@#@$)) SCons))
+                   ((applySing
+                       ((applySing ((singFun2 @CompareSym0) sCompare))
+                          sA_0123456789876543210))
+                      sB_0123456789876543210)))
+               ((applySing
+                   ((applySing ((singFun2 @(:@#@$)) SCons))
+                      ((applySing
+                          ((applySing ((singFun2 @CompareSym0) sCompare))
+                             sA_0123456789876543210))
+                         sB_0123456789876543210)))
+                  SNil))
+      sCompare SNat SInt = SLT
+      sCompare SNat SString = SLT
+      sCompare SNat (SMaybe _) = SLT
+      sCompare SNat (SVec _ _) = SLT
+      sCompare SInt SNat = SGT
+      sCompare SInt SString = SLT
+      sCompare SInt (SMaybe _) = SLT
+      sCompare SInt (SVec _ _) = SLT
+      sCompare SString SNat = SGT
+      sCompare SString SInt = SGT
+      sCompare SString (SMaybe _) = SLT
+      sCompare SString (SVec _ _) = SLT
+      sCompare (SMaybe _) SNat = SGT
+      sCompare (SMaybe _) SInt = SGT
+      sCompare (SMaybe _) SString = SGT
+      sCompare (SMaybe _) (SVec _ _) = SLT
+      sCompare (SVec _ _) SNat = SGT
+      sCompare (SVec _ _) SInt = SGT
+      sCompare (SVec _ _) SString = SGT
+      sCompare (SVec _ _) (SMaybe _) = SGT
+    instance (SShow Type, SShow Nat) => SShow Type where
+      sShowsPrec ::
+        forall (t1 :: GHC.Types.Nat) (t2 :: Type) (t3 :: Symbol).
+        Sing t1
+        -> Sing t2
+           -> Sing t3
+              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) Type ((~>) Symbol Symbol))
+                                                             -> Type) t1) t2) t3)
+      sShowsPrec
+        _
+        SNat
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "Nat")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SInt
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "Int")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SString
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "String")))
+            sA_0123456789876543210
+      sShowsPrec
+        (sP_0123456789876543210 :: Sing p_0123456789876543210)
+        (SMaybe (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
+                    ((applySing
+                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
+                       (sFromInteger (sing :: Sing 10)))))
+                ((applySing
+                    ((applySing ((singFun3 @(.@#@$)) (%.)))
+                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                          (sing :: Sing "Maybe "))))
+                   ((applySing
+                       ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                          (sFromInteger (sing :: Sing 11))))
+                      sArg_0123456789876543210))))
+            sA_0123456789876543210
+      sShowsPrec
+        (sP_0123456789876543210 :: Sing p_0123456789876543210)
+        (SVec (sArg_0123456789876543210 :: Sing arg_0123456789876543210)
+              (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
+                    ((applySing
+                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
+                       (sFromInteger (sing :: Sing 10)))))
+                ((applySing
+                    ((applySing ((singFun3 @(.@#@$)) (%.)))
+                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                          (sing :: Sing "Vec "))))
+                   ((applySing
+                       ((applySing ((singFun3 @(.@#@$)) (%.)))
+                          ((applySing
+                              ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                                 (sFromInteger (sing :: Sing 11))))
+                             sArg_0123456789876543210)))
+                      ((applySing
+                          ((applySing ((singFun3 @(.@#@$)) (%.)))
+                             ((singFun1 @ShowSpaceSym0) sShowSpace)))
+                         ((applySing
+                             ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                                (sFromInteger (sing :: Sing 11))))
+                            sArg_0123456789876543210))))))
+            sA_0123456789876543210
+    instance SingI Nat where
+      sing = SNat
+    instance SingI Int where
+      sing = SInt
+    instance SingI String where
+      sing = SString
+    instance SingI n => SingI (Maybe (n :: Type)) where
+      sing = SMaybe sing
+    instance SingI (MaybeSym0 :: (~>) Type Type) where
+      sing = (singFun1 @MaybeSym0) SMaybe
+    instance (SingI n, SingI n) =>
+             SingI (Vec (n :: Type) (n :: Nat)) where
+      sing = (SVec sing) sing
+    instance SingI (VecSym0 :: (~>) Type ((~>) Nat Type)) where
+      sing = (singFun2 @VecSym0) SVec
+    instance SingI d =>
+             SingI (VecSym1 (d :: Type) :: (~>) Nat Type) where
+      sing = (singFun1 @(VecSym1 (d :: Type))) (SVec (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T124.ghc88.template b/tests/compile-and-dump/Singletons/T124.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T124.ghc88.template
+++ /dev/null
@@ -1,33 +0,0 @@
-Singletons/T124.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| foo :: Bool -> ()
-          foo True = ()
-          foo False = () |]
-  ======>
-    foo :: Bool -> ()
-    foo True = ()
-    foo False = ()
-    type FooSym1 (a0123456789876543210 :: Bool) =
-        Foo a0123456789876543210
-    instance SuppressUnusedWarnings FooSym0 where
-      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
-    data FooSym0 :: (~>) Bool ()
-      where
-        FooSym0KindInference :: forall a0123456789876543210
-                                       arg. SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
-                                FooSym0 a0123456789876543210
-    type instance Apply FooSym0 a0123456789876543210 = Foo a0123456789876543210
-    type family Foo (a :: Bool) :: () where
-      Foo 'True = Tuple0Sym0
-      Foo 'False = Tuple0Sym0
-    sFoo :: forall (t :: Bool). Sing t -> Sing (Apply FooSym0 t :: ())
-    sFoo STrue = STuple0
-    sFoo SFalse = STuple0
-    instance SingI (FooSym0 :: (~>) Bool ()) where
-      sing = (singFun1 @FooSym0) sFoo
-Singletons/T124.hs:0:0:: Splicing expression
-    sCases ''Bool [| b |] [| STuple0 |]
-  ======>
-    case b of
-      SFalse -> STuple0
-      STrue -> STuple0
diff --git a/tests/compile-and-dump/Singletons/T124.golden b/tests/compile-and-dump/Singletons/T124.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T124.golden
@@ -0,0 +1,34 @@
+Singletons/T124.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| foo :: Bool -> ()
+          foo True = ()
+          foo False = () |]
+  ======>
+    foo :: Bool -> ()
+    foo True = ()
+    foo False = ()
+    type FooSym0 :: (~>) Bool ()
+    data FooSym0 a0123456789876543210
+      where
+        FooSym0KindInference :: SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
+                                FooSym0 a0123456789876543210
+    type instance Apply FooSym0 a0123456789876543210 = FooSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FooSym0 where
+      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
+    type FooSym1 (a0123456789876543210 :: Bool) =
+        Foo a0123456789876543210 :: ()
+    type Foo :: Bool -> ()
+    type family Foo a where
+      Foo 'True = Tuple0Sym0
+      Foo 'False = Tuple0Sym0
+    sFoo :: forall (t :: Bool). Sing t -> Sing (Apply FooSym0 t :: ())
+    sFoo STrue = STuple0
+    sFoo SFalse = STuple0
+    instance SingI (FooSym0 :: (~>) Bool ()) where
+      sing = (singFun1 @FooSym0) sFoo
+Singletons/T124.hs:0:0:: Splicing expression
+    sCases ''Bool [| b |] [| STuple0 |]
+  ======>
+    case b of
+      SFalse -> STuple0
+      STrue -> STuple0
diff --git a/tests/compile-and-dump/Singletons/T136.ghc88.template b/tests/compile-and-dump/Singletons/T136.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T136.ghc88.template
+++ /dev/null
@@ -1,174 +0,0 @@
-Singletons/T136.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| instance Enum BiNat where
-            succ [] = [True]
-            succ (False : as) = True : as
-            succ (True : as) = False : succ as
-            pred [] = error "pred 0"
-            pred (False : as) = True : pred as
-            pred (True : as) = False : as
-            toEnum i
-              | i < 0 = error "negative toEnum"
-              | i == 0 = []
-              | otherwise = succ (toEnum (pred i))
-            fromEnum [] = 0
-            fromEnum (False : as) = 2 * fromEnum as
-            fromEnum (True : as) = 1 + 2 * fromEnum as |]
-  ======>
-    instance Enum BiNat where
-      succ [] = [True]
-      succ (False : as) = (True : as)
-      succ (True : as) = (False : succ as)
-      pred [] = error "pred 0"
-      pred (False : as) = (True : pred as)
-      pred (True : as) = (False : as)
-      toEnum i
-        | (i < 0) = error "negative toEnum"
-        | (i == 0) = []
-        | otherwise = succ (toEnum (pred i))
-      fromEnum [] = 0
-      fromEnum (False : as) = (2 * fromEnum as)
-      fromEnum (True : as) = (1 + (2 * fromEnum as))
-    type family Succ_0123456789876543210 (a :: [Bool]) :: [Bool] where
-      Succ_0123456789876543210 '[] = Apply (Apply (:@#@$) TrueSym0) '[]
-      Succ_0123456789876543210 ('(:) 'False as) = Apply (Apply (:@#@$) TrueSym0) as
-      Succ_0123456789876543210 ('(:) 'True as) = Apply (Apply (:@#@$) FalseSym0) (Apply SuccSym0 as)
-    type Succ_0123456789876543210Sym1 (a0123456789876543210 :: [Bool]) =
-        Succ_0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Succ_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Succ_0123456789876543210Sym0KindInference) ())
-    data Succ_0123456789876543210Sym0 :: (~>) [Bool] [Bool]
-      where
-        Succ_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                            arg. SameKind (Apply Succ_0123456789876543210Sym0 arg) (Succ_0123456789876543210Sym1 arg) =>
-                                                     Succ_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Succ_0123456789876543210Sym0 a0123456789876543210 = Succ_0123456789876543210 a0123456789876543210
-    type family Pred_0123456789876543210 (a :: [Bool]) :: [Bool] where
-      Pred_0123456789876543210 '[] = Apply ErrorSym0 "pred 0"
-      Pred_0123456789876543210 ('(:) 'False as) = Apply (Apply (:@#@$) TrueSym0) (Apply PredSym0 as)
-      Pred_0123456789876543210 ('(:) 'True as) = Apply (Apply (:@#@$) FalseSym0) as
-    type Pred_0123456789876543210Sym1 (a0123456789876543210 :: [Bool]) =
-        Pred_0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Pred_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Pred_0123456789876543210Sym0KindInference) ())
-    data Pred_0123456789876543210Sym0 :: (~>) [Bool] [Bool]
-      where
-        Pred_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                            arg. SameKind (Apply Pred_0123456789876543210Sym0 arg) (Pred_0123456789876543210Sym1 arg) =>
-                                                     Pred_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Pred_0123456789876543210Sym0 a0123456789876543210 = Pred_0123456789876543210 a0123456789876543210
-    type family Case_0123456789876543210 i arg_0123456789876543210 t where
-      Case_0123456789876543210 i arg_0123456789876543210 'True = '[]
-      Case_0123456789876543210 i arg_0123456789876543210 'False = Apply SuccSym0 (Apply ToEnumSym0 (Apply PredSym0 i))
-    type family Case_0123456789876543210 i arg_0123456789876543210 t where
-      Case_0123456789876543210 i arg_0123456789876543210 'True = Apply ErrorSym0 "negative toEnum"
-      Case_0123456789876543210 i arg_0123456789876543210 'False = Case_0123456789876543210 i arg_0123456789876543210 (Apply (Apply (==@#@$) i) (FromInteger 0))
-    type family Case_0123456789876543210 arg_0123456789876543210 t where
-      Case_0123456789876543210 arg_0123456789876543210 i = Case_0123456789876543210 i arg_0123456789876543210 (Apply (Apply (<@#@$) i) (FromInteger 0))
-    type family ToEnum_0123456789876543210 (a :: GHC.Types.Nat) :: [Bool] where
-      ToEnum_0123456789876543210 arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 arg_0123456789876543210
-    type ToEnum_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) =
-        ToEnum_0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ToEnum_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ToEnum_0123456789876543210Sym0KindInference) ())
-    data ToEnum_0123456789876543210Sym0 :: (~>) GHC.Types.Nat [Bool]
-      where
-        ToEnum_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                              arg. SameKind (Apply ToEnum_0123456789876543210Sym0 arg) (ToEnum_0123456789876543210Sym1 arg) =>
-                                                       ToEnum_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ToEnum_0123456789876543210Sym0 a0123456789876543210 = ToEnum_0123456789876543210 a0123456789876543210
-    type family FromEnum_0123456789876543210 (a :: [Bool]) :: GHC.Types.Nat where
-      FromEnum_0123456789876543210 '[] = FromInteger 0
-      FromEnum_0123456789876543210 ('(:) 'False as) = Apply (Apply (*@#@$) (FromInteger 2)) (Apply FromEnumSym0 as)
-      FromEnum_0123456789876543210 ('(:) 'True as) = Apply (Apply (+@#@$) (FromInteger 1)) (Apply (Apply (*@#@$) (FromInteger 2)) (Apply FromEnumSym0 as))
-    type FromEnum_0123456789876543210Sym1 (a0123456789876543210 :: [Bool]) =
-        FromEnum_0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings FromEnum_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) FromEnum_0123456789876543210Sym0KindInference) ())
-    data FromEnum_0123456789876543210Sym0 :: (~>) [Bool] GHC.Types.Nat
-      where
-        FromEnum_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                arg. SameKind (Apply FromEnum_0123456789876543210Sym0 arg) (FromEnum_0123456789876543210Sym1 arg) =>
-                                                         FromEnum_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply FromEnum_0123456789876543210Sym0 a0123456789876543210 = FromEnum_0123456789876543210 a0123456789876543210
-    instance PEnum [Bool] where
-      type Succ a = Apply Succ_0123456789876543210Sym0 a
-      type Pred a = Apply Pred_0123456789876543210Sym0 a
-      type ToEnum a = Apply ToEnum_0123456789876543210Sym0 a
-      type FromEnum a = Apply FromEnum_0123456789876543210Sym0 a
-    instance SEnum [Bool] where
-      sSucc ::
-        forall (t :: [Bool]).
-        Sing t
-        -> Sing (Apply (SuccSym0 :: TyFun [Bool] [Bool]
-                                    -> GHC.Types.Type) t)
-      sPred ::
-        forall (t :: [Bool]).
-        Sing t
-        -> Sing (Apply (PredSym0 :: TyFun [Bool] [Bool]
-                                    -> GHC.Types.Type) t)
-      sToEnum ::
-        forall (t :: GHC.Types.Nat).
-        Sing t
-        -> Sing (Apply (ToEnumSym0 :: TyFun GHC.Types.Nat [Bool]
-                                      -> GHC.Types.Type) t)
-      sFromEnum ::
-        forall (t :: [Bool]).
-        Sing t
-        -> Sing (Apply (FromEnumSym0 :: TyFun [Bool] GHC.Types.Nat
-                                        -> GHC.Types.Type) t)
-      sSucc SNil
-        = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) STrue)) SNil
-      sSucc (SCons SFalse (sAs :: Sing as))
-        = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) STrue)) sAs
-      sSucc (SCons STrue (sAs :: Sing as))
-        = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SFalse))
-            ((applySing ((singFun1 @SuccSym0) sSucc)) sAs)
-      sPred SNil = sError (sing :: Sing "pred 0")
-      sPred (SCons SFalse (sAs :: Sing as))
-        = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) STrue))
-            ((applySing ((singFun1 @PredSym0) sPred)) sAs)
-      sPred (SCons STrue (sAs :: Sing as))
-        = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SFalse)) sAs
-      sToEnum (sArg_0123456789876543210 :: Sing arg_0123456789876543210)
-        = (id
-             @(Sing (Case_0123456789876543210 arg_0123456789876543210 arg_0123456789876543210)))
-            (case sArg_0123456789876543210 of {
-               (sI :: Sing i)
-                 -> (id
-                       @(Sing (Case_0123456789876543210 i arg_0123456789876543210 (Apply (Apply (<@#@$) i) (FromInteger 0)))))
-                      (case
-                           (applySing ((applySing ((singFun2 @(<@#@$)) (%<))) sI))
-                             (sFromInteger (sing :: Sing 0))
-                       of
-                         STrue -> sError (sing :: Sing "negative toEnum")
-                         SFalse
-                           -> (id
-                                 @(Sing (Case_0123456789876543210 i arg_0123456789876543210 (Apply (Apply (==@#@$) i) (FromInteger 0)))))
-                                (case
-                                     (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sI))
-                                       (sFromInteger (sing :: Sing 0))
-                                 of
-                                   STrue -> SNil
-                                   SFalse
-                                     -> (applySing ((singFun1 @SuccSym0) sSucc))
-                                          ((applySing ((singFun1 @ToEnumSym0) sToEnum))
-                                             ((applySing ((singFun1 @PredSym0) sPred)) sI)))) })
-      sFromEnum SNil = sFromInteger (sing :: Sing 0)
-      sFromEnum (SCons SFalse (sAs :: Sing as))
-        = (applySing
-             ((applySing ((singFun2 @(*@#@$)) (%*)))
-                (sFromInteger (sing :: Sing 2))))
-            ((applySing ((singFun1 @FromEnumSym0) sFromEnum)) sAs)
-      sFromEnum (SCons STrue (sAs :: Sing as))
-        = (applySing
-             ((applySing ((singFun2 @(+@#@$)) (%+)))
-                (sFromInteger (sing :: Sing 1))))
-            ((applySing
-                ((applySing ((singFun2 @(*@#@$)) (%*)))
-                   (sFromInteger (sing :: Sing 2))))
-               ((applySing ((singFun1 @FromEnumSym0) sFromEnum)) sAs))
diff --git a/tests/compile-and-dump/Singletons/T136.golden b/tests/compile-and-dump/Singletons/T136.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T136.golden
@@ -0,0 +1,178 @@
+Singletons/T136.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| instance Enum BiNat where
+            succ [] = [True]
+            succ (False : as) = True : as
+            succ (True : as) = False : succ as
+            pred [] = error "pred 0"
+            pred (False : as) = True : pred as
+            pred (True : as) = False : as
+            toEnum i
+              | i < 0 = error "negative toEnum"
+              | i == 0 = []
+              | otherwise = succ (toEnum (pred i))
+            fromEnum [] = 0
+            fromEnum (False : as) = 2 * fromEnum as
+            fromEnum (True : as) = 1 + 2 * fromEnum as |]
+  ======>
+    instance Enum BiNat where
+      succ [] = [True]
+      succ (False : as) = (True : as)
+      succ (True : as) = (False : succ as)
+      pred [] = error "pred 0"
+      pred (False : as) = (True : pred as)
+      pred (True : as) = (False : as)
+      toEnum i
+        | (i < 0) = error "negative toEnum"
+        | (i == 0) = []
+        | otherwise = succ (toEnum (pred i))
+      fromEnum [] = 0
+      fromEnum (False : as) = (2 * fromEnum as)
+      fromEnum (True : as) = (1 + (2 * fromEnum as))
+    type Succ_0123456789876543210 :: [Bool] -> [Bool]
+    type family Succ_0123456789876543210 a where
+      Succ_0123456789876543210 '[] = Apply (Apply (:@#@$) TrueSym0) NilSym0
+      Succ_0123456789876543210 ('(:) 'False as) = Apply (Apply (:@#@$) TrueSym0) as
+      Succ_0123456789876543210 ('(:) 'True as) = Apply (Apply (:@#@$) FalseSym0) (Apply SuccSym0 as)
+    type Succ_0123456789876543210Sym0 :: (~>) [Bool] [Bool]
+    data Succ_0123456789876543210Sym0 a0123456789876543210
+      where
+        Succ_0123456789876543210Sym0KindInference :: SameKind (Apply Succ_0123456789876543210Sym0 arg) (Succ_0123456789876543210Sym1 arg) =>
+                                                     Succ_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Succ_0123456789876543210Sym0 a0123456789876543210 = Succ_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Succ_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Succ_0123456789876543210Sym0KindInference) ())
+    type Succ_0123456789876543210Sym1 (a0123456789876543210 :: [Bool]) =
+        Succ_0123456789876543210 a0123456789876543210 :: [Bool]
+    type Pred_0123456789876543210 :: [Bool] -> [Bool]
+    type family Pred_0123456789876543210 a where
+      Pred_0123456789876543210 '[] = Apply ErrorSym0 "pred 0"
+      Pred_0123456789876543210 ('(:) 'False as) = Apply (Apply (:@#@$) TrueSym0) (Apply PredSym0 as)
+      Pred_0123456789876543210 ('(:) 'True as) = Apply (Apply (:@#@$) FalseSym0) as
+    type Pred_0123456789876543210Sym0 :: (~>) [Bool] [Bool]
+    data Pred_0123456789876543210Sym0 a0123456789876543210
+      where
+        Pred_0123456789876543210Sym0KindInference :: SameKind (Apply Pred_0123456789876543210Sym0 arg) (Pred_0123456789876543210Sym1 arg) =>
+                                                     Pred_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Pred_0123456789876543210Sym0 a0123456789876543210 = Pred_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Pred_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Pred_0123456789876543210Sym0KindInference) ())
+    type Pred_0123456789876543210Sym1 (a0123456789876543210 :: [Bool]) =
+        Pred_0123456789876543210 a0123456789876543210 :: [Bool]
+    type family Case_0123456789876543210 i arg_0123456789876543210 t where
+      Case_0123456789876543210 i arg_0123456789876543210 'True = NilSym0
+      Case_0123456789876543210 i arg_0123456789876543210 'False = Apply SuccSym0 (Apply ToEnumSym0 (Apply PredSym0 i))
+    type family Case_0123456789876543210 i arg_0123456789876543210 t where
+      Case_0123456789876543210 i arg_0123456789876543210 'True = Apply ErrorSym0 "negative toEnum"
+      Case_0123456789876543210 i arg_0123456789876543210 'False = Case_0123456789876543210 i arg_0123456789876543210 (Apply (Apply (==@#@$) i) (FromInteger 0))
+    type family Case_0123456789876543210 arg_0123456789876543210 t where
+      Case_0123456789876543210 arg_0123456789876543210 i = Case_0123456789876543210 i arg_0123456789876543210 (Apply (Apply (<@#@$) i) (FromInteger 0))
+    type ToEnum_0123456789876543210 :: GHC.Types.Nat -> [Bool]
+    type family ToEnum_0123456789876543210 a where
+      ToEnum_0123456789876543210 arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 arg_0123456789876543210
+    type ToEnum_0123456789876543210Sym0 :: (~>) GHC.Types.Nat [Bool]
+    data ToEnum_0123456789876543210Sym0 a0123456789876543210
+      where
+        ToEnum_0123456789876543210Sym0KindInference :: SameKind (Apply ToEnum_0123456789876543210Sym0 arg) (ToEnum_0123456789876543210Sym1 arg) =>
+                                                       ToEnum_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ToEnum_0123456789876543210Sym0 a0123456789876543210 = ToEnum_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ToEnum_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ToEnum_0123456789876543210Sym0KindInference) ())
+    type ToEnum_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) =
+        ToEnum_0123456789876543210 a0123456789876543210 :: [Bool]
+    type FromEnum_0123456789876543210 :: [Bool] -> GHC.Types.Nat
+    type family FromEnum_0123456789876543210 a where
+      FromEnum_0123456789876543210 '[] = FromInteger 0
+      FromEnum_0123456789876543210 ('(:) 'False as) = Apply (Apply (*@#@$) (FromInteger 2)) (Apply FromEnumSym0 as)
+      FromEnum_0123456789876543210 ('(:) 'True as) = Apply (Apply (+@#@$) (FromInteger 1)) (Apply (Apply (*@#@$) (FromInteger 2)) (Apply FromEnumSym0 as))
+    type FromEnum_0123456789876543210Sym0 :: (~>) [Bool] GHC.Types.Nat
+    data FromEnum_0123456789876543210Sym0 a0123456789876543210
+      where
+        FromEnum_0123456789876543210Sym0KindInference :: SameKind (Apply FromEnum_0123456789876543210Sym0 arg) (FromEnum_0123456789876543210Sym1 arg) =>
+                                                         FromEnum_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply FromEnum_0123456789876543210Sym0 a0123456789876543210 = FromEnum_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings FromEnum_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) FromEnum_0123456789876543210Sym0KindInference) ())
+    type FromEnum_0123456789876543210Sym1 (a0123456789876543210 :: [Bool]) =
+        FromEnum_0123456789876543210 a0123456789876543210 :: GHC.Types.Nat
+    instance PEnum [Bool] where
+      type Succ a = Apply Succ_0123456789876543210Sym0 a
+      type Pred a = Apply Pred_0123456789876543210Sym0 a
+      type ToEnum a = Apply ToEnum_0123456789876543210Sym0 a
+      type FromEnum a = Apply FromEnum_0123456789876543210Sym0 a
+    instance SEnum [Bool] where
+      sSucc ::
+        forall (t :: [Bool]).
+        Sing t
+        -> Sing (Apply (SuccSym0 :: TyFun [Bool] [Bool]
+                                    -> GHC.Types.Type) t)
+      sPred ::
+        forall (t :: [Bool]).
+        Sing t
+        -> Sing (Apply (PredSym0 :: TyFun [Bool] [Bool]
+                                    -> GHC.Types.Type) t)
+      sToEnum ::
+        forall (t :: GHC.Types.Nat).
+        Sing t
+        -> Sing (Apply (ToEnumSym0 :: TyFun GHC.Types.Nat [Bool]
+                                      -> GHC.Types.Type) t)
+      sFromEnum ::
+        forall (t :: [Bool]).
+        Sing t
+        -> Sing (Apply (FromEnumSym0 :: TyFun [Bool] GHC.Types.Nat
+                                        -> GHC.Types.Type) t)
+      sSucc SNil
+        = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) STrue)) SNil
+      sSucc (SCons SFalse (sAs :: Sing as))
+        = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) STrue)) sAs
+      sSucc (SCons STrue (sAs :: Sing as))
+        = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SFalse))
+            ((applySing ((singFun1 @SuccSym0) sSucc)) sAs)
+      sPred SNil = sError (sing :: Sing "pred 0")
+      sPred (SCons SFalse (sAs :: Sing as))
+        = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) STrue))
+            ((applySing ((singFun1 @PredSym0) sPred)) sAs)
+      sPred (SCons STrue (sAs :: Sing as))
+        = (applySing ((applySing ((singFun2 @(:@#@$)) SCons)) SFalse)) sAs
+      sToEnum (sArg_0123456789876543210 :: Sing arg_0123456789876543210)
+        = (id
+             @(Sing (Case_0123456789876543210 arg_0123456789876543210 arg_0123456789876543210)))
+            (case sArg_0123456789876543210 of {
+               (sI :: Sing i)
+                 -> (id
+                       @(Sing (Case_0123456789876543210 i arg_0123456789876543210 (Apply (Apply (<@#@$) i) (FromInteger 0)))))
+                      (case
+                           (applySing ((applySing ((singFun2 @(<@#@$)) (%<))) sI))
+                             (sFromInteger (sing :: Sing 0))
+                       of
+                         STrue -> sError (sing :: Sing "negative toEnum")
+                         SFalse
+                           -> (id
+                                 @(Sing (Case_0123456789876543210 i arg_0123456789876543210 (Apply (Apply (==@#@$) i) (FromInteger 0)))))
+                                (case
+                                     (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sI))
+                                       (sFromInteger (sing :: Sing 0))
+                                 of
+                                   STrue -> SNil
+                                   SFalse
+                                     -> (applySing ((singFun1 @SuccSym0) sSucc))
+                                          ((applySing ((singFun1 @ToEnumSym0) sToEnum))
+                                             ((applySing ((singFun1 @PredSym0) sPred)) sI)))) })
+      sFromEnum SNil = sFromInteger (sing :: Sing 0)
+      sFromEnum (SCons SFalse (sAs :: Sing as))
+        = (applySing
+             ((applySing ((singFun2 @(*@#@$)) (%*)))
+                (sFromInteger (sing :: Sing 2))))
+            ((applySing ((singFun1 @FromEnumSym0) sFromEnum)) sAs)
+      sFromEnum (SCons STrue (sAs :: Sing as))
+        = (applySing
+             ((applySing ((singFun2 @(+@#@$)) (%+)))
+                (sFromInteger (sing :: Sing 1))))
+            ((applySing
+                ((applySing ((singFun2 @(*@#@$)) (%*)))
+                   (sFromInteger (sing :: Sing 2))))
+               ((applySing ((singFun1 @FromEnumSym0) sFromEnum)) sAs))
diff --git a/tests/compile-and-dump/Singletons/T136b.ghc88.template b/tests/compile-and-dump/Singletons/T136b.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T136b.ghc88.template
+++ /dev/null
@@ -1,53 +0,0 @@
-Singletons/T136b.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| class C a where
-            meth :: a -> a |]
-  ======>
-    class C a where
-      meth :: a -> a
-    type MethSym1 (arg0123456789876543210 :: a0123456789876543210) =
-        Meth arg0123456789876543210
-    instance SuppressUnusedWarnings MethSym0 where
-      suppressUnusedWarnings = snd (((,) MethSym0KindInference) ())
-    data MethSym0 :: forall a0123456789876543210.
-                     (~>) a0123456789876543210 a0123456789876543210
-      where
-        MethSym0KindInference :: forall arg0123456789876543210
-                                        arg. SameKind (Apply MethSym0 arg) (MethSym1 arg) =>
-                                 MethSym0 arg0123456789876543210
-    type instance Apply MethSym0 arg0123456789876543210 = Meth arg0123456789876543210
-    class PC (a :: GHC.Types.Type) where
-      type Meth (arg :: a) :: a
-    class SC a where
-      sMeth :: forall (t :: a). Sing t -> Sing (Apply MethSym0 t :: a)
-    instance SC a => SingI (MethSym0 :: (~>) a a) where
-      sing = (singFun1 @MethSym0) sMeth
-Singletons/T136b.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| instance C Bool where
-            meth = not |]
-  ======>
-    instance C Bool where
-      meth = not
-    type family Meth_0123456789876543210 (a :: Bool) :: Bool where
-      Meth_0123456789876543210 a_0123456789876543210 = Apply NotSym0 a_0123456789876543210
-    type Meth_0123456789876543210Sym1 (a0123456789876543210 :: Bool) =
-        Meth_0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Meth_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Meth_0123456789876543210Sym0KindInference) ())
-    data Meth_0123456789876543210Sym0 :: (~>) Bool Bool
-      where
-        Meth_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                            arg. SameKind (Apply Meth_0123456789876543210Sym0 arg) (Meth_0123456789876543210Sym1 arg) =>
-                                                     Meth_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Meth_0123456789876543210Sym0 a0123456789876543210 = Meth_0123456789876543210 a0123456789876543210
-    instance PC Bool where
-      type Meth a = Apply Meth_0123456789876543210Sym0 a
-    instance SC Bool where
-      sMeth ::
-        forall (t :: Bool).
-        Sing t
-        -> Sing (Apply (MethSym0 :: TyFun Bool Bool -> GHC.Types.Type) t)
-      sMeth (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing ((singFun1 @NotSym0) sNot)) sA_0123456789876543210
diff --git a/tests/compile-and-dump/Singletons/T136b.golden b/tests/compile-and-dump/Singletons/T136b.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T136b.golden
@@ -0,0 +1,53 @@
+Singletons/T136b.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| class C a where
+            meth :: a -> a |]
+  ======>
+    class C a where
+      meth :: a -> a
+    type MethSym0 :: forall a. (~>) a a
+    data MethSym0 a0123456789876543210
+      where
+        MethSym0KindInference :: SameKind (Apply MethSym0 arg) (MethSym1 arg) =>
+                                 MethSym0 a0123456789876543210
+    type instance Apply MethSym0 a0123456789876543210 = MethSym1 a0123456789876543210
+    instance SuppressUnusedWarnings MethSym0 where
+      suppressUnusedWarnings = snd (((,) MethSym0KindInference) ())
+    type MethSym1 (a0123456789876543210 :: a) =
+        Meth a0123456789876543210 :: a
+    class PC a where
+      type Meth (arg :: a) :: a
+    class SC a where
+      sMeth :: forall (t :: a). Sing t -> Sing (Apply MethSym0 t :: a)
+    instance SC a => SingI (MethSym0 :: (~>) a a) where
+      sing = (singFun1 @MethSym0) sMeth
+Singletons/T136b.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| instance C Bool where
+            meth = not |]
+  ======>
+    instance C Bool where
+      meth = not
+    type Meth_0123456789876543210 :: Bool -> Bool
+    type family Meth_0123456789876543210 a where
+      Meth_0123456789876543210 a_0123456789876543210 = Apply NotSym0 a_0123456789876543210
+    type Meth_0123456789876543210Sym0 :: (~>) Bool Bool
+    data Meth_0123456789876543210Sym0 a0123456789876543210
+      where
+        Meth_0123456789876543210Sym0KindInference :: SameKind (Apply Meth_0123456789876543210Sym0 arg) (Meth_0123456789876543210Sym1 arg) =>
+                                                     Meth_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Meth_0123456789876543210Sym0 a0123456789876543210 = Meth_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Meth_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Meth_0123456789876543210Sym0KindInference) ())
+    type Meth_0123456789876543210Sym1 (a0123456789876543210 :: Bool) =
+        Meth_0123456789876543210 a0123456789876543210 :: Bool
+    instance PC Bool where
+      type Meth a = Apply Meth_0123456789876543210Sym0 a
+    instance SC Bool where
+      sMeth ::
+        forall (t :: Bool).
+        Sing t
+        -> Sing (Apply (MethSym0 :: TyFun Bool Bool -> GHC.Types.Type) t)
+      sMeth (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing ((singFun1 @NotSym0) sNot)) sA_0123456789876543210
diff --git a/tests/compile-and-dump/Singletons/T145.ghc88.template b/tests/compile-and-dump/Singletons/T145.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T145.ghc88.template
+++ /dev/null
@@ -1,39 +0,0 @@
-Singletons/T145.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| class Column (f :: Type -> Type) where
-            col :: f a -> a -> Bool |]
-  ======>
-    class Column (f :: Type -> Type) where
-      col :: f a -> a -> Bool
-    type ColSym2 (arg0123456789876543210 :: f0123456789876543210 a0123456789876543210) (arg0123456789876543210 :: a0123456789876543210) =
-        Col arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings (ColSym1 arg0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) ColSym1KindInference) ())
-    data ColSym1 (arg0123456789876543210 :: f0123456789876543210 a0123456789876543210) :: (~>) a0123456789876543210 Bool
-      where
-        ColSym1KindInference :: forall arg0123456789876543210
-                                       arg0123456789876543210
-                                       arg. SameKind (Apply (ColSym1 arg0123456789876543210) arg) (ColSym2 arg0123456789876543210 arg) =>
-                                ColSym1 arg0123456789876543210 arg0123456789876543210
-    type instance Apply (ColSym1 arg0123456789876543210) arg0123456789876543210 = Col arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings ColSym0 where
-      suppressUnusedWarnings = snd (((,) ColSym0KindInference) ())
-    data ColSym0 :: forall f0123456789876543210 a0123456789876543210.
-                    (~>) (f0123456789876543210 a0123456789876543210) ((~>) a0123456789876543210 Bool)
-      where
-        ColSym0KindInference :: forall arg0123456789876543210
-                                       arg. SameKind (Apply ColSym0 arg) (ColSym1 arg) =>
-                                ColSym0 arg0123456789876543210
-    type instance Apply ColSym0 arg0123456789876543210 = ColSym1 arg0123456789876543210
-    class PColumn (f :: Type -> Type) where
-      type Col (arg :: f a) (arg :: a) :: Bool
-    class SColumn (f :: Type -> Type) where
-      sCol ::
-        forall a (t :: f a) (t :: a).
-        Sing t -> Sing t -> Sing (Apply (Apply ColSym0 t) t :: Bool)
-    instance SColumn f =>
-             SingI (ColSym0 :: (~>) (f a) ((~>) a Bool)) where
-      sing = (singFun2 @ColSym0) sCol
-    instance (SColumn f, SingI d) =>
-             SingI (ColSym1 (d :: f a) :: (~>) a Bool) where
-      sing = (singFun1 @(ColSym1 (d :: f a))) (sCol (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T145.golden b/tests/compile-and-dump/Singletons/T145.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T145.golden
@@ -0,0 +1,37 @@
+Singletons/T145.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| class Column (f :: Type -> Type) where
+            col :: f a -> a -> Bool |]
+  ======>
+    class Column (f :: Type -> Type) where
+      col :: f a -> a -> Bool
+    type ColSym0 :: forall f a. (~>) (f a) ((~>) a Bool)
+    data ColSym0 a0123456789876543210
+      where
+        ColSym0KindInference :: SameKind (Apply ColSym0 arg) (ColSym1 arg) =>
+                                ColSym0 a0123456789876543210
+    type instance Apply ColSym0 a0123456789876543210 = ColSym1 a0123456789876543210
+    instance SuppressUnusedWarnings ColSym0 where
+      suppressUnusedWarnings = snd (((,) ColSym0KindInference) ())
+    type ColSym1 :: forall f a. f a -> (~>) a Bool
+    data ColSym1 a0123456789876543210 a0123456789876543210
+      where
+        ColSym1KindInference :: SameKind (Apply (ColSym1 a0123456789876543210) arg) (ColSym2 a0123456789876543210 arg) =>
+                                ColSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ColSym1 a0123456789876543210) a0123456789876543210 = ColSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ColSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) ColSym1KindInference) ())
+    type ColSym2 (a0123456789876543210 :: f a) (a0123456789876543210 :: a) =
+        Col a0123456789876543210 a0123456789876543210 :: Bool
+    class PColumn (f :: Type -> Type) where
+      type Col (arg :: f a) (arg :: a) :: Bool
+    class SColumn (f :: Type -> Type) where
+      sCol ::
+        forall a (t :: f a) (t :: a).
+        Sing t -> Sing t -> Sing (Apply (Apply ColSym0 t) t :: Bool)
+    instance SColumn f =>
+             SingI (ColSym0 :: (~>) (f a) ((~>) a Bool)) where
+      sing = (singFun2 @ColSym0) sCol
+    instance (SColumn f, SingI d) =>
+             SingI (ColSym1 (d :: f a) :: (~>) a Bool) where
+      sing = (singFun1 @(ColSym1 (d :: f a))) (sCol (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T150.golden b/tests/compile-and-dump/Singletons/T150.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T150.golden
@@ -0,0 +1,363 @@
+Singletons/T150.hs:(0,0)-(0,0): Splicing declarations
+    withOptions defaultOptions {genSingKindInsts = False}
+      $ singletons
+          $ lift
+              [d| headVec :: Vec (Succ n) a -> a
+                  headVec (VCons x _) = x
+                  tailVec :: Vec (Succ n) a -> Vec n a
+                  tailVec (VCons _ xs) = xs
+                  (!) :: Vec n a -> Fin n -> a
+                  VCons x _ ! FZ = x
+                  VCons _ xs ! FS n = xs ! n
+                  VNil ! n = case n of
+                  mapVec :: (a -> b) -> Vec n a -> Vec n b
+                  mapVec _ VNil = VNil
+                  mapVec f (VCons x xs) = VCons (f x) (mapVec f xs)
+                  symmetry :: Equal a b -> Equal b a
+                  symmetry Reflexive = Reflexive
+                  transitivity :: Equal a b -> Equal b c -> Equal a c
+                  transitivity Reflexive Reflexive = Reflexive
+                  
+                  data Fin :: Nat -> Type
+                    where
+                      FZ :: Fin (Succ n)
+                      FS :: Fin n -> Fin (Succ n)
+                  data Foo :: Type -> Type
+                    where
+                      MkFoo1 :: Foo Bool
+                      MkFoo2 :: Foo Ordering
+                  data Vec :: Nat -> Type -> Type
+                    where
+                      VNil :: Vec Zero a
+                      VCons :: a -> Vec n a -> Vec (Succ n) a
+                  data Equal :: Type -> Type -> Type where Reflexive :: Equal a a
+                  data HList :: [Type] -> Type
+                    where
+                      HNil :: HList '[]
+                      HCons :: x -> HList xs -> HList (x : xs)
+                  data Obj :: Type where Obj :: a -> Obj |]
+  ======>
+    data Fin :: Nat -> Type
+      where
+        FZ :: Fin ('Succ n)
+        FS :: (Fin n) -> Fin ('Succ n)
+    data Foo :: Type -> Type
+      where
+        MkFoo1 :: Foo Bool
+        MkFoo2 :: Foo Ordering
+    data Vec :: Nat -> Type -> Type
+      where
+        VNil :: Vec 'Zero a
+        VCons :: a -> (Vec n a) -> Vec ('Succ n) a
+    headVec :: Vec ('Succ n) a -> a
+    headVec (VCons x _) = x
+    tailVec :: Vec ('Succ n) a -> Vec n a
+    tailVec (VCons _ xs) = xs
+    (!) :: Vec n a -> Fin n -> a
+    (!) (VCons x _) FZ = x
+    (!) (VCons _ xs) (FS n) = (xs ! n)
+    (!) VNil n = case n of
+    mapVec :: (a -> b) -> Vec n a -> Vec n b
+    mapVec _ VNil = VNil
+    mapVec f (VCons x xs) = (VCons (f x)) ((mapVec f) xs)
+    data Equal :: Type -> Type -> Type where Reflexive :: Equal a a
+    symmetry :: Equal a b -> Equal b a
+    symmetry Reflexive = Reflexive
+    transitivity :: Equal a b -> Equal b c -> Equal a c
+    transitivity Reflexive Reflexive = Reflexive
+    data HList :: [Type] -> Type
+      where
+        HNil :: HList '[]
+        HCons :: x -> (HList xs) -> HList ('(:) x xs)
+    data Obj :: Type where Obj :: a -> Obj
+    type FZSym0 = FZ :: Fin ('Succ n)
+    type FSSym0 :: (~>) (Fin n) (Fin ('Succ n))
+    data FSSym0 a0123456789876543210
+      where
+        FSSym0KindInference :: SameKind (Apply FSSym0 arg) (FSSym1 arg) =>
+                               FSSym0 a0123456789876543210
+    type instance Apply FSSym0 a0123456789876543210 = FSSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FSSym0 where
+      suppressUnusedWarnings = snd (((,) FSSym0KindInference) ())
+    type FSSym1 (a0123456789876543210 :: Fin n) =
+        FS a0123456789876543210 :: Fin ('Succ n)
+    type MkFoo1Sym0 = MkFoo1 :: Foo Bool
+    type MkFoo2Sym0 = MkFoo2 :: Foo Ordering
+    type VNilSym0 = VNil :: Vec 'Zero a
+    type VConsSym0 :: (~>) a ((~>) (Vec n a) (Vec ('Succ n) a))
+    data VConsSym0 a0123456789876543210
+      where
+        VConsSym0KindInference :: SameKind (Apply VConsSym0 arg) (VConsSym1 arg) =>
+                                  VConsSym0 a0123456789876543210
+    type instance Apply VConsSym0 a0123456789876543210 = VConsSym1 a0123456789876543210
+    instance SuppressUnusedWarnings VConsSym0 where
+      suppressUnusedWarnings = snd (((,) VConsSym0KindInference) ())
+    type VConsSym1 :: a -> (~>) (Vec n a) (Vec ('Succ n) a)
+    data VConsSym1 a0123456789876543210 a0123456789876543210
+      where
+        VConsSym1KindInference :: SameKind (Apply (VConsSym1 a0123456789876543210) arg) (VConsSym2 a0123456789876543210 arg) =>
+                                  VConsSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (VConsSym1 a0123456789876543210) a0123456789876543210 = VConsSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (VConsSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) VConsSym1KindInference) ())
+    type VConsSym2 (a0123456789876543210 :: a) (a0123456789876543210 :: Vec n a) =
+        VCons a0123456789876543210 a0123456789876543210 :: Vec ('Succ n) a
+    type ReflexiveSym0 = Reflexive :: Equal a a
+    type HNilSym0 = HNil :: HList '[]
+    type HConsSym0 :: (~>) x ((~>) (HList xs) (HList ('(:) x xs)))
+    data HConsSym0 a0123456789876543210
+      where
+        HConsSym0KindInference :: SameKind (Apply HConsSym0 arg) (HConsSym1 arg) =>
+                                  HConsSym0 a0123456789876543210
+    type instance Apply HConsSym0 a0123456789876543210 = HConsSym1 a0123456789876543210
+    instance SuppressUnusedWarnings HConsSym0 where
+      suppressUnusedWarnings = snd (((,) HConsSym0KindInference) ())
+    type HConsSym1 :: x -> (~>) (HList xs) (HList ('(:) x xs))
+    data HConsSym1 a0123456789876543210 a0123456789876543210
+      where
+        HConsSym1KindInference :: SameKind (Apply (HConsSym1 a0123456789876543210) arg) (HConsSym2 a0123456789876543210 arg) =>
+                                  HConsSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (HConsSym1 a0123456789876543210) a0123456789876543210 = HConsSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (HConsSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) HConsSym1KindInference) ())
+    type HConsSym2 (a0123456789876543210 :: x) (a0123456789876543210 :: HList xs) =
+        HCons a0123456789876543210 a0123456789876543210 :: HList ('(:) x xs)
+    type ObjSym0 :: (~>) a Obj
+    data ObjSym0 a0123456789876543210
+      where
+        ObjSym0KindInference :: SameKind (Apply ObjSym0 arg) (ObjSym1 arg) =>
+                                ObjSym0 a0123456789876543210
+    type instance Apply ObjSym0 a0123456789876543210 = ObjSym1 a0123456789876543210
+    instance SuppressUnusedWarnings ObjSym0 where
+      suppressUnusedWarnings = snd (((,) ObjSym0KindInference) ())
+    type ObjSym1 (a0123456789876543210 :: a) =
+        Obj a0123456789876543210 :: Obj
+    type family Case_0123456789876543210 n t where
+    type TransitivitySym0 :: (~>) (Equal a b) ((~>) (Equal b c) (Equal a c))
+    data TransitivitySym0 a0123456789876543210
+      where
+        TransitivitySym0KindInference :: SameKind (Apply TransitivitySym0 arg) (TransitivitySym1 arg) =>
+                                         TransitivitySym0 a0123456789876543210
+    type instance Apply TransitivitySym0 a0123456789876543210 = TransitivitySym1 a0123456789876543210
+    instance SuppressUnusedWarnings TransitivitySym0 where
+      suppressUnusedWarnings
+        = snd (((,) TransitivitySym0KindInference) ())
+    type TransitivitySym1 :: Equal a b -> (~>) (Equal b c) (Equal a c)
+    data TransitivitySym1 a0123456789876543210 a0123456789876543210
+      where
+        TransitivitySym1KindInference :: SameKind (Apply (TransitivitySym1 a0123456789876543210) arg) (TransitivitySym2 a0123456789876543210 arg) =>
+                                         TransitivitySym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (TransitivitySym1 a0123456789876543210) a0123456789876543210 = TransitivitySym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (TransitivitySym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) TransitivitySym1KindInference) ())
+    type TransitivitySym2 (a0123456789876543210 :: Equal a b) (a0123456789876543210 :: Equal b c) =
+        Transitivity a0123456789876543210 a0123456789876543210 :: Equal a c
+    type SymmetrySym0 :: (~>) (Equal a b) (Equal b a)
+    data SymmetrySym0 a0123456789876543210
+      where
+        SymmetrySym0KindInference :: SameKind (Apply SymmetrySym0 arg) (SymmetrySym1 arg) =>
+                                     SymmetrySym0 a0123456789876543210
+    type instance Apply SymmetrySym0 a0123456789876543210 = SymmetrySym1 a0123456789876543210
+    instance SuppressUnusedWarnings SymmetrySym0 where
+      suppressUnusedWarnings = snd (((,) SymmetrySym0KindInference) ())
+    type SymmetrySym1 (a0123456789876543210 :: Equal a b) =
+        Symmetry a0123456789876543210 :: Equal b a
+    type MapVecSym0 :: (~>) ((~>) a b) ((~>) (Vec n a) (Vec n b))
+    data MapVecSym0 a0123456789876543210
+      where
+        MapVecSym0KindInference :: SameKind (Apply MapVecSym0 arg) (MapVecSym1 arg) =>
+                                   MapVecSym0 a0123456789876543210
+    type instance Apply MapVecSym0 a0123456789876543210 = MapVecSym1 a0123456789876543210
+    instance SuppressUnusedWarnings MapVecSym0 where
+      suppressUnusedWarnings = snd (((,) MapVecSym0KindInference) ())
+    type MapVecSym1 :: (~>) a b -> (~>) (Vec n a) (Vec n b)
+    data MapVecSym1 a0123456789876543210 a0123456789876543210
+      where
+        MapVecSym1KindInference :: SameKind (Apply (MapVecSym1 a0123456789876543210) arg) (MapVecSym2 a0123456789876543210 arg) =>
+                                   MapVecSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (MapVecSym1 a0123456789876543210) a0123456789876543210 = MapVecSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (MapVecSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) MapVecSym1KindInference) ())
+    type MapVecSym2 (a0123456789876543210 :: (~>) a b) (a0123456789876543210 :: Vec n a) =
+        MapVec a0123456789876543210 a0123456789876543210 :: Vec n b
+    type (!@#@$) :: (~>) (Vec n a) ((~>) (Fin n) a)
+    data (!@#@$) a0123456789876543210
+      where
+        (:!@#@$###) :: SameKind (Apply (!@#@$) arg) ((!@#@$$) arg) =>
+                       (!@#@$) a0123456789876543210
+    type instance Apply (!@#@$) a0123456789876543210 = (!@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (!@#@$) where
+      suppressUnusedWarnings = snd (((,) (:!@#@$###)) ())
+    type (!@#@$$) :: Vec n a -> (~>) (Fin n) a
+    data (!@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (:!@#@$$###) :: SameKind (Apply ((!@#@$$) a0123456789876543210) arg) ((!@#@$$$) a0123456789876543210 arg) =>
+                        (!@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((!@#@$$) a0123456789876543210) a0123456789876543210 = (!@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((!@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (:!@#@$$###)) ())
+    type (!@#@$$$) (a0123456789876543210 :: Vec n a) (a0123456789876543210 :: Fin n) =
+        (!) a0123456789876543210 a0123456789876543210 :: a
+    type TailVecSym0 :: (~>) (Vec ('Succ n) a) (Vec n a)
+    data TailVecSym0 a0123456789876543210
+      where
+        TailVecSym0KindInference :: SameKind (Apply TailVecSym0 arg) (TailVecSym1 arg) =>
+                                    TailVecSym0 a0123456789876543210
+    type instance Apply TailVecSym0 a0123456789876543210 = TailVecSym1 a0123456789876543210
+    instance SuppressUnusedWarnings TailVecSym0 where
+      suppressUnusedWarnings = snd (((,) TailVecSym0KindInference) ())
+    type TailVecSym1 (a0123456789876543210 :: Vec ('Succ n) a) =
+        TailVec a0123456789876543210 :: Vec n a
+    type HeadVecSym0 :: (~>) (Vec ('Succ n) a) a
+    data HeadVecSym0 a0123456789876543210
+      where
+        HeadVecSym0KindInference :: SameKind (Apply HeadVecSym0 arg) (HeadVecSym1 arg) =>
+                                    HeadVecSym0 a0123456789876543210
+    type instance Apply HeadVecSym0 a0123456789876543210 = HeadVecSym1 a0123456789876543210
+    instance SuppressUnusedWarnings HeadVecSym0 where
+      suppressUnusedWarnings = snd (((,) HeadVecSym0KindInference) ())
+    type HeadVecSym1 (a0123456789876543210 :: Vec ('Succ n) a) =
+        HeadVec a0123456789876543210 :: a
+    type Transitivity :: Equal a b -> Equal b c -> Equal a c
+    type family Transitivity a a where
+      Transitivity Reflexive Reflexive = ReflexiveSym0
+    type Symmetry :: Equal a b -> Equal b a
+    type family Symmetry a where
+      Symmetry Reflexive = ReflexiveSym0
+    type MapVec :: (~>) a b -> Vec n a -> Vec n b
+    type family MapVec a a where
+      MapVec _ VNil = VNilSym0
+      MapVec f (VCons x xs) = Apply (Apply VConsSym0 (Apply f x)) (Apply (Apply MapVecSym0 f) xs)
+    type (!) :: Vec n a -> Fin n -> a
+    type family (!) a a where
+      (!) (VCons x _) FZ = x
+      (!) (VCons _ xs) (FS n) = Apply (Apply (!@#@$) xs) n
+      (!) VNil n = Case_0123456789876543210 n n
+    type TailVec :: Vec ('Succ n) a -> Vec n a
+    type family TailVec a where
+      TailVec (VCons _ xs) = xs
+    type HeadVec :: Vec ('Succ n) a -> a
+    type family HeadVec a where
+      HeadVec (VCons x _) = x
+    sTransitivity ::
+      forall a b c (t :: Equal a b) (t :: Equal b c).
+      Sing t
+      -> Sing t -> Sing (Apply (Apply TransitivitySym0 t) t :: Equal a c)
+    sSymmetry ::
+      forall a b (t :: Equal a b).
+      Sing t -> Sing (Apply SymmetrySym0 t :: Equal b a)
+    sMapVec ::
+      forall a b n (t :: (~>) a b) (t :: Vec n a).
+      Sing t -> Sing t -> Sing (Apply (Apply MapVecSym0 t) t :: Vec n b)
+    (%!) ::
+      forall n a (t :: Vec n a) (t :: Fin n).
+      Sing t -> Sing t -> Sing (Apply (Apply (!@#@$) t) t :: a)
+    sTailVec ::
+      forall n a (t :: Vec ('Succ n) a).
+      Sing t -> Sing (Apply TailVecSym0 t :: Vec n a)
+    sHeadVec ::
+      forall n a (t :: Vec ('Succ n) a).
+      Sing t -> Sing (Apply HeadVecSym0 t :: a)
+    sTransitivity SReflexive SReflexive = SReflexive
+    sSymmetry SReflexive = SReflexive
+    sMapVec _ SVNil = SVNil
+    sMapVec (sF :: Sing f) (SVCons (sX :: Sing x) (sXs :: Sing xs))
+      = (applySing
+           ((applySing ((singFun2 @VConsSym0) SVCons)) ((applySing sF) sX)))
+          ((applySing ((applySing ((singFun2 @MapVecSym0) sMapVec)) sF)) sXs)
+    (%!) (SVCons (sX :: Sing x) _) SFZ = sX
+    (%!) (SVCons _ (sXs :: Sing xs)) (SFS (sN :: Sing n))
+      = (applySing ((applySing ((singFun2 @(!@#@$)) (%!))) sXs)) sN
+    (%!) SVNil (sN :: Sing n)
+      = (id @(Sing (Case_0123456789876543210 n n :: a))) (case sN of)
+    sTailVec (SVCons _ (sXs :: Sing xs)) = sXs
+    sHeadVec (SVCons (sX :: Sing x) _) = sX
+    instance SingI (TransitivitySym0 :: (~>) (Equal a b) ((~>) (Equal b c) (Equal a c))) where
+      sing = (singFun2 @TransitivitySym0) sTransitivity
+    instance SingI d =>
+             SingI (TransitivitySym1 (d :: Equal a b) :: (~>) (Equal b c) (Equal a c)) where
+      sing
+        = (singFun1 @(TransitivitySym1 (d :: Equal a b)))
+            (sTransitivity (sing @d))
+    instance SingI (SymmetrySym0 :: (~>) (Equal a b) (Equal b a)) where
+      sing = (singFun1 @SymmetrySym0) sSymmetry
+    instance SingI (MapVecSym0 :: (~>) ((~>) a b) ((~>) (Vec n a) (Vec n b))) where
+      sing = (singFun2 @MapVecSym0) sMapVec
+    instance SingI d =>
+             SingI (MapVecSym1 (d :: (~>) a b) :: (~>) (Vec n a) (Vec n b)) where
+      sing = (singFun1 @(MapVecSym1 (d :: (~>) a b))) (sMapVec (sing @d))
+    instance SingI ((!@#@$) :: (~>) (Vec n a) ((~>) (Fin n) a)) where
+      sing = (singFun2 @(!@#@$)) (%!)
+    instance SingI d =>
+             SingI ((!@#@$$) (d :: Vec n a) :: (~>) (Fin n) a) where
+      sing = (singFun1 @((!@#@$$) (d :: Vec n a))) ((%!) (sing @d))
+    instance SingI (TailVecSym0 :: (~>) (Vec ('Succ n) a) (Vec n a)) where
+      sing = (singFun1 @TailVecSym0) sTailVec
+    instance SingI (HeadVecSym0 :: (~>) (Vec ('Succ n) a) a) where
+      sing = (singFun1 @HeadVecSym0) sHeadVec
+    data SFin :: forall a. Fin (a :: Nat) -> Type
+      where
+        SFZ :: forall n. SFin (FZ :: Fin ('Succ n))
+        SFS :: forall n (n :: Fin n).
+               (Sing n) -> SFin (FS n :: Fin ('Succ n))
+    type instance Sing @(Fin a) = SFin
+    data SFoo :: forall a. Foo (a :: Type) -> Type
+      where
+        SMkFoo1 :: SFoo (MkFoo1 :: Foo Bool)
+        SMkFoo2 :: SFoo (MkFoo2 :: Foo Ordering)
+    type instance Sing @(Foo a) = SFoo
+    data SVec :: forall a a. Vec (a :: Nat) (a :: Type) -> Type
+      where
+        SVNil :: forall a. SVec (VNil :: Vec 'Zero a)
+        SVCons :: forall a n (n :: a) (n :: Vec n a).
+                  (Sing n) -> (Sing n) -> SVec (VCons n n :: Vec ('Succ n) a)
+    type instance Sing @(Vec a a) = SVec
+    data SEqual :: forall a a. Equal (a :: Type) (a :: Type) -> Type
+      where SReflexive :: forall a. SEqual (Reflexive :: Equal a a)
+    type instance Sing @(Equal a a) = SEqual
+    data SHList :: forall a. HList (a :: [Type]) -> Type
+      where
+        SHNil :: SHList (HNil :: HList '[])
+        SHCons :: forall x xs (n :: x) (n :: HList xs).
+                  (Sing n) -> (Sing n) -> SHList (HCons n n :: HList ('(:) x xs))
+    type instance Sing @(HList a) = SHList
+    data SObj :: Obj -> Type
+      where SObj :: forall a (n :: a). (Sing n) -> SObj (Obj n :: Obj)
+    type instance Sing @Obj = SObj
+    instance SingI FZ where
+      sing = SFZ
+    instance SingI n => SingI (FS (n :: Fin n)) where
+      sing = SFS sing
+    instance SingI (FSSym0 :: (~>) (Fin n) (Fin ('Succ n))) where
+      sing = (singFun1 @FSSym0) SFS
+    instance SingI MkFoo1 where
+      sing = SMkFoo1
+    instance SingI MkFoo2 where
+      sing = SMkFoo2
+    instance SingI VNil where
+      sing = SVNil
+    instance (SingI n, SingI n) =>
+             SingI (VCons (n :: a) (n :: Vec n a)) where
+      sing = (SVCons sing) sing
+    instance SingI (VConsSym0 :: (~>) a ((~>) (Vec n a) (Vec ('Succ n) a))) where
+      sing = (singFun2 @VConsSym0) SVCons
+    instance SingI d =>
+             SingI (VConsSym1 (d :: a) :: (~>) (Vec n a) (Vec ('Succ n) a)) where
+      sing = (singFun1 @(VConsSym1 (d :: a))) (SVCons (sing @d))
+    instance SingI Reflexive where
+      sing = SReflexive
+    instance SingI HNil where
+      sing = SHNil
+    instance (SingI n, SingI n) =>
+             SingI (HCons (n :: x) (n :: HList xs)) where
+      sing = (SHCons sing) sing
+    instance SingI (HConsSym0 :: (~>) x ((~>) (HList xs) (HList ('(:) x xs)))) where
+      sing = (singFun2 @HConsSym0) SHCons
+    instance SingI d =>
+             SingI (HConsSym1 (d :: x) :: (~>) (HList xs) (HList ('(:) x xs))) where
+      sing = (singFun1 @(HConsSym1 (d :: x))) (SHCons (sing @d))
+    instance SingI n => SingI (Obj (n :: a)) where
+      sing = SObj sing
+    instance SingI (ObjSym0 :: (~>) a Obj) where
+      sing = (singFun1 @ObjSym0) SObj
diff --git a/tests/compile-and-dump/Singletons/T150.hs b/tests/compile-and-dump/Singletons/T150.hs
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T150.hs
@@ -0,0 +1,53 @@
+module T150 where
+
+import Control.Monad.Trans.Class
+import Data.Kind
+import Data.Singletons.TH
+import Data.Singletons.TH.Options
+import Singletons.Nat
+
+$(withOptions defaultOptions{genSingKindInsts = False} $
+    singletons $ lift
+    [d| data Fin :: Nat -> Type where
+          FZ :: Fin (Succ n)
+          FS :: Fin n -> Fin (Succ n)
+
+        data Foo :: Type -> Type where
+          MkFoo1 :: Foo Bool
+          MkFoo2 :: Foo Ordering
+
+        data Vec :: Nat -> Type -> Type where
+          VNil  :: Vec Zero a
+          VCons :: a -> Vec n a -> Vec (Succ n) a
+
+        headVec :: Vec (Succ n) a -> a
+        headVec (VCons x _) = x
+
+        tailVec :: Vec (Succ n) a -> Vec n a
+        tailVec (VCons _ xs) = xs
+
+        (!) :: Vec n a -> Fin n -> a
+        VCons x _  ! FZ   = x
+        VCons _ xs ! FS n = xs ! n
+        VNil       ! n    = case n of {}
+
+        mapVec :: (a -> b) -> Vec n a -> Vec n b
+        mapVec _ VNil         = VNil
+        mapVec f (VCons x xs) = VCons (f x) (mapVec f xs)
+
+        data Equal :: Type -> Type -> Type where
+          Reflexive :: Equal a a
+
+        symmetry :: Equal a b -> Equal b a
+        symmetry Reflexive = Reflexive
+
+        transitivity :: Equal a b -> Equal b c -> Equal a c
+        transitivity Reflexive Reflexive = Reflexive
+
+        data HList :: [Type] -> Type where
+          HNil  :: HList '[]
+          HCons :: x -> HList xs -> HList (x:xs)
+
+        data Obj :: Type where
+          Obj :: a -> Obj
+    |])
diff --git a/tests/compile-and-dump/Singletons/T153.ghc88.template b/tests/compile-and-dump/Singletons/T153.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T153.ghc88.template
+++ /dev/null
diff --git a/tests/compile-and-dump/Singletons/T153.golden b/tests/compile-and-dump/Singletons/T153.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T153.golden
diff --git a/tests/compile-and-dump/Singletons/T157.ghc88.template b/tests/compile-and-dump/Singletons/T157.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T157.ghc88.template
+++ /dev/null
diff --git a/tests/compile-and-dump/Singletons/T157.golden b/tests/compile-and-dump/Singletons/T157.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T157.golden
diff --git a/tests/compile-and-dump/Singletons/T159.ghc88.template b/tests/compile-and-dump/Singletons/T159.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T159.ghc88.template
+++ /dev/null
@@ -1,225 +0,0 @@
-Singletons/T159.hs:0:0:: Splicing declarations
-    genSingletons [''T0, ''T1]
-  ======>
-    type ASym0 = 'A
-    type BSym0 = 'B
-    type CSym0 = 'C
-    type DSym0 = 'D
-    type ESym0 = 'E
-    type FSym0 = 'F
-    data ST0 :: T0 -> GHC.Types.Type
-      where
-        SA :: ST0 'A
-        SB :: ST0 'B
-        SC :: ST0 'C
-        SD :: ST0 'D
-        SE :: ST0 'E
-        SF :: ST0 'F
-    type instance Sing @T0 = ST0
-    instance SingKind T0 where
-      type Demote T0 = T0
-      fromSing SA = A
-      fromSing SB = B
-      fromSing SC = C
-      fromSing SD = D
-      fromSing SE = E
-      fromSing SF = F
-      toSing A = SomeSing SA
-      toSing B = SomeSing SB
-      toSing C = SomeSing SC
-      toSing D = SomeSing SD
-      toSing E = SomeSing SE
-      toSing F = SomeSing SF
-    instance SingI 'A where
-      sing = SA
-    instance SingI 'B where
-      sing = SB
-    instance SingI 'C where
-      sing = SC
-    instance SingI 'D where
-      sing = SD
-    instance SingI 'E where
-      sing = SE
-    instance SingI 'F where
-      sing = SF
-    type N1Sym0 = 'N1
-    type C1Sym2 (t0123456789876543210 :: T0) (t0123456789876543210 :: T1) =
-        'C1 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (C1Sym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) C1Sym1KindInference) ())
-    data C1Sym1 (t0123456789876543210 :: T0) :: (~>) T1 T1
-      where
-        C1Sym1KindInference :: forall t0123456789876543210
-                                      t0123456789876543210
-                                      arg. SameKind (Apply (C1Sym1 t0123456789876543210) arg) (C1Sym2 t0123456789876543210 arg) =>
-                               C1Sym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (C1Sym1 t0123456789876543210) t0123456789876543210 = 'C1 t0123456789876543210 t0123456789876543210
-    infixr 5 `C1Sym1`
-    instance SuppressUnusedWarnings C1Sym0 where
-      suppressUnusedWarnings = snd (((,) C1Sym0KindInference) ())
-    data C1Sym0 :: (~>) T0 ((~>) T1 T1)
-      where
-        C1Sym0KindInference :: forall t0123456789876543210
-                                      arg. SameKind (Apply C1Sym0 arg) (C1Sym1 arg) =>
-                               C1Sym0 t0123456789876543210
-    type instance Apply C1Sym0 t0123456789876543210 = C1Sym1 t0123456789876543210
-    infixr 5 `C1Sym0`
-    type (:&&@#@$$$) (t0123456789876543210 :: T0) (t0123456789876543210 :: T1) =
-        '(:&&) t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings ((:&&@#@$$) t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (::&&@#@$$###)) ())
-    data (:&&@#@$$) (t0123456789876543210 :: T0) :: (~>) T1 T1
-      where
-        (::&&@#@$$###) :: forall t0123456789876543210
-                                 t0123456789876543210
-                                 arg. SameKind (Apply ((:&&@#@$$) t0123456789876543210) arg) ((:&&@#@$$$) t0123456789876543210 arg) =>
-                          (:&&@#@$$) t0123456789876543210 t0123456789876543210
-    type instance Apply ((:&&@#@$$) t0123456789876543210) t0123456789876543210 = '(:&&) t0123456789876543210 t0123456789876543210
-    infixr 5 :&&@#@$$
-    instance SuppressUnusedWarnings (:&&@#@$) where
-      suppressUnusedWarnings = snd (((,) (::&&@#@$###)) ())
-    data (:&&@#@$) :: (~>) T0 ((~>) T1 T1)
-      where
-        (::&&@#@$###) :: forall t0123456789876543210
-                                arg. SameKind (Apply (:&&@#@$) arg) ((:&&@#@$$) arg) =>
-                         (:&&@#@$) t0123456789876543210
-    type instance Apply (:&&@#@$) t0123456789876543210 = (:&&@#@$$) t0123456789876543210
-    infixr 5 :&&@#@$
-    data ST1 :: T1 -> GHC.Types.Type
-      where
-        SN1 :: ST1 'N1
-        SC1 :: forall (n :: T0) (n :: T1).
-               (Sing (n :: T0)) -> (Sing (n :: T1)) -> ST1 ('C1 n n)
-        (:%&&) :: forall (n :: T0) (n :: T1).
-                  (Sing (n :: T0)) -> (Sing (n :: T1)) -> ST1 ('(:&&) n n)
-    type instance Sing @T1 = ST1
-    instance SingKind T1 where
-      type Demote T1 = T1
-      fromSing SN1 = N1
-      fromSing (SC1 b b) = (C1 (fromSing b)) (fromSing b)
-      fromSing ((:%&&) b b) = ((:&&) (fromSing b)) (fromSing b)
-      toSing N1 = SomeSing SN1
-      toSing (C1 (b :: Demote T0) (b :: Demote T1))
-        = case
-              ((,) (toSing b :: SomeSing T0)) (toSing b :: SomeSing T1)
-          of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SC1 c) c) }
-      toSing ((:&&) (b :: Demote T0) (b :: Demote T1))
-        = case
-              ((,) (toSing b :: SomeSing T0)) (toSing b :: SomeSing T1)
-          of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:%&&) c) c) }
-    infixr 5 `SC1`
-    infixr 5 :%&&
-    instance SingI 'N1 where
-      sing = SN1
-    instance (SingI n, SingI n) =>
-             SingI ('C1 (n :: T0) (n :: T1)) where
-      sing = (SC1 sing) sing
-    instance SingI (C1Sym0 :: (~>) T0 ((~>) T1 T1)) where
-      sing = (singFun2 @C1Sym0) SC1
-    instance SingI d => SingI (C1Sym1 (d :: T0) :: (~>) T1 T1) where
-      sing = (singFun1 @(C1Sym1 (d :: T0))) (SC1 (sing @d))
-    instance (SingI n, SingI n) =>
-             SingI ('(:&&) (n :: T0) (n :: T1)) where
-      sing = ((:%&&) sing) sing
-    instance SingI ((:&&@#@$) :: (~>) T0 ((~>) T1 T1)) where
-      sing = (singFun2 @(:&&@#@$)) (:%&&)
-    instance SingI d =>
-             SingI ((:&&@#@$$) (d :: T0) :: (~>) T1 T1) where
-      sing = (singFun1 @((:&&@#@$$) (d :: T0))) ((:%&&) (sing @d))
-Singletons/T159.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| infixr 5 :||
-          infixr 5 `C2`
-          
-          data T2 = N2 | C2 T0 T2 | T0 :|| T2 |]
-  ======>
-    data T2 = N2 | C2 T0 T2 | T0 :|| T2
-    infixr 5 `C2`
-    infixr 5 :||
-    type N2Sym0 = N2
-    type C2Sym2 (t0123456789876543210 :: T0) (t0123456789876543210 :: T2) =
-        C2 t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (C2Sym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) C2Sym1KindInference) ())
-    data C2Sym1 (t0123456789876543210 :: T0) :: (~>) T2 T2
-      where
-        C2Sym1KindInference :: forall t0123456789876543210
-                                      t0123456789876543210
-                                      arg. SameKind (Apply (C2Sym1 t0123456789876543210) arg) (C2Sym2 t0123456789876543210 arg) =>
-                               C2Sym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (C2Sym1 t0123456789876543210) t0123456789876543210 = C2 t0123456789876543210 t0123456789876543210
-    infixr 5 `C2Sym1`
-    instance SuppressUnusedWarnings C2Sym0 where
-      suppressUnusedWarnings = snd (((,) C2Sym0KindInference) ())
-    data C2Sym0 :: (~>) T0 ((~>) T2 T2)
-      where
-        C2Sym0KindInference :: forall t0123456789876543210
-                                      arg. SameKind (Apply C2Sym0 arg) (C2Sym1 arg) =>
-                               C2Sym0 t0123456789876543210
-    type instance Apply C2Sym0 t0123456789876543210 = C2Sym1 t0123456789876543210
-    infixr 5 `C2Sym0`
-    type (:||@#@$$$) (t0123456789876543210 :: T0) (t0123456789876543210 :: T2) =
-        (:||) t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings ((:||@#@$$) t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (::||@#@$$###)) ())
-    data (:||@#@$$) (t0123456789876543210 :: T0) :: (~>) T2 T2
-      where
-        (::||@#@$$###) :: forall t0123456789876543210
-                                 t0123456789876543210
-                                 arg. SameKind (Apply ((:||@#@$$) t0123456789876543210) arg) ((:||@#@$$$) t0123456789876543210 arg) =>
-                          (:||@#@$$) t0123456789876543210 t0123456789876543210
-    type instance Apply ((:||@#@$$) t0123456789876543210) t0123456789876543210 = (:||) t0123456789876543210 t0123456789876543210
-    infixr 5 :||@#@$$
-    instance SuppressUnusedWarnings (:||@#@$) where
-      suppressUnusedWarnings = snd (((,) (::||@#@$###)) ())
-    data (:||@#@$) :: (~>) T0 ((~>) T2 T2)
-      where
-        (::||@#@$###) :: forall t0123456789876543210
-                                arg. SameKind (Apply (:||@#@$) arg) ((:||@#@$$) arg) =>
-                         (:||@#@$) t0123456789876543210
-    type instance Apply (:||@#@$) t0123456789876543210 = (:||@#@$$) t0123456789876543210
-    infixr 5 :||@#@$
-    infixr 5 :%||
-    infixr 5 `SC2`
-    data ST2 :: T2 -> GHC.Types.Type
-      where
-        SN2 :: ST2 N2
-        SC2 :: forall (n :: T0) (n :: T2).
-               (Sing (n :: T0)) -> (Sing (n :: T2)) -> ST2 (C2 n n)
-        (:%||) :: forall (n :: T0) (n :: T2).
-                  (Sing (n :: T0)) -> (Sing (n :: T2)) -> ST2 ((:||) n n)
-    type instance Sing @T2 = ST2
-    instance SingKind T2 where
-      type Demote T2 = T2
-      fromSing SN2 = N2
-      fromSing (SC2 b b) = (C2 (fromSing b)) (fromSing b)
-      fromSing ((:%||) b b) = ((:||) (fromSing b)) (fromSing b)
-      toSing N2 = SomeSing SN2
-      toSing (C2 (b :: Demote T0) (b :: Demote T2))
-        = case
-              ((,) (toSing b :: SomeSing T0)) (toSing b :: SomeSing T2)
-          of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SC2 c) c) }
-      toSing ((:||) (b :: Demote T0) (b :: Demote T2))
-        = case
-              ((,) (toSing b :: SomeSing T0)) (toSing b :: SomeSing T2)
-          of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:%||) c) c) }
-    instance SingI N2 where
-      sing = SN2
-    instance (SingI n, SingI n) => SingI (C2 (n :: T0) (n :: T2)) where
-      sing = (SC2 sing) sing
-    instance SingI (C2Sym0 :: (~>) T0 ((~>) T2 T2)) where
-      sing = (singFun2 @C2Sym0) SC2
-    instance SingI d => SingI (C2Sym1 (d :: T0) :: (~>) T2 T2) where
-      sing = (singFun1 @(C2Sym1 (d :: T0))) (SC2 (sing @d))
-    instance (SingI n, SingI n) =>
-             SingI ((:||) (n :: T0) (n :: T2)) where
-      sing = ((:%||) sing) sing
-    instance SingI ((:||@#@$) :: (~>) T0 ((~>) T2 T2)) where
-      sing = (singFun2 @(:||@#@$)) (:%||)
-    instance SingI d =>
-             SingI ((:||@#@$$) (d :: T0) :: (~>) T2 T2) where
-      sing = (singFun1 @((:||@#@$$) (d :: T0))) ((:%||) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T159.golden b/tests/compile-and-dump/Singletons/T159.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T159.golden
@@ -0,0 +1,227 @@
+Singletons/T159.hs:0:0:: Splicing declarations
+    genSingletons [''T0, ''T1]
+  ======>
+    type ASym0 = 'A :: T0
+    type BSym0 = 'B :: T0
+    type CSym0 = 'C :: T0
+    type DSym0 = 'D :: T0
+    type ESym0 = 'E :: T0
+    type FSym0 = 'F :: T0
+    type ST0 :: T0 -> GHC.Types.Type
+    data ST0 z
+      where
+        SA :: ST0 ('A :: T0)
+        SB :: ST0 ('B :: T0)
+        SC :: ST0 ('C :: T0)
+        SD :: ST0 ('D :: T0)
+        SE :: ST0 ('E :: T0)
+        SF :: ST0 ('F :: T0)
+    type instance Sing @T0 = ST0
+    instance SingKind T0 where
+      type Demote T0 = T0
+      fromSing SA = A
+      fromSing SB = B
+      fromSing SC = C
+      fromSing SD = D
+      fromSing SE = E
+      fromSing SF = F
+      toSing A = SomeSing SA
+      toSing B = SomeSing SB
+      toSing C = SomeSing SC
+      toSing D = SomeSing SD
+      toSing E = SomeSing SE
+      toSing F = SomeSing SF
+    instance SingI 'A where
+      sing = SA
+    instance SingI 'B where
+      sing = SB
+    instance SingI 'C where
+      sing = SC
+    instance SingI 'D where
+      sing = SD
+    instance SingI 'E where
+      sing = SE
+    instance SingI 'F where
+      sing = SF
+    type N1Sym0 = 'N1 :: T1
+    type C1Sym0 :: (~>) T0 ((~>) T1 T1)
+    data C1Sym0 a0123456789876543210
+      where
+        C1Sym0KindInference :: SameKind (Apply C1Sym0 arg) (C1Sym1 arg) =>
+                               C1Sym0 a0123456789876543210
+    type instance Apply C1Sym0 a0123456789876543210 = C1Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings C1Sym0 where
+      suppressUnusedWarnings = snd (((,) C1Sym0KindInference) ())
+    infixr 5 `C1Sym0`
+    type C1Sym1 :: T0 -> (~>) T1 T1
+    data C1Sym1 a0123456789876543210 a0123456789876543210
+      where
+        C1Sym1KindInference :: SameKind (Apply (C1Sym1 a0123456789876543210) arg) (C1Sym2 a0123456789876543210 arg) =>
+                               C1Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (C1Sym1 a0123456789876543210) a0123456789876543210 = C1Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (C1Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) C1Sym1KindInference) ())
+    infixr 5 `C1Sym1`
+    type C1Sym2 (a0123456789876543210 :: T0) (a0123456789876543210 :: T1) =
+        'C1 a0123456789876543210 a0123456789876543210 :: T1
+    infixr 5 `C1Sym2`
+    type (:&&@#@$) :: (~>) T0 ((~>) T1 T1)
+    data (:&&@#@$) a0123456789876543210
+      where
+        (::&&@#@$###) :: SameKind (Apply (:&&@#@$) arg) ((:&&@#@$$) arg) =>
+                         (:&&@#@$) a0123456789876543210
+    type instance Apply (:&&@#@$) a0123456789876543210 = (:&&@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (:&&@#@$) where
+      suppressUnusedWarnings = snd (((,) (::&&@#@$###)) ())
+    infixr 5 :&&@#@$
+    type (:&&@#@$$) :: T0 -> (~>) T1 T1
+    data (:&&@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (::&&@#@$$###) :: SameKind (Apply ((:&&@#@$$) a0123456789876543210) arg) ((:&&@#@$$$) a0123456789876543210 arg) =>
+                          (:&&@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((:&&@#@$$) a0123456789876543210) a0123456789876543210 = (:&&@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((:&&@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (::&&@#@$$###)) ())
+    infixr 5 :&&@#@$$
+    type (:&&@#@$$$) (a0123456789876543210 :: T0) (a0123456789876543210 :: T1) =
+        '(:&&) a0123456789876543210 a0123456789876543210 :: T1
+    infixr 5 :&&@#@$$$
+    type ST1 :: T1 -> GHC.Types.Type
+    data ST1 z
+      where
+        SN1 :: ST1 ('N1 :: T1)
+        SC1 :: forall (n :: T0) (n :: T1).
+               (Sing n) -> (Sing n) -> ST1 ('C1 n n :: T1)
+        (:%&&) :: forall (n :: T0) (n :: T1).
+                  (Sing n) -> (Sing n) -> ST1 ('(:&&) n n :: T1)
+    type instance Sing @T1 = ST1
+    instance SingKind T1 where
+      type Demote T1 = T1
+      fromSing SN1 = N1
+      fromSing (SC1 b b) = (C1 (fromSing b)) (fromSing b)
+      fromSing ((:%&&) b b) = ((:&&) (fromSing b)) (fromSing b)
+      toSing N1 = SomeSing SN1
+      toSing (C1 (b :: Demote T0) (b :: Demote T1))
+        = case
+              ((,) (toSing b :: SomeSing T0)) (toSing b :: SomeSing T1)
+          of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SC1 c) c) }
+      toSing ((:&&) (b :: Demote T0) (b :: Demote T1))
+        = case
+              ((,) (toSing b :: SomeSing T0)) (toSing b :: SomeSing T1)
+          of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:%&&) c) c) }
+    infixr 5 `SC1`
+    infixr 5 :%&&
+    instance SingI 'N1 where
+      sing = SN1
+    instance (SingI n, SingI n) =>
+             SingI ('C1 (n :: T0) (n :: T1)) where
+      sing = (SC1 sing) sing
+    instance SingI (C1Sym0 :: (~>) T0 ((~>) T1 T1)) where
+      sing = (singFun2 @C1Sym0) SC1
+    instance SingI d => SingI (C1Sym1 (d :: T0) :: (~>) T1 T1) where
+      sing = (singFun1 @(C1Sym1 (d :: T0))) (SC1 (sing @d))
+    instance (SingI n, SingI n) =>
+             SingI ('(:&&) (n :: T0) (n :: T1)) where
+      sing = ((:%&&) sing) sing
+    instance SingI ((:&&@#@$) :: (~>) T0 ((~>) T1 T1)) where
+      sing = (singFun2 @(:&&@#@$)) (:%&&)
+    instance SingI d =>
+             SingI ((:&&@#@$$) (d :: T0) :: (~>) T1 T1) where
+      sing = (singFun1 @((:&&@#@$$) (d :: T0))) ((:%&&) (sing @d))
+Singletons/T159.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| infixr 5 :||
+          infixr 5 `C2`
+          
+          data T2 = N2 | C2 T0 T2 | T0 :|| T2 |]
+  ======>
+    data T2 = N2 | C2 T0 T2 | T0 :|| T2
+    infixr 5 `C2`
+    infixr 5 :||
+    type N2Sym0 = N2 :: T2
+    type C2Sym0 :: (~>) T0 ((~>) T2 T2)
+    data C2Sym0 a0123456789876543210
+      where
+        C2Sym0KindInference :: SameKind (Apply C2Sym0 arg) (C2Sym1 arg) =>
+                               C2Sym0 a0123456789876543210
+    type instance Apply C2Sym0 a0123456789876543210 = C2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings C2Sym0 where
+      suppressUnusedWarnings = snd (((,) C2Sym0KindInference) ())
+    infixr 5 `C2Sym0`
+    type C2Sym1 :: T0 -> (~>) T2 T2
+    data C2Sym1 a0123456789876543210 a0123456789876543210
+      where
+        C2Sym1KindInference :: SameKind (Apply (C2Sym1 a0123456789876543210) arg) (C2Sym2 a0123456789876543210 arg) =>
+                               C2Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (C2Sym1 a0123456789876543210) a0123456789876543210 = C2Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (C2Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) C2Sym1KindInference) ())
+    infixr 5 `C2Sym1`
+    type C2Sym2 (a0123456789876543210 :: T0) (a0123456789876543210 :: T2) =
+        C2 a0123456789876543210 a0123456789876543210 :: T2
+    infixr 5 `C2Sym2`
+    type (:||@#@$) :: (~>) T0 ((~>) T2 T2)
+    data (:||@#@$) a0123456789876543210
+      where
+        (::||@#@$###) :: SameKind (Apply (:||@#@$) arg) ((:||@#@$$) arg) =>
+                         (:||@#@$) a0123456789876543210
+    type instance Apply (:||@#@$) a0123456789876543210 = (:||@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (:||@#@$) where
+      suppressUnusedWarnings = snd (((,) (::||@#@$###)) ())
+    infixr 5 :||@#@$
+    type (:||@#@$$) :: T0 -> (~>) T2 T2
+    data (:||@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (::||@#@$$###) :: SameKind (Apply ((:||@#@$$) a0123456789876543210) arg) ((:||@#@$$$) a0123456789876543210 arg) =>
+                          (:||@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((:||@#@$$) a0123456789876543210) a0123456789876543210 = (:||@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((:||@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (::||@#@$$###)) ())
+    infixr 5 :||@#@$$
+    type (:||@#@$$$) (a0123456789876543210 :: T0) (a0123456789876543210 :: T2) =
+        (:||) a0123456789876543210 a0123456789876543210 :: T2
+    infixr 5 :||@#@$$$
+    infixr 5 :%||
+    infixr 5 `SC2`
+    data ST2 :: T2 -> GHC.Types.Type
+      where
+        SN2 :: ST2 (N2 :: T2)
+        SC2 :: forall (n :: T0) (n :: T2).
+               (Sing n) -> (Sing n) -> ST2 (C2 n n :: T2)
+        (:%||) :: forall (n :: T0) (n :: T2).
+                  (Sing n) -> (Sing n) -> ST2 ((:||) n n :: T2)
+    type instance Sing @T2 = ST2
+    instance SingKind T2 where
+      type Demote T2 = T2
+      fromSing SN2 = N2
+      fromSing (SC2 b b) = (C2 (fromSing b)) (fromSing b)
+      fromSing ((:%||) b b) = ((:||) (fromSing b)) (fromSing b)
+      toSing N2 = SomeSing SN2
+      toSing (C2 (b :: Demote T0) (b :: Demote T2))
+        = case
+              ((,) (toSing b :: SomeSing T0)) (toSing b :: SomeSing T2)
+          of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SC2 c) c) }
+      toSing ((:||) (b :: Demote T0) (b :: Demote T2))
+        = case
+              ((,) (toSing b :: SomeSing T0)) (toSing b :: SomeSing T2)
+          of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:%||) c) c) }
+    instance SingI N2 where
+      sing = SN2
+    instance (SingI n, SingI n) => SingI (C2 (n :: T0) (n :: T2)) where
+      sing = (SC2 sing) sing
+    instance SingI (C2Sym0 :: (~>) T0 ((~>) T2 T2)) where
+      sing = (singFun2 @C2Sym0) SC2
+    instance SingI d => SingI (C2Sym1 (d :: T0) :: (~>) T2 T2) where
+      sing = (singFun1 @(C2Sym1 (d :: T0))) (SC2 (sing @d))
+    instance (SingI n, SingI n) =>
+             SingI ((:||) (n :: T0) (n :: T2)) where
+      sing = ((:%||) sing) sing
+    instance SingI ((:||@#@$) :: (~>) T0 ((~>) T2 T2)) where
+      sing = (singFun2 @(:||@#@$)) (:%||)
+    instance SingI d =>
+             SingI ((:||@#@$$) (d :: T0) :: (~>) T2 T2) where
+      sing = (singFun1 @((:||@#@$$) (d :: T0))) ((:%||) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T160.ghc88.template b/tests/compile-and-dump/Singletons/T160.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T160.ghc88.template
+++ /dev/null
@@ -1,69 +0,0 @@
-Singletons/T160.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| foo :: (Num a, Eq a) => a -> a
-          foo x = if x == 0 then 1 else typeError $ ShowType x |]
-  ======>
-    foo :: (Num a, Eq a) => a -> a
-    foo x = if (x == 0) then 1 else (typeError $ ShowType x)
-    type Let0123456789876543210Scrutinee_0123456789876543210Sym1 x0123456789876543210 =
-        Let0123456789876543210Scrutinee_0123456789876543210 x0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210Scrutinee_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd
-            (((,)
-                Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference)
-               ())
-    data Let0123456789876543210Scrutinee_0123456789876543210Sym0 x0123456789876543210
-      where
-        Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference :: forall x0123456789876543210
-                                                                                       arg. SameKind (Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym1 arg) =>
-                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym0 x0123456789876543210
-    type instance Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 x0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210 x0123456789876543210
-    type family Let0123456789876543210Scrutinee_0123456789876543210 x where
-      Let0123456789876543210Scrutinee_0123456789876543210 x = Apply (Apply (==@#@$) x) (FromInteger 0)
-    type family Case_0123456789876543210 x t where
-      Case_0123456789876543210 x 'True = FromInteger 1
-      Case_0123456789876543210 x 'False = Apply (Apply ($@#@$) TypeErrorSym0) (Apply ShowTypeSym0 x)
-    type FooSym1 (a0123456789876543210 :: a0123456789876543210) =
-        Foo a0123456789876543210
-    instance SuppressUnusedWarnings FooSym0 where
-      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
-    data FooSym0 :: forall a0123456789876543210.
-                    (~>) a0123456789876543210 a0123456789876543210
-      where
-        FooSym0KindInference :: forall a0123456789876543210
-                                       arg. SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
-                                FooSym0 a0123456789876543210
-    type instance Apply FooSym0 a0123456789876543210 = Foo a0123456789876543210
-    type family Foo (a :: a) :: a where
-      Foo x = Case_0123456789876543210 x (Let0123456789876543210Scrutinee_0123456789876543210Sym1 x)
-    sFoo ::
-      forall a (t :: a).
-      (SNum a, SEq a) => Sing t -> Sing (Apply FooSym0 t :: a)
-    sFoo (sX :: Sing x)
-      = let
-          sScrutinee_0123456789876543210 ::
-            Sing (Let0123456789876543210Scrutinee_0123456789876543210Sym1 x)
-          sScrutinee_0123456789876543210
-            = (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sX))
-                (sFromInteger (sing :: Sing 0))
-        in
-          (id
-             @(Sing (Case_0123456789876543210 x (Let0123456789876543210Scrutinee_0123456789876543210Sym1 x) :: a)))
-            (case sScrutinee_0123456789876543210 of
-               STrue -> sFromInteger (sing :: Sing 1)
-               SFalse
-                 -> (applySing
-                       ((applySing ((singFun2 @($@#@$)) (%$)))
-                          ((singFun1 @TypeErrorSym0) sTypeError)))
-                      ((applySing ((singFun1 @ShowTypeSym0) SShowType)) sX))
-    instance (SNum a, SEq a) => SingI (FooSym0 :: (~>) a a) where
-      sing = (singFun1 @FooSym0) sFoo
-
-Singletons/T160.hs:0:0: error:
-    • 1
-    • In the expression: Refl
-      In an equation for ‘f’: f = Refl
-   |
-13 | f = Refl
-   |     ^^^^
diff --git a/tests/compile-and-dump/Singletons/T160.golden b/tests/compile-and-dump/Singletons/T160.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T160.golden
@@ -0,0 +1,68 @@
+Singletons/T160.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| foo :: (Num a, Eq a) => a -> a
+          foo x = if x == 0 then 1 else typeError $ ShowType x |]
+  ======>
+    foo :: (Num a, Eq a) => a -> a
+    foo x = if (x == 0) then 1 else (typeError $ ShowType x)
+    data Let0123456789876543210Scrutinee_0123456789876543210Sym0 x0123456789876543210
+      where
+        Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference :: SameKind (Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym1 arg) =>
+                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym0 x0123456789876543210
+    type instance Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 x0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym1 x0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210Scrutinee_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd
+            (((,)
+                Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference)
+               ())
+    type Let0123456789876543210Scrutinee_0123456789876543210Sym1 x0123456789876543210 =
+        Let0123456789876543210Scrutinee_0123456789876543210 x0123456789876543210
+    type family Let0123456789876543210Scrutinee_0123456789876543210 x where
+      Let0123456789876543210Scrutinee_0123456789876543210 x = Apply (Apply (==@#@$) x) (FromInteger 0)
+    type family Case_0123456789876543210 x t where
+      Case_0123456789876543210 x 'True = FromInteger 1
+      Case_0123456789876543210 x 'False = Apply (Apply ($@#@$) TypeErrorSym0) (Apply ShowTypeSym0 x)
+    type FooSym0 :: (~>) a a
+    data FooSym0 a0123456789876543210
+      where
+        FooSym0KindInference :: SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
+                                FooSym0 a0123456789876543210
+    type instance Apply FooSym0 a0123456789876543210 = FooSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FooSym0 where
+      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
+    type FooSym1 (a0123456789876543210 :: a) =
+        Foo a0123456789876543210 :: a
+    type Foo :: a -> a
+    type family Foo a where
+      Foo x = Case_0123456789876543210 x (Let0123456789876543210Scrutinee_0123456789876543210Sym1 x)
+    sFoo ::
+      forall a (t :: a).
+      (SNum a, SEq a) => Sing t -> Sing (Apply FooSym0 t :: a)
+    sFoo (sX :: Sing x)
+      = let
+          sScrutinee_0123456789876543210 ::
+            Sing @_ (Let0123456789876543210Scrutinee_0123456789876543210Sym1 x)
+          sScrutinee_0123456789876543210
+            = (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sX))
+                (sFromInteger (sing :: Sing 0))
+        in
+          (id
+             @(Sing (Case_0123456789876543210 x (Let0123456789876543210Scrutinee_0123456789876543210Sym1 x) :: a)))
+            (case sScrutinee_0123456789876543210 of
+               STrue -> sFromInteger (sing :: Sing 1)
+               SFalse
+                 -> (applySing
+                       ((applySing ((singFun2 @($@#@$)) (%$)))
+                          ((singFun1 @TypeErrorSym0) sTypeError)))
+                      ((applySing ((singFun1 @ShowTypeSym0) SShowType)) sX))
+    instance (SNum a, SEq a) => SingI (FooSym0 :: (~>) a a) where
+      sing = (singFun1 @FooSym0) sFoo
+
+Singletons/T160.hs:0:0: error:
+    • 1
+    • In the expression: Refl
+      In an equation for ‘f’: f = Refl
+   |
+13 | f = Refl
+   |     ^^^^
diff --git a/tests/compile-and-dump/Singletons/T163.ghc88.template b/tests/compile-and-dump/Singletons/T163.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T163.ghc88.template
+++ /dev/null
@@ -1,47 +0,0 @@
-Singletons/T163.hs:0:0:: Splicing declarations
-    singletons [d| data a + b = L a | R b |]
-  ======>
-    data (+) a b = L a | R b
-    type LSym1 (t0123456789876543210 :: a0123456789876543210) =
-        L t0123456789876543210
-    instance SuppressUnusedWarnings LSym0 where
-      suppressUnusedWarnings = snd (((,) LSym0KindInference) ())
-    data LSym0 :: forall a0123456789876543210 b0123456789876543210.
-                  (~>) a0123456789876543210 ((+) a0123456789876543210 b0123456789876543210)
-      where
-        LSym0KindInference :: forall t0123456789876543210
-                                     arg. SameKind (Apply LSym0 arg) (LSym1 arg) =>
-                              LSym0 t0123456789876543210
-    type instance Apply LSym0 t0123456789876543210 = L t0123456789876543210
-    type RSym1 (t0123456789876543210 :: b0123456789876543210) =
-        R t0123456789876543210
-    instance SuppressUnusedWarnings RSym0 where
-      suppressUnusedWarnings = snd (((,) RSym0KindInference) ())
-    data RSym0 :: forall b0123456789876543210 a0123456789876543210.
-                  (~>) b0123456789876543210 ((+) a0123456789876543210 b0123456789876543210)
-      where
-        RSym0KindInference :: forall t0123456789876543210
-                                     arg. SameKind (Apply RSym0 arg) (RSym1 arg) =>
-                              RSym0 t0123456789876543210
-    type instance Apply RSym0 t0123456789876543210 = R t0123456789876543210
-    data (%+) :: forall a b. (+) a b -> GHC.Types.Type
-      where
-        SL :: forall a (n :: a). (Sing (n :: a)) -> (%+) (L n)
-        SR :: forall b (n :: b). (Sing (n :: b)) -> (%+) (R n)
-    type instance Sing @((+) a b) = (%+)
-    instance (SingKind a, SingKind b) => SingKind ((+) a b) where
-      type Demote ((+) a b) = (+) (Demote a) (Demote b)
-      fromSing (SL b) = L (fromSing b)
-      fromSing (SR b) = R (fromSing b)
-      toSing (L (b :: Demote a))
-        = case toSing b :: SomeSing a of { SomeSing c -> SomeSing (SL c) }
-      toSing (R (b :: Demote b))
-        = case toSing b :: SomeSing b of { SomeSing c -> SomeSing (SR c) }
-    instance SingI n => SingI (L (n :: a)) where
-      sing = SL sing
-    instance SingI (LSym0 :: (~>) a ((+) a b)) where
-      sing = (singFun1 @LSym0) SL
-    instance SingI n => SingI (R (n :: b)) where
-      sing = SR sing
-    instance SingI (RSym0 :: (~>) b ((+) a b)) where
-      sing = (singFun1 @RSym0) SR
diff --git a/tests/compile-and-dump/Singletons/T163.golden b/tests/compile-and-dump/Singletons/T163.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T163.golden
@@ -0,0 +1,45 @@
+Singletons/T163.hs:0:0:: Splicing declarations
+    singletons [d| data a + b = L a | R b |]
+  ======>
+    data (+) a b = L a | R b
+    type LSym0 :: forall a b. (~>) a ((+) a b)
+    data LSym0 a0123456789876543210
+      where
+        LSym0KindInference :: SameKind (Apply LSym0 arg) (LSym1 arg) =>
+                              LSym0 a0123456789876543210
+    type instance Apply LSym0 a0123456789876543210 = LSym1 a0123456789876543210
+    instance SuppressUnusedWarnings LSym0 where
+      suppressUnusedWarnings = snd (((,) LSym0KindInference) ())
+    type LSym1 (a0123456789876543210 :: a) =
+        L a0123456789876543210 :: (+) a b
+    type RSym0 :: forall a b. (~>) b ((+) a b)
+    data RSym0 a0123456789876543210
+      where
+        RSym0KindInference :: SameKind (Apply RSym0 arg) (RSym1 arg) =>
+                              RSym0 a0123456789876543210
+    type instance Apply RSym0 a0123456789876543210 = RSym1 a0123456789876543210
+    instance SuppressUnusedWarnings RSym0 where
+      suppressUnusedWarnings = snd (((,) RSym0KindInference) ())
+    type RSym1 (a0123456789876543210 :: b) =
+        R a0123456789876543210 :: (+) a b
+    data (%+) :: forall a b. (+) a b -> GHC.Types.Type
+      where
+        SL :: forall a b (n :: a). (Sing n) -> (%+) (L n :: (+) a b)
+        SR :: forall a b (n :: b). (Sing n) -> (%+) (R n :: (+) a b)
+    type instance Sing @((+) a b) = (%+)
+    instance (SingKind a, SingKind b) => SingKind ((+) a b) where
+      type Demote ((+) a b) = (+) (Demote a) (Demote b)
+      fromSing (SL b) = L (fromSing b)
+      fromSing (SR b) = R (fromSing b)
+      toSing (L (b :: Demote a))
+        = case toSing b :: SomeSing a of { SomeSing c -> SomeSing (SL c) }
+      toSing (R (b :: Demote b))
+        = case toSing b :: SomeSing b of { SomeSing c -> SomeSing (SR c) }
+    instance SingI n => SingI (L (n :: a)) where
+      sing = SL sing
+    instance SingI (LSym0 :: (~>) a ((+) a b)) where
+      sing = (singFun1 @LSym0) SL
+    instance SingI n => SingI (R (n :: b)) where
+      sing = SR sing
+    instance SingI (RSym0 :: (~>) b ((+) a b)) where
+      sing = (singFun1 @RSym0) SR
diff --git a/tests/compile-and-dump/Singletons/T166.ghc88.template b/tests/compile-and-dump/Singletons/T166.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T166.ghc88.template
+++ /dev/null
@@ -1,139 +0,0 @@
-Singletons/T166.hs:(0,0)-(0,0): Splicing declarations
-    singletonsOnly
-      [d| class Foo a where
-            foosPrec :: Nat -> a -> [Bool] -> [Bool]
-            foo :: a -> [Bool]
-            foo x s = foosPrec 0 x s |]
-  ======>
-    type FoosPrecSym3 (arg0123456789876543210 :: Nat) (arg0123456789876543210 :: a0123456789876543210) (arg0123456789876543210 :: [Bool]) =
-        FoosPrec arg0123456789876543210 arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings (FoosPrecSym2 arg0123456789876543210 arg0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) FoosPrecSym2KindInference) ())
-    data FoosPrecSym2 (arg0123456789876543210 :: Nat) (arg0123456789876543210 :: a0123456789876543210) :: (~>) [Bool] [Bool]
-      where
-        FoosPrecSym2KindInference :: forall arg0123456789876543210
-                                            arg0123456789876543210
-                                            arg0123456789876543210
-                                            arg. SameKind (Apply (FoosPrecSym2 arg0123456789876543210 arg0123456789876543210) arg) (FoosPrecSym3 arg0123456789876543210 arg0123456789876543210 arg) =>
-                                     FoosPrecSym2 arg0123456789876543210 arg0123456789876543210 arg0123456789876543210
-    type instance Apply (FoosPrecSym2 arg0123456789876543210 arg0123456789876543210) arg0123456789876543210 = FoosPrec arg0123456789876543210 arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings (FoosPrecSym1 arg0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) FoosPrecSym1KindInference) ())
-    data FoosPrecSym1 (arg0123456789876543210 :: Nat) :: forall a0123456789876543210.
-                                                         (~>) a0123456789876543210 ((~>) [Bool] [Bool])
-      where
-        FoosPrecSym1KindInference :: forall arg0123456789876543210
-                                            arg0123456789876543210
-                                            arg. SameKind (Apply (FoosPrecSym1 arg0123456789876543210) arg) (FoosPrecSym2 arg0123456789876543210 arg) =>
-                                     FoosPrecSym1 arg0123456789876543210 arg0123456789876543210
-    type instance Apply (FoosPrecSym1 arg0123456789876543210) arg0123456789876543210 = FoosPrecSym2 arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings FoosPrecSym0 where
-      suppressUnusedWarnings = snd (((,) FoosPrecSym0KindInference) ())
-    data FoosPrecSym0 :: forall a0123456789876543210.
-                         (~>) Nat ((~>) a0123456789876543210 ((~>) [Bool] [Bool]))
-      where
-        FoosPrecSym0KindInference :: forall arg0123456789876543210
-                                            arg. SameKind (Apply FoosPrecSym0 arg) (FoosPrecSym1 arg) =>
-                                     FoosPrecSym0 arg0123456789876543210
-    type instance Apply FoosPrecSym0 arg0123456789876543210 = FoosPrecSym1 arg0123456789876543210
-    type FooSym1 (arg0123456789876543210 :: a0123456789876543210) =
-        Foo arg0123456789876543210
-    instance SuppressUnusedWarnings FooSym0 where
-      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
-    data FooSym0 :: forall a0123456789876543210.
-                    (~>) a0123456789876543210 [Bool]
-      where
-        FooSym0KindInference :: forall arg0123456789876543210
-                                       arg. SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
-                                FooSym0 arg0123456789876543210
-    type instance Apply FooSym0 arg0123456789876543210 = Foo arg0123456789876543210
-    type family Lambda_0123456789876543210 x t where
-      Lambda_0123456789876543210 x s = Apply (Apply (Apply FoosPrecSym0 (Data.Singletons.Prelude.Num.FromInteger 0)) x) s
-    type Lambda_0123456789876543210Sym2 x0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 x0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall x0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 x0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall x0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
-    type family Foo_0123456789876543210 (a :: a) :: [Bool] where
-      Foo_0123456789876543210 x = Apply Lambda_0123456789876543210Sym0 x
-    type Foo_0123456789876543210Sym1 (a0123456789876543210 :: a0123456789876543210) =
-        Foo_0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Foo_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Foo_0123456789876543210Sym0KindInference) ())
-    data Foo_0123456789876543210Sym0 :: forall a0123456789876543210.
-                                        (~>) a0123456789876543210 [Bool]
-      where
-        Foo_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                           arg. SameKind (Apply Foo_0123456789876543210Sym0 arg) (Foo_0123456789876543210Sym1 arg) =>
-                                                    Foo_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Foo_0123456789876543210Sym0 a0123456789876543210 = Foo_0123456789876543210 a0123456789876543210
-    class PFoo (a :: GHC.Types.Type) where
-      type FoosPrec (arg :: Nat) (arg :: a) (arg :: [Bool]) :: [Bool]
-      type Foo (arg :: a) :: [Bool]
-      type Foo a = Apply Foo_0123456789876543210Sym0 a
-    class SFoo a where
-      sFoosPrec ::
-        forall (t :: Nat) (t :: a) (t :: [Bool]).
-        Sing t
-        -> Sing t
-           -> Sing t
-              -> Sing (Apply (Apply (Apply FoosPrecSym0 t) t) t :: [Bool])
-      sFoo :: forall (t :: a). Sing t -> Sing (Apply FooSym0 t :: [Bool])
-      default sFoo ::
-                forall (t :: a).
-                ((Apply FooSym0 t :: [Bool])
-                 ~ Apply Foo_0123456789876543210Sym0 t) =>
-                Sing t -> Sing (Apply FooSym0 t :: [Bool])
-      sFoo (sX :: Sing x)
-        = (singFun1 @(Apply Lambda_0123456789876543210Sym0 x))
-            (\ sS
-               -> case sS of {
-                    (_ :: Sing s)
-                      -> (applySing
-                            ((applySing
-                                ((applySing ((singFun3 @FoosPrecSym0) sFoosPrec))
-                                   (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 0))))
-                               sX))
-                           sS })
-    instance SFoo a =>
-             SingI (FoosPrecSym0 :: (~>) Nat ((~>) a ((~>) [Bool] [Bool]))) where
-      sing = (singFun3 @FoosPrecSym0) sFoosPrec
-    instance (SFoo a, SingI d) =>
-             SingI (FoosPrecSym1 (d :: Nat) :: (~>) a ((~>) [Bool] [Bool])) where
-      sing = (singFun2 @(FoosPrecSym1 (d :: Nat))) (sFoosPrec (sing @d))
-    instance (SFoo a, SingI d, SingI d) =>
-             SingI (FoosPrecSym2 (d :: Nat) (d :: a) :: (~>) [Bool] [Bool]) where
-      sing
-        = (singFun1 @(FoosPrecSym2 (d :: Nat) (d :: a)))
-            ((sFoosPrec (sing @d)) (sing @d))
-    instance SFoo a => SingI (FooSym0 :: (~>) a [Bool]) where
-      sing = (singFun1 @FooSym0) sFoo
-
-Singletons/T166.hs:0:0: error:
-    • Expecting one more argument to ‘Apply Lambda_0123456789876543210Sym0 x’
-      Expected kind ‘[Bool]’,
-        but ‘Apply Lambda_0123456789876543210Sym0 x’ has kind ‘TyFun
-                                                                 [Bool] [Bool]
-                                                               -> Type’
-    • In the type ‘Apply Lambda_0123456789876543210Sym0 x’
-      In the type family declaration for ‘Foo_0123456789876543210’
-   |
-14 | $(singletonsOnly [d|
-   |   ^^^^^^^^^^^^^^^^^^...
diff --git a/tests/compile-and-dump/Singletons/T166.golden b/tests/compile-and-dump/Singletons/T166.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T166.golden
@@ -0,0 +1,131 @@
+Singletons/T166.hs:(0,0)-(0,0): Splicing declarations
+    singletonsOnly
+      [d| class Foo a where
+            foosPrec :: Nat -> a -> [Bool] -> [Bool]
+            foo :: a -> [Bool]
+            foo x s = foosPrec 0 x s |]
+  ======>
+    type FoosPrecSym0 :: forall a.
+                         (~>) Nat ((~>) a ((~>) [Bool] [Bool]))
+    data FoosPrecSym0 a0123456789876543210
+      where
+        FoosPrecSym0KindInference :: SameKind (Apply FoosPrecSym0 arg) (FoosPrecSym1 arg) =>
+                                     FoosPrecSym0 a0123456789876543210
+    type instance Apply FoosPrecSym0 a0123456789876543210 = FoosPrecSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FoosPrecSym0 where
+      suppressUnusedWarnings = snd (((,) FoosPrecSym0KindInference) ())
+    type FoosPrecSym1 :: forall a. Nat -> (~>) a ((~>) [Bool] [Bool])
+    data FoosPrecSym1 a0123456789876543210 a0123456789876543210
+      where
+        FoosPrecSym1KindInference :: SameKind (Apply (FoosPrecSym1 a0123456789876543210) arg) (FoosPrecSym2 a0123456789876543210 arg) =>
+                                     FoosPrecSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (FoosPrecSym1 a0123456789876543210) a0123456789876543210 = FoosPrecSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (FoosPrecSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) FoosPrecSym1KindInference) ())
+    type FoosPrecSym2 :: forall a. Nat -> a -> (~>) [Bool] [Bool]
+    data FoosPrecSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        FoosPrecSym2KindInference :: SameKind (Apply (FoosPrecSym2 a0123456789876543210 a0123456789876543210) arg) (FoosPrecSym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                     FoosPrecSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (FoosPrecSym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = FoosPrecSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (FoosPrecSym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) FoosPrecSym2KindInference) ())
+    type FoosPrecSym3 (a0123456789876543210 :: Nat) (a0123456789876543210 :: a) (a0123456789876543210 :: [Bool]) =
+        FoosPrec a0123456789876543210 a0123456789876543210 a0123456789876543210 :: [Bool]
+    type FooSym0 :: forall a. (~>) a [Bool]
+    data FooSym0 a0123456789876543210
+      where
+        FooSym0KindInference :: SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
+                                FooSym0 a0123456789876543210
+    type instance Apply FooSym0 a0123456789876543210 = FooSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FooSym0 where
+      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
+    type FooSym1 (a0123456789876543210 :: a) =
+        Foo a0123456789876543210 :: [Bool]
+    type family Lambda_0123456789876543210 x s where
+      Lambda_0123456789876543210 x s = Apply (Apply (Apply FoosPrecSym0 (Data.Singletons.Prelude.Num.FromInteger 0)) x) s
+    data Lambda_0123456789876543210Sym0 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 x0123456789876543210 s0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 s0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) s0123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 s0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    type Lambda_0123456789876543210Sym2 x0123456789876543210 s0123456789876543210 =
+        Lambda_0123456789876543210 x0123456789876543210 s0123456789876543210
+    type Foo_0123456789876543210 :: a -> [Bool]
+    type family Foo_0123456789876543210 a where
+      Foo_0123456789876543210 x = Apply Lambda_0123456789876543210Sym0 x
+    type Foo_0123456789876543210Sym0 :: (~>) a [Bool]
+    data Foo_0123456789876543210Sym0 a0123456789876543210
+      where
+        Foo_0123456789876543210Sym0KindInference :: SameKind (Apply Foo_0123456789876543210Sym0 arg) (Foo_0123456789876543210Sym1 arg) =>
+                                                    Foo_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Foo_0123456789876543210Sym0 a0123456789876543210 = Foo_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Foo_0123456789876543210Sym0KindInference) ())
+    type Foo_0123456789876543210Sym1 (a0123456789876543210 :: a) =
+        Foo_0123456789876543210 a0123456789876543210 :: [Bool]
+    class PFoo a where
+      type FoosPrec (arg :: Nat) (arg :: a) (arg :: [Bool]) :: [Bool]
+      type Foo (arg :: a) :: [Bool]
+      type Foo a = Apply Foo_0123456789876543210Sym0 a
+    class SFoo a where
+      sFoosPrec ::
+        forall (t :: Nat) (t :: a) (t :: [Bool]).
+        Sing t
+        -> Sing t
+           -> Sing t
+              -> Sing (Apply (Apply (Apply FoosPrecSym0 t) t) t :: [Bool])
+      sFoo :: forall (t :: a). Sing t -> Sing (Apply FooSym0 t :: [Bool])
+      default sFoo ::
+                forall (t :: a).
+                ((Apply FooSym0 t :: [Bool])
+                 ~ Apply Foo_0123456789876543210Sym0 t) =>
+                Sing t -> Sing (Apply FooSym0 t :: [Bool])
+      sFoo (sX :: Sing x)
+        = (singFun1 @(Apply Lambda_0123456789876543210Sym0 x))
+            (\ sS
+               -> case sS of {
+                    (_ :: Sing s)
+                      -> (applySing
+                            ((applySing
+                                ((applySing ((singFun3 @FoosPrecSym0) sFoosPrec))
+                                   (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 0))))
+                               sX))
+                           sS })
+    instance SFoo a =>
+             SingI (FoosPrecSym0 :: (~>) Nat ((~>) a ((~>) [Bool] [Bool]))) where
+      sing = (singFun3 @FoosPrecSym0) sFoosPrec
+    instance (SFoo a, SingI d) =>
+             SingI (FoosPrecSym1 (d :: Nat) :: (~>) a ((~>) [Bool] [Bool])) where
+      sing = (singFun2 @(FoosPrecSym1 (d :: Nat))) (sFoosPrec (sing @d))
+    instance (SFoo a, SingI d, SingI d) =>
+             SingI (FoosPrecSym2 (d :: Nat) (d :: a) :: (~>) [Bool] [Bool]) where
+      sing
+        = (singFun1 @(FoosPrecSym2 (d :: Nat) (d :: a)))
+            ((sFoosPrec (sing @d)) (sing @d))
+    instance SFoo a => SingI (FooSym0 :: (~>) a [Bool]) where
+      sing = (singFun1 @FooSym0) sFoo
+
+Singletons/T166.hs:0:0: error:
+    • Expecting one more argument to ‘Apply Lambda_0123456789876543210Sym0 x’
+      Expected kind ‘[Bool]’,
+        but ‘Apply Lambda_0123456789876543210Sym0 x’ has kind ‘TyFun
+                                                                 [Bool] [Bool]
+                                                               -> Type’
+    • In the type ‘Apply Lambda_0123456789876543210Sym0 x’
+      In the type family declaration for ‘Foo_0123456789876543210’
+   |
+14 | $(singletonsOnly [d|
+   |   ^^^^^^^^^^^^^^^^^^...
diff --git a/tests/compile-and-dump/Singletons/T167.ghc88.template b/tests/compile-and-dump/Singletons/T167.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T167.ghc88.template
+++ /dev/null
@@ -1,178 +0,0 @@
-Singletons/T167.hs:(0,0)-(0,0): Splicing declarations
-    singletonsOnly
-      [d| class Foo a where
-            foosPrec :: Nat -> a -> DiffList
-            fooList :: a -> DiffList
-            fooList = undefined
-          
-          instance Foo a => Foo [a] where
-            foosPrec _ = fooList |]
-  ======>
-    type FoosPrecSym3 (arg0123456789876543210 :: Nat) (arg0123456789876543210 :: a0123456789876543210) (arg0123456789876543210 :: [Bool]) =
-        FoosPrec arg0123456789876543210 arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings (FoosPrecSym2 arg0123456789876543210 arg0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) FoosPrecSym2KindInference) ())
-    data FoosPrecSym2 (arg0123456789876543210 :: Nat) (arg0123456789876543210 :: a0123456789876543210) :: (~>) [Bool] [Bool]
-      where
-        FoosPrecSym2KindInference :: forall arg0123456789876543210
-                                            arg0123456789876543210
-                                            arg0123456789876543210
-                                            arg. SameKind (Apply (FoosPrecSym2 arg0123456789876543210 arg0123456789876543210) arg) (FoosPrecSym3 arg0123456789876543210 arg0123456789876543210 arg) =>
-                                     FoosPrecSym2 arg0123456789876543210 arg0123456789876543210 arg0123456789876543210
-    type instance Apply (FoosPrecSym2 arg0123456789876543210 arg0123456789876543210) arg0123456789876543210 = FoosPrec arg0123456789876543210 arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings (FoosPrecSym1 arg0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) FoosPrecSym1KindInference) ())
-    data FoosPrecSym1 (arg0123456789876543210 :: Nat) :: forall a0123456789876543210.
-                                                         (~>) a0123456789876543210 ((~>) [Bool] [Bool])
-      where
-        FoosPrecSym1KindInference :: forall arg0123456789876543210
-                                            arg0123456789876543210
-                                            arg. SameKind (Apply (FoosPrecSym1 arg0123456789876543210) arg) (FoosPrecSym2 arg0123456789876543210 arg) =>
-                                     FoosPrecSym1 arg0123456789876543210 arg0123456789876543210
-    type instance Apply (FoosPrecSym1 arg0123456789876543210) arg0123456789876543210 = FoosPrecSym2 arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings FoosPrecSym0 where
-      suppressUnusedWarnings = snd (((,) FoosPrecSym0KindInference) ())
-    data FoosPrecSym0 :: forall a0123456789876543210.
-                         (~>) Nat ((~>) a0123456789876543210 ((~>) [Bool] [Bool]))
-      where
-        FoosPrecSym0KindInference :: forall arg0123456789876543210
-                                            arg. SameKind (Apply FoosPrecSym0 arg) (FoosPrecSym1 arg) =>
-                                     FoosPrecSym0 arg0123456789876543210
-    type instance Apply FoosPrecSym0 arg0123456789876543210 = FoosPrecSym1 arg0123456789876543210
-    type FooListSym2 (arg0123456789876543210 :: a0123456789876543210) (arg0123456789876543210 :: [Bool]) =
-        FooList arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings (FooListSym1 arg0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) FooListSym1KindInference) ())
-    data FooListSym1 (arg0123456789876543210 :: a0123456789876543210) :: (~>) [Bool] [Bool]
-      where
-        FooListSym1KindInference :: forall arg0123456789876543210
-                                           arg0123456789876543210
-                                           arg. SameKind (Apply (FooListSym1 arg0123456789876543210) arg) (FooListSym2 arg0123456789876543210 arg) =>
-                                    FooListSym1 arg0123456789876543210 arg0123456789876543210
-    type instance Apply (FooListSym1 arg0123456789876543210) arg0123456789876543210 = FooList arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings FooListSym0 where
-      suppressUnusedWarnings = snd (((,) FooListSym0KindInference) ())
-    data FooListSym0 :: forall a0123456789876543210.
-                        (~>) a0123456789876543210 ((~>) [Bool] [Bool])
-      where
-        FooListSym0KindInference :: forall arg0123456789876543210
-                                           arg. SameKind (Apply FooListSym0 arg) (FooListSym1 arg) =>
-                                    FooListSym0 arg0123456789876543210
-    type instance Apply FooListSym0 arg0123456789876543210 = FooListSym1 arg0123456789876543210
-    type family FooList_0123456789876543210 (a :: a) (a :: [Bool]) :: [Bool] where
-      FooList_0123456789876543210 a_0123456789876543210 a_0123456789876543210 = Apply (Apply UndefinedSym0 a_0123456789876543210) a_0123456789876543210
-    type FooList_0123456789876543210Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: [Bool]) =
-        FooList_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (FooList_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) FooList_0123456789876543210Sym1KindInference) ())
-    data FooList_0123456789876543210Sym1 (a0123456789876543210 :: a0123456789876543210) :: (~>) [Bool] [Bool]
-      where
-        FooList_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                               a0123456789876543210
-                                                               arg. SameKind (Apply (FooList_0123456789876543210Sym1 a0123456789876543210) arg) (FooList_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                        FooList_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (FooList_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = FooList_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings FooList_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) FooList_0123456789876543210Sym0KindInference) ())
-    data FooList_0123456789876543210Sym0 :: forall a0123456789876543210.
-                                            (~>) a0123456789876543210 ((~>) [Bool] [Bool])
-      where
-        FooList_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                               arg. SameKind (Apply FooList_0123456789876543210Sym0 arg) (FooList_0123456789876543210Sym1 arg) =>
-                                                        FooList_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply FooList_0123456789876543210Sym0 a0123456789876543210 = FooList_0123456789876543210Sym1 a0123456789876543210
-    class PFoo (a :: GHC.Types.Type) where
-      type FoosPrec (arg :: Nat) (arg :: a) (arg :: [Bool]) :: [Bool]
-      type FooList (arg :: a) (arg :: [Bool]) :: [Bool]
-      type FooList a a = Apply (Apply FooList_0123456789876543210Sym0 a) a
-    type family FoosPrec_0123456789876543210 (a :: Nat) (a :: [a]) (a :: [Bool]) :: [Bool] where
-      FoosPrec_0123456789876543210 _ a_0123456789876543210 a_0123456789876543210 = Apply (Apply FooListSym0 a_0123456789876543210) a_0123456789876543210
-    type FoosPrec_0123456789876543210Sym3 (a0123456789876543210 :: Nat) (a0123456789876543210 :: [a0123456789876543210]) (a0123456789876543210 :: [Bool]) =
-        FoosPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (FoosPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) FoosPrec_0123456789876543210Sym2KindInference) ())
-    data FoosPrec_0123456789876543210Sym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: [a0123456789876543210]) :: (~>) [Bool] [Bool]
-      where
-        FoosPrec_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                                a0123456789876543210
-                                                                a0123456789876543210
-                                                                arg. SameKind (Apply (FoosPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (FoosPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                                         FoosPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (FoosPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = FoosPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (FoosPrec_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) FoosPrec_0123456789876543210Sym1KindInference) ())
-    data FoosPrec_0123456789876543210Sym1 (a0123456789876543210 :: Nat) :: forall a0123456789876543210.
-                                                                           (~>) [a0123456789876543210] ((~>) [Bool] [Bool])
-      where
-        FoosPrec_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                a0123456789876543210
-                                                                arg. SameKind (Apply (FoosPrec_0123456789876543210Sym1 a0123456789876543210) arg) (FoosPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                         FoosPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (FoosPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = FoosPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings FoosPrec_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) FoosPrec_0123456789876543210Sym0KindInference) ())
-    data FoosPrec_0123456789876543210Sym0 :: forall a0123456789876543210.
-                                             (~>) Nat ((~>) [a0123456789876543210] ((~>) [Bool] [Bool]))
-      where
-        FoosPrec_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                arg. SameKind (Apply FoosPrec_0123456789876543210Sym0 arg) (FoosPrec_0123456789876543210Sym1 arg) =>
-                                                         FoosPrec_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply FoosPrec_0123456789876543210Sym0 a0123456789876543210 = FoosPrec_0123456789876543210Sym1 a0123456789876543210
-    instance PFoo [a] where
-      type FoosPrec a a a = Apply (Apply (Apply FoosPrec_0123456789876543210Sym0 a) a) a
-    class SFoo a where
-      sFoosPrec ::
-        forall (t :: Nat) (t :: a) (t :: [Bool]).
-        Sing t
-        -> Sing t
-           -> Sing t
-              -> Sing (Apply (Apply (Apply FoosPrecSym0 t) t) t :: [Bool])
-      sFooList ::
-        forall (t :: a) (t :: [Bool]).
-        Sing t -> Sing t -> Sing (Apply (Apply FooListSym0 t) t :: [Bool])
-      default sFooList ::
-                forall (t :: a) (t :: [Bool]).
-                ((Apply (Apply FooListSym0 t) t :: [Bool])
-                 ~ Apply (Apply FooList_0123456789876543210Sym0 t) t) =>
-                Sing t -> Sing t -> Sing (Apply (Apply FooListSym0 t) t :: [Bool])
-      sFooList
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (sUndefined sA_0123456789876543210) sA_0123456789876543210
-    instance SFoo a => SFoo [a] where
-      sFoosPrec ::
-        forall (t :: Nat) (t :: [a]) (t :: [Bool]).
-        Sing t
-        -> Sing t
-           -> Sing t
-              -> Sing (Apply (Apply (Apply FoosPrecSym0 t) t) t :: [Bool])
-      sFoosPrec
-        _
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @FooListSym0) sFooList))
-                sA_0123456789876543210))
-            sA_0123456789876543210
-    instance SFoo a =>
-             SingI (FoosPrecSym0 :: (~>) Nat ((~>) a ((~>) [Bool] [Bool]))) where
-      sing = (singFun3 @FoosPrecSym0) sFoosPrec
-    instance (SFoo a, SingI d) =>
-             SingI (FoosPrecSym1 (d :: Nat) :: (~>) a ((~>) [Bool] [Bool])) where
-      sing = (singFun2 @(FoosPrecSym1 (d :: Nat))) (sFoosPrec (sing @d))
-    instance (SFoo a, SingI d, SingI d) =>
-             SingI (FoosPrecSym2 (d :: Nat) (d :: a) :: (~>) [Bool] [Bool]) where
-      sing
-        = (singFun1 @(FoosPrecSym2 (d :: Nat) (d :: a)))
-            ((sFoosPrec (sing @d)) (sing @d))
-    instance SFoo a =>
-             SingI (FooListSym0 :: (~>) a ((~>) [Bool] [Bool])) where
-      sing = (singFun2 @FooListSym0) sFooList
-    instance (SFoo a, SingI d) =>
-             SingI (FooListSym1 (d :: a) :: (~>) [Bool] [Bool]) where
-      sing = (singFun1 @(FooListSym1 (d :: a))) (sFooList (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T167.golden b/tests/compile-and-dump/Singletons/T167.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T167.golden
@@ -0,0 +1,169 @@
+Singletons/T167.hs:(0,0)-(0,0): Splicing declarations
+    singletonsOnly
+      [d| class Foo a where
+            foosPrec :: Nat -> a -> DiffList
+            fooList :: a -> DiffList
+            fooList = undefined
+          
+          instance Foo a => Foo [a] where
+            foosPrec _ = fooList |]
+  ======>
+    type FoosPrecSym0 :: forall a.
+                         (~>) Nat ((~>) a ((~>) [Bool] [Bool]))
+    data FoosPrecSym0 a0123456789876543210
+      where
+        FoosPrecSym0KindInference :: SameKind (Apply FoosPrecSym0 arg) (FoosPrecSym1 arg) =>
+                                     FoosPrecSym0 a0123456789876543210
+    type instance Apply FoosPrecSym0 a0123456789876543210 = FoosPrecSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FoosPrecSym0 where
+      suppressUnusedWarnings = snd (((,) FoosPrecSym0KindInference) ())
+    type FoosPrecSym1 :: forall a. Nat -> (~>) a ((~>) [Bool] [Bool])
+    data FoosPrecSym1 a0123456789876543210 a0123456789876543210
+      where
+        FoosPrecSym1KindInference :: SameKind (Apply (FoosPrecSym1 a0123456789876543210) arg) (FoosPrecSym2 a0123456789876543210 arg) =>
+                                     FoosPrecSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (FoosPrecSym1 a0123456789876543210) a0123456789876543210 = FoosPrecSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (FoosPrecSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) FoosPrecSym1KindInference) ())
+    type FoosPrecSym2 :: forall a. Nat -> a -> (~>) [Bool] [Bool]
+    data FoosPrecSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        FoosPrecSym2KindInference :: SameKind (Apply (FoosPrecSym2 a0123456789876543210 a0123456789876543210) arg) (FoosPrecSym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                     FoosPrecSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (FoosPrecSym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = FoosPrecSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (FoosPrecSym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) FoosPrecSym2KindInference) ())
+    type FoosPrecSym3 (a0123456789876543210 :: Nat) (a0123456789876543210 :: a) (a0123456789876543210 :: [Bool]) =
+        FoosPrec a0123456789876543210 a0123456789876543210 a0123456789876543210 :: [Bool]
+    type FooListSym0 :: forall a. (~>) a ((~>) [Bool] [Bool])
+    data FooListSym0 a0123456789876543210
+      where
+        FooListSym0KindInference :: SameKind (Apply FooListSym0 arg) (FooListSym1 arg) =>
+                                    FooListSym0 a0123456789876543210
+    type instance Apply FooListSym0 a0123456789876543210 = FooListSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FooListSym0 where
+      suppressUnusedWarnings = snd (((,) FooListSym0KindInference) ())
+    type FooListSym1 :: forall a. a -> (~>) [Bool] [Bool]
+    data FooListSym1 a0123456789876543210 a0123456789876543210
+      where
+        FooListSym1KindInference :: SameKind (Apply (FooListSym1 a0123456789876543210) arg) (FooListSym2 a0123456789876543210 arg) =>
+                                    FooListSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (FooListSym1 a0123456789876543210) a0123456789876543210 = FooListSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (FooListSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) FooListSym1KindInference) ())
+    type FooListSym2 (a0123456789876543210 :: a) (a0123456789876543210 :: [Bool]) =
+        FooList a0123456789876543210 a0123456789876543210 :: [Bool]
+    type FooList_0123456789876543210 :: a -> [Bool] -> [Bool]
+    type family FooList_0123456789876543210 a a where
+      FooList_0123456789876543210 a_0123456789876543210 a_0123456789876543210 = Apply (Apply UndefinedSym0 a_0123456789876543210) a_0123456789876543210
+    type FooList_0123456789876543210Sym0 :: (~>) a ((~>) [Bool] [Bool])
+    data FooList_0123456789876543210Sym0 a0123456789876543210
+      where
+        FooList_0123456789876543210Sym0KindInference :: SameKind (Apply FooList_0123456789876543210Sym0 arg) (FooList_0123456789876543210Sym1 arg) =>
+                                                        FooList_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply FooList_0123456789876543210Sym0 a0123456789876543210 = FooList_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings FooList_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) FooList_0123456789876543210Sym0KindInference) ())
+    type FooList_0123456789876543210Sym1 :: a -> (~>) [Bool] [Bool]
+    data FooList_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        FooList_0123456789876543210Sym1KindInference :: SameKind (Apply (FooList_0123456789876543210Sym1 a0123456789876543210) arg) (FooList_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                        FooList_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (FooList_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = FooList_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (FooList_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) FooList_0123456789876543210Sym1KindInference) ())
+    type FooList_0123456789876543210Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: [Bool]) =
+        FooList_0123456789876543210 a0123456789876543210 a0123456789876543210 :: [Bool]
+    class PFoo a where
+      type FoosPrec (arg :: Nat) (arg :: a) (arg :: [Bool]) :: [Bool]
+      type FooList (arg :: a) (arg :: [Bool]) :: [Bool]
+      type FooList a a = Apply (Apply FooList_0123456789876543210Sym0 a) a
+    type FoosPrec_0123456789876543210 :: Nat -> [a] -> [Bool] -> [Bool]
+    type family FoosPrec_0123456789876543210 a a a where
+      FoosPrec_0123456789876543210 _ a_0123456789876543210 a_0123456789876543210 = Apply (Apply FooListSym0 a_0123456789876543210) a_0123456789876543210
+    type FoosPrec_0123456789876543210Sym0 :: (~>) Nat ((~>) [a] ((~>) [Bool] [Bool]))
+    data FoosPrec_0123456789876543210Sym0 a0123456789876543210
+      where
+        FoosPrec_0123456789876543210Sym0KindInference :: SameKind (Apply FoosPrec_0123456789876543210Sym0 arg) (FoosPrec_0123456789876543210Sym1 arg) =>
+                                                         FoosPrec_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply FoosPrec_0123456789876543210Sym0 a0123456789876543210 = FoosPrec_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings FoosPrec_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) FoosPrec_0123456789876543210Sym0KindInference) ())
+    type FoosPrec_0123456789876543210Sym1 :: Nat
+                                             -> (~>) [a] ((~>) [Bool] [Bool])
+    data FoosPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        FoosPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (FoosPrec_0123456789876543210Sym1 a0123456789876543210) arg) (FoosPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                         FoosPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (FoosPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = FoosPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (FoosPrec_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) FoosPrec_0123456789876543210Sym1KindInference) ())
+    type FoosPrec_0123456789876543210Sym2 :: Nat
+                                             -> [a] -> (~>) [Bool] [Bool]
+    data FoosPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        FoosPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (FoosPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (FoosPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                                         FoosPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (FoosPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = FoosPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (FoosPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) FoosPrec_0123456789876543210Sym2KindInference) ())
+    type FoosPrec_0123456789876543210Sym3 (a0123456789876543210 :: Nat) (a0123456789876543210 :: [a]) (a0123456789876543210 :: [Bool]) =
+        FoosPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: [Bool]
+    instance PFoo [a] where
+      type FoosPrec a a a = Apply (Apply (Apply FoosPrec_0123456789876543210Sym0 a) a) a
+    class SFoo a where
+      sFoosPrec ::
+        forall (t :: Nat) (t :: a) (t :: [Bool]).
+        Sing t
+        -> Sing t
+           -> Sing t
+              -> Sing (Apply (Apply (Apply FoosPrecSym0 t) t) t :: [Bool])
+      sFooList ::
+        forall (t :: a) (t :: [Bool]).
+        Sing t -> Sing t -> Sing (Apply (Apply FooListSym0 t) t :: [Bool])
+      default sFooList ::
+                forall (t :: a) (t :: [Bool]).
+                ((Apply (Apply FooListSym0 t) t :: [Bool])
+                 ~ Apply (Apply FooList_0123456789876543210Sym0 t) t) =>
+                Sing t -> Sing t -> Sing (Apply (Apply FooListSym0 t) t :: [Bool])
+      sFooList
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (sUndefined sA_0123456789876543210) sA_0123456789876543210
+    instance SFoo a => SFoo [a] where
+      sFoosPrec ::
+        forall (t :: Nat) (t :: [a]) (t :: [Bool]).
+        Sing t
+        -> Sing t
+           -> Sing t
+              -> Sing (Apply (Apply (Apply FoosPrecSym0 t) t) t :: [Bool])
+      sFoosPrec
+        _
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @FooListSym0) sFooList))
+                sA_0123456789876543210))
+            sA_0123456789876543210
+    instance SFoo a =>
+             SingI (FoosPrecSym0 :: (~>) Nat ((~>) a ((~>) [Bool] [Bool]))) where
+      sing = (singFun3 @FoosPrecSym0) sFoosPrec
+    instance (SFoo a, SingI d) =>
+             SingI (FoosPrecSym1 (d :: Nat) :: (~>) a ((~>) [Bool] [Bool])) where
+      sing = (singFun2 @(FoosPrecSym1 (d :: Nat))) (sFoosPrec (sing @d))
+    instance (SFoo a, SingI d, SingI d) =>
+             SingI (FoosPrecSym2 (d :: Nat) (d :: a) :: (~>) [Bool] [Bool]) where
+      sing
+        = (singFun1 @(FoosPrecSym2 (d :: Nat) (d :: a)))
+            ((sFoosPrec (sing @d)) (sing @d))
+    instance SFoo a =>
+             SingI (FooListSym0 :: (~>) a ((~>) [Bool] [Bool])) where
+      sing = (singFun2 @FooListSym0) sFooList
+    instance (SFoo a, SingI d) =>
+             SingI (FooListSym1 (d :: a) :: (~>) [Bool] [Bool]) where
+      sing = (singFun1 @(FooListSym1 (d :: a))) (sFooList (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T172.ghc88.template b/tests/compile-and-dump/Singletons/T172.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T172.ghc88.template
+++ /dev/null
@@ -1,40 +0,0 @@
-Singletons/T172.hs:(0,0)-(0,0): Splicing declarations
-    singletonsOnly
-      [d| ($>) :: Nat -> Nat -> Nat
-          ($>) = (+) |]
-  ======>
-    type ($>@#@$$$) (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
-        ($>) a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (($>@#@$$) a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (:$>@#@$$###)) ())
-    data ($>@#@$$) (a0123456789876543210 :: Nat) :: (~>) Nat Nat
-      where
-        (:$>@#@$$###) :: forall a0123456789876543210
-                                a0123456789876543210
-                                arg. SameKind (Apply (($>@#@$$) a0123456789876543210) arg) (($>@#@$$$) a0123456789876543210 arg) =>
-                         ($>@#@$$) a0123456789876543210 a0123456789876543210
-    type instance Apply (($>@#@$$) a0123456789876543210) a0123456789876543210 = ($>) a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ($>@#@$) where
-      suppressUnusedWarnings = snd (((,) (:$>@#@$###)) ())
-    data ($>@#@$) :: (~>) Nat ((~>) Nat Nat)
-      where
-        (:$>@#@$###) :: forall a0123456789876543210
-                               arg. SameKind (Apply ($>@#@$) arg) (($>@#@$$) arg) =>
-                        ($>@#@$) a0123456789876543210
-    type instance Apply ($>@#@$) a0123456789876543210 = ($>@#@$$) a0123456789876543210
-    type family ($>) (a :: Nat) (a :: Nat) :: Nat where
-      ($>) a_0123456789876543210 a_0123456789876543210 = Apply (Apply (+@#@$) a_0123456789876543210) a_0123456789876543210
-    (%$>) ::
-      forall (t :: Nat) (t :: Nat).
-      Sing t -> Sing t -> Sing (Apply (Apply ($>@#@$) t) t :: Nat)
-    (%$>)
-      (sA_0123456789876543210 :: Sing a_0123456789876543210)
-      (sA_0123456789876543210 :: Sing a_0123456789876543210)
-      = (applySing
-           ((applySing ((singFun2 @(+@#@$)) (%+))) sA_0123456789876543210))
-          sA_0123456789876543210
-    instance SingI (($>@#@$) :: (~>) Nat ((~>) Nat Nat)) where
-      sing = (singFun2 @($>@#@$)) (%$>)
-    instance SingI d =>
-             SingI (($>@#@$$) (d :: Nat) :: (~>) Nat Nat) where
-      sing = (singFun1 @(($>@#@$$) (d :: Nat))) ((%$>) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T172.golden b/tests/compile-and-dump/Singletons/T172.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T172.golden
@@ -0,0 +1,40 @@
+Singletons/T172.hs:(0,0)-(0,0): Splicing declarations
+    singletonsOnly
+      [d| ($>) :: Nat -> Nat -> Nat
+          ($>) = (+) |]
+  ======>
+    type ($>@#@$) :: (~>) Nat ((~>) Nat Nat)
+    data ($>@#@$) a0123456789876543210
+      where
+        (:$>@#@$###) :: SameKind (Apply ($>@#@$) arg) (($>@#@$$) arg) =>
+                        ($>@#@$) a0123456789876543210
+    type instance Apply ($>@#@$) a0123456789876543210 = ($>@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings ($>@#@$) where
+      suppressUnusedWarnings = snd (((,) (:$>@#@$###)) ())
+    type ($>@#@$$) :: Nat -> (~>) Nat Nat
+    data ($>@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (:$>@#@$$###) :: SameKind (Apply (($>@#@$$) a0123456789876543210) arg) (($>@#@$$$) a0123456789876543210 arg) =>
+                         ($>@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply (($>@#@$$) a0123456789876543210) a0123456789876543210 = ($>@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (($>@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (:$>@#@$$###)) ())
+    type ($>@#@$$$) (a0123456789876543210 :: Nat) (a0123456789876543210 :: Nat) =
+        ($>) a0123456789876543210 a0123456789876543210 :: Nat
+    type ($>) :: Nat -> Nat -> Nat
+    type family ($>) a a where
+      ($>) a_0123456789876543210 a_0123456789876543210 = Apply (Apply (+@#@$) a_0123456789876543210) a_0123456789876543210
+    (%$>) ::
+      forall (t :: Nat) (t :: Nat).
+      Sing t -> Sing t -> Sing (Apply (Apply ($>@#@$) t) t :: Nat)
+    (%$>)
+      (sA_0123456789876543210 :: Sing a_0123456789876543210)
+      (sA_0123456789876543210 :: Sing a_0123456789876543210)
+      = (applySing
+           ((applySing ((singFun2 @(+@#@$)) (%+))) sA_0123456789876543210))
+          sA_0123456789876543210
+    instance SingI (($>@#@$) :: (~>) Nat ((~>) Nat Nat)) where
+      sing = (singFun2 @($>@#@$)) (%$>)
+    instance SingI d =>
+             SingI (($>@#@$$) (d :: Nat) :: (~>) Nat Nat) where
+      sing = (singFun1 @(($>@#@$$) (d :: Nat))) ((%$>) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T175.ghc88.template b/tests/compile-and-dump/Singletons/T175.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T175.ghc88.template
+++ /dev/null
@@ -1,45 +0,0 @@
-Singletons/T175.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| quux2 :: Bar2 a => a
-          quux2 = baz
-          
-          class Foo a where
-            baz :: a
-          class Foo a => Bar1 a where
-            quux1 :: a
-            quux1 = baz
-          class Foo a => Bar2 a |]
-  ======>
-    class Foo a where
-      baz :: a
-    class Foo a => Bar1 a where
-      quux1 :: a
-      quux1 = baz
-    class Foo a => Bar2 a
-    quux2 :: Bar2 a => a
-    quux2 = baz
-    type Quux2Sym0 = Quux2
-    type family Quux2 :: a where
-      Quux2 = BazSym0
-    type BazSym0 = Baz
-    class PFoo (a :: GHC.Types.Type) where
-      type Baz :: a
-    type Quux1Sym0 = Quux1
-    type family Quux1_0123456789876543210 :: a where
-      Quux1_0123456789876543210 = BazSym0
-    type Quux1_0123456789876543210Sym0 = Quux1_0123456789876543210
-    class PBar1 (a :: GHC.Types.Type) where
-      type Quux1 :: a
-      type Quux1 = Quux1_0123456789876543210Sym0
-    class PBar2 (a :: GHC.Types.Type)
-    sQuux2 :: forall a. SBar2 a => Sing (Quux2Sym0 :: a)
-    sQuux2 = sBaz
-    class SFoo a where
-      sBaz :: Sing (BazSym0 :: a)
-    class SFoo a => SBar1 a where
-      sQuux1 :: Sing (Quux1Sym0 :: a)
-      default sQuux1 ::
-                ((Quux1Sym0 :: a) ~ Quux1_0123456789876543210Sym0) =>
-                Sing (Quux1Sym0 :: a)
-      sQuux1 = sBaz
-    class SFoo a => SBar2 a
diff --git a/tests/compile-and-dump/Singletons/T175.golden b/tests/compile-and-dump/Singletons/T175.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T175.golden
@@ -0,0 +1,47 @@
+Singletons/T175.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| quux2 :: Bar2 a => a
+          quux2 = baz
+          
+          class Foo a where
+            baz :: a
+          class Foo a => Bar1 a where
+            quux1 :: a
+            quux1 = baz
+          class Foo a => Bar2 a |]
+  ======>
+    class Foo a where
+      baz :: a
+    class Foo a => Bar1 a where
+      quux1 :: a
+      quux1 = baz
+    class Foo a => Bar2 a
+    quux2 :: Bar2 a => a
+    quux2 = baz
+    type Quux2Sym0 = Quux2 :: a
+    type Quux2 :: a
+    type family Quux2 where
+      Quux2 = BazSym0
+    type BazSym0 = Baz :: a
+    class PFoo a where
+      type Baz :: a
+    type Quux1Sym0 = Quux1 :: a
+    type Quux1_0123456789876543210 :: a
+    type family Quux1_0123456789876543210 where
+      Quux1_0123456789876543210 = BazSym0
+    type Quux1_0123456789876543210Sym0 = Quux1_0123456789876543210 :: a
+    class PBar1 a where
+      type Quux1 :: a
+      type Quux1 = Quux1_0123456789876543210Sym0
+    class PBar2 a
+    sQuux2 :: forall a. SBar2 a => Sing (Quux2Sym0 :: a)
+    sQuux2 = sBaz
+    class SFoo a where
+      sBaz :: Sing (BazSym0 :: a)
+    class SFoo a => SBar1 a where
+      sQuux1 :: Sing (Quux1Sym0 :: a)
+      default sQuux1 ::
+                ((Quux1Sym0 :: a) ~ Quux1_0123456789876543210Sym0) =>
+                Sing (Quux1Sym0 :: a)
+      sQuux1 = sBaz
+    class SFoo a => SBar2 a
diff --git a/tests/compile-and-dump/Singletons/T176.ghc88.template b/tests/compile-and-dump/Singletons/T176.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T176.ghc88.template
+++ /dev/null
@@ -1,167 +0,0 @@
-Singletons/T176.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| quux1 :: Foo1 a => a -> a
-          quux1 x = x `bar1` \ _ -> baz1
-          quux2 :: Foo2 a => a -> a
-          quux2 x = x `bar2` baz2
-          
-          class Foo1 a where
-            bar1 :: a -> (a -> b) -> b
-            baz1 :: a
-          class Foo2 a where
-            bar2 :: a -> b -> b
-            baz2 :: a |]
-  ======>
-    class Foo1 a where
-      bar1 :: a -> (a -> b) -> b
-      baz1 :: a
-    quux1 :: Foo1 a => a -> a
-    quux1 x = (x `bar1` (\ _ -> baz1))
-    class Foo2 a where
-      bar2 :: a -> b -> b
-      baz2 :: a
-    quux2 :: Foo2 a => a -> a
-    quux2 x = (x `bar2` baz2)
-    type family Case_0123456789876543210 arg_0123456789876543210 x t where
-      Case_0123456789876543210 arg_0123456789876543210 x _ = Baz1Sym0
-    type family Lambda_0123456789876543210 x t where
-      Lambda_0123456789876543210 x arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 x arg_0123456789876543210
-    type Lambda_0123456789876543210Sym2 x0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 x0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall x0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 x0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall x0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
-    type Quux2Sym1 (a0123456789876543210 :: a0123456789876543210) =
-        Quux2 a0123456789876543210
-    instance SuppressUnusedWarnings Quux2Sym0 where
-      suppressUnusedWarnings = snd (((,) Quux2Sym0KindInference) ())
-    data Quux2Sym0 :: forall a0123456789876543210.
-                      (~>) a0123456789876543210 a0123456789876543210
-      where
-        Quux2Sym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply Quux2Sym0 arg) (Quux2Sym1 arg) =>
-                                  Quux2Sym0 a0123456789876543210
-    type instance Apply Quux2Sym0 a0123456789876543210 = Quux2 a0123456789876543210
-    type Quux1Sym1 (a0123456789876543210 :: a0123456789876543210) =
-        Quux1 a0123456789876543210
-    instance SuppressUnusedWarnings Quux1Sym0 where
-      suppressUnusedWarnings = snd (((,) Quux1Sym0KindInference) ())
-    data Quux1Sym0 :: forall a0123456789876543210.
-                      (~>) a0123456789876543210 a0123456789876543210
-      where
-        Quux1Sym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply Quux1Sym0 arg) (Quux1Sym1 arg) =>
-                                  Quux1Sym0 a0123456789876543210
-    type instance Apply Quux1Sym0 a0123456789876543210 = Quux1 a0123456789876543210
-    type family Quux2 (a :: a) :: a where
-      Quux2 x = Apply (Apply Bar2Sym0 x) Baz2Sym0
-    type family Quux1 (a :: a) :: a where
-      Quux1 x = Apply (Apply Bar1Sym0 x) (Apply Lambda_0123456789876543210Sym0 x)
-    type Bar1Sym2 (arg0123456789876543210 :: a0123456789876543210) (arg0123456789876543210 :: (~>) a0123456789876543210 b0123456789876543210) =
-        Bar1 arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings (Bar1Sym1 arg0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) Bar1Sym1KindInference) ())
-    data Bar1Sym1 (arg0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                      (~>) ((~>) a0123456789876543210 b0123456789876543210) b0123456789876543210
-      where
-        Bar1Sym1KindInference :: forall arg0123456789876543210
-                                        arg0123456789876543210
-                                        arg. SameKind (Apply (Bar1Sym1 arg0123456789876543210) arg) (Bar1Sym2 arg0123456789876543210 arg) =>
-                                 Bar1Sym1 arg0123456789876543210 arg0123456789876543210
-    type instance Apply (Bar1Sym1 arg0123456789876543210) arg0123456789876543210 = Bar1 arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings Bar1Sym0 where
-      suppressUnusedWarnings = snd (((,) Bar1Sym0KindInference) ())
-    data Bar1Sym0 :: forall a0123456789876543210 b0123456789876543210.
-                     (~>) a0123456789876543210 ((~>) ((~>) a0123456789876543210 b0123456789876543210) b0123456789876543210)
-      where
-        Bar1Sym0KindInference :: forall arg0123456789876543210
-                                        arg. SameKind (Apply Bar1Sym0 arg) (Bar1Sym1 arg) =>
-                                 Bar1Sym0 arg0123456789876543210
-    type instance Apply Bar1Sym0 arg0123456789876543210 = Bar1Sym1 arg0123456789876543210
-    type Baz1Sym0 = Baz1
-    class PFoo1 (a :: Type) where
-      type Bar1 (arg :: a) (arg :: (~>) a b) :: b
-      type Baz1 :: a
-    type Bar2Sym2 (arg0123456789876543210 :: a0123456789876543210) (arg0123456789876543210 :: b0123456789876543210) =
-        Bar2 arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings (Bar2Sym1 arg0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) Bar2Sym1KindInference) ())
-    data Bar2Sym1 (arg0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                      (~>) b0123456789876543210 b0123456789876543210
-      where
-        Bar2Sym1KindInference :: forall arg0123456789876543210
-                                        arg0123456789876543210
-                                        arg. SameKind (Apply (Bar2Sym1 arg0123456789876543210) arg) (Bar2Sym2 arg0123456789876543210 arg) =>
-                                 Bar2Sym1 arg0123456789876543210 arg0123456789876543210
-    type instance Apply (Bar2Sym1 arg0123456789876543210) arg0123456789876543210 = Bar2 arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings Bar2Sym0 where
-      suppressUnusedWarnings = snd (((,) Bar2Sym0KindInference) ())
-    data Bar2Sym0 :: forall a0123456789876543210 b0123456789876543210.
-                     (~>) a0123456789876543210 ((~>) b0123456789876543210 b0123456789876543210)
-      where
-        Bar2Sym0KindInference :: forall arg0123456789876543210
-                                        arg. SameKind (Apply Bar2Sym0 arg) (Bar2Sym1 arg) =>
-                                 Bar2Sym0 arg0123456789876543210
-    type instance Apply Bar2Sym0 arg0123456789876543210 = Bar2Sym1 arg0123456789876543210
-    type Baz2Sym0 = Baz2
-    class PFoo2 (a :: Type) where
-      type Bar2 (arg :: a) (arg :: b) :: b
-      type Baz2 :: a
-    sQuux2 ::
-      forall a (t :: a).
-      SFoo2 a => Sing t -> Sing (Apply Quux2Sym0 t :: a)
-    sQuux1 ::
-      forall a (t :: a).
-      SFoo1 a => Sing t -> Sing (Apply Quux1Sym0 t :: a)
-    sQuux2 (sX :: Sing x)
-      = (applySing ((applySing ((singFun2 @Bar2Sym0) sBar2)) sX)) sBaz2
-    sQuux1 (sX :: Sing x)
-      = (applySing ((applySing ((singFun2 @Bar1Sym0) sBar1)) sX))
-          ((singFun1 @(Apply Lambda_0123456789876543210Sym0 x))
-             (\ sArg_0123456789876543210
-                -> case sArg_0123456789876543210 of {
-                     (_ :: Sing arg_0123456789876543210)
-                       -> (id
-                             @(Sing (Case_0123456789876543210 arg_0123456789876543210 x arg_0123456789876543210)))
-                            (case sArg_0123456789876543210 of { _ -> sBaz1 }) }))
-    instance SFoo2 a => SingI (Quux2Sym0 :: (~>) a a) where
-      sing = (singFun1 @Quux2Sym0) sQuux2
-    instance SFoo1 a => SingI (Quux1Sym0 :: (~>) a a) where
-      sing = (singFun1 @Quux1Sym0) sQuux1
-    class SFoo1 a where
-      sBar1 ::
-        forall b (t :: a) (t :: (~>) a b).
-        Sing t -> Sing t -> Sing (Apply (Apply Bar1Sym0 t) t :: b)
-      sBaz1 :: Sing (Baz1Sym0 :: a)
-    class SFoo2 a where
-      sBar2 ::
-        forall b (t :: a) (t :: b).
-        Sing t -> Sing t -> Sing (Apply (Apply Bar2Sym0 t) t :: b)
-      sBaz2 :: Sing (Baz2Sym0 :: a)
-    instance SFoo1 a =>
-             SingI (Bar1Sym0 :: (~>) a ((~>) ((~>) a b) b)) where
-      sing = (singFun2 @Bar1Sym0) sBar1
-    instance (SFoo1 a, SingI d) =>
-             SingI (Bar1Sym1 (d :: a) :: (~>) ((~>) a b) b) where
-      sing = (singFun1 @(Bar1Sym1 (d :: a))) (sBar1 (sing @d))
-    instance SFoo2 a => SingI (Bar2Sym0 :: (~>) a ((~>) b b)) where
-      sing = (singFun2 @Bar2Sym0) sBar2
-    instance (SFoo2 a, SingI d) =>
-             SingI (Bar2Sym1 (d :: a) :: (~>) b b) where
-      sing = (singFun1 @(Bar2Sym1 (d :: a))) (sBar2 (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T176.golden b/tests/compile-and-dump/Singletons/T176.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T176.golden
@@ -0,0 +1,158 @@
+Singletons/T176.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| quux1 :: Foo1 a => a -> a
+          quux1 x = x `bar1` \ _ -> baz1
+          quux2 :: Foo2 a => a -> a
+          quux2 x = x `bar2` baz2
+          
+          class Foo1 a where
+            bar1 :: a -> (a -> b) -> b
+            baz1 :: a
+          class Foo2 a where
+            bar2 :: a -> b -> b
+            baz2 :: a |]
+  ======>
+    class Foo1 a where
+      bar1 :: a -> (a -> b) -> b
+      baz1 :: a
+    quux1 :: Foo1 a => a -> a
+    quux1 x = (x `bar1` (\ _ -> baz1))
+    class Foo2 a where
+      bar2 :: a -> b -> b
+      baz2 :: a
+    quux2 :: Foo2 a => a -> a
+    quux2 x = (x `bar2` baz2)
+    type family Case_0123456789876543210 arg_0123456789876543210 x t where
+      Case_0123456789876543210 arg_0123456789876543210 x _ = Baz1Sym0
+    type family Lambda_0123456789876543210 x arg_0123456789876543210 where
+      Lambda_0123456789876543210 x arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 x arg_0123456789876543210
+    data Lambda_0123456789876543210Sym0 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 x0123456789876543210 arg_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 arg_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 arg_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    type Lambda_0123456789876543210Sym2 x0123456789876543210 arg_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 x0123456789876543210 arg_01234567898765432100123456789876543210
+    type Quux2Sym0 :: (~>) a a
+    data Quux2Sym0 a0123456789876543210
+      where
+        Quux2Sym0KindInference :: SameKind (Apply Quux2Sym0 arg) (Quux2Sym1 arg) =>
+                                  Quux2Sym0 a0123456789876543210
+    type instance Apply Quux2Sym0 a0123456789876543210 = Quux2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Quux2Sym0 where
+      suppressUnusedWarnings = snd (((,) Quux2Sym0KindInference) ())
+    type Quux2Sym1 (a0123456789876543210 :: a) =
+        Quux2 a0123456789876543210 :: a
+    type Quux1Sym0 :: (~>) a a
+    data Quux1Sym0 a0123456789876543210
+      where
+        Quux1Sym0KindInference :: SameKind (Apply Quux1Sym0 arg) (Quux1Sym1 arg) =>
+                                  Quux1Sym0 a0123456789876543210
+    type instance Apply Quux1Sym0 a0123456789876543210 = Quux1Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Quux1Sym0 where
+      suppressUnusedWarnings = snd (((,) Quux1Sym0KindInference) ())
+    type Quux1Sym1 (a0123456789876543210 :: a) =
+        Quux1 a0123456789876543210 :: a
+    type Quux2 :: a -> a
+    type family Quux2 a where
+      Quux2 x = Apply (Apply Bar2Sym0 x) Baz2Sym0
+    type Quux1 :: a -> a
+    type family Quux1 a where
+      Quux1 x = Apply (Apply Bar1Sym0 x) (Apply Lambda_0123456789876543210Sym0 x)
+    type Bar1Sym0 :: forall a b. (~>) a ((~>) ((~>) a b) b)
+    data Bar1Sym0 a0123456789876543210
+      where
+        Bar1Sym0KindInference :: SameKind (Apply Bar1Sym0 arg) (Bar1Sym1 arg) =>
+                                 Bar1Sym0 a0123456789876543210
+    type instance Apply Bar1Sym0 a0123456789876543210 = Bar1Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Bar1Sym0 where
+      suppressUnusedWarnings = snd (((,) Bar1Sym0KindInference) ())
+    type Bar1Sym1 :: forall a b. a -> (~>) ((~>) a b) b
+    data Bar1Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Bar1Sym1KindInference :: SameKind (Apply (Bar1Sym1 a0123456789876543210) arg) (Bar1Sym2 a0123456789876543210 arg) =>
+                                 Bar1Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Bar1Sym1 a0123456789876543210) a0123456789876543210 = Bar1Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Bar1Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) Bar1Sym1KindInference) ())
+    type Bar1Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: (~>) a b) =
+        Bar1 a0123456789876543210 a0123456789876543210 :: b
+    type Baz1Sym0 = Baz1 :: a
+    class PFoo1 a where
+      type Bar1 (arg :: a) (arg :: (~>) a b) :: b
+      type Baz1 :: a
+    type Bar2Sym0 :: forall a b. (~>) a ((~>) b b)
+    data Bar2Sym0 a0123456789876543210
+      where
+        Bar2Sym0KindInference :: SameKind (Apply Bar2Sym0 arg) (Bar2Sym1 arg) =>
+                                 Bar2Sym0 a0123456789876543210
+    type instance Apply Bar2Sym0 a0123456789876543210 = Bar2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Bar2Sym0 where
+      suppressUnusedWarnings = snd (((,) Bar2Sym0KindInference) ())
+    type Bar2Sym1 :: forall a b. a -> (~>) b b
+    data Bar2Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Bar2Sym1KindInference :: SameKind (Apply (Bar2Sym1 a0123456789876543210) arg) (Bar2Sym2 a0123456789876543210 arg) =>
+                                 Bar2Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Bar2Sym1 a0123456789876543210) a0123456789876543210 = Bar2Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Bar2Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) Bar2Sym1KindInference) ())
+    type Bar2Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        Bar2 a0123456789876543210 a0123456789876543210 :: b
+    type Baz2Sym0 = Baz2 :: a
+    class PFoo2 a where
+      type Bar2 (arg :: a) (arg :: b) :: b
+      type Baz2 :: a
+    sQuux2 ::
+      forall a (t :: a).
+      SFoo2 a => Sing t -> Sing (Apply Quux2Sym0 t :: a)
+    sQuux1 ::
+      forall a (t :: a).
+      SFoo1 a => Sing t -> Sing (Apply Quux1Sym0 t :: a)
+    sQuux2 (sX :: Sing x)
+      = (applySing ((applySing ((singFun2 @Bar2Sym0) sBar2)) sX)) sBaz2
+    sQuux1 (sX :: Sing x)
+      = (applySing ((applySing ((singFun2 @Bar1Sym0) sBar1)) sX))
+          ((singFun1 @(Apply Lambda_0123456789876543210Sym0 x))
+             (\ sArg_0123456789876543210
+                -> case sArg_0123456789876543210 of {
+                     (_ :: Sing arg_0123456789876543210)
+                       -> (id
+                             @(Sing (Case_0123456789876543210 arg_0123456789876543210 x arg_0123456789876543210)))
+                            (case sArg_0123456789876543210 of { _ -> sBaz1 }) }))
+    instance SFoo2 a => SingI (Quux2Sym0 :: (~>) a a) where
+      sing = (singFun1 @Quux2Sym0) sQuux2
+    instance SFoo1 a => SingI (Quux1Sym0 :: (~>) a a) where
+      sing = (singFun1 @Quux1Sym0) sQuux1
+    class SFoo1 a where
+      sBar1 ::
+        forall b (t :: a) (t :: (~>) a b).
+        Sing t -> Sing t -> Sing (Apply (Apply Bar1Sym0 t) t :: b)
+      sBaz1 :: Sing (Baz1Sym0 :: a)
+    class SFoo2 a where
+      sBar2 ::
+        forall b (t :: a) (t :: b).
+        Sing t -> Sing t -> Sing (Apply (Apply Bar2Sym0 t) t :: b)
+      sBaz2 :: Sing (Baz2Sym0 :: a)
+    instance SFoo1 a =>
+             SingI (Bar1Sym0 :: (~>) a ((~>) ((~>) a b) b)) where
+      sing = (singFun2 @Bar1Sym0) sBar1
+    instance (SFoo1 a, SingI d) =>
+             SingI (Bar1Sym1 (d :: a) :: (~>) ((~>) a b) b) where
+      sing = (singFun1 @(Bar1Sym1 (d :: a))) (sBar1 (sing @d))
+    instance SFoo2 a => SingI (Bar2Sym0 :: (~>) a ((~>) b b)) where
+      sing = (singFun2 @Bar2Sym0) sBar2
+    instance (SFoo2 a, SingI d) =>
+             SingI (Bar2Sym1 (d :: a) :: (~>) b b) where
+      sing = (singFun1 @(Bar2Sym1 (d :: a))) (sBar2 (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T178.ghc88.template b/tests/compile-and-dump/Singletons/T178.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T178.ghc88.template
+++ /dev/null
@@ -1,221 +0,0 @@
-Singletons/T178.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| empty :: U
-          empty = []
-          
-          data Occ
-            = Str | Opt | Many
-            deriving (Eq, Ord, Show)
-          type U = [(Symbol, Occ)] |]
-  ======>
-    data Occ
-      = Str | Opt | Many
-      deriving (Eq, Ord, Show)
-    type U = [(Symbol, Occ)]
-    empty :: U
-    empty = []
-    type USym0 = U
-    type StrSym0 = Str
-    type OptSym0 = Opt
-    type ManySym0 = Many
-    type EmptySym0 = Empty
-    type family Empty :: [(Symbol, Occ)] where
-      Empty = '[]
-    type family Compare_0123456789876543210 (a :: Occ) (a :: Occ) :: Ordering where
-      Compare_0123456789876543210 Str Str = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) '[]
-      Compare_0123456789876543210 Opt Opt = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) '[]
-      Compare_0123456789876543210 Many Many = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) '[]
-      Compare_0123456789876543210 Str Opt = LTSym0
-      Compare_0123456789876543210 Str Many = LTSym0
-      Compare_0123456789876543210 Opt Str = GTSym0
-      Compare_0123456789876543210 Opt Many = LTSym0
-      Compare_0123456789876543210 Many Str = GTSym0
-      Compare_0123456789876543210 Many Opt = GTSym0
-    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Occ) (a0123456789876543210 :: Occ) =
-        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
-    data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Occ) :: (~>) Occ Ordering
-      where
-        Compare_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                               a0123456789876543210
-                                                               arg. SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
-    data Compare_0123456789876543210Sym0 :: (~>) Occ ((~>) Occ Ordering)
-      where
-        Compare_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                               arg. SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
-                                                        Compare_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
-    instance POrd Occ where
-      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
-    type family ShowsPrec_0123456789876543210 (a :: Nat) (a :: Occ) (a :: Symbol) :: Symbol where
-      ShowsPrec_0123456789876543210 _ Str a_0123456789876543210 = Apply (Apply ShowStringSym0 "Str") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ Opt a_0123456789876543210 = Apply (Apply ShowStringSym0 "Opt") a_0123456789876543210
-      ShowsPrec_0123456789876543210 _ Many a_0123456789876543210 = Apply (Apply ShowStringSym0 "Many") a_0123456789876543210
-    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Occ) (a0123456789876543210 :: Symbol) =
-        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
-    data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Occ) :: (~>) Symbol Symbol
-      where
-        ShowsPrec_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
-    data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: Nat) :: (~>) Occ ((~>) Symbol Symbol)
-      where
-        ShowsPrec_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
-    data ShowsPrec_0123456789876543210Sym0 :: (~>) Nat ((~>) Occ ((~>) Symbol Symbol))
-      where
-        ShowsPrec_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
-    instance PShow Occ where
-      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
-    type family Equals_0123456789876543210 (a :: Occ) (b :: Occ) :: Bool where
-      Equals_0123456789876543210 Str Str = TrueSym0
-      Equals_0123456789876543210 Opt Opt = TrueSym0
-      Equals_0123456789876543210 Many Many = TrueSym0
-      Equals_0123456789876543210 (_ :: Occ) (_ :: Occ) = FalseSym0
-    instance PEq Occ where
-      type (==) a b = Equals_0123456789876543210 a b
-    sEmpty :: Sing (EmptySym0 :: [(Symbol, Occ)])
-    sEmpty = Data.Singletons.Prelude.Instances.SNil
-    data SOcc :: Occ -> GHC.Types.Type
-      where
-        SStr :: SOcc Str
-        SOpt :: SOcc Opt
-        SMany :: SOcc Many
-    type instance Sing @Occ = SOcc
-    instance SingKind Occ where
-      type Demote Occ = Occ
-      fromSing SStr = Str
-      fromSing SOpt = Opt
-      fromSing SMany = Many
-      toSing Str = SomeSing SStr
-      toSing Opt = SomeSing SOpt
-      toSing Many = SomeSing SMany
-    instance SOrd Occ where
-      sCompare ::
-        forall (t1 :: Occ) (t2 :: Occ).
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply (CompareSym0 :: TyFun Occ ((~>) Occ Ordering)
-                                                 -> GHC.Types.Type) t1) t2)
-      sCompare SStr SStr
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            Data.Singletons.Prelude.Instances.SNil
-      sCompare SOpt SOpt
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            Data.Singletons.Prelude.Instances.SNil
-      sCompare SMany SMany
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            Data.Singletons.Prelude.Instances.SNil
-      sCompare SStr SOpt = SLT
-      sCompare SStr SMany = SLT
-      sCompare SOpt SStr = SGT
-      sCompare SOpt SMany = SLT
-      sCompare SMany SStr = SGT
-      sCompare SMany SOpt = SGT
-    instance SShow Occ where
-      sShowsPrec ::
-        forall (t1 :: Nat) (t2 :: Occ) (t3 :: Symbol).
-        Sing t1
-        -> Sing t2
-           -> Sing t3
-              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun Nat ((~>) Occ ((~>) Symbol Symbol))
-                                                             -> GHC.Types.Type) t1) t2) t3)
-      sShowsPrec
-        _
-        SStr
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "Str")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SOpt
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "Opt")))
-            sA_0123456789876543210
-      sShowsPrec
-        _
-        SMany
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "Many")))
-            sA_0123456789876543210
-    instance SEq Occ where
-      (%==) SStr SStr = STrue
-      (%==) SStr SOpt = SFalse
-      (%==) SStr SMany = SFalse
-      (%==) SOpt SStr = SFalse
-      (%==) SOpt SOpt = STrue
-      (%==) SOpt SMany = SFalse
-      (%==) SMany SStr = SFalse
-      (%==) SMany SOpt = SFalse
-      (%==) SMany SMany = STrue
-    instance SDecide Occ where
-      (%~) SStr SStr = Proved Refl
-      (%~) SStr SOpt = Disproved (\ x -> case x of)
-      (%~) SStr SMany = Disproved (\ x -> case x of)
-      (%~) SOpt SStr = Disproved (\ x -> case x of)
-      (%~) SOpt SOpt = Proved Refl
-      (%~) SOpt SMany = Disproved (\ x -> case x of)
-      (%~) SMany SStr = Disproved (\ x -> case x of)
-      (%~) SMany SOpt = Disproved (\ x -> case x of)
-      (%~) SMany SMany = Proved Refl
-    instance Data.Type.Equality.TestEquality (SOcc :: Occ
-                                                      -> GHC.Types.Type) where
-      Data.Type.Equality.testEquality
-        = Data.Singletons.Decide.decideEquality
-    instance Data.Type.Coercion.TestCoercion (SOcc :: Occ
-                                                      -> GHC.Types.Type) where
-      Data.Type.Coercion.testCoercion
-        = Data.Singletons.Decide.decideCoercion
-    instance Show (SOcc (z :: Occ)) where
-      showsPrec _ SStr = showString "SStr"
-      showsPrec _ SOpt = showString "SOpt"
-      showsPrec _ SMany = showString "SMany"
-    instance SingI Str where
-      sing = SStr
-    instance SingI Opt where
-      sing = SOpt
-    instance SingI Many where
-      sing = SMany
diff --git a/tests/compile-and-dump/Singletons/T178.golden b/tests/compile-and-dump/Singletons/T178.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T178.golden
@@ -0,0 +1,224 @@
+Singletons/T178.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| empty :: U
+          empty = []
+          
+          data Occ
+            = Str | Opt | Many
+            deriving (Eq, Ord, Show)
+          type U = [(Symbol, Occ)] |]
+  ======>
+    data Occ
+      = Str | Opt | Many
+      deriving (Eq, Ord, Show)
+    type U = [(Symbol, Occ)]
+    empty :: U
+    empty = []
+    type USym0 = U
+    type StrSym0 = Str :: Occ
+    type OptSym0 = Opt :: Occ
+    type ManySym0 = Many :: Occ
+    type EmptySym0 = Empty :: [(Symbol, Occ)]
+    type Empty :: [(Symbol, Occ)]
+    type family Empty where
+      Empty = NilSym0
+    type Compare_0123456789876543210 :: Occ -> Occ -> Ordering
+    type family Compare_0123456789876543210 a a where
+      Compare_0123456789876543210 Str Str = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) NilSym0
+      Compare_0123456789876543210 Opt Opt = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) NilSym0
+      Compare_0123456789876543210 Many Many = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) NilSym0
+      Compare_0123456789876543210 Str Opt = LTSym0
+      Compare_0123456789876543210 Str Many = LTSym0
+      Compare_0123456789876543210 Opt Str = GTSym0
+      Compare_0123456789876543210 Opt Many = LTSym0
+      Compare_0123456789876543210 Many Str = GTSym0
+      Compare_0123456789876543210 Many Opt = GTSym0
+    type Compare_0123456789876543210Sym0 :: (~>) Occ ((~>) Occ Ordering)
+    data Compare_0123456789876543210Sym0 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
+                                                        Compare_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
+    type Compare_0123456789876543210Sym1 :: Occ -> (~>) Occ Ordering
+    data Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
+    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Occ) (a0123456789876543210 :: Occ) =
+        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    instance POrd Occ where
+      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
+    type ShowsPrec_0123456789876543210 :: Nat
+                                          -> Occ -> Symbol -> Symbol
+    type family ShowsPrec_0123456789876543210 a a a where
+      ShowsPrec_0123456789876543210 _ Str a_0123456789876543210 = Apply (Apply ShowStringSym0 "Str") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ Opt a_0123456789876543210 = Apply (Apply ShowStringSym0 "Opt") a_0123456789876543210
+      ShowsPrec_0123456789876543210 _ Many a_0123456789876543210 = Apply (Apply ShowStringSym0 "Many") a_0123456789876543210
+    type ShowsPrec_0123456789876543210Sym0 :: (~>) Nat ((~>) Occ ((~>) Symbol Symbol))
+    data ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
+    type ShowsPrec_0123456789876543210Sym1 :: Nat
+                                              -> (~>) Occ ((~>) Symbol Symbol)
+    data ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
+    type ShowsPrec_0123456789876543210Sym2 :: Nat
+                                              -> Occ -> (~>) Symbol Symbol
+    data ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
+    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: Nat) (a0123456789876543210 :: Occ) (a0123456789876543210 :: Symbol) =
+        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Symbol
+    instance PShow Occ where
+      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
+    type Equals_0123456789876543210 :: Occ -> Occ -> Bool
+    type family Equals_0123456789876543210 a b where
+      Equals_0123456789876543210 Str Str = TrueSym0
+      Equals_0123456789876543210 Opt Opt = TrueSym0
+      Equals_0123456789876543210 Many Many = TrueSym0
+      Equals_0123456789876543210 (_ :: Occ) (_ :: Occ) = FalseSym0
+    instance PEq Occ where
+      type (==) a b = Equals_0123456789876543210 a b
+    sEmpty :: Sing (EmptySym0 :: [(Symbol, Occ)])
+    sEmpty = Data.Singletons.Prelude.Instances.SNil
+    data SOcc :: Occ -> GHC.Types.Type
+      where
+        SStr :: SOcc (Str :: Occ)
+        SOpt :: SOcc (Opt :: Occ)
+        SMany :: SOcc (Many :: Occ)
+    type instance Sing @Occ = SOcc
+    instance SingKind Occ where
+      type Demote Occ = Occ
+      fromSing SStr = Str
+      fromSing SOpt = Opt
+      fromSing SMany = Many
+      toSing Str = SomeSing SStr
+      toSing Opt = SomeSing SOpt
+      toSing Many = SomeSing SMany
+    instance SOrd Occ where
+      sCompare ::
+        forall (t1 :: Occ) (t2 :: Occ).
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply (CompareSym0 :: TyFun Occ ((~>) Occ Ordering)
+                                                 -> GHC.Types.Type) t1) t2)
+      sCompare SStr SStr
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            Data.Singletons.Prelude.Instances.SNil
+      sCompare SOpt SOpt
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            Data.Singletons.Prelude.Instances.SNil
+      sCompare SMany SMany
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            Data.Singletons.Prelude.Instances.SNil
+      sCompare SStr SOpt = SLT
+      sCompare SStr SMany = SLT
+      sCompare SOpt SStr = SGT
+      sCompare SOpt SMany = SLT
+      sCompare SMany SStr = SGT
+      sCompare SMany SOpt = SGT
+    instance SShow Occ where
+      sShowsPrec ::
+        forall (t1 :: Nat) (t2 :: Occ) (t3 :: Symbol).
+        Sing t1
+        -> Sing t2
+           -> Sing t3
+              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun Nat ((~>) Occ ((~>) Symbol Symbol))
+                                                             -> GHC.Types.Type) t1) t2) t3)
+      sShowsPrec
+        _
+        SStr
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "Str")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SOpt
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "Opt")))
+            sA_0123456789876543210
+      sShowsPrec
+        _
+        SMany
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "Many")))
+            sA_0123456789876543210
+    instance SEq Occ where
+      (%==) SStr SStr = STrue
+      (%==) SStr SOpt = SFalse
+      (%==) SStr SMany = SFalse
+      (%==) SOpt SStr = SFalse
+      (%==) SOpt SOpt = STrue
+      (%==) SOpt SMany = SFalse
+      (%==) SMany SStr = SFalse
+      (%==) SMany SOpt = SFalse
+      (%==) SMany SMany = STrue
+    instance SDecide Occ where
+      (%~) SStr SStr = Proved Refl
+      (%~) SStr SOpt = Disproved (\ x -> case x of)
+      (%~) SStr SMany = Disproved (\ x -> case x of)
+      (%~) SOpt SStr = Disproved (\ x -> case x of)
+      (%~) SOpt SOpt = Proved Refl
+      (%~) SOpt SMany = Disproved (\ x -> case x of)
+      (%~) SMany SStr = Disproved (\ x -> case x of)
+      (%~) SMany SOpt = Disproved (\ x -> case x of)
+      (%~) SMany SMany = Proved Refl
+    instance Data.Type.Equality.TestEquality (SOcc :: Occ
+                                                      -> GHC.Types.Type) where
+      Data.Type.Equality.testEquality
+        = Data.Singletons.Decide.decideEquality
+    instance Data.Type.Coercion.TestCoercion (SOcc :: Occ
+                                                      -> GHC.Types.Type) where
+      Data.Type.Coercion.testCoercion
+        = Data.Singletons.Decide.decideCoercion
+    instance Show (SOcc (z :: Occ)) where
+      showsPrec _ SStr = showString "SStr"
+      showsPrec _ SOpt = showString "SOpt"
+      showsPrec _ SMany = showString "SMany"
+    instance SingI Str where
+      sing = SStr
+    instance SingI Opt where
+      sing = SOpt
+    instance SingI Many where
+      sing = SMany
diff --git a/tests/compile-and-dump/Singletons/T183.ghc88.template b/tests/compile-and-dump/Singletons/T183.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T183.ghc88.template
+++ /dev/null
@@ -1,516 +0,0 @@
-Singletons/T183.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| f1 (x :: Maybe Bool) = (x :: Maybe Bool)
-          f2 (x :: Maybe a) = (x :: Maybe a)
-          f3 (Just a :: Maybe Bool) = "hi"
-          g x = case Just x of { (Just y :: Maybe Bool) -> (y :: Bool) }
-          foo1 :: Maybe a -> a
-          foo1 (Just x :: Maybe a) = (x :: a)
-          foo2, foo3 :: forall a. Maybe a -> a
-          foo2 (Just x :: Maybe a) = (x :: a)
-          foo3 (Just x) = (x :: a)
-          foo4 :: (a, b) -> (b, a)
-          foo4 = \ (x :: a, y :: b) -> (y :: b, x :: a)
-          foo5, foo6 :: Maybe (Maybe a) -> Maybe (Maybe a)
-          foo5 (Just (Just (x :: a) :: Maybe a) :: Maybe (Maybe a))
-            = Just (Just (x :: a) :: Maybe a) :: Maybe (Maybe a)
-          foo6 (Just x :: Maybe (Maybe a))
-            = case x :: Maybe a of {
-                (Just (y :: a) :: Maybe a) -> Just (Just (y :: a) :: Maybe a) }
-          foo7 :: a -> b -> a
-          foo7 (x :: a) (_ :: b) = (x :: a)
-          foo8 :: forall a. Maybe a -> Maybe a
-          foo8 x@(Just (_ :: a) :: Maybe a) = x
-          foo9 :: a -> a
-          foo9 (x :: a)
-            = let
-                g :: a -> b -> a
-                g y _ = y
-              in g x () |]
-  ======>
-    f1 (x :: Maybe Bool) = x :: Maybe Bool
-    f2 (x :: Maybe a) = x :: Maybe a
-    f3 (Just a :: Maybe Bool) = "hi"
-    g x = case Just x of { (Just y :: Maybe Bool) -> y :: Bool }
-    foo1 :: Maybe a -> a
-    foo1 (Just x :: Maybe a) = x :: a
-    foo2 :: forall a. Maybe a -> a
-    foo3 :: forall a. Maybe a -> a
-    foo2 (Just x :: Maybe a) = x :: a
-    foo3 (Just x) = x :: a
-    foo4 :: (a, b) -> (b, a)
-    foo4 = \ (x :: a, y :: b) -> (y :: b, x :: a)
-    foo5 :: Maybe (Maybe a) -> Maybe (Maybe a)
-    foo6 :: Maybe (Maybe a) -> Maybe (Maybe a)
-    foo5 (Just (Just (x :: a) :: Maybe a) :: Maybe (Maybe a))
-      = Just (Just (x :: a) :: Maybe a) :: Maybe (Maybe a)
-    foo6 (Just x :: Maybe (Maybe a))
-      = case x :: Maybe a of {
-          (Just (y :: a) :: Maybe a) -> Just (Just (y :: a) :: Maybe a) }
-    foo7 :: a -> b -> a
-    foo7 (x :: a) (_ :: b) = x :: a
-    foo8 :: forall a. Maybe a -> Maybe a
-    foo8 x@(Just (_ :: a) :: Maybe a) = x
-    foo9 :: a -> a
-    foo9 (x :: a)
-      = let
-          g :: a -> b -> a
-          g y _ = y
-        in (g x) ()
-    type Let0123456789876543210GSym3 x0123456789876543210 (a0123456789876543210 :: a) (a0123456789876543210 :: b0123456789876543210) =
-        Let0123456789876543210G x0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210GSym2 a0123456789876543210 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210GSym2KindInference) ())
-    data Let0123456789876543210GSym2 x0123456789876543210 (a0123456789876543210 :: a) :: forall b0123456789876543210.
-                                                                                         (~>) b0123456789876543210 a
-      where
-        Let0123456789876543210GSym2KindInference :: forall x0123456789876543210
-                                                           a0123456789876543210
-                                                           a0123456789876543210
-                                                           arg. SameKind (Apply (Let0123456789876543210GSym2 x0123456789876543210 a0123456789876543210) arg) (Let0123456789876543210GSym3 x0123456789876543210 a0123456789876543210 arg) =>
-                                                    Let0123456789876543210GSym2 x0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (Let0123456789876543210GSym2 a0123456789876543210 x0123456789876543210) a0123456789876543210 = Let0123456789876543210G a0123456789876543210 x0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210GSym1 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210GSym1KindInference) ())
-    data Let0123456789876543210GSym1 x0123456789876543210 :: forall a
-                                                                    b0123456789876543210.
-                                                             (~>) a ((~>) b0123456789876543210 a)
-      where
-        Let0123456789876543210GSym1KindInference :: forall x0123456789876543210
-                                                           a0123456789876543210
-                                                           arg. SameKind (Apply (Let0123456789876543210GSym1 x0123456789876543210) arg) (Let0123456789876543210GSym2 x0123456789876543210 arg) =>
-                                                    Let0123456789876543210GSym1 x0123456789876543210 a0123456789876543210
-    type instance Apply (Let0123456789876543210GSym1 x0123456789876543210) a0123456789876543210 = Let0123456789876543210GSym2 x0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210GSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210GSym0KindInference) ())
-    data Let0123456789876543210GSym0 x0123456789876543210
-      where
-        Let0123456789876543210GSym0KindInference :: forall x0123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210GSym0 arg) (Let0123456789876543210GSym1 arg) =>
-                                                    Let0123456789876543210GSym0 x0123456789876543210
-    type instance Apply Let0123456789876543210GSym0 x0123456789876543210 = Let0123456789876543210GSym1 x0123456789876543210
-    type family Let0123456789876543210G x (a :: a) (a :: b) :: a where
-      Let0123456789876543210G x y _ = y
-    type Let0123456789876543210XSym1 wild_01234567898765432100123456789876543210 =
-        Let0123456789876543210X wild_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210XSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210XSym0KindInference) ())
-    data Let0123456789876543210XSym0 wild_01234567898765432100123456789876543210
-      where
-        Let0123456789876543210XSym0KindInference :: forall wild_01234567898765432100123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210XSym0 arg) (Let0123456789876543210XSym1 arg) =>
-                                                    Let0123456789876543210XSym0 wild_01234567898765432100123456789876543210
-    type instance Apply Let0123456789876543210XSym0 wild_01234567898765432100123456789876543210 = Let0123456789876543210X wild_01234567898765432100123456789876543210
-    type family Let0123456789876543210X wild_0123456789876543210 where
-      Let0123456789876543210X wild_0123456789876543210 = Apply JustSym0 (wild_0123456789876543210 :: a) :: Maybe a
-    type Let0123456789876543210Scrutinee_0123456789876543210Sym1 x0123456789876543210 =
-        Let0123456789876543210Scrutinee_0123456789876543210 x0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210Scrutinee_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd
-            (((,)
-                Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference)
-               ())
-    data Let0123456789876543210Scrutinee_0123456789876543210Sym0 x0123456789876543210
-      where
-        Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference :: forall x0123456789876543210
-                                                                                       arg. SameKind (Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym1 arg) =>
-                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym0 x0123456789876543210
-    type instance Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 x0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210 x0123456789876543210
-    type family Let0123456789876543210Scrutinee_0123456789876543210 x where
-      Let0123456789876543210Scrutinee_0123456789876543210 x = x :: Maybe a
-    type family Case_0123456789876543210 x t where
-      Case_0123456789876543210 x ('Just (y :: a) :: Maybe a) = Apply JustSym0 (Apply JustSym0 (y :: a) :: Maybe a)
-    type family Case_0123456789876543210 arg_0123456789876543210 a_0123456789876543210 t where
-      Case_0123456789876543210 arg_0123456789876543210 a_0123456789876543210 '(x :: a,
-                                                                               y :: b) = Apply (Apply Tuple2Sym0 (y :: b)) (x :: a)
-    type family Lambda_0123456789876543210 a_0123456789876543210 t where
-      Lambda_0123456789876543210 a_0123456789876543210 arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 a_0123456789876543210 arg_0123456789876543210
-    type Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall a_01234567898765432100123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 a_01234567898765432100123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall a_01234567898765432100123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210
-    type Let0123456789876543210Scrutinee_0123456789876543210Sym1 x0123456789876543210 =
-        Let0123456789876543210Scrutinee_0123456789876543210 x0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210Scrutinee_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd
-            (((,)
-                Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference)
-               ())
-    data Let0123456789876543210Scrutinee_0123456789876543210Sym0 x0123456789876543210
-      where
-        Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference :: forall x0123456789876543210
-                                                                                       arg. SameKind (Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym1 arg) =>
-                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym0 x0123456789876543210
-    type instance Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 x0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210 x0123456789876543210
-    type family Let0123456789876543210Scrutinee_0123456789876543210 x where
-      Let0123456789876543210Scrutinee_0123456789876543210 x = Apply JustSym0 x
-    type family Case_0123456789876543210 x t where
-      Case_0123456789876543210 x ('Just y :: Maybe Bool) = y :: Bool
-    type Foo9Sym1 (a0123456789876543210 :: a0123456789876543210) =
-        Foo9 a0123456789876543210
-    instance SuppressUnusedWarnings Foo9Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo9Sym0KindInference) ())
-    data Foo9Sym0 :: forall a0123456789876543210.
-                     (~>) a0123456789876543210 a0123456789876543210
-      where
-        Foo9Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo9Sym0 arg) (Foo9Sym1 arg) =>
-                                 Foo9Sym0 a0123456789876543210
-    type instance Apply Foo9Sym0 a0123456789876543210 = Foo9 a0123456789876543210
-    type Foo8Sym1 (a0123456789876543210 :: Maybe a0123456789876543210) =
-        Foo8 a0123456789876543210
-    instance SuppressUnusedWarnings Foo8Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo8Sym0KindInference) ())
-    data Foo8Sym0 :: forall a0123456789876543210.
-                     (~>) (Maybe a0123456789876543210) (Maybe a0123456789876543210)
-      where
-        Foo8Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo8Sym0 arg) (Foo8Sym1 arg) =>
-                                 Foo8Sym0 a0123456789876543210
-    type instance Apply Foo8Sym0 a0123456789876543210 = Foo8 a0123456789876543210
-    type Foo7Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: b0123456789876543210) =
-        Foo7 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Foo7Sym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) Foo7Sym1KindInference) ())
-    data Foo7Sym1 (a0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                    (~>) b0123456789876543210 a0123456789876543210
-      where
-        Foo7Sym1KindInference :: forall a0123456789876543210
-                                        a0123456789876543210
-                                        arg. SameKind (Apply (Foo7Sym1 a0123456789876543210) arg) (Foo7Sym2 a0123456789876543210 arg) =>
-                                 Foo7Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Foo7Sym1 a0123456789876543210) a0123456789876543210 = Foo7 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Foo7Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo7Sym0KindInference) ())
-    data Foo7Sym0 :: forall a0123456789876543210 b0123456789876543210.
-                     (~>) a0123456789876543210 ((~>) b0123456789876543210 a0123456789876543210)
-      where
-        Foo7Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo7Sym0 arg) (Foo7Sym1 arg) =>
-                                 Foo7Sym0 a0123456789876543210
-    type instance Apply Foo7Sym0 a0123456789876543210 = Foo7Sym1 a0123456789876543210
-    type Foo6Sym1 (a0123456789876543210 :: Maybe (Maybe a0123456789876543210)) =
-        Foo6 a0123456789876543210
-    instance SuppressUnusedWarnings Foo6Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo6Sym0KindInference) ())
-    data Foo6Sym0 :: forall a0123456789876543210.
-                     (~>) (Maybe (Maybe a0123456789876543210)) (Maybe (Maybe a0123456789876543210))
-      where
-        Foo6Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo6Sym0 arg) (Foo6Sym1 arg) =>
-                                 Foo6Sym0 a0123456789876543210
-    type instance Apply Foo6Sym0 a0123456789876543210 = Foo6 a0123456789876543210
-    type Foo5Sym1 (a0123456789876543210 :: Maybe (Maybe a0123456789876543210)) =
-        Foo5 a0123456789876543210
-    instance SuppressUnusedWarnings Foo5Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo5Sym0KindInference) ())
-    data Foo5Sym0 :: forall a0123456789876543210.
-                     (~>) (Maybe (Maybe a0123456789876543210)) (Maybe (Maybe a0123456789876543210))
-      where
-        Foo5Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo5Sym0 arg) (Foo5Sym1 arg) =>
-                                 Foo5Sym0 a0123456789876543210
-    type instance Apply Foo5Sym0 a0123456789876543210 = Foo5 a0123456789876543210
-    type Foo4Sym1 (a0123456789876543210 :: (a0123456789876543210,
-                                            b0123456789876543210)) =
-        Foo4 a0123456789876543210
-    instance SuppressUnusedWarnings Foo4Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo4Sym0KindInference) ())
-    data Foo4Sym0 :: forall a0123456789876543210 b0123456789876543210.
-                     (~>) (a0123456789876543210,
-                           b0123456789876543210) (b0123456789876543210, a0123456789876543210)
-      where
-        Foo4Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo4Sym0 arg) (Foo4Sym1 arg) =>
-                                 Foo4Sym0 a0123456789876543210
-    type instance Apply Foo4Sym0 a0123456789876543210 = Foo4 a0123456789876543210
-    type Foo3Sym1 (a0123456789876543210 :: Maybe a0123456789876543210) =
-        Foo3 a0123456789876543210
-    instance SuppressUnusedWarnings Foo3Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo3Sym0KindInference) ())
-    data Foo3Sym0 :: forall a0123456789876543210.
-                     (~>) (Maybe a0123456789876543210) a0123456789876543210
-      where
-        Foo3Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo3Sym0 arg) (Foo3Sym1 arg) =>
-                                 Foo3Sym0 a0123456789876543210
-    type instance Apply Foo3Sym0 a0123456789876543210 = Foo3 a0123456789876543210
-    type Foo2Sym1 (a0123456789876543210 :: Maybe a0123456789876543210) =
-        Foo2 a0123456789876543210
-    instance SuppressUnusedWarnings Foo2Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo2Sym0KindInference) ())
-    data Foo2Sym0 :: forall a0123456789876543210.
-                     (~>) (Maybe a0123456789876543210) a0123456789876543210
-      where
-        Foo2Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo2Sym0 arg) (Foo2Sym1 arg) =>
-                                 Foo2Sym0 a0123456789876543210
-    type instance Apply Foo2Sym0 a0123456789876543210 = Foo2 a0123456789876543210
-    type Foo1Sym1 (a0123456789876543210 :: Maybe a0123456789876543210) =
-        Foo1 a0123456789876543210
-    instance SuppressUnusedWarnings Foo1Sym0 where
-      suppressUnusedWarnings = snd (((,) Foo1Sym0KindInference) ())
-    data Foo1Sym0 :: forall a0123456789876543210.
-                     (~>) (Maybe a0123456789876543210) a0123456789876543210
-      where
-        Foo1Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Foo1Sym0 arg) (Foo1Sym1 arg) =>
-                                 Foo1Sym0 a0123456789876543210
-    type instance Apply Foo1Sym0 a0123456789876543210 = Foo1 a0123456789876543210
-    type GSym1 a0123456789876543210 = G a0123456789876543210
-    instance SuppressUnusedWarnings GSym0 where
-      suppressUnusedWarnings = snd (((,) GSym0KindInference) ())
-    data GSym0 a0123456789876543210
-      where
-        GSym0KindInference :: forall a0123456789876543210
-                                     arg. SameKind (Apply GSym0 arg) (GSym1 arg) =>
-                              GSym0 a0123456789876543210
-    type instance Apply GSym0 a0123456789876543210 = G a0123456789876543210
-    type F3Sym1 a0123456789876543210 = F3 a0123456789876543210
-    instance SuppressUnusedWarnings F3Sym0 where
-      suppressUnusedWarnings = snd (((,) F3Sym0KindInference) ())
-    data F3Sym0 a0123456789876543210
-      where
-        F3Sym0KindInference :: forall a0123456789876543210
-                                      arg. SameKind (Apply F3Sym0 arg) (F3Sym1 arg) =>
-                               F3Sym0 a0123456789876543210
-    type instance Apply F3Sym0 a0123456789876543210 = F3 a0123456789876543210
-    type F2Sym1 a0123456789876543210 = F2 a0123456789876543210
-    instance SuppressUnusedWarnings F2Sym0 where
-      suppressUnusedWarnings = snd (((,) F2Sym0KindInference) ())
-    data F2Sym0 a0123456789876543210
-      where
-        F2Sym0KindInference :: forall a0123456789876543210
-                                      arg. SameKind (Apply F2Sym0 arg) (F2Sym1 arg) =>
-                               F2Sym0 a0123456789876543210
-    type instance Apply F2Sym0 a0123456789876543210 = F2 a0123456789876543210
-    type F1Sym1 a0123456789876543210 = F1 a0123456789876543210
-    instance SuppressUnusedWarnings F1Sym0 where
-      suppressUnusedWarnings = snd (((,) F1Sym0KindInference) ())
-    data F1Sym0 a0123456789876543210
-      where
-        F1Sym0KindInference :: forall a0123456789876543210
-                                      arg. SameKind (Apply F1Sym0 arg) (F1Sym1 arg) =>
-                               F1Sym0 a0123456789876543210
-    type instance Apply F1Sym0 a0123456789876543210 = F1 a0123456789876543210
-    type family Foo9 (a :: a) :: a where
-      Foo9 (x :: a) = Apply (Apply (Let0123456789876543210GSym1 x) x) Tuple0Sym0
-    type family Foo8 (a :: Maybe a) :: Maybe a where
-      Foo8 ('Just (wild_0123456789876543210 :: a) :: Maybe a) = Let0123456789876543210XSym1 wild_0123456789876543210
-    type family Foo7 (a :: a) (a :: b) :: a where
-      Foo7 (x :: a) (wild_0123456789876543210 :: b) = x :: a
-    type family Foo6 (a :: Maybe (Maybe a)) :: Maybe (Maybe a) where
-      Foo6 ('Just x :: Maybe (Maybe a)) = Case_0123456789876543210 x (Let0123456789876543210Scrutinee_0123456789876543210Sym1 x)
-    type family Foo5 (a :: Maybe (Maybe a)) :: Maybe (Maybe a) where
-      Foo5 ('Just ('Just (x :: a) :: Maybe a) :: Maybe (Maybe a)) = Apply JustSym0 (Apply JustSym0 (x :: a) :: Maybe a) :: Maybe (Maybe a)
-    type family Foo4 (a :: (a, b)) :: (b, a) where
-      Foo4 a_0123456789876543210 = Apply (Apply Lambda_0123456789876543210Sym0 a_0123456789876543210) a_0123456789876543210
-    type family Foo3 (a :: Maybe a) :: a where
-      Foo3 ('Just x) = x :: a
-    type family Foo2 (a :: Maybe a) :: a where
-      Foo2 ('Just x :: Maybe a) = x :: a
-    type family Foo1 (a :: Maybe a) :: a where
-      Foo1 ('Just x :: Maybe a) = x :: a
-    type family G a where
-      G x = Case_0123456789876543210 x (Let0123456789876543210Scrutinee_0123456789876543210Sym1 x)
-    type family F3 a where
-      F3 ('Just a :: Maybe Bool) = "hi"
-    type family F2 a where
-      F2 (x :: Maybe a) = x :: Maybe a
-    type family F1 a where
-      F1 (x :: Maybe Bool) = x :: Maybe Bool
-    sFoo9 :: forall a (t :: a). Sing t -> Sing (Apply Foo9Sym0 t :: a)
-    sFoo8 ::
-      forall a (t :: Maybe a).
-      Sing t -> Sing (Apply Foo8Sym0 t :: Maybe a)
-    sFoo7 ::
-      forall a b (t :: a) (t :: b).
-      Sing t -> Sing t -> Sing (Apply (Apply Foo7Sym0 t) t :: a)
-    sFoo6 ::
-      forall a (t :: Maybe (Maybe a)).
-      Sing t -> Sing (Apply Foo6Sym0 t :: Maybe (Maybe a))
-    sFoo5 ::
-      forall a (t :: Maybe (Maybe a)).
-      Sing t -> Sing (Apply Foo5Sym0 t :: Maybe (Maybe a))
-    sFoo4 ::
-      forall a b (t :: (a, b)).
-      Sing t -> Sing (Apply Foo4Sym0 t :: (b, a))
-    sFoo3 ::
-      forall a (t :: Maybe a). Sing t -> Sing (Apply Foo3Sym0 t :: a)
-    sFoo2 ::
-      forall a (t :: Maybe a). Sing t -> Sing (Apply Foo2Sym0 t :: a)
-    sFoo1 ::
-      forall a (t :: Maybe a). Sing t -> Sing (Apply Foo1Sym0 t :: a)
-    sG :: forall arg. Sing arg -> Sing (Apply GSym0 arg)
-    sF3 :: forall arg. Sing arg -> Sing (Apply F3Sym0 arg)
-    sF2 :: forall arg. Sing arg -> Sing (Apply F2Sym0 arg)
-    sF1 :: forall arg. Sing arg -> Sing (Apply F1Sym0 arg)
-    sFoo9 (sX :: Sing x)
-      = case sX :: Sing x of {
-          (_ :: Sing (x :: a))
-            -> let
-                 sG ::
-                   forall b (t :: a) (t :: b).
-                   Sing t
-                   -> Sing t
-                      -> Sing (Apply (Apply (Let0123456789876543210GSym1 x) t) t :: a)
-                 sG (sY :: Sing y) _ = sY
-               in
-                 (applySing
-                    ((applySing ((singFun2 @(Let0123456789876543210GSym1 x)) sG)) sX))
-                   STuple0 }
-    sFoo8
-      (SJust (sWild_0123456789876543210 :: Sing wild_0123456789876543210))
-      = case
-            ((,) (sWild_0123456789876543210 :: Sing wild_0123456789876543210))
-              (SJust
-                 (sWild_0123456789876543210 :: Sing wild_0123456789876543210))
-        of {
-          (,) (_ :: Sing (wild_0123456789876543210 :: a))
-              (_ :: Sing ('Just (wild_0123456789876543210 :: a) :: Maybe a))
-            -> let
-                 sX :: Sing (Let0123456789876543210XSym1 wild_0123456789876543210)
-                 sX
-                   = (applySing ((singFun1 @JustSym0) SJust))
-                       (sWild_0123456789876543210 ::
-                          Sing (wild_0123456789876543210 :: a)) ::
-                       Sing (Apply JustSym0 (wild_0123456789876543210 :: a) :: Maybe a)
-               in sX }
-    sFoo7
-      (sX :: Sing x)
-      (sWild_0123456789876543210 :: Sing wild_0123456789876543210)
-      = case
-            ((,) (sX :: Sing x))
-              (sWild_0123456789876543210 :: Sing wild_0123456789876543210)
-        of {
-          (,) (_ :: Sing (x :: a))
-              (_ :: Sing (wild_0123456789876543210 :: b))
-            -> sX :: Sing (x :: a) }
-    sFoo6 (SJust (sX :: Sing x))
-      = case SJust (sX :: Sing x) of {
-          (_ :: Sing ('Just x :: Maybe (Maybe a)))
-            -> let
-                 sScrutinee_0123456789876543210 ::
-                   Sing (Let0123456789876543210Scrutinee_0123456789876543210Sym1 x)
-                 sScrutinee_0123456789876543210 = sX :: Sing (x :: Maybe a)
-               in
-                 (id
-                    @(Sing (Case_0123456789876543210 x (Let0123456789876543210Scrutinee_0123456789876543210Sym1 x) :: Maybe (Maybe a))))
-                   (case sScrutinee_0123456789876543210 of {
-                      SJust (sY :: Sing y)
-                        -> case ((,) (sY :: Sing y)) (SJust (sY :: Sing y)) of {
-                             (,) (_ :: Sing (y :: a)) (_ :: Sing ('Just (y :: a) :: Maybe a))
-                               -> (applySing ((singFun1 @JustSym0) SJust))
-                                    ((applySing ((singFun1 @JustSym0) SJust))
-                                       (sY :: Sing (y :: a)) ::
-                                       Sing (Apply JustSym0 (y :: a) :: Maybe a)) } }) }
-    sFoo5 (SJust (SJust (sX :: Sing x)))
-      = case
-            (((,,) (sX :: Sing x)) (SJust (sX :: Sing x)))
-              (SJust (SJust (sX :: Sing x)))
-        of {
-          (,,) (_ :: Sing (x :: a))
-               (_ :: Sing ('Just (x :: a) :: Maybe a))
-               (_ :: Sing ('Just ('Just (x :: a) :: Maybe a) :: Maybe (Maybe a)))
-            -> (applySing ((singFun1 @JustSym0) SJust))
-                 ((applySing ((singFun1 @JustSym0) SJust)) (sX :: Sing (x :: a)) ::
-                    Sing (Apply JustSym0 (x :: a) :: Maybe a)) ::
-                 Sing (Apply JustSym0 (Apply JustSym0 (x :: a) :: Maybe a) :: Maybe (Maybe a)) }
-    sFoo4 (sA_0123456789876543210 :: Sing a_0123456789876543210)
-      = (applySing
-           ((singFun1
-               @(Apply Lambda_0123456789876543210Sym0 a_0123456789876543210))
-              (\ sArg_0123456789876543210
-                 -> case sArg_0123456789876543210 of {
-                      (_ :: Sing arg_0123456789876543210)
-                        -> (id
-                              @(Sing (Case_0123456789876543210 arg_0123456789876543210 a_0123456789876543210 arg_0123456789876543210)))
-                             (case sArg_0123456789876543210 of {
-                                STuple2 (sX :: Sing x) (sY :: Sing y)
-                                  -> case ((,) (sX :: Sing x)) (sY :: Sing y) of {
-                                       (,) (_ :: Sing (x :: a)) (_ :: Sing (y :: b))
-                                         -> (applySing
-                                               ((applySing ((singFun2 @Tuple2Sym0) STuple2))
-                                                  (sY :: Sing (y :: b))))
-                                              (sX :: Sing (x :: a)) } }) })))
-          sA_0123456789876543210
-    sFoo3 (SJust (sX :: Sing x)) = sX :: Sing (x :: a)
-    sFoo2 (SJust (sX :: Sing x))
-      = case SJust (sX :: Sing x) of {
-          (_ :: Sing ('Just x :: Maybe a)) -> sX :: Sing (x :: a) }
-    sFoo1 (SJust (sX :: Sing x))
-      = case SJust (sX :: Sing x) of {
-          (_ :: Sing ('Just x :: Maybe a)) -> sX :: Sing (x :: a) }
-    sG (sX :: Sing x)
-      = let
-          sScrutinee_0123456789876543210 ::
-            Sing (Let0123456789876543210Scrutinee_0123456789876543210Sym1 x)
-          sScrutinee_0123456789876543210
-            = (applySing ((singFun1 @JustSym0) SJust)) sX
-        in
-          (id
-             @(Sing (Case_0123456789876543210 x (Let0123456789876543210Scrutinee_0123456789876543210Sym1 x))))
-            (case sScrutinee_0123456789876543210 of {
-               SJust (sY :: Sing y)
-                 -> case SJust (sY :: Sing y) of {
-                      (_ :: Sing ('Just y :: Maybe Bool)) -> sY :: Sing (y :: Bool) } })
-    sF3 (SJust (sA :: Sing a))
-      = case SJust (sA :: Sing a) of {
-          (_ :: Sing ('Just a :: Maybe Bool)) -> sing :: Sing "hi" }
-    sF2 (sX :: Sing x)
-      = case sX :: Sing x of {
-          (_ :: Sing (x :: Maybe a)) -> sX :: Sing (x :: Maybe a) }
-    sF1 (sX :: Sing x)
-      = case sX :: Sing x of {
-          (_ :: Sing (x :: Maybe Bool)) -> sX :: Sing (x :: Maybe Bool) }
-    instance SingI (Foo9Sym0 :: (~>) a a) where
-      sing = (singFun1 @Foo9Sym0) sFoo9
-    instance SingI (Foo8Sym0 :: (~>) (Maybe a) (Maybe a)) where
-      sing = (singFun1 @Foo8Sym0) sFoo8
-    instance SingI (Foo7Sym0 :: (~>) a ((~>) b a)) where
-      sing = (singFun2 @Foo7Sym0) sFoo7
-    instance SingI d => SingI (Foo7Sym1 (d :: a) :: (~>) b a) where
-      sing = (singFun1 @(Foo7Sym1 (d :: a))) (sFoo7 (sing @d))
-    instance SingI (Foo6Sym0 :: (~>) (Maybe (Maybe a)) (Maybe (Maybe a))) where
-      sing = (singFun1 @Foo6Sym0) sFoo6
-    instance SingI (Foo5Sym0 :: (~>) (Maybe (Maybe a)) (Maybe (Maybe a))) where
-      sing = (singFun1 @Foo5Sym0) sFoo5
-    instance SingI (Foo4Sym0 :: (~>) (a, b) (b, a)) where
-      sing = (singFun1 @Foo4Sym0) sFoo4
-    instance SingI (Foo3Sym0 :: (~>) (Maybe a) a) where
-      sing = (singFun1 @Foo3Sym0) sFoo3
-    instance SingI (Foo2Sym0 :: (~>) (Maybe a) a) where
-      sing = (singFun1 @Foo2Sym0) sFoo2
-    instance SingI (Foo1Sym0 :: (~>) (Maybe a) a) where
-      sing = (singFun1 @Foo1Sym0) sFoo1
-    instance SingI GSym0 where
-      sing = (singFun1 @GSym0) sG
-    instance SingI F3Sym0 where
-      sing = (singFun1 @F3Sym0) sF3
-    instance SingI F2Sym0 where
-      sing = (singFun1 @F2Sym0) sF2
-    instance SingI F1Sym0 where
-      sing = (singFun1 @F1Sym0) sF1
diff --git a/tests/compile-and-dump/Singletons/T183.golden b/tests/compile-and-dump/Singletons/T183.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T183.golden
@@ -0,0 +1,506 @@
+Singletons/T183.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| f1 (x :: Maybe Bool) = (x :: Maybe Bool)
+          f2 (x :: Maybe a) = (x :: Maybe a)
+          f3 (Just a :: Maybe Bool) = "hi"
+          g x = case Just x of { (Just y :: Maybe Bool) -> (y :: Bool) }
+          foo1 :: Maybe a -> a
+          foo1 (Just x :: Maybe a) = (x :: a)
+          foo2, foo3 :: forall a. Maybe a -> a
+          foo2 (Just x :: Maybe a) = (x :: a)
+          foo3 (Just x) = (x :: a)
+          foo4 :: (a, b) -> (b, a)
+          foo4 = \ (x :: a, y :: b) -> (y :: b, x :: a)
+          foo5, foo6 :: Maybe (Maybe a) -> Maybe (Maybe a)
+          foo5 (Just (Just (x :: a) :: Maybe a) :: Maybe (Maybe a))
+            = Just (Just (x :: a) :: Maybe a) :: Maybe (Maybe a)
+          foo6 (Just x :: Maybe (Maybe a))
+            = case x :: Maybe a of {
+                (Just (y :: a) :: Maybe a) -> Just (Just (y :: a) :: Maybe a) }
+          foo7 :: a -> b -> a
+          foo7 (x :: a) (_ :: b) = (x :: a)
+          foo8 :: forall a. Maybe a -> Maybe a
+          foo8 x@(Just (_ :: a) :: Maybe a) = x
+          foo8 x@(Nothing :: Maybe a) = x
+          foo9 :: a -> a
+          foo9 (x :: a)
+            = let
+                g :: a -> b -> a
+                g y _ = y
+              in g x () |]
+  ======>
+    f1 (x :: Maybe Bool) = x :: Maybe Bool
+    f2 (x :: Maybe a) = x :: Maybe a
+    f3 (Just a :: Maybe Bool) = "hi"
+    g x = case Just x of { (Just y :: Maybe Bool) -> y :: Bool }
+    foo1 :: Maybe a -> a
+    foo1 (Just x :: Maybe a) = x :: a
+    foo2 :: forall a. Maybe a -> a
+    foo3 :: forall a. Maybe a -> a
+    foo2 (Just x :: Maybe a) = x :: a
+    foo3 (Just x) = x :: a
+    foo4 :: (a, b) -> (b, a)
+    foo4 = \ (x :: a, y :: b) -> (y :: b, x :: a)
+    foo5 :: Maybe (Maybe a) -> Maybe (Maybe a)
+    foo6 :: Maybe (Maybe a) -> Maybe (Maybe a)
+    foo5 (Just (Just (x :: a) :: Maybe a) :: Maybe (Maybe a))
+      = Just (Just (x :: a) :: Maybe a) :: Maybe (Maybe a)
+    foo6 (Just x :: Maybe (Maybe a))
+      = case x :: Maybe a of {
+          (Just (y :: a) :: Maybe a) -> Just (Just (y :: a) :: Maybe a) }
+    foo7 :: a -> b -> a
+    foo7 (x :: a) (_ :: b) = x :: a
+    foo8 :: forall a. Maybe a -> Maybe a
+    foo8 x@(Just (_ :: a) :: Maybe a) = x
+    foo8 x@(Nothing :: Maybe a) = x
+    foo9 :: a -> a
+    foo9 (x :: a)
+      = let
+          g :: a -> b -> a
+          g y _ = y
+        in (g x) ()
+    data Let0123456789876543210GSym0 x0123456789876543210
+      where
+        Let0123456789876543210GSym0KindInference :: SameKind (Apply Let0123456789876543210GSym0 arg) (Let0123456789876543210GSym1 arg) =>
+                                                    Let0123456789876543210GSym0 x0123456789876543210
+    type instance Apply Let0123456789876543210GSym0 x0123456789876543210 = Let0123456789876543210GSym1 x0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210GSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210GSym0KindInference) ())
+    data Let0123456789876543210GSym1 x0123456789876543210 :: (~>) a ((~>) b0123456789876543210 a)
+      where
+        Let0123456789876543210GSym1KindInference :: SameKind (Apply (Let0123456789876543210GSym1 x0123456789876543210) arg) (Let0123456789876543210GSym2 x0123456789876543210 arg) =>
+                                                    Let0123456789876543210GSym1 x0123456789876543210 a0123456789876543210
+    type instance Apply (Let0123456789876543210GSym1 x0123456789876543210) a0123456789876543210 = Let0123456789876543210GSym2 x0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210GSym1 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210GSym1KindInference) ())
+    data Let0123456789876543210GSym2 x0123456789876543210 (a0123456789876543210 :: a) :: (~>) b0123456789876543210 a
+      where
+        Let0123456789876543210GSym2KindInference :: SameKind (Apply (Let0123456789876543210GSym2 x0123456789876543210 a0123456789876543210) arg) (Let0123456789876543210GSym3 x0123456789876543210 a0123456789876543210 arg) =>
+                                                    Let0123456789876543210GSym2 x0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (Let0123456789876543210GSym2 x0123456789876543210 a0123456789876543210) a0123456789876543210 = Let0123456789876543210GSym3 x0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210GSym2 x0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210GSym2KindInference) ())
+    type Let0123456789876543210GSym3 x0123456789876543210 (a0123456789876543210 :: a) (a0123456789876543210 :: b0123456789876543210) =
+        Let0123456789876543210G x0123456789876543210 a0123456789876543210 a0123456789876543210 :: a
+    type family Let0123456789876543210G x (a :: a) (a :: b) :: a where
+      Let0123456789876543210G x y _ = y
+    data Let0123456789876543210XSym0 wild_01234567898765432100123456789876543210
+      where
+        Let0123456789876543210XSym0KindInference :: SameKind (Apply Let0123456789876543210XSym0 arg) (Let0123456789876543210XSym1 arg) =>
+                                                    Let0123456789876543210XSym0 wild_01234567898765432100123456789876543210
+    type instance Apply Let0123456789876543210XSym0 wild_01234567898765432100123456789876543210 = Let0123456789876543210XSym1 wild_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210XSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210XSym0KindInference) ())
+    type Let0123456789876543210XSym1 wild_01234567898765432100123456789876543210 =
+        Let0123456789876543210X wild_01234567898765432100123456789876543210
+    type family Let0123456789876543210X wild_0123456789876543210 where
+      Let0123456789876543210X wild_0123456789876543210 = Apply JustSym0 (wild_0123456789876543210 :: a) :: Maybe a
+    type Let0123456789876543210XSym0 = Let0123456789876543210X
+    type family Let0123456789876543210X where
+      Let0123456789876543210X = NothingSym0 :: Maybe a
+    data Let0123456789876543210Scrutinee_0123456789876543210Sym0 x0123456789876543210
+      where
+        Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference :: SameKind (Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym1 arg) =>
+                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym0 x0123456789876543210
+    type instance Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 x0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym1 x0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210Scrutinee_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd
+            (((,)
+                Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference)
+               ())
+    type Let0123456789876543210Scrutinee_0123456789876543210Sym1 x0123456789876543210 =
+        Let0123456789876543210Scrutinee_0123456789876543210 x0123456789876543210
+    type family Let0123456789876543210Scrutinee_0123456789876543210 x where
+      Let0123456789876543210Scrutinee_0123456789876543210 x = x :: Maybe a
+    type family Case_0123456789876543210 x t where
+      Case_0123456789876543210 x ('Just (y :: a) :: Maybe a) = Apply JustSym0 (Apply JustSym0 (y :: a) :: Maybe a)
+    type family Case_0123456789876543210 arg_0123456789876543210 a_0123456789876543210 t where
+      Case_0123456789876543210 arg_0123456789876543210 a_0123456789876543210 '(x :: a,
+                                                                               y :: b) = Apply (Apply Tuple2Sym0 (y :: b)) (x :: a)
+    type family Lambda_0123456789876543210 a_0123456789876543210 arg_0123456789876543210 where
+      Lambda_0123456789876543210 a_0123456789876543210 arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 a_0123456789876543210 arg_0123456789876543210
+    data Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 a_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210 arg_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) arg) (Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210 arg_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) arg_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 arg_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    type Lambda_0123456789876543210Sym2 a_01234567898765432100123456789876543210 arg_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 a_01234567898765432100123456789876543210 arg_01234567898765432100123456789876543210
+    data Let0123456789876543210Scrutinee_0123456789876543210Sym0 x0123456789876543210
+      where
+        Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference :: SameKind (Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym1 arg) =>
+                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym0 x0123456789876543210
+    type instance Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 x0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym1 x0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210Scrutinee_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd
+            (((,)
+                Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference)
+               ())
+    type Let0123456789876543210Scrutinee_0123456789876543210Sym1 x0123456789876543210 =
+        Let0123456789876543210Scrutinee_0123456789876543210 x0123456789876543210
+    type family Let0123456789876543210Scrutinee_0123456789876543210 x where
+      Let0123456789876543210Scrutinee_0123456789876543210 x = Apply JustSym0 x
+    type family Case_0123456789876543210 x t where
+      Case_0123456789876543210 x ('Just y :: Maybe Bool) = y :: Bool
+    type Foo9Sym0 :: (~>) a a
+    data Foo9Sym0 a0123456789876543210
+      where
+        Foo9Sym0KindInference :: SameKind (Apply Foo9Sym0 arg) (Foo9Sym1 arg) =>
+                                 Foo9Sym0 a0123456789876543210
+    type instance Apply Foo9Sym0 a0123456789876543210 = Foo9Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo9Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo9Sym0KindInference) ())
+    type Foo9Sym1 (a0123456789876543210 :: a) =
+        Foo9 a0123456789876543210 :: a
+    type Foo8Sym0 :: forall a. (~>) (Maybe a) (Maybe a)
+    data Foo8Sym0 a0123456789876543210
+      where
+        Foo8Sym0KindInference :: SameKind (Apply Foo8Sym0 arg) (Foo8Sym1 arg) =>
+                                 Foo8Sym0 a0123456789876543210
+    type instance Apply Foo8Sym0 a0123456789876543210 = Foo8Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo8Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo8Sym0KindInference) ())
+    type Foo8Sym1 (a0123456789876543210 :: Maybe a) =
+        Foo8 a0123456789876543210 :: Maybe a
+    type Foo7Sym0 :: (~>) a ((~>) b a)
+    data Foo7Sym0 a0123456789876543210
+      where
+        Foo7Sym0KindInference :: SameKind (Apply Foo7Sym0 arg) (Foo7Sym1 arg) =>
+                                 Foo7Sym0 a0123456789876543210
+    type instance Apply Foo7Sym0 a0123456789876543210 = Foo7Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo7Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo7Sym0KindInference) ())
+    type Foo7Sym1 :: a -> (~>) b a
+    data Foo7Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Foo7Sym1KindInference :: SameKind (Apply (Foo7Sym1 a0123456789876543210) arg) (Foo7Sym2 a0123456789876543210 arg) =>
+                                 Foo7Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Foo7Sym1 a0123456789876543210) a0123456789876543210 = Foo7Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Foo7Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) Foo7Sym1KindInference) ())
+    type Foo7Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        Foo7 a0123456789876543210 a0123456789876543210 :: a
+    type Foo6Sym0 :: (~>) (Maybe (Maybe a)) (Maybe (Maybe a))
+    data Foo6Sym0 a0123456789876543210
+      where
+        Foo6Sym0KindInference :: SameKind (Apply Foo6Sym0 arg) (Foo6Sym1 arg) =>
+                                 Foo6Sym0 a0123456789876543210
+    type instance Apply Foo6Sym0 a0123456789876543210 = Foo6Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo6Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo6Sym0KindInference) ())
+    type Foo6Sym1 (a0123456789876543210 :: Maybe (Maybe a)) =
+        Foo6 a0123456789876543210 :: Maybe (Maybe a)
+    type Foo5Sym0 :: (~>) (Maybe (Maybe a)) (Maybe (Maybe a))
+    data Foo5Sym0 a0123456789876543210
+      where
+        Foo5Sym0KindInference :: SameKind (Apply Foo5Sym0 arg) (Foo5Sym1 arg) =>
+                                 Foo5Sym0 a0123456789876543210
+    type instance Apply Foo5Sym0 a0123456789876543210 = Foo5Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo5Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo5Sym0KindInference) ())
+    type Foo5Sym1 (a0123456789876543210 :: Maybe (Maybe a)) =
+        Foo5 a0123456789876543210 :: Maybe (Maybe a)
+    type Foo4Sym0 :: (~>) (a, b) (b, a)
+    data Foo4Sym0 a0123456789876543210
+      where
+        Foo4Sym0KindInference :: SameKind (Apply Foo4Sym0 arg) (Foo4Sym1 arg) =>
+                                 Foo4Sym0 a0123456789876543210
+    type instance Apply Foo4Sym0 a0123456789876543210 = Foo4Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo4Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo4Sym0KindInference) ())
+    type Foo4Sym1 (a0123456789876543210 :: (a, b)) =
+        Foo4 a0123456789876543210 :: (b, a)
+    type Foo3Sym0 :: forall a. (~>) (Maybe a) a
+    data Foo3Sym0 a0123456789876543210
+      where
+        Foo3Sym0KindInference :: SameKind (Apply Foo3Sym0 arg) (Foo3Sym1 arg) =>
+                                 Foo3Sym0 a0123456789876543210
+    type instance Apply Foo3Sym0 a0123456789876543210 = Foo3Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo3Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo3Sym0KindInference) ())
+    type Foo3Sym1 (a0123456789876543210 :: Maybe a) =
+        Foo3 a0123456789876543210 :: a
+    type Foo2Sym0 :: forall a. (~>) (Maybe a) a
+    data Foo2Sym0 a0123456789876543210
+      where
+        Foo2Sym0KindInference :: SameKind (Apply Foo2Sym0 arg) (Foo2Sym1 arg) =>
+                                 Foo2Sym0 a0123456789876543210
+    type instance Apply Foo2Sym0 a0123456789876543210 = Foo2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo2Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo2Sym0KindInference) ())
+    type Foo2Sym1 (a0123456789876543210 :: Maybe a) =
+        Foo2 a0123456789876543210 :: a
+    type Foo1Sym0 :: (~>) (Maybe a) a
+    data Foo1Sym0 a0123456789876543210
+      where
+        Foo1Sym0KindInference :: SameKind (Apply Foo1Sym0 arg) (Foo1Sym1 arg) =>
+                                 Foo1Sym0 a0123456789876543210
+    type instance Apply Foo1Sym0 a0123456789876543210 = Foo1Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Foo1Sym0 where
+      suppressUnusedWarnings = snd (((,) Foo1Sym0KindInference) ())
+    type Foo1Sym1 (a0123456789876543210 :: Maybe a) =
+        Foo1 a0123456789876543210 :: a
+    data GSym0 a0123456789876543210
+      where
+        GSym0KindInference :: SameKind (Apply GSym0 arg) (GSym1 arg) =>
+                              GSym0 a0123456789876543210
+    type instance Apply GSym0 a0123456789876543210 = GSym1 a0123456789876543210
+    instance SuppressUnusedWarnings GSym0 where
+      suppressUnusedWarnings = snd (((,) GSym0KindInference) ())
+    type GSym1 a0123456789876543210 = G a0123456789876543210
+    data F3Sym0 a0123456789876543210
+      where
+        F3Sym0KindInference :: SameKind (Apply F3Sym0 arg) (F3Sym1 arg) =>
+                               F3Sym0 a0123456789876543210
+    type instance Apply F3Sym0 a0123456789876543210 = F3Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings F3Sym0 where
+      suppressUnusedWarnings = snd (((,) F3Sym0KindInference) ())
+    type F3Sym1 a0123456789876543210 = F3 a0123456789876543210
+    data F2Sym0 a0123456789876543210
+      where
+        F2Sym0KindInference :: SameKind (Apply F2Sym0 arg) (F2Sym1 arg) =>
+                               F2Sym0 a0123456789876543210
+    type instance Apply F2Sym0 a0123456789876543210 = F2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings F2Sym0 where
+      suppressUnusedWarnings = snd (((,) F2Sym0KindInference) ())
+    type F2Sym1 a0123456789876543210 = F2 a0123456789876543210
+    data F1Sym0 a0123456789876543210
+      where
+        F1Sym0KindInference :: SameKind (Apply F1Sym0 arg) (F1Sym1 arg) =>
+                               F1Sym0 a0123456789876543210
+    type instance Apply F1Sym0 a0123456789876543210 = F1Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings F1Sym0 where
+      suppressUnusedWarnings = snd (((,) F1Sym0KindInference) ())
+    type F1Sym1 a0123456789876543210 = F1 a0123456789876543210
+    type Foo9 :: a -> a
+    type family Foo9 a where
+      Foo9 (x :: a) = Apply (Apply (Let0123456789876543210GSym1 x) x) Tuple0Sym0
+    type Foo8 :: forall a. Maybe a -> Maybe a
+    type family Foo8 a where
+      Foo8 ('Just (wild_0123456789876543210 :: a) :: Maybe a) = Let0123456789876543210XSym1 wild_0123456789876543210
+      Foo8 ('Nothing :: Maybe a) = Let0123456789876543210XSym0
+    type Foo7 :: a -> b -> a
+    type family Foo7 a a where
+      Foo7 (x :: a) (wild_0123456789876543210 :: b) = x :: a
+    type Foo6 :: Maybe (Maybe a) -> Maybe (Maybe a)
+    type family Foo6 a where
+      Foo6 ('Just x :: Maybe (Maybe a)) = Case_0123456789876543210 x (Let0123456789876543210Scrutinee_0123456789876543210Sym1 x)
+    type Foo5 :: Maybe (Maybe a) -> Maybe (Maybe a)
+    type family Foo5 a where
+      Foo5 ('Just ('Just (x :: a) :: Maybe a) :: Maybe (Maybe a)) = Apply JustSym0 (Apply JustSym0 (x :: a) :: Maybe a) :: Maybe (Maybe a)
+    type Foo4 :: (a, b) -> (b, a)
+    type family Foo4 a where
+      Foo4 a_0123456789876543210 = Apply (Apply Lambda_0123456789876543210Sym0 a_0123456789876543210) a_0123456789876543210
+    type Foo3 :: forall a. Maybe a -> a
+    type family Foo3 a where
+      Foo3 ('Just x) = x :: a
+    type Foo2 :: forall a. Maybe a -> a
+    type family Foo2 a where
+      Foo2 ('Just x :: Maybe a) = x :: a
+    type Foo1 :: Maybe a -> a
+    type family Foo1 a where
+      Foo1 ('Just x :: Maybe a) = x :: a
+    type family G a where
+      G x = Case_0123456789876543210 x (Let0123456789876543210Scrutinee_0123456789876543210Sym1 x)
+    type family F3 a where
+      F3 ('Just a :: Maybe Bool) = "hi"
+    type family F2 a where
+      F2 (x :: Maybe a) = x :: Maybe a
+    type family F1 a where
+      F1 (x :: Maybe Bool) = x :: Maybe Bool
+    sFoo9 :: forall a (t :: a). Sing t -> Sing (Apply Foo9Sym0 t :: a)
+    sFoo8 ::
+      forall a (t :: Maybe a).
+      Sing t -> Sing (Apply Foo8Sym0 t :: Maybe a)
+    sFoo7 ::
+      forall a b (t :: a) (t :: b).
+      Sing t -> Sing t -> Sing (Apply (Apply Foo7Sym0 t) t :: a)
+    sFoo6 ::
+      forall a (t :: Maybe (Maybe a)).
+      Sing t -> Sing (Apply Foo6Sym0 t :: Maybe (Maybe a))
+    sFoo5 ::
+      forall a (t :: Maybe (Maybe a)).
+      Sing t -> Sing (Apply Foo5Sym0 t :: Maybe (Maybe a))
+    sFoo4 ::
+      forall a b (t :: (a, b)).
+      Sing t -> Sing (Apply Foo4Sym0 t :: (b, a))
+    sFoo3 ::
+      forall a (t :: Maybe a). Sing t -> Sing (Apply Foo3Sym0 t :: a)
+    sFoo2 ::
+      forall a (t :: Maybe a). Sing t -> Sing (Apply Foo2Sym0 t :: a)
+    sFoo1 ::
+      forall a (t :: Maybe a). Sing t -> Sing (Apply Foo1Sym0 t :: a)
+    sG :: forall arg. Sing arg -> Sing (Apply GSym0 arg)
+    sF3 :: forall arg. Sing arg -> Sing (Apply F3Sym0 arg)
+    sF2 :: forall arg. Sing arg -> Sing (Apply F2Sym0 arg)
+    sF1 :: forall arg. Sing arg -> Sing (Apply F1Sym0 arg)
+    sFoo9 (sX :: Sing x)
+      = case sX :: Sing x of {
+          (_ :: Sing (x :: a))
+            -> let
+                 sG ::
+                   forall b (t :: a) (t :: b).
+                   Sing t
+                   -> Sing t
+                      -> Sing (Apply (Apply (Let0123456789876543210GSym1 x) t) t :: a)
+                 sG (sY :: Sing y) _ = sY
+               in
+                 (applySing
+                    ((applySing ((singFun2 @(Let0123456789876543210GSym1 x)) sG)) sX))
+                   STuple0 }
+    sFoo8
+      (SJust (sWild_0123456789876543210 :: Sing wild_0123456789876543210))
+      = case
+            ((,) (sWild_0123456789876543210 :: Sing wild_0123456789876543210))
+              (SJust
+                 (sWild_0123456789876543210 :: Sing wild_0123456789876543210))
+        of {
+          (,) (_ :: Sing (wild_0123456789876543210 :: a))
+              (_ :: Sing ('Just (wild_0123456789876543210 :: a) :: Maybe a))
+            -> let
+                 sX ::
+                   Sing @_ (Let0123456789876543210XSym1 wild_0123456789876543210)
+                 sX
+                   = (applySing ((singFun1 @JustSym0) SJust))
+                       (sWild_0123456789876543210 ::
+                          Sing (wild_0123456789876543210 :: a)) ::
+                       Sing (Apply JustSym0 (wild_0123456789876543210 :: a) :: Maybe a)
+               in sX }
+    sFoo8 SNothing
+      = case SNothing of {
+          (_ :: Sing ('Nothing :: Maybe a))
+            -> let
+                 sX :: Sing @_ Let0123456789876543210XSym0
+                 sX = SNothing :: Sing (NothingSym0 :: Maybe a)
+               in sX }
+    sFoo7
+      (sX :: Sing x)
+      (sWild_0123456789876543210 :: Sing wild_0123456789876543210)
+      = case
+            ((,) (sX :: Sing x))
+              (sWild_0123456789876543210 :: Sing wild_0123456789876543210)
+        of {
+          (,) (_ :: Sing (x :: a))
+              (_ :: Sing (wild_0123456789876543210 :: b))
+            -> sX :: Sing (x :: a) }
+    sFoo6 (SJust (sX :: Sing x))
+      = case SJust (sX :: Sing x) of {
+          (_ :: Sing ('Just x :: Maybe (Maybe a)))
+            -> let
+                 sScrutinee_0123456789876543210 ::
+                   Sing @_ (Let0123456789876543210Scrutinee_0123456789876543210Sym1 x)
+                 sScrutinee_0123456789876543210 = sX :: Sing (x :: Maybe a)
+               in
+                 (id
+                    @(Sing (Case_0123456789876543210 x (Let0123456789876543210Scrutinee_0123456789876543210Sym1 x) :: Maybe (Maybe a))))
+                   (case sScrutinee_0123456789876543210 of {
+                      SJust (sY :: Sing y)
+                        -> case ((,) (sY :: Sing y)) (SJust (sY :: Sing y)) of {
+                             (,) (_ :: Sing (y :: a)) (_ :: Sing ('Just (y :: a) :: Maybe a))
+                               -> (applySing ((singFun1 @JustSym0) SJust))
+                                    ((applySing ((singFun1 @JustSym0) SJust))
+                                       (sY :: Sing (y :: a)) ::
+                                       Sing (Apply JustSym0 (y :: a) :: Maybe a)) } }) }
+    sFoo5 (SJust (SJust (sX :: Sing x)))
+      = case
+            (((,,) (sX :: Sing x)) (SJust (sX :: Sing x)))
+              (SJust (SJust (sX :: Sing x)))
+        of {
+          (,,) (_ :: Sing (x :: a)) (_ :: Sing ('Just (x :: a) :: Maybe a))
+               (_ :: Sing ('Just ('Just (x :: a) :: Maybe a) :: Maybe (Maybe a)))
+            -> (applySing ((singFun1 @JustSym0) SJust))
+                 ((applySing ((singFun1 @JustSym0) SJust)) (sX :: Sing (x :: a)) ::
+                    Sing (Apply JustSym0 (x :: a) :: Maybe a)) ::
+                 Sing (Apply JustSym0 (Apply JustSym0 (x :: a) :: Maybe a) :: Maybe (Maybe a)) }
+    sFoo4 (sA_0123456789876543210 :: Sing a_0123456789876543210)
+      = (applySing
+           ((singFun1
+               @(Apply Lambda_0123456789876543210Sym0 a_0123456789876543210))
+              (\ sArg_0123456789876543210
+                 -> case sArg_0123456789876543210 of {
+                      (_ :: Sing arg_0123456789876543210)
+                        -> (id
+                              @(Sing (Case_0123456789876543210 arg_0123456789876543210 a_0123456789876543210 arg_0123456789876543210)))
+                             (case sArg_0123456789876543210 of {
+                                STuple2 (sX :: Sing x) (sY :: Sing y)
+                                  -> case ((,) (sX :: Sing x)) (sY :: Sing y) of {
+                                       (,) (_ :: Sing (x :: a)) (_ :: Sing (y :: b))
+                                         -> (applySing
+                                               ((applySing ((singFun2 @Tuple2Sym0) STuple2))
+                                                  (sY :: Sing (y :: b))))
+                                              (sX :: Sing (x :: a)) } }) })))
+          sA_0123456789876543210
+    sFoo3 (SJust (sX :: Sing x)) = sX :: Sing (x :: a)
+    sFoo2 (SJust (sX :: Sing x))
+      = case SJust (sX :: Sing x) of {
+          (_ :: Sing ('Just x :: Maybe a)) -> sX :: Sing (x :: a) }
+    sFoo1 (SJust (sX :: Sing x))
+      = case SJust (sX :: Sing x) of {
+          (_ :: Sing ('Just x :: Maybe a)) -> sX :: Sing (x :: a) }
+    sG (sX :: Sing x)
+      = let
+          sScrutinee_0123456789876543210 ::
+            Sing @_ (Let0123456789876543210Scrutinee_0123456789876543210Sym1 x)
+          sScrutinee_0123456789876543210
+            = (applySing ((singFun1 @JustSym0) SJust)) sX
+        in
+          (id
+             @(Sing (Case_0123456789876543210 x (Let0123456789876543210Scrutinee_0123456789876543210Sym1 x))))
+            (case sScrutinee_0123456789876543210 of {
+               SJust (sY :: Sing y)
+                 -> case SJust (sY :: Sing y) of {
+                      (_ :: Sing ('Just y :: Maybe Bool)) -> sY :: Sing (y :: Bool) } })
+    sF3 (SJust (sA :: Sing a))
+      = case SJust (sA :: Sing a) of {
+          (_ :: Sing ('Just a :: Maybe Bool)) -> sing :: Sing "hi" }
+    sF2 (sX :: Sing x)
+      = case sX :: Sing x of {
+          (_ :: Sing (x :: Maybe a)) -> sX :: Sing (x :: Maybe a) }
+    sF1 (sX :: Sing x)
+      = case sX :: Sing x of {
+          (_ :: Sing (x :: Maybe Bool)) -> sX :: Sing (x :: Maybe Bool) }
+    instance SingI (Foo9Sym0 :: (~>) a a) where
+      sing = (singFun1 @Foo9Sym0) sFoo9
+    instance SingI (Foo8Sym0 :: (~>) (Maybe a) (Maybe a)) where
+      sing = (singFun1 @Foo8Sym0) sFoo8
+    instance SingI (Foo7Sym0 :: (~>) a ((~>) b a)) where
+      sing = (singFun2 @Foo7Sym0) sFoo7
+    instance SingI d => SingI (Foo7Sym1 (d :: a) :: (~>) b a) where
+      sing = (singFun1 @(Foo7Sym1 (d :: a))) (sFoo7 (sing @d))
+    instance SingI (Foo6Sym0 :: (~>) (Maybe (Maybe a)) (Maybe (Maybe a))) where
+      sing = (singFun1 @Foo6Sym0) sFoo6
+    instance SingI (Foo5Sym0 :: (~>) (Maybe (Maybe a)) (Maybe (Maybe a))) where
+      sing = (singFun1 @Foo5Sym0) sFoo5
+    instance SingI (Foo4Sym0 :: (~>) (a, b) (b, a)) where
+      sing = (singFun1 @Foo4Sym0) sFoo4
+    instance SingI (Foo3Sym0 :: (~>) (Maybe a) a) where
+      sing = (singFun1 @Foo3Sym0) sFoo3
+    instance SingI (Foo2Sym0 :: (~>) (Maybe a) a) where
+      sing = (singFun1 @Foo2Sym0) sFoo2
+    instance SingI (Foo1Sym0 :: (~>) (Maybe a) a) where
+      sing = (singFun1 @Foo1Sym0) sFoo1
+    instance SingI GSym0 where
+      sing = (singFun1 @GSym0) sG
+    instance SingI F3Sym0 where
+      sing = (singFun1 @F3Sym0) sF3
+    instance SingI F2Sym0 where
+      sing = (singFun1 @F2Sym0) sF2
+    instance SingI F1Sym0 where
+      sing = (singFun1 @F1Sym0) sF1
diff --git a/tests/compile-and-dump/Singletons/T183.hs b/tests/compile-and-dump/Singletons/T183.hs
--- a/tests/compile-and-dump/Singletons/T183.hs
+++ b/tests/compile-and-dump/Singletons/T183.hs
@@ -51,7 +51,7 @@
 
   foo8 :: forall a. Maybe a -> Maybe a
   foo8 x@(Just (_ :: a) :: Maybe a) = x
-  -- foo8 x@(Nothing :: Maybe a)       = x -- #296
+  foo8 x@(Nothing :: Maybe a)       = x
 
   -----
   -- Type variable scoping (vis-à-vis #297)
diff --git a/tests/compile-and-dump/Singletons/T184.ghc88.template b/tests/compile-and-dump/Singletons/T184.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T184.ghc88.template
+++ /dev/null
@@ -1,500 +0,0 @@
-Singletons/T184.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| boogie :: Maybe a -> Maybe Bool -> Maybe a
-          boogie ma mb
-            = do a <- ma
-                 b <- mb
-                 guard b
-                 return a
-          zip' :: [a] -> [b] -> [(a, b)]
-          zip' xs ys = [(x, y) | x <- xs |  y <- ys]
-          cartProd :: [a] -> [b] -> [(a, b)]
-          cartProd xs ys = [(x, y) | x <- xs, y <- ys]
-          trues :: [Bool] -> [Bool]
-          trues xs = [x | x <- xs, x] |]
-  ======>
-    boogie :: Maybe a -> Maybe Bool -> Maybe a
-    boogie ma mb
-      = do a <- ma
-           b <- mb
-           guard b
-           return a
-    zip' :: [a] -> [b] -> [(a, b)]
-    zip' xs ys = [(x, y) | x <- xs |  y <- ys]
-    cartProd :: [a] -> [b] -> [(a, b)]
-    cartProd xs ys = [(x, y) | x <- xs, y <- ys]
-    trues :: [Bool] -> [Bool]
-    trues xs = [x | x <- xs, x]
-    type family Lambda_0123456789876543210 xs t where
-      Lambda_0123456789876543210 xs x = Apply (Apply (>>@#@$) (Apply GuardSym0 x)) (Apply ReturnSym0 x)
-    type Lambda_0123456789876543210Sym2 xs0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 xs0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 xs0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 xs0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall xs0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) arg) (Lambda_0123456789876543210Sym2 xs0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 xs0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 xs0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 xs0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall xs0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 xs0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 xs0123456789876543210 = Lambda_0123456789876543210Sym1 xs0123456789876543210
-    type family Lambda_0123456789876543210 x xs ys t where
-      Lambda_0123456789876543210 x xs ys y = Apply ReturnSym0 (Apply (Apply Tuple2Sym0 x) y)
-    type Lambda_0123456789876543210Sym4 x0123456789876543210 xs0123456789876543210 ys0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 x0123456789876543210 xs0123456789876543210 ys0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 ys0123456789876543210 xs0123456789876543210 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
-    data Lambda_0123456789876543210Sym3 x0123456789876543210 xs0123456789876543210 ys0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym3KindInference :: forall x0123456789876543210
-                                                              xs0123456789876543210
-                                                              ys0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym3 x0123456789876543210 xs0123456789876543210 ys0123456789876543210) arg) (Lambda_0123456789876543210Sym4 x0123456789876543210 xs0123456789876543210 ys0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym3 x0123456789876543210 xs0123456789876543210 ys0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym3 ys0123456789876543210 xs0123456789876543210 x0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 ys0123456789876543210 xs0123456789876543210 x0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 xs0123456789876543210 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 x0123456789876543210 xs0123456789876543210 ys0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall x0123456789876543210
-                                                              xs0123456789876543210
-                                                              ys0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 xs0123456789876543210) arg) (Lambda_0123456789876543210Sym3 x0123456789876543210 xs0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 x0123456789876543210 xs0123456789876543210 ys0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 xs0123456789876543210 x0123456789876543210) ys0123456789876543210 = Lambda_0123456789876543210Sym3 xs0123456789876543210 x0123456789876543210 ys0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 x0123456789876543210 xs0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall x0123456789876543210
-                                                              xs0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 xs0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) xs0123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 xs0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 x0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall x0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
-    type family Lambda_0123456789876543210 xs ys t where
-      Lambda_0123456789876543210 xs ys x = Apply (Apply (>>=@#@$) ys) (Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) xs) ys)
-    type Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 xs0123456789876543210 ys0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 ys0123456789876543210 xs0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall xs0123456789876543210
-                                                              ys0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210) arg) (Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 ys0123456789876543210 xs0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 ys0123456789876543210 xs0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 xs0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 xs0123456789876543210 ys0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall xs0123456789876543210
-                                                              ys0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) arg) (Lambda_0123456789876543210Sym2 xs0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 xs0123456789876543210 ys0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) ys0123456789876543210 = Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 xs0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall xs0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 xs0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 xs0123456789876543210 = Lambda_0123456789876543210Sym1 xs0123456789876543210
-    type family Lambda_0123456789876543210 xs ys t where
-      Lambda_0123456789876543210 xs ys x = Apply ReturnSym0 x
-    type Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 xs0123456789876543210 ys0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 ys0123456789876543210 xs0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall xs0123456789876543210
-                                                              ys0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210) arg) (Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 ys0123456789876543210 xs0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 ys0123456789876543210 xs0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 xs0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 xs0123456789876543210 ys0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall xs0123456789876543210
-                                                              ys0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) arg) (Lambda_0123456789876543210Sym2 xs0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 xs0123456789876543210 ys0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) ys0123456789876543210 = Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 xs0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall xs0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 xs0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 xs0123456789876543210 = Lambda_0123456789876543210Sym1 xs0123456789876543210
-    type family Lambda_0123456789876543210 xs ys t where
-      Lambda_0123456789876543210 xs ys y = Apply ReturnSym0 y
-    type Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 xs0123456789876543210 ys0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 ys0123456789876543210 xs0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall xs0123456789876543210
-                                                              ys0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210) arg) (Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 ys0123456789876543210 xs0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 ys0123456789876543210 xs0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 xs0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 xs0123456789876543210 ys0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall xs0123456789876543210
-                                                              ys0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) arg) (Lambda_0123456789876543210Sym2 xs0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 xs0123456789876543210 ys0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) ys0123456789876543210 = Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 xs0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall xs0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 xs0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 xs0123456789876543210 = Lambda_0123456789876543210Sym1 xs0123456789876543210
-    type family Case_0123456789876543210 arg_0123456789876543210 xs ys t where
-      Case_0123456789876543210 arg_0123456789876543210 xs ys '(x,
-                                                               y) = Apply ReturnSym0 (Apply (Apply Tuple2Sym0 x) y)
-    type family Lambda_0123456789876543210 xs ys t where
-      Lambda_0123456789876543210 xs ys arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 xs ys arg_0123456789876543210
-    type Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 xs0123456789876543210 ys0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 ys0123456789876543210 xs0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall xs0123456789876543210
-                                                              ys0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210) arg) (Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 ys0123456789876543210 xs0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 ys0123456789876543210 xs0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 xs0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 xs0123456789876543210 ys0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall xs0123456789876543210
-                                                              ys0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) arg) (Lambda_0123456789876543210Sym2 xs0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 xs0123456789876543210 ys0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) ys0123456789876543210 = Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 xs0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall xs0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 xs0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 xs0123456789876543210 = Lambda_0123456789876543210Sym1 xs0123456789876543210
-    type family Lambda_0123456789876543210 a ma mb t where
-      Lambda_0123456789876543210 a ma mb b = Apply (Apply (>>@#@$) (Apply GuardSym0 b)) (Apply ReturnSym0 a)
-    type Lambda_0123456789876543210Sym4 a0123456789876543210 ma0123456789876543210 mb0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 a0123456789876543210 ma0123456789876543210 mb0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 mb0123456789876543210 ma0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
-    data Lambda_0123456789876543210Sym3 a0123456789876543210 ma0123456789876543210 mb0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym3KindInference :: forall a0123456789876543210
-                                                              ma0123456789876543210
-                                                              mb0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym3 a0123456789876543210 ma0123456789876543210 mb0123456789876543210) arg) (Lambda_0123456789876543210Sym4 a0123456789876543210 ma0123456789876543210 mb0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym3 a0123456789876543210 ma0123456789876543210 mb0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym3 mb0123456789876543210 ma0123456789876543210 a0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 mb0123456789876543210 ma0123456789876543210 a0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 ma0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 a0123456789876543210 ma0123456789876543210 mb0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                              ma0123456789876543210
-                                                              mb0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 a0123456789876543210 ma0123456789876543210) arg) (Lambda_0123456789876543210Sym3 a0123456789876543210 ma0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 a0123456789876543210 ma0123456789876543210 mb0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 ma0123456789876543210 a0123456789876543210) mb0123456789876543210 = Lambda_0123456789876543210Sym3 ma0123456789876543210 a0123456789876543210 mb0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 a0123456789876543210 ma0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                              ma0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 a0123456789876543210) arg) (Lambda_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 a0123456789876543210 ma0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 a0123456789876543210) ma0123456789876543210 = Lambda_0123456789876543210Sym2 a0123456789876543210 ma0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 a0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 a0123456789876543210 = Lambda_0123456789876543210Sym1 a0123456789876543210
-    type family Lambda_0123456789876543210 ma mb t where
-      Lambda_0123456789876543210 ma mb a = Apply (Apply (>>=@#@$) mb) (Apply (Apply (Apply Lambda_0123456789876543210Sym0 a) ma) mb)
-    type Lambda_0123456789876543210Sym3 ma0123456789876543210 mb0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 ma0123456789876543210 mb0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 mb0123456789876543210 ma0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 ma0123456789876543210 mb0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall ma0123456789876543210
-                                                              mb0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 ma0123456789876543210 mb0123456789876543210) arg) (Lambda_0123456789876543210Sym3 ma0123456789876543210 mb0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 ma0123456789876543210 mb0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 mb0123456789876543210 ma0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 mb0123456789876543210 ma0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 ma0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 ma0123456789876543210 mb0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall ma0123456789876543210
-                                                              mb0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 ma0123456789876543210) arg) (Lambda_0123456789876543210Sym2 ma0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 ma0123456789876543210 mb0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 ma0123456789876543210) mb0123456789876543210 = Lambda_0123456789876543210Sym2 ma0123456789876543210 mb0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 ma0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall ma0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 ma0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 ma0123456789876543210 = Lambda_0123456789876543210Sym1 ma0123456789876543210
-    type TruesSym1 (a0123456789876543210 :: [Bool]) =
-        Trues a0123456789876543210
-    instance SuppressUnusedWarnings TruesSym0 where
-      suppressUnusedWarnings = snd (((,) TruesSym0KindInference) ())
-    data TruesSym0 :: (~>) [Bool] [Bool]
-      where
-        TruesSym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply TruesSym0 arg) (TruesSym1 arg) =>
-                                  TruesSym0 a0123456789876543210
-    type instance Apply TruesSym0 a0123456789876543210 = Trues a0123456789876543210
-    type CartProdSym2 (a0123456789876543210 :: [a0123456789876543210]) (a0123456789876543210 :: [b0123456789876543210]) =
-        CartProd a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (CartProdSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) CartProdSym1KindInference) ())
-    data CartProdSym1 (a0123456789876543210 :: [a0123456789876543210]) :: forall b0123456789876543210.
-                                                                          (~>) [b0123456789876543210] [(a0123456789876543210,
-                                                                                                        b0123456789876543210)]
-      where
-        CartProdSym1KindInference :: forall a0123456789876543210
-                                            a0123456789876543210
-                                            arg. SameKind (Apply (CartProdSym1 a0123456789876543210) arg) (CartProdSym2 a0123456789876543210 arg) =>
-                                     CartProdSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (CartProdSym1 a0123456789876543210) a0123456789876543210 = CartProd a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings CartProdSym0 where
-      suppressUnusedWarnings = snd (((,) CartProdSym0KindInference) ())
-    data CartProdSym0 :: forall a0123456789876543210
-                                b0123456789876543210.
-                         (~>) [a0123456789876543210] ((~>) [b0123456789876543210] [(a0123456789876543210,
-                                                                                    b0123456789876543210)])
-      where
-        CartProdSym0KindInference :: forall a0123456789876543210
-                                            arg. SameKind (Apply CartProdSym0 arg) (CartProdSym1 arg) =>
-                                     CartProdSym0 a0123456789876543210
-    type instance Apply CartProdSym0 a0123456789876543210 = CartProdSym1 a0123456789876543210
-    type Zip'Sym2 (a0123456789876543210 :: [a0123456789876543210]) (a0123456789876543210 :: [b0123456789876543210]) =
-        Zip' a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Zip'Sym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) Zip'Sym1KindInference) ())
-    data Zip'Sym1 (a0123456789876543210 :: [a0123456789876543210]) :: forall b0123456789876543210.
-                                                                      (~>) [b0123456789876543210] [(a0123456789876543210,
-                                                                                                    b0123456789876543210)]
-      where
-        Zip'Sym1KindInference :: forall a0123456789876543210
-                                        a0123456789876543210
-                                        arg. SameKind (Apply (Zip'Sym1 a0123456789876543210) arg) (Zip'Sym2 a0123456789876543210 arg) =>
-                                 Zip'Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Zip'Sym1 a0123456789876543210) a0123456789876543210 = Zip' a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Zip'Sym0 where
-      suppressUnusedWarnings = snd (((,) Zip'Sym0KindInference) ())
-    data Zip'Sym0 :: forall a0123456789876543210 b0123456789876543210.
-                     (~>) [a0123456789876543210] ((~>) [b0123456789876543210] [(a0123456789876543210,
-                                                                                b0123456789876543210)])
-      where
-        Zip'Sym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply Zip'Sym0 arg) (Zip'Sym1 arg) =>
-                                 Zip'Sym0 a0123456789876543210
-    type instance Apply Zip'Sym0 a0123456789876543210 = Zip'Sym1 a0123456789876543210
-    type BoogieSym2 (a0123456789876543210 :: Maybe a0123456789876543210) (a0123456789876543210 :: Maybe Bool) =
-        Boogie a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (BoogieSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) BoogieSym1KindInference) ())
-    data BoogieSym1 (a0123456789876543210 :: Maybe a0123456789876543210) :: (~>) (Maybe Bool) (Maybe a0123456789876543210)
-      where
-        BoogieSym1KindInference :: forall a0123456789876543210
-                                          a0123456789876543210
-                                          arg. SameKind (Apply (BoogieSym1 a0123456789876543210) arg) (BoogieSym2 a0123456789876543210 arg) =>
-                                   BoogieSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (BoogieSym1 a0123456789876543210) a0123456789876543210 = Boogie a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings BoogieSym0 where
-      suppressUnusedWarnings = snd (((,) BoogieSym0KindInference) ())
-    data BoogieSym0 :: forall a0123456789876543210.
-                       (~>) (Maybe a0123456789876543210) ((~>) (Maybe Bool) (Maybe a0123456789876543210))
-      where
-        BoogieSym0KindInference :: forall a0123456789876543210
-                                          arg. SameKind (Apply BoogieSym0 arg) (BoogieSym1 arg) =>
-                                   BoogieSym0 a0123456789876543210
-    type instance Apply BoogieSym0 a0123456789876543210 = BoogieSym1 a0123456789876543210
-    type family Trues (a :: [Bool]) :: [Bool] where
-      Trues xs = Apply (Apply (>>=@#@$) xs) (Apply Lambda_0123456789876543210Sym0 xs)
-    type family CartProd (a :: [a]) (a :: [b]) :: [(a, b)] where
-      CartProd xs ys = Apply (Apply (>>=@#@$) xs) (Apply (Apply Lambda_0123456789876543210Sym0 xs) ys)
-    type family Zip' (a :: [a]) (a :: [b]) :: [(a, b)] where
-      Zip' xs ys = Apply (Apply (>>=@#@$) (Apply (Apply MzipSym0 (Apply (Apply (>>=@#@$) xs) (Apply (Apply Lambda_0123456789876543210Sym0 xs) ys))) (Apply (Apply (>>=@#@$) ys) (Apply (Apply Lambda_0123456789876543210Sym0 xs) ys)))) (Apply (Apply Lambda_0123456789876543210Sym0 xs) ys)
-    type family Boogie (a :: Maybe a) (a :: Maybe Bool) :: Maybe a where
-      Boogie ma mb = Apply (Apply (>>=@#@$) ma) (Apply (Apply Lambda_0123456789876543210Sym0 ma) mb)
-    sTrues ::
-      forall (t :: [Bool]). Sing t -> Sing (Apply TruesSym0 t :: [Bool])
-    sCartProd ::
-      forall a b (t :: [a]) (t :: [b]).
-      Sing t
-      -> Sing t -> Sing (Apply (Apply CartProdSym0 t) t :: [(a, b)])
-    sZip' ::
-      forall a b (t :: [a]) (t :: [b]).
-      Sing t -> Sing t -> Sing (Apply (Apply Zip'Sym0 t) t :: [(a, b)])
-    sBoogie ::
-      forall a (t :: Maybe a) (t :: Maybe Bool).
-      Sing t -> Sing t -> Sing (Apply (Apply BoogieSym0 t) t :: Maybe a)
-    sTrues (sXs :: Sing xs)
-      = (applySing ((applySing ((singFun2 @(>>=@#@$)) (%>>=))) sXs))
-          ((singFun1 @(Apply Lambda_0123456789876543210Sym0 xs))
-             (\ sX
-                -> case sX of {
-                     (_ :: Sing x)
-                       -> (applySing
-                             ((applySing ((singFun2 @(>>@#@$)) (%>>)))
-                                ((applySing ((singFun1 @GuardSym0) sGuard)) sX)))
-                            ((applySing ((singFun1 @ReturnSym0) sReturn)) sX) }))
-    sCartProd (sXs :: Sing xs) (sYs :: Sing ys)
-      = (applySing ((applySing ((singFun2 @(>>=@#@$)) (%>>=))) sXs))
-          ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 xs) ys))
-             (\ sX
-                -> case sX of {
-                     (_ :: Sing x)
-                       -> (applySing ((applySing ((singFun2 @(>>=@#@$)) (%>>=))) sYs))
-                            ((singFun1
-                                @(Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) xs) ys))
-                               (\ sY
-                                  -> case sY of {
-                                       (_ :: Sing y)
-                                         -> (applySing ((singFun1 @ReturnSym0) sReturn))
-                                              ((applySing
-                                                  ((applySing ((singFun2 @Tuple2Sym0) STuple2)) sX))
-                                                 sY) })) }))
-    sZip' (sXs :: Sing xs) (sYs :: Sing ys)
-      = (applySing
-           ((applySing ((singFun2 @(>>=@#@$)) (%>>=)))
-              ((applySing
-                  ((applySing ((singFun2 @MzipSym0) sMzip))
-                     ((applySing ((applySing ((singFun2 @(>>=@#@$)) (%>>=))) sXs))
-                        ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 xs) ys))
-                           (\ sX
-                              -> case sX of {
-                                   (_ :: Sing x)
-                                     -> (applySing ((singFun1 @ReturnSym0) sReturn)) sX })))))
-                 ((applySing ((applySing ((singFun2 @(>>=@#@$)) (%>>=))) sYs))
-                    ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 xs) ys))
-                       (\ sY
-                          -> case sY of {
-                               (_ :: Sing y)
-                                 -> (applySing ((singFun1 @ReturnSym0) sReturn)) sY }))))))
-          ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 xs) ys))
-             (\ sArg_0123456789876543210
-                -> case sArg_0123456789876543210 of {
-                     (_ :: Sing arg_0123456789876543210)
-                       -> (id
-                             @(Sing (Case_0123456789876543210 arg_0123456789876543210 xs ys arg_0123456789876543210)))
-                            (case sArg_0123456789876543210 of {
-                               STuple2 (sX :: Sing x) (sY :: Sing y)
-                                 -> (applySing ((singFun1 @ReturnSym0) sReturn))
-                                      ((applySing ((applySing ((singFun2 @Tuple2Sym0) STuple2)) sX))
-                                         sY) }) }))
-    sBoogie (sMa :: Sing ma) (sMb :: Sing mb)
-      = (applySing ((applySing ((singFun2 @(>>=@#@$)) (%>>=))) sMa))
-          ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 ma) mb))
-             (\ sA
-                -> case sA of {
-                     (_ :: Sing a)
-                       -> (applySing ((applySing ((singFun2 @(>>=@#@$)) (%>>=))) sMb))
-                            ((singFun1
-                                @(Apply (Apply (Apply Lambda_0123456789876543210Sym0 a) ma) mb))
-                               (\ sB
-                                  -> case sB of {
-                                       (_ :: Sing b)
-                                         -> (applySing
-                                               ((applySing ((singFun2 @(>>@#@$)) (%>>)))
-                                                  ((applySing ((singFun1 @GuardSym0) sGuard)) sB)))
-                                              ((applySing ((singFun1 @ReturnSym0) sReturn))
-                                                 sA) })) }))
-    instance SingI (TruesSym0 :: (~>) [Bool] [Bool]) where
-      sing = (singFun1 @TruesSym0) sTrues
-    instance SingI (CartProdSym0 :: (~>) [a] ((~>) [b] [(a, b)])) where
-      sing = (singFun2 @CartProdSym0) sCartProd
-    instance SingI d =>
-             SingI (CartProdSym1 (d :: [a]) :: (~>) [b] [(a, b)]) where
-      sing = (singFun1 @(CartProdSym1 (d :: [a]))) (sCartProd (sing @d))
-    instance SingI (Zip'Sym0 :: (~>) [a] ((~>) [b] [(a, b)])) where
-      sing = (singFun2 @Zip'Sym0) sZip'
-    instance SingI d =>
-             SingI (Zip'Sym1 (d :: [a]) :: (~>) [b] [(a, b)]) where
-      sing = (singFun1 @(Zip'Sym1 (d :: [a]))) (sZip' (sing @d))
-    instance SingI (BoogieSym0 :: (~>) (Maybe a) ((~>) (Maybe Bool) (Maybe a))) where
-      sing = (singFun2 @BoogieSym0) sBoogie
-    instance SingI d =>
-             SingI (BoogieSym1 (d :: Maybe a) :: (~>) (Maybe Bool) (Maybe a)) where
-      sing = (singFun1 @(BoogieSym1 (d :: Maybe a))) (sBoogie (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T184.golden b/tests/compile-and-dump/Singletons/T184.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T184.golden
@@ -0,0 +1,438 @@
+Singletons/T184.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| boogie :: Maybe a -> Maybe Bool -> Maybe a
+          boogie ma mb
+            = do a <- ma
+                 b <- mb
+                 guard b
+                 return a
+          zip' :: [a] -> [b] -> [(a, b)]
+          zip' xs ys = [(x, y) | x <- xs |  y <- ys]
+          cartProd :: [a] -> [b] -> [(a, b)]
+          cartProd xs ys = [(x, y) | x <- xs, y <- ys]
+          trues :: [Bool] -> [Bool]
+          trues xs = [x | x <- xs, x] |]
+  ======>
+    boogie :: Maybe a -> Maybe Bool -> Maybe a
+    boogie ma mb
+      = do a <- ma
+           b <- mb
+           guard b
+           return a
+    zip' :: [a] -> [b] -> [(a, b)]
+    zip' xs ys = [(x, y) | x <- xs |  y <- ys]
+    cartProd :: [a] -> [b] -> [(a, b)]
+    cartProd xs ys = [(x, y) | x <- xs, y <- ys]
+    trues :: [Bool] -> [Bool]
+    trues xs = [x | x <- xs, x]
+    type family Lambda_0123456789876543210 xs x where
+      Lambda_0123456789876543210 xs x = Apply (Apply (>>@#@$) (Apply GuardSym0 x)) (Apply ReturnSym0 x)
+    data Lambda_0123456789876543210Sym0 xs0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 xs0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 xs0123456789876543210 = Lambda_0123456789876543210Sym1 xs0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 xs0123456789876543210 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) arg) (Lambda_0123456789876543210Sym2 xs0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 xs0123456789876543210 x0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) x0123456789876543210 = Lambda_0123456789876543210Sym2 xs0123456789876543210 x0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 xs0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    type Lambda_0123456789876543210Sym2 xs0123456789876543210 x0123456789876543210 =
+        Lambda_0123456789876543210 xs0123456789876543210 x0123456789876543210
+    type family Lambda_0123456789876543210 x xs ys y where
+      Lambda_0123456789876543210 x xs ys y = Apply ReturnSym0 (Apply (Apply Tuple2Sym0 x) y)
+    data Lambda_0123456789876543210Sym0 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 x0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 x0123456789876543210 = Lambda_0123456789876543210Sym1 x0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 x0123456789876543210 xs0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) arg) (Lambda_0123456789876543210Sym2 x0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 x0123456789876543210 xs0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 x0123456789876543210) xs0123456789876543210 = Lambda_0123456789876543210Sym2 x0123456789876543210 xs0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 x0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 x0123456789876543210 xs0123456789876543210 ys0123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 xs0123456789876543210) arg) (Lambda_0123456789876543210Sym3 x0123456789876543210 xs0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 x0123456789876543210 xs0123456789876543210 ys0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 x0123456789876543210 xs0123456789876543210) ys0123456789876543210 = Lambda_0123456789876543210Sym3 x0123456789876543210 xs0123456789876543210 ys0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 x0123456789876543210 xs0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    data Lambda_0123456789876543210Sym3 x0123456789876543210 xs0123456789876543210 ys0123456789876543210 y0123456789876543210
+      where
+        Lambda_0123456789876543210Sym3KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym3 x0123456789876543210 xs0123456789876543210 ys0123456789876543210) arg) (Lambda_0123456789876543210Sym4 x0123456789876543210 xs0123456789876543210 ys0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym3 x0123456789876543210 xs0123456789876543210 ys0123456789876543210 y0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym3 x0123456789876543210 xs0123456789876543210 ys0123456789876543210) y0123456789876543210 = Lambda_0123456789876543210Sym4 x0123456789876543210 xs0123456789876543210 ys0123456789876543210 y0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 x0123456789876543210 xs0123456789876543210 ys0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
+    type Lambda_0123456789876543210Sym4 x0123456789876543210 xs0123456789876543210 ys0123456789876543210 y0123456789876543210 =
+        Lambda_0123456789876543210 x0123456789876543210 xs0123456789876543210 ys0123456789876543210 y0123456789876543210
+    type family Lambda_0123456789876543210 xs ys x where
+      Lambda_0123456789876543210 xs ys x = Apply (Apply (>>=@#@$) ys) (Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) xs) ys)
+    data Lambda_0123456789876543210Sym0 xs0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 xs0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 xs0123456789876543210 = Lambda_0123456789876543210Sym1 xs0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 xs0123456789876543210 ys0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) arg) (Lambda_0123456789876543210Sym2 xs0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 xs0123456789876543210 ys0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) ys0123456789876543210 = Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 xs0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210) arg) (Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210 x0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210) x0123456789876543210 = Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 x0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    type Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 x0123456789876543210 =
+        Lambda_0123456789876543210 xs0123456789876543210 ys0123456789876543210 x0123456789876543210
+    type family Lambda_0123456789876543210 xs ys x where
+      Lambda_0123456789876543210 xs ys x = Apply ReturnSym0 x
+    data Lambda_0123456789876543210Sym0 xs0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 xs0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 xs0123456789876543210 = Lambda_0123456789876543210Sym1 xs0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 xs0123456789876543210 ys0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) arg) (Lambda_0123456789876543210Sym2 xs0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 xs0123456789876543210 ys0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) ys0123456789876543210 = Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 xs0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210) arg) (Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210 x0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210) x0123456789876543210 = Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 x0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    type Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 x0123456789876543210 =
+        Lambda_0123456789876543210 xs0123456789876543210 ys0123456789876543210 x0123456789876543210
+    type family Lambda_0123456789876543210 xs ys y where
+      Lambda_0123456789876543210 xs ys y = Apply ReturnSym0 y
+    data Lambda_0123456789876543210Sym0 xs0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 xs0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 xs0123456789876543210 = Lambda_0123456789876543210Sym1 xs0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 xs0123456789876543210 ys0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) arg) (Lambda_0123456789876543210Sym2 xs0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 xs0123456789876543210 ys0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) ys0123456789876543210 = Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 xs0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210 y0123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210) arg) (Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210 y0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210) y0123456789876543210 = Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 y0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    type Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 y0123456789876543210 =
+        Lambda_0123456789876543210 xs0123456789876543210 ys0123456789876543210 y0123456789876543210
+    type family Case_0123456789876543210 arg_0123456789876543210 xs ys t where
+      Case_0123456789876543210 arg_0123456789876543210 xs ys '(x,
+                                                               y) = Apply ReturnSym0 (Apply (Apply Tuple2Sym0 x) y)
+    type family Lambda_0123456789876543210 xs ys arg_0123456789876543210 where
+      Lambda_0123456789876543210 xs ys arg_0123456789876543210 = Case_0123456789876543210 arg_0123456789876543210 xs ys arg_0123456789876543210
+    data Lambda_0123456789876543210Sym0 xs0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 xs0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 xs0123456789876543210 = Lambda_0123456789876543210Sym1 xs0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 xs0123456789876543210 ys0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) arg) (Lambda_0123456789876543210Sym2 xs0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 xs0123456789876543210 ys0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 xs0123456789876543210) ys0123456789876543210 = Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 xs0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210 arg_01234567898765432100123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210) arg) (Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210 arg_01234567898765432100123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210) arg_01234567898765432100123456789876543210 = Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 arg_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 xs0123456789876543210 ys0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    type Lambda_0123456789876543210Sym3 xs0123456789876543210 ys0123456789876543210 arg_01234567898765432100123456789876543210 =
+        Lambda_0123456789876543210 xs0123456789876543210 ys0123456789876543210 arg_01234567898765432100123456789876543210
+    type family Lambda_0123456789876543210 a ma mb b where
+      Lambda_0123456789876543210 a ma mb b = Apply (Apply (>>@#@$) (Apply GuardSym0 b)) (Apply ReturnSym0 a)
+    data Lambda_0123456789876543210Sym0 a0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 a0123456789876543210 = Lambda_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 a0123456789876543210 ma0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 a0123456789876543210) arg) (Lambda_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 a0123456789876543210 ma0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 a0123456789876543210) ma0123456789876543210 = Lambda_0123456789876543210Sym2 a0123456789876543210 ma0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 a0123456789876543210 ma0123456789876543210 mb0123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 a0123456789876543210 ma0123456789876543210) arg) (Lambda_0123456789876543210Sym3 a0123456789876543210 ma0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 a0123456789876543210 ma0123456789876543210 mb0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 a0123456789876543210 ma0123456789876543210) mb0123456789876543210 = Lambda_0123456789876543210Sym3 a0123456789876543210 ma0123456789876543210 mb0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 a0123456789876543210 ma0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    data Lambda_0123456789876543210Sym3 a0123456789876543210 ma0123456789876543210 mb0123456789876543210 b0123456789876543210
+      where
+        Lambda_0123456789876543210Sym3KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym3 a0123456789876543210 ma0123456789876543210 mb0123456789876543210) arg) (Lambda_0123456789876543210Sym4 a0123456789876543210 ma0123456789876543210 mb0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym3 a0123456789876543210 ma0123456789876543210 mb0123456789876543210 b0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym3 a0123456789876543210 ma0123456789876543210 mb0123456789876543210) b0123456789876543210 = Lambda_0123456789876543210Sym4 a0123456789876543210 ma0123456789876543210 mb0123456789876543210 b0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym3 a0123456789876543210 ma0123456789876543210 mb0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym3KindInference) ())
+    type Lambda_0123456789876543210Sym4 a0123456789876543210 ma0123456789876543210 mb0123456789876543210 b0123456789876543210 =
+        Lambda_0123456789876543210 a0123456789876543210 ma0123456789876543210 mb0123456789876543210 b0123456789876543210
+    type family Lambda_0123456789876543210 ma mb a where
+      Lambda_0123456789876543210 ma mb a = Apply (Apply (>>=@#@$) mb) (Apply (Apply (Apply Lambda_0123456789876543210Sym0 a) ma) mb)
+    data Lambda_0123456789876543210Sym0 ma0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 ma0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 ma0123456789876543210 = Lambda_0123456789876543210Sym1 ma0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 ma0123456789876543210 mb0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 ma0123456789876543210) arg) (Lambda_0123456789876543210Sym2 ma0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 ma0123456789876543210 mb0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 ma0123456789876543210) mb0123456789876543210 = Lambda_0123456789876543210Sym2 ma0123456789876543210 mb0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 ma0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 ma0123456789876543210 mb0123456789876543210 a0123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 ma0123456789876543210 mb0123456789876543210) arg) (Lambda_0123456789876543210Sym3 ma0123456789876543210 mb0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 ma0123456789876543210 mb0123456789876543210 a0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 ma0123456789876543210 mb0123456789876543210) a0123456789876543210 = Lambda_0123456789876543210Sym3 ma0123456789876543210 mb0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 ma0123456789876543210 mb0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    type Lambda_0123456789876543210Sym3 ma0123456789876543210 mb0123456789876543210 a0123456789876543210 =
+        Lambda_0123456789876543210 ma0123456789876543210 mb0123456789876543210 a0123456789876543210
+    type TruesSym0 :: (~>) [Bool] [Bool]
+    data TruesSym0 a0123456789876543210
+      where
+        TruesSym0KindInference :: SameKind (Apply TruesSym0 arg) (TruesSym1 arg) =>
+                                  TruesSym0 a0123456789876543210
+    type instance Apply TruesSym0 a0123456789876543210 = TruesSym1 a0123456789876543210
+    instance SuppressUnusedWarnings TruesSym0 where
+      suppressUnusedWarnings = snd (((,) TruesSym0KindInference) ())
+    type TruesSym1 (a0123456789876543210 :: [Bool]) =
+        Trues a0123456789876543210 :: [Bool]
+    type CartProdSym0 :: (~>) [a] ((~>) [b] [(a, b)])
+    data CartProdSym0 a0123456789876543210
+      where
+        CartProdSym0KindInference :: SameKind (Apply CartProdSym0 arg) (CartProdSym1 arg) =>
+                                     CartProdSym0 a0123456789876543210
+    type instance Apply CartProdSym0 a0123456789876543210 = CartProdSym1 a0123456789876543210
+    instance SuppressUnusedWarnings CartProdSym0 where
+      suppressUnusedWarnings = snd (((,) CartProdSym0KindInference) ())
+    type CartProdSym1 :: [a] -> (~>) [b] [(a, b)]
+    data CartProdSym1 a0123456789876543210 a0123456789876543210
+      where
+        CartProdSym1KindInference :: SameKind (Apply (CartProdSym1 a0123456789876543210) arg) (CartProdSym2 a0123456789876543210 arg) =>
+                                     CartProdSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (CartProdSym1 a0123456789876543210) a0123456789876543210 = CartProdSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (CartProdSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) CartProdSym1KindInference) ())
+    type CartProdSym2 (a0123456789876543210 :: [a]) (a0123456789876543210 :: [b]) =
+        CartProd a0123456789876543210 a0123456789876543210 :: [(a, b)]
+    type Zip'Sym0 :: (~>) [a] ((~>) [b] [(a, b)])
+    data Zip'Sym0 a0123456789876543210
+      where
+        Zip'Sym0KindInference :: SameKind (Apply Zip'Sym0 arg) (Zip'Sym1 arg) =>
+                                 Zip'Sym0 a0123456789876543210
+    type instance Apply Zip'Sym0 a0123456789876543210 = Zip'Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Zip'Sym0 where
+      suppressUnusedWarnings = snd (((,) Zip'Sym0KindInference) ())
+    type Zip'Sym1 :: [a] -> (~>) [b] [(a, b)]
+    data Zip'Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Zip'Sym1KindInference :: SameKind (Apply (Zip'Sym1 a0123456789876543210) arg) (Zip'Sym2 a0123456789876543210 arg) =>
+                                 Zip'Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Zip'Sym1 a0123456789876543210) a0123456789876543210 = Zip'Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Zip'Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) Zip'Sym1KindInference) ())
+    type Zip'Sym2 (a0123456789876543210 :: [a]) (a0123456789876543210 :: [b]) =
+        Zip' a0123456789876543210 a0123456789876543210 :: [(a, b)]
+    type BoogieSym0 :: (~>) (Maybe a) ((~>) (Maybe Bool) (Maybe a))
+    data BoogieSym0 a0123456789876543210
+      where
+        BoogieSym0KindInference :: SameKind (Apply BoogieSym0 arg) (BoogieSym1 arg) =>
+                                   BoogieSym0 a0123456789876543210
+    type instance Apply BoogieSym0 a0123456789876543210 = BoogieSym1 a0123456789876543210
+    instance SuppressUnusedWarnings BoogieSym0 where
+      suppressUnusedWarnings = snd (((,) BoogieSym0KindInference) ())
+    type BoogieSym1 :: Maybe a -> (~>) (Maybe Bool) (Maybe a)
+    data BoogieSym1 a0123456789876543210 a0123456789876543210
+      where
+        BoogieSym1KindInference :: SameKind (Apply (BoogieSym1 a0123456789876543210) arg) (BoogieSym2 a0123456789876543210 arg) =>
+                                   BoogieSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (BoogieSym1 a0123456789876543210) a0123456789876543210 = BoogieSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (BoogieSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) BoogieSym1KindInference) ())
+    type BoogieSym2 (a0123456789876543210 :: Maybe a) (a0123456789876543210 :: Maybe Bool) =
+        Boogie a0123456789876543210 a0123456789876543210 :: Maybe a
+    type Trues :: [Bool] -> [Bool]
+    type family Trues a where
+      Trues xs = Apply (Apply (>>=@#@$) xs) (Apply Lambda_0123456789876543210Sym0 xs)
+    type CartProd :: [a] -> [b] -> [(a, b)]
+    type family CartProd a a where
+      CartProd xs ys = Apply (Apply (>>=@#@$) xs) (Apply (Apply Lambda_0123456789876543210Sym0 xs) ys)
+    type Zip' :: [a] -> [b] -> [(a, b)]
+    type family Zip' a a where
+      Zip' xs ys = Apply (Apply (>>=@#@$) (Apply (Apply MzipSym0 (Apply (Apply (>>=@#@$) xs) (Apply (Apply Lambda_0123456789876543210Sym0 xs) ys))) (Apply (Apply (>>=@#@$) ys) (Apply (Apply Lambda_0123456789876543210Sym0 xs) ys)))) (Apply (Apply Lambda_0123456789876543210Sym0 xs) ys)
+    type Boogie :: Maybe a -> Maybe Bool -> Maybe a
+    type family Boogie a a where
+      Boogie ma mb = Apply (Apply (>>=@#@$) ma) (Apply (Apply Lambda_0123456789876543210Sym0 ma) mb)
+    sTrues ::
+      forall (t :: [Bool]). Sing t -> Sing (Apply TruesSym0 t :: [Bool])
+    sCartProd ::
+      forall a b (t :: [a]) (t :: [b]).
+      Sing t
+      -> Sing t -> Sing (Apply (Apply CartProdSym0 t) t :: [(a, b)])
+    sZip' ::
+      forall a b (t :: [a]) (t :: [b]).
+      Sing t -> Sing t -> Sing (Apply (Apply Zip'Sym0 t) t :: [(a, b)])
+    sBoogie ::
+      forall a (t :: Maybe a) (t :: Maybe Bool).
+      Sing t -> Sing t -> Sing (Apply (Apply BoogieSym0 t) t :: Maybe a)
+    sTrues (sXs :: Sing xs)
+      = (applySing ((applySing ((singFun2 @(>>=@#@$)) (%>>=))) sXs))
+          ((singFun1 @(Apply Lambda_0123456789876543210Sym0 xs))
+             (\ sX
+                -> case sX of {
+                     (_ :: Sing x)
+                       -> (applySing
+                             ((applySing ((singFun2 @(>>@#@$)) (%>>)))
+                                ((applySing ((singFun1 @GuardSym0) sGuard)) sX)))
+                            ((applySing ((singFun1 @ReturnSym0) sReturn)) sX) }))
+    sCartProd (sXs :: Sing xs) (sYs :: Sing ys)
+      = (applySing ((applySing ((singFun2 @(>>=@#@$)) (%>>=))) sXs))
+          ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 xs) ys))
+             (\ sX
+                -> case sX of {
+                     (_ :: Sing x)
+                       -> (applySing ((applySing ((singFun2 @(>>=@#@$)) (%>>=))) sYs))
+                            ((singFun1
+                                @(Apply (Apply (Apply Lambda_0123456789876543210Sym0 x) xs) ys))
+                               (\ sY
+                                  -> case sY of {
+                                       (_ :: Sing y)
+                                         -> (applySing ((singFun1 @ReturnSym0) sReturn))
+                                              ((applySing
+                                                  ((applySing ((singFun2 @Tuple2Sym0) STuple2)) sX))
+                                                 sY) })) }))
+    sZip' (sXs :: Sing xs) (sYs :: Sing ys)
+      = (applySing
+           ((applySing ((singFun2 @(>>=@#@$)) (%>>=)))
+              ((applySing
+                  ((applySing ((singFun2 @MzipSym0) sMzip))
+                     ((applySing ((applySing ((singFun2 @(>>=@#@$)) (%>>=))) sXs))
+                        ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 xs) ys))
+                           (\ sX
+                              -> case sX of {
+                                   (_ :: Sing x)
+                                     -> (applySing ((singFun1 @ReturnSym0) sReturn)) sX })))))
+                 ((applySing ((applySing ((singFun2 @(>>=@#@$)) (%>>=))) sYs))
+                    ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 xs) ys))
+                       (\ sY
+                          -> case sY of {
+                               (_ :: Sing y)
+                                 -> (applySing ((singFun1 @ReturnSym0) sReturn)) sY }))))))
+          ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 xs) ys))
+             (\ sArg_0123456789876543210
+                -> case sArg_0123456789876543210 of {
+                     (_ :: Sing arg_0123456789876543210)
+                       -> (id
+                             @(Sing (Case_0123456789876543210 arg_0123456789876543210 xs ys arg_0123456789876543210)))
+                            (case sArg_0123456789876543210 of {
+                               STuple2 (sX :: Sing x) (sY :: Sing y)
+                                 -> (applySing ((singFun1 @ReturnSym0) sReturn))
+                                      ((applySing ((applySing ((singFun2 @Tuple2Sym0) STuple2)) sX))
+                                         sY) }) }))
+    sBoogie (sMa :: Sing ma) (sMb :: Sing mb)
+      = (applySing ((applySing ((singFun2 @(>>=@#@$)) (%>>=))) sMa))
+          ((singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 ma) mb))
+             (\ sA
+                -> case sA of {
+                     (_ :: Sing a)
+                       -> (applySing ((applySing ((singFun2 @(>>=@#@$)) (%>>=))) sMb))
+                            ((singFun1
+                                @(Apply (Apply (Apply Lambda_0123456789876543210Sym0 a) ma) mb))
+                               (\ sB
+                                  -> case sB of {
+                                       (_ :: Sing b)
+                                         -> (applySing
+                                               ((applySing ((singFun2 @(>>@#@$)) (%>>)))
+                                                  ((applySing ((singFun1 @GuardSym0) sGuard)) sB)))
+                                              ((applySing ((singFun1 @ReturnSym0) sReturn))
+                                                 sA) })) }))
+    instance SingI (TruesSym0 :: (~>) [Bool] [Bool]) where
+      sing = (singFun1 @TruesSym0) sTrues
+    instance SingI (CartProdSym0 :: (~>) [a] ((~>) [b] [(a, b)])) where
+      sing = (singFun2 @CartProdSym0) sCartProd
+    instance SingI d =>
+             SingI (CartProdSym1 (d :: [a]) :: (~>) [b] [(a, b)]) where
+      sing = (singFun1 @(CartProdSym1 (d :: [a]))) (sCartProd (sing @d))
+    instance SingI (Zip'Sym0 :: (~>) [a] ((~>) [b] [(a, b)])) where
+      sing = (singFun2 @Zip'Sym0) sZip'
+    instance SingI d =>
+             SingI (Zip'Sym1 (d :: [a]) :: (~>) [b] [(a, b)]) where
+      sing = (singFun1 @(Zip'Sym1 (d :: [a]))) (sZip' (sing @d))
+    instance SingI (BoogieSym0 :: (~>) (Maybe a) ((~>) (Maybe Bool) (Maybe a))) where
+      sing = (singFun2 @BoogieSym0) sBoogie
+    instance SingI d =>
+             SingI (BoogieSym1 (d :: Maybe a) :: (~>) (Maybe Bool) (Maybe a)) where
+      sing = (singFun1 @(BoogieSym1 (d :: Maybe a))) (sBoogie (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T187.ghc88.template b/tests/compile-and-dump/Singletons/T187.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T187.ghc88.template
+++ /dev/null
@@ -1,65 +0,0 @@
-Singletons/T187.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| data Empty
-          
-          deriving instance Ord Empty
-          deriving instance Eq Empty |]
-  ======>
-    data Empty
-    deriving instance Eq Empty
-    deriving instance Ord Empty
-    type family Compare_0123456789876543210 (a :: Empty) (a :: Empty) :: Ordering where
-      Compare_0123456789876543210 _ _ = EQSym0
-    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Empty) (a0123456789876543210 :: Empty) =
-        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
-    data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Empty) :: (~>) Empty Ordering
-      where
-        Compare_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                               a0123456789876543210
-                                                               arg. SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
-    data Compare_0123456789876543210Sym0 :: (~>) Empty ((~>) Empty Ordering)
-      where
-        Compare_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                               arg. SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
-                                                        Compare_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
-    instance POrd Empty where
-      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
-    type family Equals_0123456789876543210 (a :: Empty) (b :: Empty) :: Bool where
-      Equals_0123456789876543210 (_ :: Empty) (_ :: Empty) = TrueSym0
-    instance PEq Empty where
-      type (==) a b = Equals_0123456789876543210 a b
-    data SEmpty :: Empty -> GHC.Types.Type
-    type instance Sing @Empty = SEmpty
-    instance SingKind Empty where
-      type Demote Empty = Empty
-      fromSing x = case x of
-      toSing x = SomeSing (case x of)
-    instance SOrd Empty where
-      sCompare ::
-        forall (t1 :: Empty) (t2 :: Empty).
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply (CompareSym0 :: TyFun Empty ((~>) Empty Ordering)
-                                                 -> GHC.Types.Type) t1) t2)
-      sCompare _ _ = SEQ
-    instance SEq Empty where
-      (%==) _ _ = STrue
-    instance SDecide Empty where
-      (%~) x _ = Proved (case x of)
-    instance Data.Type.Equality.TestEquality (SEmpty :: Empty
-                                                        -> GHC.Types.Type) where
-      Data.Type.Equality.testEquality
-        = Data.Singletons.Decide.decideEquality
-    instance Data.Type.Coercion.TestCoercion (SEmpty :: Empty
-                                                        -> GHC.Types.Type) where
-      Data.Type.Coercion.testCoercion
-        = Data.Singletons.Decide.decideCoercion
diff --git a/tests/compile-and-dump/Singletons/T187.golden b/tests/compile-and-dump/Singletons/T187.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T187.golden
@@ -0,0 +1,67 @@
+Singletons/T187.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| data Empty
+          
+          deriving instance Ord Empty
+          deriving instance Eq Empty |]
+  ======>
+    data Empty
+    deriving instance Eq Empty
+    deriving instance Ord Empty
+    type Compare_0123456789876543210 :: Empty -> Empty -> Ordering
+    type family Compare_0123456789876543210 a a where
+      Compare_0123456789876543210 _ _ = EQSym0
+    type Compare_0123456789876543210Sym0 :: (~>) Empty ((~>) Empty Ordering)
+    data Compare_0123456789876543210Sym0 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
+                                                        Compare_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
+    type Compare_0123456789876543210Sym1 :: Empty
+                                            -> (~>) Empty Ordering
+    data Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
+    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Empty) (a0123456789876543210 :: Empty) =
+        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    instance POrd Empty where
+      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
+    type Equals_0123456789876543210 :: Empty -> Empty -> Bool
+    type family Equals_0123456789876543210 a b where
+      Equals_0123456789876543210 (_ :: Empty) (_ :: Empty) = TrueSym0
+    instance PEq Empty where
+      type (==) a b = Equals_0123456789876543210 a b
+    data SEmpty :: Empty -> GHC.Types.Type
+    type instance Sing @Empty = SEmpty
+    instance SingKind Empty where
+      type Demote Empty = Empty
+      fromSing x = case x of
+      toSing x = SomeSing (case x of)
+    instance SOrd Empty where
+      sCompare ::
+        forall (t1 :: Empty) (t2 :: Empty).
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply (CompareSym0 :: TyFun Empty ((~>) Empty Ordering)
+                                                 -> GHC.Types.Type) t1) t2)
+      sCompare _ _ = SEQ
+    instance SEq Empty where
+      (%==) _ _ = STrue
+    instance SDecide Empty where
+      (%~) x _ = Proved (case x of)
+    instance Data.Type.Equality.TestEquality (SEmpty :: Empty
+                                                        -> GHC.Types.Type) where
+      Data.Type.Equality.testEquality
+        = Data.Singletons.Decide.decideEquality
+    instance Data.Type.Coercion.TestCoercion (SEmpty :: Empty
+                                                        -> GHC.Types.Type) where
+      Data.Type.Coercion.testCoercion
+        = Data.Singletons.Decide.decideCoercion
diff --git a/tests/compile-and-dump/Singletons/T190.ghc88.template b/tests/compile-and-dump/Singletons/T190.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T190.ghc88.template
+++ /dev/null
@@ -1,198 +0,0 @@
-Singletons/T190.hs:0:0:: Splicing declarations
-    singletons
-      [d| data T
-            = T
-            deriving (Eq, Ord, Enum, Bounded, Show) |]
-  ======>
-    data T
-      = T
-      deriving (Eq, Ord, Enum, Bounded, Show)
-    type TSym0 = T
-    type family Compare_0123456789876543210 (a :: T) (a :: T) :: Ordering where
-      Compare_0123456789876543210 T T = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) '[]
-    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: T) (a0123456789876543210 :: T) =
-        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
-    data Compare_0123456789876543210Sym1 (a0123456789876543210 :: T) :: (~>) T Ordering
-      where
-        Compare_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                               a0123456789876543210
-                                                               arg. SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
-    data Compare_0123456789876543210Sym0 :: (~>) T ((~>) T Ordering)
-      where
-        Compare_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                               arg. SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
-                                                        Compare_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
-    instance POrd T where
-      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
-    type family Case_0123456789876543210 n t where
-      Case_0123456789876543210 n 'True = TSym0
-      Case_0123456789876543210 n 'False = Apply ErrorSym0 "toEnum: bad argument"
-    type family ToEnum_0123456789876543210 (a :: GHC.Types.Nat) :: T where
-      ToEnum_0123456789876543210 n = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 0))
-    type ToEnum_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) =
-        ToEnum_0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ToEnum_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ToEnum_0123456789876543210Sym0KindInference) ())
-    data ToEnum_0123456789876543210Sym0 :: (~>) GHC.Types.Nat T
-      where
-        ToEnum_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                              arg. SameKind (Apply ToEnum_0123456789876543210Sym0 arg) (ToEnum_0123456789876543210Sym1 arg) =>
-                                                       ToEnum_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ToEnum_0123456789876543210Sym0 a0123456789876543210 = ToEnum_0123456789876543210 a0123456789876543210
-    type family FromEnum_0123456789876543210 (a :: T) :: GHC.Types.Nat where
-      FromEnum_0123456789876543210 T = Data.Singletons.Prelude.Num.FromInteger 0
-    type FromEnum_0123456789876543210Sym1 (a0123456789876543210 :: T) =
-        FromEnum_0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings FromEnum_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) FromEnum_0123456789876543210Sym0KindInference) ())
-    data FromEnum_0123456789876543210Sym0 :: (~>) T GHC.Types.Nat
-      where
-        FromEnum_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                arg. SameKind (Apply FromEnum_0123456789876543210Sym0 arg) (FromEnum_0123456789876543210Sym1 arg) =>
-                                                         FromEnum_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply FromEnum_0123456789876543210Sym0 a0123456789876543210 = FromEnum_0123456789876543210 a0123456789876543210
-    instance PEnum T where
-      type ToEnum a = Apply ToEnum_0123456789876543210Sym0 a
-      type FromEnum a = Apply FromEnum_0123456789876543210Sym0 a
-    type family MinBound_0123456789876543210 :: T where
-      MinBound_0123456789876543210 = TSym0
-    type MinBound_0123456789876543210Sym0 =
-        MinBound_0123456789876543210
-    type family MaxBound_0123456789876543210 :: T where
-      MaxBound_0123456789876543210 = TSym0
-    type MaxBound_0123456789876543210Sym0 =
-        MaxBound_0123456789876543210
-    instance PBounded T where
-      type MinBound = MinBound_0123456789876543210Sym0
-      type MaxBound = MaxBound_0123456789876543210Sym0
-    type family ShowsPrec_0123456789876543210 (a :: GHC.Types.Nat) (a :: T) (a :: GHC.Types.Symbol) :: GHC.Types.Symbol where
-      ShowsPrec_0123456789876543210 _ T a_0123456789876543210 = Apply (Apply ShowStringSym0 "T") a_0123456789876543210
-    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: T) (a0123456789876543210 :: GHC.Types.Symbol) =
-        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
-    data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: T) :: (~>) GHC.Types.Symbol GHC.Types.Symbol
-      where
-        ShowsPrec_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
-    data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) :: (~>) T ((~>) GHC.Types.Symbol GHC.Types.Symbol)
-      where
-        ShowsPrec_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
-    data ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) T ((~>) GHC.Types.Symbol GHC.Types.Symbol))
-      where
-        ShowsPrec_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
-    instance PShow T where
-      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
-    type family Equals_0123456789876543210 (a :: T) (b :: T) :: Bool where
-      Equals_0123456789876543210 T T = TrueSym0
-      Equals_0123456789876543210 (_ :: T) (_ :: T) = FalseSym0
-    instance PEq T where
-      type (==) a b = Equals_0123456789876543210 a b
-    data ST :: T -> GHC.Types.Type where ST :: ST T
-    type instance Sing @T = ST
-    instance SingKind T where
-      type Demote T = T
-      fromSing ST = T
-      toSing T = SomeSing ST
-    instance SOrd T where
-      sCompare ::
-        forall (t1 :: T) (t2 :: T).
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply (CompareSym0 :: TyFun T ((~>) T Ordering)
-                                                 -> GHC.Types.Type) t1) t2)
-      sCompare ST ST
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            Data.Singletons.Prelude.Instances.SNil
-    instance SEnum T where
-      sToEnum ::
-        forall (t :: GHC.Types.Nat).
-        Sing t
-        -> Sing (Apply (Data.Singletons.Prelude.Enum.ToEnumSym0 :: TyFun GHC.Types.Nat T
-                                                                   -> GHC.Types.Type) t)
-      sFromEnum ::
-        forall (t :: T).
-        Sing t
-        -> Sing (Apply (Data.Singletons.Prelude.Enum.FromEnumSym0 :: TyFun T GHC.Types.Nat
-                                                                     -> GHC.Types.Type) t)
-      sToEnum (sN :: Sing n)
-        = (id
-             @(Sing (Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 0)))))
-            (case
-                 (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sN))
-                   (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 0))
-             of
-               STrue -> ST
-               SFalse -> sError (sing :: Sing "toEnum: bad argument"))
-      sFromEnum ST
-        = Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 0)
-    instance SBounded T where
-      sMinBound :: Sing (MinBoundSym0 :: T)
-      sMaxBound :: Sing (MaxBoundSym0 :: T)
-      sMinBound = ST
-      sMaxBound = ST
-    instance SShow T where
-      sShowsPrec ::
-        forall (t1 :: GHC.Types.Nat) (t2 :: T) (t3 :: GHC.Types.Symbol).
-        Sing t1
-        -> Sing t2
-           -> Sing t3
-              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) T ((~>) GHC.Types.Symbol GHC.Types.Symbol))
-                                                             -> GHC.Types.Type) t1) t2) t3)
-      sShowsPrec
-        _
-        ST
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "T")))
-            sA_0123456789876543210
-    instance SEq T where
-      (%==) ST ST = STrue
-    instance SDecide T where
-      (%~) ST ST = Proved Refl
-    instance Data.Type.Equality.TestEquality (ST :: T
-                                                    -> GHC.Types.Type) where
-      Data.Type.Equality.testEquality
-        = Data.Singletons.Decide.decideEquality
-    instance Data.Type.Coercion.TestCoercion (ST :: T
-                                                    -> GHC.Types.Type) where
-      Data.Type.Coercion.testCoercion
-        = Data.Singletons.Decide.decideCoercion
-    instance Show (ST (z :: T)) where
-      showsPrec _ ST = showString "ST"
-    instance SingI T where
-      sing = ST
diff --git a/tests/compile-and-dump/Singletons/T190.golden b/tests/compile-and-dump/Singletons/T190.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T190.golden
@@ -0,0 +1,204 @@
+Singletons/T190.hs:0:0:: Splicing declarations
+    singletons
+      [d| data T
+            = T
+            deriving (Eq, Ord, Enum, Bounded, Show) |]
+  ======>
+    data T
+      = T
+      deriving (Eq, Ord, Enum, Bounded, Show)
+    type TSym0 = T :: T
+    type Compare_0123456789876543210 :: T -> T -> Ordering
+    type family Compare_0123456789876543210 a a where
+      Compare_0123456789876543210 T T = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) NilSym0
+    type Compare_0123456789876543210Sym0 :: (~>) T ((~>) T Ordering)
+    data Compare_0123456789876543210Sym0 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
+                                                        Compare_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
+    type Compare_0123456789876543210Sym1 :: T -> (~>) T Ordering
+    data Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
+    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: T) (a0123456789876543210 :: T) =
+        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    instance POrd T where
+      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
+    type family Case_0123456789876543210 n t where
+      Case_0123456789876543210 n 'True = TSym0
+      Case_0123456789876543210 n 'False = Apply ErrorSym0 "toEnum: bad argument"
+    type ToEnum_0123456789876543210 :: GHC.Types.Nat -> T
+    type family ToEnum_0123456789876543210 a where
+      ToEnum_0123456789876543210 n = Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 0))
+    type ToEnum_0123456789876543210Sym0 :: (~>) GHC.Types.Nat T
+    data ToEnum_0123456789876543210Sym0 a0123456789876543210
+      where
+        ToEnum_0123456789876543210Sym0KindInference :: SameKind (Apply ToEnum_0123456789876543210Sym0 arg) (ToEnum_0123456789876543210Sym1 arg) =>
+                                                       ToEnum_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ToEnum_0123456789876543210Sym0 a0123456789876543210 = ToEnum_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ToEnum_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ToEnum_0123456789876543210Sym0KindInference) ())
+    type ToEnum_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) =
+        ToEnum_0123456789876543210 a0123456789876543210 :: T
+    type FromEnum_0123456789876543210 :: T -> GHC.Types.Nat
+    type family FromEnum_0123456789876543210 a where
+      FromEnum_0123456789876543210 T = Data.Singletons.Prelude.Num.FromInteger 0
+    type FromEnum_0123456789876543210Sym0 :: (~>) T GHC.Types.Nat
+    data FromEnum_0123456789876543210Sym0 a0123456789876543210
+      where
+        FromEnum_0123456789876543210Sym0KindInference :: SameKind (Apply FromEnum_0123456789876543210Sym0 arg) (FromEnum_0123456789876543210Sym1 arg) =>
+                                                         FromEnum_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply FromEnum_0123456789876543210Sym0 a0123456789876543210 = FromEnum_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings FromEnum_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) FromEnum_0123456789876543210Sym0KindInference) ())
+    type FromEnum_0123456789876543210Sym1 (a0123456789876543210 :: T) =
+        FromEnum_0123456789876543210 a0123456789876543210 :: GHC.Types.Nat
+    instance PEnum T where
+      type ToEnum a = Apply ToEnum_0123456789876543210Sym0 a
+      type FromEnum a = Apply FromEnum_0123456789876543210Sym0 a
+    type MinBound_0123456789876543210 :: T
+    type family MinBound_0123456789876543210 where
+      MinBound_0123456789876543210 = TSym0
+    type MinBound_0123456789876543210Sym0 =
+        MinBound_0123456789876543210 :: T
+    type MaxBound_0123456789876543210 :: T
+    type family MaxBound_0123456789876543210 where
+      MaxBound_0123456789876543210 = TSym0
+    type MaxBound_0123456789876543210Sym0 =
+        MaxBound_0123456789876543210 :: T
+    instance PBounded T where
+      type MinBound = MinBound_0123456789876543210Sym0
+      type MaxBound = MaxBound_0123456789876543210Sym0
+    type ShowsPrec_0123456789876543210 :: GHC.Types.Nat
+                                          -> T -> GHC.Types.Symbol -> GHC.Types.Symbol
+    type family ShowsPrec_0123456789876543210 a a a where
+      ShowsPrec_0123456789876543210 _ T a_0123456789876543210 = Apply (Apply ShowStringSym0 "T") a_0123456789876543210
+    type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) T ((~>) GHC.Types.Symbol GHC.Types.Symbol))
+    data ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
+    type ShowsPrec_0123456789876543210Sym1 :: GHC.Types.Nat
+                                              -> (~>) T ((~>) GHC.Types.Symbol GHC.Types.Symbol)
+    data ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
+    type ShowsPrec_0123456789876543210Sym2 :: GHC.Types.Nat
+                                              -> T -> (~>) GHC.Types.Symbol GHC.Types.Symbol
+    data ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
+    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: T) (a0123456789876543210 :: GHC.Types.Symbol) =
+        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: GHC.Types.Symbol
+    instance PShow T where
+      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
+    type Equals_0123456789876543210 :: T -> T -> Bool
+    type family Equals_0123456789876543210 a b where
+      Equals_0123456789876543210 T T = TrueSym0
+      Equals_0123456789876543210 (_ :: T) (_ :: T) = FalseSym0
+    instance PEq T where
+      type (==) a b = Equals_0123456789876543210 a b
+    data ST :: T -> GHC.Types.Type where ST :: ST (T :: T)
+    type instance Sing @T = ST
+    instance SingKind T where
+      type Demote T = T
+      fromSing ST = T
+      toSing T = SomeSing ST
+    instance SOrd T where
+      sCompare ::
+        forall (t1 :: T) (t2 :: T).
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply (CompareSym0 :: TyFun T ((~>) T Ordering)
+                                                 -> GHC.Types.Type) t1) t2)
+      sCompare ST ST
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            Data.Singletons.Prelude.Instances.SNil
+    instance SEnum T where
+      sToEnum ::
+        forall (t :: GHC.Types.Nat).
+        Sing t
+        -> Sing (Apply (Data.Singletons.Prelude.Enum.ToEnumSym0 :: TyFun GHC.Types.Nat T
+                                                                   -> GHC.Types.Type) t)
+      sFromEnum ::
+        forall (t :: T).
+        Sing t
+        -> Sing (Apply (Data.Singletons.Prelude.Enum.FromEnumSym0 :: TyFun T GHC.Types.Nat
+                                                                     -> GHC.Types.Type) t)
+      sToEnum (sN :: Sing n)
+        = (id
+             @(Sing (Case_0123456789876543210 n (Apply (Apply (==@#@$) n) (Data.Singletons.Prelude.Num.FromInteger 0)))))
+            (case
+                 (applySing ((applySing ((singFun2 @(==@#@$)) (%==))) sN))
+                   (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 0))
+             of
+               STrue -> ST
+               SFalse -> sError (sing :: Sing "toEnum: bad argument"))
+      sFromEnum ST
+        = Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 0)
+    instance SBounded T where
+      sMinBound :: Sing (MinBoundSym0 :: T)
+      sMaxBound :: Sing (MaxBoundSym0 :: T)
+      sMinBound = ST
+      sMaxBound = ST
+    instance SShow T where
+      sShowsPrec ::
+        forall (t1 :: GHC.Types.Nat) (t2 :: T) (t3 :: GHC.Types.Symbol).
+        Sing t1
+        -> Sing t2
+           -> Sing t3
+              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) T ((~>) GHC.Types.Symbol GHC.Types.Symbol))
+                                                             -> GHC.Types.Type) t1) t2) t3)
+      sShowsPrec
+        _
+        ST
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "T")))
+            sA_0123456789876543210
+    instance SEq T where
+      (%==) ST ST = STrue
+    instance SDecide T where
+      (%~) ST ST = Proved Refl
+    instance Data.Type.Equality.TestEquality (ST :: T
+                                                    -> GHC.Types.Type) where
+      Data.Type.Equality.testEquality
+        = Data.Singletons.Decide.decideEquality
+    instance Data.Type.Coercion.TestCoercion (ST :: T
+                                                    -> GHC.Types.Type) where
+      Data.Type.Coercion.testCoercion
+        = Data.Singletons.Decide.decideCoercion
+    instance Show (ST (z :: T)) where
+      showsPrec _ ST = showString "ST"
+    instance SingI T where
+      sing = ST
diff --git a/tests/compile-and-dump/Singletons/T197.ghc88.template b/tests/compile-and-dump/Singletons/T197.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T197.ghc88.template
+++ /dev/null
@@ -1,43 +0,0 @@
-Singletons/T197.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| infixl 5 $$:
-          
-          ($$:) :: Bool -> Bool -> Bool
-          _ $$: _ = False |]
-  ======>
-    infixl 5 $$:
-    ($$:) :: Bool -> Bool -> Bool
-    ($$:) _ _ = False
-    type ($$:@#@$$$) (a0123456789876543210 :: Bool) (a0123456789876543210 :: Bool) =
-        ($$:) a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (($$:@#@$$) a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (:$$:@#@$$###)) ())
-    data ($$:@#@$$) (a0123456789876543210 :: Bool) :: (~>) Bool Bool
-      where
-        (:$$:@#@$$###) :: forall a0123456789876543210
-                                 a0123456789876543210
-                                 arg. SameKind (Apply (($$:@#@$$) a0123456789876543210) arg) (($$:@#@$$$) a0123456789876543210 arg) =>
-                          ($$:@#@$$) a0123456789876543210 a0123456789876543210
-    type instance Apply (($$:@#@$$) a0123456789876543210) a0123456789876543210 = ($$:) a0123456789876543210 a0123456789876543210
-    infixl 5 $$:@#@$$
-    instance SuppressUnusedWarnings ($$:@#@$) where
-      suppressUnusedWarnings = snd (((,) (:$$:@#@$###)) ())
-    data ($$:@#@$) :: (~>) Bool ((~>) Bool Bool)
-      where
-        (:$$:@#@$###) :: forall a0123456789876543210
-                                arg. SameKind (Apply ($$:@#@$) arg) (($$:@#@$$) arg) =>
-                         ($$:@#@$) a0123456789876543210
-    type instance Apply ($$:@#@$) a0123456789876543210 = ($$:@#@$$) a0123456789876543210
-    infixl 5 $$:@#@$
-    type family ($$:) (a :: Bool) (a :: Bool) :: Bool where
-      ($$:) _ _ = FalseSym0
-    infixl 5 %$$:
-    (%$$:) ::
-      forall (t :: Bool) (t :: Bool).
-      Sing t -> Sing t -> Sing (Apply (Apply ($$:@#@$) t) t :: Bool)
-    (%$$:) _ _ = SFalse
-    instance SingI (($$:@#@$) :: (~>) Bool ((~>) Bool Bool)) where
-      sing = (singFun2 @($$:@#@$)) (%$$:)
-    instance SingI d =>
-             SingI (($$:@#@$$) (d :: Bool) :: (~>) Bool Bool) where
-      sing = (singFun1 @(($$:@#@$$) (d :: Bool))) ((%$$:) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T197.golden b/tests/compile-and-dump/Singletons/T197.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T197.golden
@@ -0,0 +1,44 @@
+Singletons/T197.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| infixl 5 $$:
+          
+          ($$:) :: Bool -> Bool -> Bool
+          _ $$: _ = False |]
+  ======>
+    infixl 5 $$:
+    ($$:) :: Bool -> Bool -> Bool
+    ($$:) _ _ = False
+    type ($$:@#@$) :: (~>) Bool ((~>) Bool Bool)
+    data ($$:@#@$) a0123456789876543210
+      where
+        (:$$:@#@$###) :: SameKind (Apply ($$:@#@$) arg) (($$:@#@$$) arg) =>
+                         ($$:@#@$) a0123456789876543210
+    type instance Apply ($$:@#@$) a0123456789876543210 = ($$:@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings ($$:@#@$) where
+      suppressUnusedWarnings = snd (((,) (:$$:@#@$###)) ())
+    infixl 5 $$:@#@$
+    type ($$:@#@$$) :: Bool -> (~>) Bool Bool
+    data ($$:@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (:$$:@#@$$###) :: SameKind (Apply (($$:@#@$$) a0123456789876543210) arg) (($$:@#@$$$) a0123456789876543210 arg) =>
+                          ($$:@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply (($$:@#@$$) a0123456789876543210) a0123456789876543210 = ($$:@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (($$:@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (:$$:@#@$$###)) ())
+    infixl 5 $$:@#@$$
+    type ($$:@#@$$$) (a0123456789876543210 :: Bool) (a0123456789876543210 :: Bool) =
+        ($$:) a0123456789876543210 a0123456789876543210 :: Bool
+    infixl 5 $$:@#@$$$
+    type ($$:) :: Bool -> Bool -> Bool
+    type family ($$:) a a where
+      ($$:) _ _ = FalseSym0
+    infixl 5 %$$:
+    (%$$:) ::
+      forall (t :: Bool) (t :: Bool).
+      Sing t -> Sing t -> Sing (Apply (Apply ($$:@#@$) t) t :: Bool)
+    (%$$:) _ _ = SFalse
+    instance SingI (($$:@#@$) :: (~>) Bool ((~>) Bool Bool)) where
+      sing = (singFun2 @($$:@#@$)) (%$$:)
+    instance SingI d =>
+             SingI (($$:@#@$$) (d :: Bool) :: (~>) Bool Bool) where
+      sing = (singFun1 @(($$:@#@$$) (d :: Bool))) ((%$$:) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T197b.ghc88.template b/tests/compile-and-dump/Singletons/T197b.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T197b.ghc88.template
+++ /dev/null
@@ -1,96 +0,0 @@
-Singletons/T197b.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| infixr 9 `Pair`, `MkPair`
-          
-          data a :*: b = a :*: b
-          data Pair a b = MkPair a b |]
-  ======>
-    data (:*:) a b = a :*: b
-    data Pair a b = MkPair a b
-    infixr 9 `Pair`
-    infixr 9 `MkPair`
-    type (:*:@#@$$$) (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) =
-        (:*:) t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings ((:*:@#@$$) t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (::*:@#@$$###)) ())
-    data (:*:@#@$$) (t0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                      (~>) b0123456789876543210 ((:*:) a0123456789876543210 b0123456789876543210)
-      where
-        (::*:@#@$$###) :: forall t0123456789876543210
-                                 t0123456789876543210
-                                 arg. SameKind (Apply ((:*:@#@$$) t0123456789876543210) arg) ((:*:@#@$$$) t0123456789876543210 arg) =>
-                          (:*:@#@$$) t0123456789876543210 t0123456789876543210
-    type instance Apply ((:*:@#@$$) t0123456789876543210) t0123456789876543210 = (:*:) t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (:*:@#@$) where
-      suppressUnusedWarnings = snd (((,) (::*:@#@$###)) ())
-    data (:*:@#@$) :: forall a0123456789876543210 b0123456789876543210.
-                      (~>) a0123456789876543210 ((~>) b0123456789876543210 ((:*:) a0123456789876543210 b0123456789876543210))
-      where
-        (::*:@#@$###) :: forall t0123456789876543210
-                                arg. SameKind (Apply (:*:@#@$) arg) ((:*:@#@$$) arg) =>
-                         (:*:@#@$) t0123456789876543210
-    type instance Apply (:*:@#@$) t0123456789876543210 = (:*:@#@$$) t0123456789876543210
-    type MkPairSym2 (t0123456789876543210 :: a0123456789876543210) (t0123456789876543210 :: b0123456789876543210) =
-        MkPair t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (MkPairSym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) MkPairSym1KindInference) ())
-    data MkPairSym1 (t0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                      (~>) b0123456789876543210 (Pair a0123456789876543210 b0123456789876543210)
-      where
-        MkPairSym1KindInference :: forall t0123456789876543210
-                                          t0123456789876543210
-                                          arg. SameKind (Apply (MkPairSym1 t0123456789876543210) arg) (MkPairSym2 t0123456789876543210 arg) =>
-                                   MkPairSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (MkPairSym1 t0123456789876543210) t0123456789876543210 = MkPair t0123456789876543210 t0123456789876543210
-    infixr 9 `MkPairSym1`
-    instance SuppressUnusedWarnings MkPairSym0 where
-      suppressUnusedWarnings = snd (((,) MkPairSym0KindInference) ())
-    data MkPairSym0 :: forall a0123456789876543210
-                              b0123456789876543210.
-                       (~>) a0123456789876543210 ((~>) b0123456789876543210 (Pair a0123456789876543210 b0123456789876543210))
-      where
-        MkPairSym0KindInference :: forall t0123456789876543210
-                                          arg. SameKind (Apply MkPairSym0 arg) (MkPairSym1 arg) =>
-                                   MkPairSym0 t0123456789876543210
-    type instance Apply MkPairSym0 t0123456789876543210 = MkPairSym1 t0123456789876543210
-    infixr 9 `MkPairSym0`
-    infixr 9 `SMkPair`
-    infixr 9 `SPair`
-    data (%:*:) :: forall a b. (:*:) a b -> GHC.Types.Type
-      where
-        (:%*:) :: forall a b (n :: a) (n :: b).
-                  (Sing (n :: a)) -> (Sing (n :: b)) -> (%:*:) ((:*:) n n)
-    type instance Sing @((:*:) a b) = (%:*:)
-    instance (SingKind a, SingKind b) => SingKind ((:*:) a b) where
-      type Demote ((:*:) a b) = (:*:) (Demote a) (Demote b)
-      fromSing ((:%*:) b b) = ((:*:) (fromSing b)) (fromSing b)
-      toSing ((:*:) (b :: Demote a) (b :: Demote b))
-        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b) of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:%*:) c) c) }
-    data SPair :: forall a b. Pair a b -> GHC.Types.Type
-      where
-        SMkPair :: forall a b (n :: a) (n :: b).
-                   (Sing (n :: a)) -> (Sing (n :: b)) -> SPair (MkPair n n)
-    type instance Sing @(Pair a b) = SPair
-    instance (SingKind a, SingKind b) => SingKind (Pair a b) where
-      type Demote (Pair a b) = Pair (Demote a) (Demote b)
-      fromSing (SMkPair b b) = (MkPair (fromSing b)) (fromSing b)
-      toSing (MkPair (b :: Demote a) (b :: Demote b))
-        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b) of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SMkPair c) c) }
-    instance (SingI n, SingI n) =>
-             SingI ((:*:) (n :: a) (n :: b)) where
-      sing = ((:%*:) sing) sing
-    instance SingI ((:*:@#@$) :: (~>) a ((~>) b ((:*:) a b))) where
-      sing = (singFun2 @(:*:@#@$)) (:%*:)
-    instance SingI d =>
-             SingI ((:*:@#@$$) (d :: a) :: (~>) b ((:*:) a b)) where
-      sing = (singFun1 @((:*:@#@$$) (d :: a))) ((:%*:) (sing @d))
-    instance (SingI n, SingI n) =>
-             SingI (MkPair (n :: a) (n :: b)) where
-      sing = (SMkPair sing) sing
-    instance SingI (MkPairSym0 :: (~>) a ((~>) b (Pair a b))) where
-      sing = (singFun2 @MkPairSym0) SMkPair
-    instance SingI d =>
-             SingI (MkPairSym1 (d :: a) :: (~>) b (Pair a b)) where
-      sing = (singFun1 @(MkPairSym1 (d :: a))) (SMkPair (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T197b.golden b/tests/compile-and-dump/Singletons/T197b.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T197b.golden
@@ -0,0 +1,89 @@
+Singletons/T197b.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| infixr 9 `Pair`, `MkPair`
+          
+          data a :*: b = a :*: b
+          data Pair a b = MkPair a b |]
+  ======>
+    data (:*:) a b = a :*: b
+    data Pair a b = MkPair a b
+    infixr 9 `Pair`
+    infixr 9 `MkPair`
+    type (:*:@#@$) :: forall a b. (~>) a ((~>) b ((:*:) a b))
+    data (:*:@#@$) a0123456789876543210
+      where
+        (::*:@#@$###) :: SameKind (Apply (:*:@#@$) arg) ((:*:@#@$$) arg) =>
+                         (:*:@#@$) a0123456789876543210
+    type instance Apply (:*:@#@$) a0123456789876543210 = (:*:@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (:*:@#@$) where
+      suppressUnusedWarnings = snd (((,) (::*:@#@$###)) ())
+    type (:*:@#@$$) :: forall a b. a -> (~>) b ((:*:) a b)
+    data (:*:@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (::*:@#@$$###) :: SameKind (Apply ((:*:@#@$$) a0123456789876543210) arg) ((:*:@#@$$$) a0123456789876543210 arg) =>
+                          (:*:@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((:*:@#@$$) a0123456789876543210) a0123456789876543210 = (:*:@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((:*:@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (::*:@#@$$###)) ())
+    type (:*:@#@$$$) (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        (:*:) a0123456789876543210 a0123456789876543210 :: (:*:) a b
+    type MkPairSym0 :: forall a b. (~>) a ((~>) b (Pair a b))
+    data MkPairSym0 a0123456789876543210
+      where
+        MkPairSym0KindInference :: SameKind (Apply MkPairSym0 arg) (MkPairSym1 arg) =>
+                                   MkPairSym0 a0123456789876543210
+    type instance Apply MkPairSym0 a0123456789876543210 = MkPairSym1 a0123456789876543210
+    instance SuppressUnusedWarnings MkPairSym0 where
+      suppressUnusedWarnings = snd (((,) MkPairSym0KindInference) ())
+    infixr 9 `MkPairSym0`
+    type MkPairSym1 :: forall a b. a -> (~>) b (Pair a b)
+    data MkPairSym1 a0123456789876543210 a0123456789876543210
+      where
+        MkPairSym1KindInference :: SameKind (Apply (MkPairSym1 a0123456789876543210) arg) (MkPairSym2 a0123456789876543210 arg) =>
+                                   MkPairSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (MkPairSym1 a0123456789876543210) a0123456789876543210 = MkPairSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (MkPairSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) MkPairSym1KindInference) ())
+    infixr 9 `MkPairSym1`
+    type MkPairSym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        MkPair a0123456789876543210 a0123456789876543210 :: Pair a b
+    infixr 9 `MkPairSym2`
+    infixr 9 `SMkPair`
+    data (%:*:) :: forall a b. (:*:) a b -> GHC.Types.Type
+      where
+        (:%*:) :: forall a b (n :: a) (n :: b).
+                  (Sing n) -> (Sing n) -> (%:*:) ((:*:) n n :: (:*:) a b)
+    type instance Sing @((:*:) a b) = (%:*:)
+    instance (SingKind a, SingKind b) => SingKind ((:*:) a b) where
+      type Demote ((:*:) a b) = (:*:) (Demote a) (Demote b)
+      fromSing ((:%*:) b b) = ((:*:) (fromSing b)) (fromSing b)
+      toSing ((:*:) (b :: Demote a) (b :: Demote b))
+        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b) of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:%*:) c) c) }
+    data SPair :: forall a b. Pair a b -> GHC.Types.Type
+      where
+        SMkPair :: forall a b (n :: a) (n :: b).
+                   (Sing n) -> (Sing n) -> SPair (MkPair n n :: Pair a b)
+    type instance Sing @(Pair a b) = SPair
+    instance (SingKind a, SingKind b) => SingKind (Pair a b) where
+      type Demote (Pair a b) = Pair (Demote a) (Demote b)
+      fromSing (SMkPair b b) = (MkPair (fromSing b)) (fromSing b)
+      toSing (MkPair (b :: Demote a) (b :: Demote b))
+        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b) of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SMkPair c) c) }
+    instance (SingI n, SingI n) =>
+             SingI ((:*:) (n :: a) (n :: b)) where
+      sing = ((:%*:) sing) sing
+    instance SingI ((:*:@#@$) :: (~>) a ((~>) b ((:*:) a b))) where
+      sing = (singFun2 @(:*:@#@$)) (:%*:)
+    instance SingI d =>
+             SingI ((:*:@#@$$) (d :: a) :: (~>) b ((:*:) a b)) where
+      sing = (singFun1 @((:*:@#@$$) (d :: a))) ((:%*:) (sing @d))
+    instance (SingI n, SingI n) =>
+             SingI (MkPair (n :: a) (n :: b)) where
+      sing = (SMkPair sing) sing
+    instance SingI (MkPairSym0 :: (~>) a ((~>) b (Pair a b))) where
+      sing = (singFun2 @MkPairSym0) SMkPair
+    instance SingI d =>
+             SingI (MkPairSym1 (d :: a) :: (~>) b (Pair a b)) where
+      sing = (singFun1 @(MkPairSym1 (d :: a))) (SMkPair (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T200.ghc88.template b/tests/compile-and-dump/Singletons/T200.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T200.ghc88.template
+++ /dev/null
@@ -1,189 +0,0 @@
-Singletons/T200.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| ($$:) :: ErrorMessage -> ErrorMessage -> ErrorMessage
-          x $$: y = x :$$: y
-          (<>:) :: ErrorMessage -> ErrorMessage -> ErrorMessage
-          x <>: y = x :<>: y
-          
-          data ErrorMessage
-            = ErrorMessage :$$: ErrorMessage |
-              ErrorMessage :<>: ErrorMessage |
-              EM [Bool] |]
-  ======>
-    data ErrorMessage
-      = ErrorMessage :$$: ErrorMessage |
-        ErrorMessage :<>: ErrorMessage |
-        EM [Bool]
-    ($$:) :: ErrorMessage -> ErrorMessage -> ErrorMessage
-    ($$:) x y = (x :$$: y)
-    (<>:) :: ErrorMessage -> ErrorMessage -> ErrorMessage
-    (<>:) x y = (x :<>: y)
-    type (:$$:@#@$$$) (t0123456789876543210 :: ErrorMessage) (t0123456789876543210 :: ErrorMessage) =
-        (:$$:) t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings ((:$$:@#@$$) t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (::$$:@#@$$###)) ())
-    data (:$$:@#@$$) (t0123456789876543210 :: ErrorMessage) :: (~>) ErrorMessage ErrorMessage
-      where
-        (::$$:@#@$$###) :: forall t0123456789876543210
-                                  t0123456789876543210
-                                  arg. SameKind (Apply ((:$$:@#@$$) t0123456789876543210) arg) ((:$$:@#@$$$) t0123456789876543210 arg) =>
-                           (:$$:@#@$$) t0123456789876543210 t0123456789876543210
-    type instance Apply ((:$$:@#@$$) t0123456789876543210) t0123456789876543210 = (:$$:) t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (:$$:@#@$) where
-      suppressUnusedWarnings = snd (((,) (::$$:@#@$###)) ())
-    data (:$$:@#@$) :: (~>) ErrorMessage ((~>) ErrorMessage ErrorMessage)
-      where
-        (::$$:@#@$###) :: forall t0123456789876543210
-                                 arg. SameKind (Apply (:$$:@#@$) arg) ((:$$:@#@$$) arg) =>
-                          (:$$:@#@$) t0123456789876543210
-    type instance Apply (:$$:@#@$) t0123456789876543210 = (:$$:@#@$$) t0123456789876543210
-    type (:<>:@#@$$$) (t0123456789876543210 :: ErrorMessage) (t0123456789876543210 :: ErrorMessage) =
-        (:<>:) t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings ((:<>:@#@$$) t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (::<>:@#@$$###)) ())
-    data (:<>:@#@$$) (t0123456789876543210 :: ErrorMessage) :: (~>) ErrorMessage ErrorMessage
-      where
-        (::<>:@#@$$###) :: forall t0123456789876543210
-                                  t0123456789876543210
-                                  arg. SameKind (Apply ((:<>:@#@$$) t0123456789876543210) arg) ((:<>:@#@$$$) t0123456789876543210 arg) =>
-                           (:<>:@#@$$) t0123456789876543210 t0123456789876543210
-    type instance Apply ((:<>:@#@$$) t0123456789876543210) t0123456789876543210 = (:<>:) t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (:<>:@#@$) where
-      suppressUnusedWarnings = snd (((,) (::<>:@#@$###)) ())
-    data (:<>:@#@$) :: (~>) ErrorMessage ((~>) ErrorMessage ErrorMessage)
-      where
-        (::<>:@#@$###) :: forall t0123456789876543210
-                                 arg. SameKind (Apply (:<>:@#@$) arg) ((:<>:@#@$$) arg) =>
-                          (:<>:@#@$) t0123456789876543210
-    type instance Apply (:<>:@#@$) t0123456789876543210 = (:<>:@#@$$) t0123456789876543210
-    type EMSym1 (t0123456789876543210 :: [Bool]) =
-        EM t0123456789876543210
-    instance SuppressUnusedWarnings EMSym0 where
-      suppressUnusedWarnings = snd (((,) EMSym0KindInference) ())
-    data EMSym0 :: (~>) [Bool] ErrorMessage
-      where
-        EMSym0KindInference :: forall t0123456789876543210
-                                      arg. SameKind (Apply EMSym0 arg) (EMSym1 arg) =>
-                               EMSym0 t0123456789876543210
-    type instance Apply EMSym0 t0123456789876543210 = EM t0123456789876543210
-    type (<>:@#@$$$) (a0123456789876543210 :: ErrorMessage) (a0123456789876543210 :: ErrorMessage) =
-        (<>:) a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ((<>:@#@$$) a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (:<>:@#@$$###)) ())
-    data (<>:@#@$$) (a0123456789876543210 :: ErrorMessage) :: (~>) ErrorMessage ErrorMessage
-      where
-        (:<>:@#@$$###) :: forall a0123456789876543210
-                                 a0123456789876543210
-                                 arg. SameKind (Apply ((<>:@#@$$) a0123456789876543210) arg) ((<>:@#@$$$) a0123456789876543210 arg) =>
-                          (<>:@#@$$) a0123456789876543210 a0123456789876543210
-    type instance Apply ((<>:@#@$$) a0123456789876543210) a0123456789876543210 = (<>:) a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (<>:@#@$) where
-      suppressUnusedWarnings = snd (((,) (:<>:@#@$###)) ())
-    data (<>:@#@$) :: (~>) ErrorMessage ((~>) ErrorMessage ErrorMessage)
-      where
-        (:<>:@#@$###) :: forall a0123456789876543210
-                                arg. SameKind (Apply (<>:@#@$) arg) ((<>:@#@$$) arg) =>
-                         (<>:@#@$) a0123456789876543210
-    type instance Apply (<>:@#@$) a0123456789876543210 = (<>:@#@$$) a0123456789876543210
-    type ($$:@#@$$$) (a0123456789876543210 :: ErrorMessage) (a0123456789876543210 :: ErrorMessage) =
-        ($$:) a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (($$:@#@$$) a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (:$$:@#@$$###)) ())
-    data ($$:@#@$$) (a0123456789876543210 :: ErrorMessage) :: (~>) ErrorMessage ErrorMessage
-      where
-        (:$$:@#@$$###) :: forall a0123456789876543210
-                                 a0123456789876543210
-                                 arg. SameKind (Apply (($$:@#@$$) a0123456789876543210) arg) (($$:@#@$$$) a0123456789876543210 arg) =>
-                          ($$:@#@$$) a0123456789876543210 a0123456789876543210
-    type instance Apply (($$:@#@$$) a0123456789876543210) a0123456789876543210 = ($$:) a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ($$:@#@$) where
-      suppressUnusedWarnings = snd (((,) (:$$:@#@$###)) ())
-    data ($$:@#@$) :: (~>) ErrorMessage ((~>) ErrorMessage ErrorMessage)
-      where
-        (:$$:@#@$###) :: forall a0123456789876543210
-                                arg. SameKind (Apply ($$:@#@$) arg) (($$:@#@$$) arg) =>
-                         ($$:@#@$) a0123456789876543210
-    type instance Apply ($$:@#@$) a0123456789876543210 = ($$:@#@$$) a0123456789876543210
-    type family (<>:) (a :: ErrorMessage) (a :: ErrorMessage) :: ErrorMessage where
-      (<>:) x y = Apply (Apply (:<>:@#@$) x) y
-    type family ($$:) (a :: ErrorMessage) (a :: ErrorMessage) :: ErrorMessage where
-      ($$:) x y = Apply (Apply (:$$:@#@$) x) y
-    (%<>:) ::
-      forall (t :: ErrorMessage) (t :: ErrorMessage).
-      Sing t
-      -> Sing t -> Sing (Apply (Apply (<>:@#@$) t) t :: ErrorMessage)
-    (%$$:) ::
-      forall (t :: ErrorMessage) (t :: ErrorMessage).
-      Sing t
-      -> Sing t -> Sing (Apply (Apply ($$:@#@$) t) t :: ErrorMessage)
-    (%<>:) (sX :: Sing x) (sY :: Sing y)
-      = (applySing ((applySing ((singFun2 @(:<>:@#@$)) (:%<>:))) sX)) sY
-    (%$$:) (sX :: Sing x) (sY :: Sing y)
-      = (applySing ((applySing ((singFun2 @(:$$:@#@$)) (:%$$:))) sX)) sY
-    instance SingI ((<>:@#@$) :: (~>) ErrorMessage ((~>) ErrorMessage ErrorMessage)) where
-      sing = (singFun2 @(<>:@#@$)) (%<>:)
-    instance SingI d =>
-             SingI ((<>:@#@$$) (d :: ErrorMessage) :: (~>) ErrorMessage ErrorMessage) where
-      sing
-        = (singFun1 @((<>:@#@$$) (d :: ErrorMessage))) ((%<>:) (sing @d))
-    instance SingI (($$:@#@$) :: (~>) ErrorMessage ((~>) ErrorMessage ErrorMessage)) where
-      sing = (singFun2 @($$:@#@$)) (%$$:)
-    instance SingI d =>
-             SingI (($$:@#@$$) (d :: ErrorMessage) :: (~>) ErrorMessage ErrorMessage) where
-      sing
-        = (singFun1 @(($$:@#@$$) (d :: ErrorMessage))) ((%$$:) (sing @d))
-    data SErrorMessage :: ErrorMessage -> GHC.Types.Type
-      where
-        (:%$$:) :: forall (n :: ErrorMessage) (n :: ErrorMessage).
-                   (Sing (n :: ErrorMessage))
-                   -> (Sing (n :: ErrorMessage)) -> SErrorMessage ((:$$:) n n)
-        (:%<>:) :: forall (n :: ErrorMessage) (n :: ErrorMessage).
-                   (Sing (n :: ErrorMessage))
-                   -> (Sing (n :: ErrorMessage)) -> SErrorMessage ((:<>:) n n)
-        SEM :: forall (n :: [Bool]).
-               (Sing (n :: [Bool])) -> SErrorMessage (EM n)
-    type instance Sing @ErrorMessage = SErrorMessage
-    instance SingKind ErrorMessage where
-      type Demote ErrorMessage = ErrorMessage
-      fromSing ((:%$$:) b b) = ((:$$:) (fromSing b)) (fromSing b)
-      fromSing ((:%<>:) b b) = ((:<>:) (fromSing b)) (fromSing b)
-      fromSing (SEM b) = EM (fromSing b)
-      toSing
-        ((:$$:) (b :: Demote ErrorMessage) (b :: Demote ErrorMessage))
-        = case
-              ((,) (toSing b :: SomeSing ErrorMessage))
-                (toSing b :: SomeSing ErrorMessage)
-          of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:%$$:) c) c) }
-      toSing
-        ((:<>:) (b :: Demote ErrorMessage) (b :: Demote ErrorMessage))
-        = case
-              ((,) (toSing b :: SomeSing ErrorMessage))
-                (toSing b :: SomeSing ErrorMessage)
-          of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:%<>:) c) c) }
-      toSing (EM (b :: Demote [Bool]))
-        = case toSing b :: SomeSing [Bool] of {
-            SomeSing c -> SomeSing (SEM c) }
-    instance (SingI n, SingI n) =>
-             SingI ((:$$:) (n :: ErrorMessage) (n :: ErrorMessage)) where
-      sing = ((:%$$:) sing) sing
-    instance SingI ((:$$:@#@$) :: (~>) ErrorMessage ((~>) ErrorMessage ErrorMessage)) where
-      sing = (singFun2 @(:$$:@#@$)) (:%$$:)
-    instance SingI d =>
-             SingI ((:$$:@#@$$) (d :: ErrorMessage) :: (~>) ErrorMessage ErrorMessage) where
-      sing
-        = (singFun1 @((:$$:@#@$$) (d :: ErrorMessage))) ((:%$$:) (sing @d))
-    instance (SingI n, SingI n) =>
-             SingI ((:<>:) (n :: ErrorMessage) (n :: ErrorMessage)) where
-      sing = ((:%<>:) sing) sing
-    instance SingI ((:<>:@#@$) :: (~>) ErrorMessage ((~>) ErrorMessage ErrorMessage)) where
-      sing = (singFun2 @(:<>:@#@$)) (:%<>:)
-    instance SingI d =>
-             SingI ((:<>:@#@$$) (d :: ErrorMessage) :: (~>) ErrorMessage ErrorMessage) where
-      sing
-        = (singFun1 @((:<>:@#@$$) (d :: ErrorMessage))) ((:%<>:) (sing @d))
-    instance SingI n => SingI (EM (n :: [Bool])) where
-      sing = SEM sing
-    instance SingI (EMSym0 :: (~>) [Bool] ErrorMessage) where
-      sing = (singFun1 @EMSym0) SEM
diff --git a/tests/compile-and-dump/Singletons/T200.golden b/tests/compile-and-dump/Singletons/T200.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T200.golden
@@ -0,0 +1,185 @@
+Singletons/T200.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| ($$:) :: ErrorMessage -> ErrorMessage -> ErrorMessage
+          x $$: y = x :$$: y
+          (<>:) :: ErrorMessage -> ErrorMessage -> ErrorMessage
+          x <>: y = x :<>: y
+          
+          data ErrorMessage
+            = ErrorMessage :$$: ErrorMessage |
+              ErrorMessage :<>: ErrorMessage |
+              EM [Bool] |]
+  ======>
+    data ErrorMessage
+      = ErrorMessage :$$: ErrorMessage |
+        ErrorMessage :<>: ErrorMessage |
+        EM [Bool]
+    ($$:) :: ErrorMessage -> ErrorMessage -> ErrorMessage
+    ($$:) x y = (x :$$: y)
+    (<>:) :: ErrorMessage -> ErrorMessage -> ErrorMessage
+    (<>:) x y = (x :<>: y)
+    type (:$$:@#@$) :: (~>) ErrorMessage ((~>) ErrorMessage ErrorMessage)
+    data (:$$:@#@$) a0123456789876543210
+      where
+        (::$$:@#@$###) :: SameKind (Apply (:$$:@#@$) arg) ((:$$:@#@$$) arg) =>
+                          (:$$:@#@$) a0123456789876543210
+    type instance Apply (:$$:@#@$) a0123456789876543210 = (:$$:@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (:$$:@#@$) where
+      suppressUnusedWarnings = snd (((,) (::$$:@#@$###)) ())
+    type (:$$:@#@$$) :: ErrorMessage -> (~>) ErrorMessage ErrorMessage
+    data (:$$:@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (::$$:@#@$$###) :: SameKind (Apply ((:$$:@#@$$) a0123456789876543210) arg) ((:$$:@#@$$$) a0123456789876543210 arg) =>
+                           (:$$:@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((:$$:@#@$$) a0123456789876543210) a0123456789876543210 = (:$$:@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((:$$:@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (::$$:@#@$$###)) ())
+    type (:$$:@#@$$$) (a0123456789876543210 :: ErrorMessage) (a0123456789876543210 :: ErrorMessage) =
+        (:$$:) a0123456789876543210 a0123456789876543210 :: ErrorMessage
+    type (:<>:@#@$) :: (~>) ErrorMessage ((~>) ErrorMessage ErrorMessage)
+    data (:<>:@#@$) a0123456789876543210
+      where
+        (::<>:@#@$###) :: SameKind (Apply (:<>:@#@$) arg) ((:<>:@#@$$) arg) =>
+                          (:<>:@#@$) a0123456789876543210
+    type instance Apply (:<>:@#@$) a0123456789876543210 = (:<>:@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (:<>:@#@$) where
+      suppressUnusedWarnings = snd (((,) (::<>:@#@$###)) ())
+    type (:<>:@#@$$) :: ErrorMessage -> (~>) ErrorMessage ErrorMessage
+    data (:<>:@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (::<>:@#@$$###) :: SameKind (Apply ((:<>:@#@$$) a0123456789876543210) arg) ((:<>:@#@$$$) a0123456789876543210 arg) =>
+                           (:<>:@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((:<>:@#@$$) a0123456789876543210) a0123456789876543210 = (:<>:@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((:<>:@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (::<>:@#@$$###)) ())
+    type (:<>:@#@$$$) (a0123456789876543210 :: ErrorMessage) (a0123456789876543210 :: ErrorMessage) =
+        (:<>:) a0123456789876543210 a0123456789876543210 :: ErrorMessage
+    type EMSym0 :: (~>) [Bool] ErrorMessage
+    data EMSym0 a0123456789876543210
+      where
+        EMSym0KindInference :: SameKind (Apply EMSym0 arg) (EMSym1 arg) =>
+                               EMSym0 a0123456789876543210
+    type instance Apply EMSym0 a0123456789876543210 = EMSym1 a0123456789876543210
+    instance SuppressUnusedWarnings EMSym0 where
+      suppressUnusedWarnings = snd (((,) EMSym0KindInference) ())
+    type EMSym1 (a0123456789876543210 :: [Bool]) =
+        EM a0123456789876543210 :: ErrorMessage
+    type (<>:@#@$) :: (~>) ErrorMessage ((~>) ErrorMessage ErrorMessage)
+    data (<>:@#@$) a0123456789876543210
+      where
+        (:<>:@#@$###) :: SameKind (Apply (<>:@#@$) arg) ((<>:@#@$$) arg) =>
+                         (<>:@#@$) a0123456789876543210
+    type instance Apply (<>:@#@$) a0123456789876543210 = (<>:@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (<>:@#@$) where
+      suppressUnusedWarnings = snd (((,) (:<>:@#@$###)) ())
+    type (<>:@#@$$) :: ErrorMessage -> (~>) ErrorMessage ErrorMessage
+    data (<>:@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (:<>:@#@$$###) :: SameKind (Apply ((<>:@#@$$) a0123456789876543210) arg) ((<>:@#@$$$) a0123456789876543210 arg) =>
+                          (<>:@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((<>:@#@$$) a0123456789876543210) a0123456789876543210 = (<>:@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((<>:@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (:<>:@#@$$###)) ())
+    type (<>:@#@$$$) (a0123456789876543210 :: ErrorMessage) (a0123456789876543210 :: ErrorMessage) =
+        (<>:) a0123456789876543210 a0123456789876543210 :: ErrorMessage
+    type ($$:@#@$) :: (~>) ErrorMessage ((~>) ErrorMessage ErrorMessage)
+    data ($$:@#@$) a0123456789876543210
+      where
+        (:$$:@#@$###) :: SameKind (Apply ($$:@#@$) arg) (($$:@#@$$) arg) =>
+                         ($$:@#@$) a0123456789876543210
+    type instance Apply ($$:@#@$) a0123456789876543210 = ($$:@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings ($$:@#@$) where
+      suppressUnusedWarnings = snd (((,) (:$$:@#@$###)) ())
+    type ($$:@#@$$) :: ErrorMessage -> (~>) ErrorMessage ErrorMessage
+    data ($$:@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (:$$:@#@$$###) :: SameKind (Apply (($$:@#@$$) a0123456789876543210) arg) (($$:@#@$$$) a0123456789876543210 arg) =>
+                          ($$:@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply (($$:@#@$$) a0123456789876543210) a0123456789876543210 = ($$:@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (($$:@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (:$$:@#@$$###)) ())
+    type ($$:@#@$$$) (a0123456789876543210 :: ErrorMessage) (a0123456789876543210 :: ErrorMessage) =
+        ($$:) a0123456789876543210 a0123456789876543210 :: ErrorMessage
+    type (<>:) :: ErrorMessage -> ErrorMessage -> ErrorMessage
+    type family (<>:) a a where
+      (<>:) x y = Apply (Apply (:<>:@#@$) x) y
+    type ($$:) :: ErrorMessage -> ErrorMessage -> ErrorMessage
+    type family ($$:) a a where
+      ($$:) x y = Apply (Apply (:$$:@#@$) x) y
+    (%<>:) ::
+      forall (t :: ErrorMessage) (t :: ErrorMessage).
+      Sing t
+      -> Sing t -> Sing (Apply (Apply (<>:@#@$) t) t :: ErrorMessage)
+    (%$$:) ::
+      forall (t :: ErrorMessage) (t :: ErrorMessage).
+      Sing t
+      -> Sing t -> Sing (Apply (Apply ($$:@#@$) t) t :: ErrorMessage)
+    (%<>:) (sX :: Sing x) (sY :: Sing y)
+      = (applySing ((applySing ((singFun2 @(:<>:@#@$)) (:%<>:))) sX)) sY
+    (%$$:) (sX :: Sing x) (sY :: Sing y)
+      = (applySing ((applySing ((singFun2 @(:$$:@#@$)) (:%$$:))) sX)) sY
+    instance SingI ((<>:@#@$) :: (~>) ErrorMessage ((~>) ErrorMessage ErrorMessage)) where
+      sing = (singFun2 @(<>:@#@$)) (%<>:)
+    instance SingI d =>
+             SingI ((<>:@#@$$) (d :: ErrorMessage) :: (~>) ErrorMessage ErrorMessage) where
+      sing
+        = (singFun1 @((<>:@#@$$) (d :: ErrorMessage))) ((%<>:) (sing @d))
+    instance SingI (($$:@#@$) :: (~>) ErrorMessage ((~>) ErrorMessage ErrorMessage)) where
+      sing = (singFun2 @($$:@#@$)) (%$$:)
+    instance SingI d =>
+             SingI (($$:@#@$$) (d :: ErrorMessage) :: (~>) ErrorMessage ErrorMessage) where
+      sing
+        = (singFun1 @(($$:@#@$$) (d :: ErrorMessage))) ((%$$:) (sing @d))
+    data SErrorMessage :: ErrorMessage -> GHC.Types.Type
+      where
+        (:%$$:) :: forall (n :: ErrorMessage) (n :: ErrorMessage).
+                   (Sing n) -> (Sing n) -> SErrorMessage ((:$$:) n n :: ErrorMessage)
+        (:%<>:) :: forall (n :: ErrorMessage) (n :: ErrorMessage).
+                   (Sing n) -> (Sing n) -> SErrorMessage ((:<>:) n n :: ErrorMessage)
+        SEM :: forall (n :: [Bool]).
+               (Sing n) -> SErrorMessage (EM n :: ErrorMessage)
+    type instance Sing @ErrorMessage = SErrorMessage
+    instance SingKind ErrorMessage where
+      type Demote ErrorMessage = ErrorMessage
+      fromSing ((:%$$:) b b) = ((:$$:) (fromSing b)) (fromSing b)
+      fromSing ((:%<>:) b b) = ((:<>:) (fromSing b)) (fromSing b)
+      fromSing (SEM b) = EM (fromSing b)
+      toSing
+        ((:$$:) (b :: Demote ErrorMessage) (b :: Demote ErrorMessage))
+        = case
+              ((,) (toSing b :: SomeSing ErrorMessage))
+                (toSing b :: SomeSing ErrorMessage)
+          of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:%$$:) c) c) }
+      toSing
+        ((:<>:) (b :: Demote ErrorMessage) (b :: Demote ErrorMessage))
+        = case
+              ((,) (toSing b :: SomeSing ErrorMessage))
+                (toSing b :: SomeSing ErrorMessage)
+          of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:%<>:) c) c) }
+      toSing (EM (b :: Demote [Bool]))
+        = case toSing b :: SomeSing [Bool] of {
+            SomeSing c -> SomeSing (SEM c) }
+    instance (SingI n, SingI n) =>
+             SingI ((:$$:) (n :: ErrorMessage) (n :: ErrorMessage)) where
+      sing = ((:%$$:) sing) sing
+    instance SingI ((:$$:@#@$) :: (~>) ErrorMessage ((~>) ErrorMessage ErrorMessage)) where
+      sing = (singFun2 @(:$$:@#@$)) (:%$$:)
+    instance SingI d =>
+             SingI ((:$$:@#@$$) (d :: ErrorMessage) :: (~>) ErrorMessage ErrorMessage) where
+      sing
+        = (singFun1 @((:$$:@#@$$) (d :: ErrorMessage))) ((:%$$:) (sing @d))
+    instance (SingI n, SingI n) =>
+             SingI ((:<>:) (n :: ErrorMessage) (n :: ErrorMessage)) where
+      sing = ((:%<>:) sing) sing
+    instance SingI ((:<>:@#@$) :: (~>) ErrorMessage ((~>) ErrorMessage ErrorMessage)) where
+      sing = (singFun2 @(:<>:@#@$)) (:%<>:)
+    instance SingI d =>
+             SingI ((:<>:@#@$$) (d :: ErrorMessage) :: (~>) ErrorMessage ErrorMessage) where
+      sing
+        = (singFun1 @((:<>:@#@$$) (d :: ErrorMessage))) ((:%<>:) (sing @d))
+    instance SingI n => SingI (EM (n :: [Bool])) where
+      sing = SEM sing
+    instance SingI (EMSym0 :: (~>) [Bool] ErrorMessage) where
+      sing = (singFun1 @EMSym0) SEM
diff --git a/tests/compile-and-dump/Singletons/T204.golden b/tests/compile-and-dump/Singletons/T204.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T204.golden
@@ -0,0 +1,90 @@
+Singletons/T204.hs:(0,0)-(0,0): Splicing declarations
+    let
+      sing_data_con_name :: Name -> Name
+      sing_data_con_name n
+        = case nameBase n of
+            ':' : '%' : rest -> mkName $ ":^%" ++ rest
+            _ -> singledDataConName defaultOptions n
+    in
+      withOptions
+        defaultOptions {singledDataConName = sing_data_con_name}
+        $ singletons
+            $ lift
+                [d| data Ratio1 a = a :% a
+                    data Ratio2 a = a :%% a |]
+  ======>
+    data Ratio1 a = a :% a
+    data Ratio2 a = a :%% a
+    type (:%@#@$) :: forall a. (~>) a ((~>) a (Ratio1 a))
+    data (:%@#@$) a0123456789876543210
+      where
+        (::%@#@$###) :: SameKind (Apply (:%@#@$) arg) ((:%@#@$$) arg) =>
+                        (:%@#@$) a0123456789876543210
+    type instance Apply (:%@#@$) a0123456789876543210 = (:%@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (:%@#@$) where
+      suppressUnusedWarnings = snd (((,) (::%@#@$###)) ())
+    type (:%@#@$$) :: forall a. a -> (~>) a (Ratio1 a)
+    data (:%@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (::%@#@$$###) :: SameKind (Apply ((:%@#@$$) a0123456789876543210) arg) ((:%@#@$$$) a0123456789876543210 arg) =>
+                         (:%@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((:%@#@$$) a0123456789876543210) a0123456789876543210 = (:%@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((:%@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (::%@#@$$###)) ())
+    type (:%@#@$$$) (a0123456789876543210 :: a) (a0123456789876543210 :: a) =
+        (:%) a0123456789876543210 a0123456789876543210 :: Ratio1 a
+    type (:%%@#@$) :: forall a. (~>) a ((~>) a (Ratio2 a))
+    data (:%%@#@$) a0123456789876543210
+      where
+        (::%%@#@$###) :: SameKind (Apply (:%%@#@$) arg) ((:%%@#@$$) arg) =>
+                         (:%%@#@$) a0123456789876543210
+    type instance Apply (:%%@#@$) a0123456789876543210 = (:%%@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (:%%@#@$) where
+      suppressUnusedWarnings = snd (((,) (::%%@#@$###)) ())
+    type (:%%@#@$$) :: forall a. a -> (~>) a (Ratio2 a)
+    data (:%%@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (::%%@#@$$###) :: SameKind (Apply ((:%%@#@$$) a0123456789876543210) arg) ((:%%@#@$$$) a0123456789876543210 arg) =>
+                          (:%%@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((:%%@#@$$) a0123456789876543210) a0123456789876543210 = (:%%@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((:%%@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (::%%@#@$$###)) ())
+    type (:%%@#@$$$) (a0123456789876543210 :: a) (a0123456789876543210 :: a) =
+        (:%%) a0123456789876543210 a0123456789876543210 :: Ratio2 a
+    data SRatio1 :: forall a. Ratio1 a -> GHC.Types.Type
+      where
+        (:^%) :: forall a (n :: a) (n :: a).
+                 (Sing n) -> (Sing n) -> SRatio1 ((:%) n n :: Ratio1 a)
+    type instance Sing @(Ratio1 a) = SRatio1
+    instance SingKind a => SingKind (Ratio1 a) where
+      type Demote (Ratio1 a) = Ratio1 (Demote a)
+      fromSing ((:^%) b b) = ((:%) (fromSing b)) (fromSing b)
+      toSing ((:%) (b :: Demote a) (b :: Demote a))
+        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing a) of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:^%) c) c) }
+    data SRatio2 :: forall a. Ratio2 a -> GHC.Types.Type
+      where
+        (:^%%) :: forall a (n :: a) (n :: a).
+                  (Sing n) -> (Sing n) -> SRatio2 ((:%%) n n :: Ratio2 a)
+    type instance Sing @(Ratio2 a) = SRatio2
+    instance SingKind a => SingKind (Ratio2 a) where
+      type Demote (Ratio2 a) = Ratio2 (Demote a)
+      fromSing ((:^%%) b b) = ((:%%) (fromSing b)) (fromSing b)
+      toSing ((:%%) (b :: Demote a) (b :: Demote a))
+        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing a) of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing (((:^%%) c) c) }
+    instance (SingI n, SingI n) => SingI ((:%) (n :: a) (n :: a)) where
+      sing = ((:^%) sing) sing
+    instance SingI ((:%@#@$) :: (~>) a ((~>) a (Ratio1 a))) where
+      sing = (singFun2 @(:%@#@$)) (:^%)
+    instance SingI d =>
+             SingI ((:%@#@$$) (d :: a) :: (~>) a (Ratio1 a)) where
+      sing = (singFun1 @((:%@#@$$) (d :: a))) ((:^%) (sing @d))
+    instance (SingI n, SingI n) =>
+             SingI ((:%%) (n :: a) (n :: a)) where
+      sing = ((:^%%) sing) sing
+    instance SingI ((:%%@#@$) :: (~>) a ((~>) a (Ratio2 a))) where
+      sing = (singFun2 @(:%%@#@$)) (:^%%)
+    instance SingI d =>
+             SingI ((:%%@#@$$) (d :: a) :: (~>) a (Ratio2 a)) where
+      sing = (singFun1 @((:%%@#@$$) (d :: a))) ((:^%%) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T204.hs b/tests/compile-and-dump/Singletons/T204.hs
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T204.hs
@@ -0,0 +1,17 @@
+module T204 where
+
+import Control.Monad.Trans.Class
+import Data.Singletons.TH
+import Data.Singletons.TH.Options
+import Language.Haskell.TH
+
+$(let sing_data_con_name :: Name -> Name
+      sing_data_con_name n =
+        case nameBase n of
+          ':':'%':rest -> mkName $ ":^%" ++ rest
+          _            -> singledDataConName defaultOptions n in
+  withOptions defaultOptions{singledDataConName = sing_data_con_name} $
+    singletons $ lift
+    [d| data Ratio1 a = a :%  a
+        data Ratio2 a = a :%% a
+      |])
diff --git a/tests/compile-and-dump/Singletons/T206.ghc88.template b/tests/compile-and-dump/Singletons/T206.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T206.ghc88.template
+++ /dev/null
diff --git a/tests/compile-and-dump/Singletons/T206.golden b/tests/compile-and-dump/Singletons/T206.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T206.golden
diff --git a/tests/compile-and-dump/Singletons/T209.ghc88.template b/tests/compile-and-dump/Singletons/T209.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T209.ghc88.template
+++ /dev/null
@@ -1,82 +0,0 @@
-Singletons/T209.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| m :: a -> b -> Bool -> Bool
-          m _ _ x = x
-          
-          class C a b
-          data Hm
-            = Hm
-            deriving anyclass (C Bool)
-          
-          deriving anyclass instance C a a => C a (Maybe a) |]
-  ======>
-    class C a b
-    m :: a -> b -> Bool -> Bool
-    m _ _ x = x
-    data Hm
-      = Hm
-      deriving anyclass (C Bool)
-    deriving anyclass instance C a a => C a (Maybe a)
-    type HmSym0 = Hm
-    type MSym3 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: b0123456789876543210) (a0123456789876543210 :: Bool) =
-        M a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (MSym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) MSym2KindInference) ())
-    data MSym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: b0123456789876543210) :: (~>) Bool Bool
-      where
-        MSym2KindInference :: forall a0123456789876543210
-                                     a0123456789876543210
-                                     a0123456789876543210
-                                     arg. SameKind (Apply (MSym2 a0123456789876543210 a0123456789876543210) arg) (MSym3 a0123456789876543210 a0123456789876543210 arg) =>
-                              MSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (MSym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = M a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (MSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) MSym1KindInference) ())
-    data MSym1 (a0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                 (~>) b0123456789876543210 ((~>) Bool Bool)
-      where
-        MSym1KindInference :: forall a0123456789876543210
-                                     a0123456789876543210
-                                     arg. SameKind (Apply (MSym1 a0123456789876543210) arg) (MSym2 a0123456789876543210 arg) =>
-                              MSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (MSym1 a0123456789876543210) a0123456789876543210 = MSym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings MSym0 where
-      suppressUnusedWarnings = snd (((,) MSym0KindInference) ())
-    data MSym0 :: forall a0123456789876543210 b0123456789876543210.
-                  (~>) a0123456789876543210 ((~>) b0123456789876543210 ((~>) Bool Bool))
-      where
-        MSym0KindInference :: forall a0123456789876543210
-                                     arg. SameKind (Apply MSym0 arg) (MSym1 arg) =>
-                              MSym0 a0123456789876543210
-    type instance Apply MSym0 a0123456789876543210 = MSym1 a0123456789876543210
-    type family M (a :: a) (a :: b) (a :: Bool) :: Bool where
-      M _ _ x = x
-    class PC (a :: GHC.Types.Type) (b :: GHC.Types.Type)
-    instance PC Bool Hm
-    instance PC a (Maybe a)
-    sM ::
-      forall a b (t :: a) (t :: b) (t :: Bool).
-      Sing t
-      -> Sing t
-         -> Sing t -> Sing (Apply (Apply (Apply MSym0 t) t) t :: Bool)
-    sM _ _ (sX :: Sing x) = sX
-    instance SingI (MSym0 :: (~>) a ((~>) b ((~>) Bool Bool))) where
-      sing = (singFun3 @MSym0) sM
-    instance SingI d =>
-             SingI (MSym1 (d :: a) :: (~>) b ((~>) Bool Bool)) where
-      sing = (singFun2 @(MSym1 (d :: a))) (sM (sing @d))
-    instance (SingI d, SingI d) =>
-             SingI (MSym2 (d :: a) (d :: b) :: (~>) Bool Bool) where
-      sing
-        = (singFun1 @(MSym2 (d :: a) (d :: b))) ((sM (sing @d)) (sing @d))
-    data SHm :: Hm -> GHC.Types.Type where SHm :: SHm Hm
-    type instance Sing @Hm = SHm
-    instance SingKind Hm where
-      type Demote Hm = Hm
-      fromSing SHm = Hm
-      toSing Hm = SomeSing SHm
-    class SC a b
-    instance SC Bool Hm
-    instance SC a a => SC a (Maybe a)
-    instance SingI Hm where
-      sing = SHm
diff --git a/tests/compile-and-dump/Singletons/T209.golden b/tests/compile-and-dump/Singletons/T209.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T209.golden
@@ -0,0 +1,78 @@
+Singletons/T209.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| m :: a -> b -> Bool -> Bool
+          m _ _ x = x
+          
+          class C a b
+          data Hm
+            = Hm
+            deriving anyclass (C Bool)
+          
+          deriving anyclass instance C a a => C a (Maybe a) |]
+  ======>
+    class C a b
+    m :: a -> b -> Bool -> Bool
+    m _ _ x = x
+    data Hm
+      = Hm
+      deriving anyclass (C Bool)
+    deriving anyclass instance C a a => C a (Maybe a)
+    type HmSym0 = Hm :: Hm
+    type MSym0 :: (~>) a ((~>) b ((~>) Bool Bool))
+    data MSym0 a0123456789876543210
+      where
+        MSym0KindInference :: SameKind (Apply MSym0 arg) (MSym1 arg) =>
+                              MSym0 a0123456789876543210
+    type instance Apply MSym0 a0123456789876543210 = MSym1 a0123456789876543210
+    instance SuppressUnusedWarnings MSym0 where
+      suppressUnusedWarnings = snd (((,) MSym0KindInference) ())
+    type MSym1 :: a -> (~>) b ((~>) Bool Bool)
+    data MSym1 a0123456789876543210 a0123456789876543210
+      where
+        MSym1KindInference :: SameKind (Apply (MSym1 a0123456789876543210) arg) (MSym2 a0123456789876543210 arg) =>
+                              MSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (MSym1 a0123456789876543210) a0123456789876543210 = MSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (MSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) MSym1KindInference) ())
+    type MSym2 :: a -> b -> (~>) Bool Bool
+    data MSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        MSym2KindInference :: SameKind (Apply (MSym2 a0123456789876543210 a0123456789876543210) arg) (MSym3 a0123456789876543210 a0123456789876543210 arg) =>
+                              MSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (MSym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = MSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (MSym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) MSym2KindInference) ())
+    type MSym3 (a0123456789876543210 :: a) (a0123456789876543210 :: b) (a0123456789876543210 :: Bool) =
+        M a0123456789876543210 a0123456789876543210 a0123456789876543210 :: Bool
+    type M :: a -> b -> Bool -> Bool
+    type family M a a a where
+      M _ _ x = x
+    class PC a b
+    instance PC Bool Hm
+    instance PC a (Maybe a)
+    sM ::
+      forall a b (t :: a) (t :: b) (t :: Bool).
+      Sing t
+      -> Sing t
+         -> Sing t -> Sing (Apply (Apply (Apply MSym0 t) t) t :: Bool)
+    sM _ _ (sX :: Sing x) = sX
+    instance SingI (MSym0 :: (~>) a ((~>) b ((~>) Bool Bool))) where
+      sing = (singFun3 @MSym0) sM
+    instance SingI d =>
+             SingI (MSym1 (d :: a) :: (~>) b ((~>) Bool Bool)) where
+      sing = (singFun2 @(MSym1 (d :: a))) (sM (sing @d))
+    instance (SingI d, SingI d) =>
+             SingI (MSym2 (d :: a) (d :: b) :: (~>) Bool Bool) where
+      sing
+        = (singFun1 @(MSym2 (d :: a) (d :: b))) ((sM (sing @d)) (sing @d))
+    data SHm :: Hm -> GHC.Types.Type where SHm :: SHm (Hm :: Hm)
+    type instance Sing @Hm = SHm
+    instance SingKind Hm where
+      type Demote Hm = Hm
+      fromSing SHm = Hm
+      toSing Hm = SomeSing SHm
+    class SC a b
+    instance SC Bool Hm
+    instance SC a a => SC a (Maybe a)
+    instance SingI Hm where
+      sing = SHm
diff --git a/tests/compile-and-dump/Singletons/T216.ghc88.template b/tests/compile-and-dump/Singletons/T216.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T216.ghc88.template
+++ /dev/null
@@ -1,56 +0,0 @@
-Singletons/T216.hs:0:0:: Splicing declarations
-    genDefunSymbols [''MyProxy, ''Symmetry]
-  ======>
-    type MyProxySym2 (k0123456789876543210 :: Type) (a0123456789876543210 :: k0123456789876543210) =
-        MyProxy k0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (MyProxySym1 k0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) MyProxySym1KindInference) ())
-    data MyProxySym1 (k0123456789876543210 :: Type) :: (~>) k0123456789876543210 Type
-      where
-        MyProxySym1KindInference :: forall k0123456789876543210
-                                           a0123456789876543210
-                                           arg. SameKind (Apply (MyProxySym1 k0123456789876543210) arg) (MyProxySym2 k0123456789876543210 arg) =>
-                                    MyProxySym1 k0123456789876543210 a0123456789876543210
-    type instance Apply (MyProxySym1 k0123456789876543210) a0123456789876543210 = MyProxy k0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings MyProxySym0 where
-      suppressUnusedWarnings = snd (((,) MyProxySym0KindInference) ())
-    data MyProxySym0 :: forall (k0123456789876543210 :: Type).
-                        (~>) Type ((~>) k0123456789876543210 Type)
-      where
-        MyProxySym0KindInference :: forall k0123456789876543210
-                                           arg. SameKind (Apply MyProxySym0 arg) (MyProxySym1 arg) =>
-                                    MyProxySym0 k0123456789876543210
-    type instance Apply MyProxySym0 k0123456789876543210 = MyProxySym1 k0123456789876543210
-    type SymmetrySym3 (a0123456789876543210 :: t0123456789876543210) (y0123456789876543210 :: t0123456789876543210) (e0123456789876543210 :: (:~:) a0123456789876543210 y0123456789876543210) =
-        Symmetry a0123456789876543210 y0123456789876543210 e0123456789876543210
-    instance SuppressUnusedWarnings (SymmetrySym2 y0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) SymmetrySym2KindInference) ())
-    data SymmetrySym2 (a0123456789876543210 :: t0123456789876543210) (y0123456789876543210 :: t0123456789876543210) :: (~>) ((:~:) a0123456789876543210 y0123456789876543210) Type
-      where
-        SymmetrySym2KindInference :: forall a0123456789876543210
-                                            y0123456789876543210
-                                            e0123456789876543210
-                                            arg. SameKind (Apply (SymmetrySym2 a0123456789876543210 y0123456789876543210) arg) (SymmetrySym3 a0123456789876543210 y0123456789876543210 arg) =>
-                                     SymmetrySym2 a0123456789876543210 y0123456789876543210 e0123456789876543210
-    type instance Apply (SymmetrySym2 y0123456789876543210 a0123456789876543210) e0123456789876543210 = Symmetry y0123456789876543210 a0123456789876543210 e0123456789876543210
-    instance SuppressUnusedWarnings (SymmetrySym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) SymmetrySym1KindInference) ())
-    data SymmetrySym1 (a0123456789876543210 :: t0123456789876543210) :: forall (y0123456789876543210 :: t0123456789876543210).
-                                                                        (~>) t0123456789876543210 ((~>) ((:~:) a0123456789876543210 y0123456789876543210) Type)
-      where
-        SymmetrySym1KindInference :: forall a0123456789876543210
-                                            y0123456789876543210
-                                            arg. SameKind (Apply (SymmetrySym1 a0123456789876543210) arg) (SymmetrySym2 a0123456789876543210 arg) =>
-                                     SymmetrySym1 a0123456789876543210 y0123456789876543210
-    type instance Apply (SymmetrySym1 a0123456789876543210) y0123456789876543210 = SymmetrySym2 a0123456789876543210 y0123456789876543210
-    instance SuppressUnusedWarnings SymmetrySym0 where
-      suppressUnusedWarnings = snd (((,) SymmetrySym0KindInference) ())
-    data SymmetrySym0 :: forall t0123456789876543210
-                                (a0123456789876543210 :: t0123456789876543210)
-                                (y0123456789876543210 :: t0123456789876543210).
-                         (~>) t0123456789876543210 ((~>) t0123456789876543210 ((~>) ((:~:) a0123456789876543210 y0123456789876543210) Type))
-      where
-        SymmetrySym0KindInference :: forall a0123456789876543210
-                                            arg. SameKind (Apply SymmetrySym0 arg) (SymmetrySym1 arg) =>
-                                     SymmetrySym0 a0123456789876543210
-    type instance Apply SymmetrySym0 a0123456789876543210 = SymmetrySym1 a0123456789876543210
diff --git a/tests/compile-and-dump/Singletons/T216.golden b/tests/compile-and-dump/Singletons/T216.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T216.golden
@@ -0,0 +1,42 @@
+Singletons/T216.hs:0:0:: Splicing declarations
+    genDefunSymbols [''MyProxy, ''Symmetry]
+  ======>
+    data MyProxySym0 :: (~>) Type ((~>) k0123456789876543210 Type)
+      where
+        MyProxySym0KindInference :: SameKind (Apply MyProxySym0 arg) (MyProxySym1 arg) =>
+                                    MyProxySym0 k0123456789876543210
+    type instance Apply MyProxySym0 k0123456789876543210 = MyProxySym1 k0123456789876543210
+    instance SuppressUnusedWarnings MyProxySym0 where
+      suppressUnusedWarnings = snd (((,) MyProxySym0KindInference) ())
+    data MyProxySym1 (k0123456789876543210 :: Type) :: (~>) k0123456789876543210 Type
+      where
+        MyProxySym1KindInference :: SameKind (Apply (MyProxySym1 k0123456789876543210) arg) (MyProxySym2 k0123456789876543210 arg) =>
+                                    MyProxySym1 k0123456789876543210 e
+    type instance Apply (MyProxySym1 k0123456789876543210) e = MyProxySym2 k0123456789876543210 e
+    instance SuppressUnusedWarnings (MyProxySym1 k0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) MyProxySym1KindInference) ())
+    type MyProxySym2 (k0123456789876543210 :: Type) (e :: k0123456789876543210) =
+        MyProxy k0123456789876543210 e :: Type
+    data SymmetrySym0 :: (~>) t0123456789876543210 ((~>) t0123456789876543210 ((~>) ((:~:) a0123456789876543210 y0123456789876543210) Type))
+      where
+        SymmetrySym0KindInference :: SameKind (Apply SymmetrySym0 arg) (SymmetrySym1 arg) =>
+                                     SymmetrySym0 a0123456789876543210
+    type instance Apply SymmetrySym0 a0123456789876543210 = SymmetrySym1 a0123456789876543210
+    instance SuppressUnusedWarnings SymmetrySym0 where
+      suppressUnusedWarnings = snd (((,) SymmetrySym0KindInference) ())
+    data SymmetrySym1 (a0123456789876543210 :: t0123456789876543210) :: (~>) t0123456789876543210 ((~>) ((:~:) a0123456789876543210 y0123456789876543210) Type)
+      where
+        SymmetrySym1KindInference :: SameKind (Apply (SymmetrySym1 a0123456789876543210) arg) (SymmetrySym2 a0123456789876543210 arg) =>
+                                     SymmetrySym1 a0123456789876543210 y0123456789876543210
+    type instance Apply (SymmetrySym1 a0123456789876543210) y0123456789876543210 = SymmetrySym2 a0123456789876543210 y0123456789876543210
+    instance SuppressUnusedWarnings (SymmetrySym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) SymmetrySym1KindInference) ())
+    data SymmetrySym2 (a0123456789876543210 :: t0123456789876543210) (y0123456789876543210 :: t0123456789876543210) :: (~>) ((:~:) a0123456789876543210 y0123456789876543210) Type
+      where
+        SymmetrySym2KindInference :: SameKind (Apply (SymmetrySym2 a0123456789876543210 y0123456789876543210) arg) (SymmetrySym3 a0123456789876543210 y0123456789876543210 arg) =>
+                                     SymmetrySym2 a0123456789876543210 y0123456789876543210 e
+    type instance Apply (SymmetrySym2 a0123456789876543210 y0123456789876543210) e = SymmetrySym3 a0123456789876543210 y0123456789876543210 e
+    instance SuppressUnusedWarnings (SymmetrySym2 a0123456789876543210 y0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) SymmetrySym2KindInference) ())
+    type SymmetrySym3 (a0123456789876543210 :: t0123456789876543210) (y0123456789876543210 :: t0123456789876543210) (e :: (:~:) a0123456789876543210 y0123456789876543210) =
+        Symmetry a0123456789876543210 y0123456789876543210 e :: Type
diff --git a/tests/compile-and-dump/Singletons/T226.ghc88.template b/tests/compile-and-dump/Singletons/T226.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T226.ghc88.template
+++ /dev/null
@@ -1,6 +0,0 @@
-Singletons/T226.hs:0:0:: Splicing declarations
-    singletons [d| class a ~> b |]
-  ======>
-    class (~>) a b
-    class (#~>) (a :: GHC.Types.Type) (b :: GHC.Types.Type)
-    class (%~>) a b
diff --git a/tests/compile-and-dump/Singletons/T226.golden b/tests/compile-and-dump/Singletons/T226.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T226.golden
@@ -0,0 +1,6 @@
+Singletons/T226.hs:0:0:: Splicing declarations
+    singletons [d| class a ~> b |]
+  ======>
+    class (~>) a b
+    class (#~>) a b
+    class (%~>) a b
diff --git a/tests/compile-and-dump/Singletons/T229.ghc88.template b/tests/compile-and-dump/Singletons/T229.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T229.ghc88.template
+++ /dev/null
@@ -1,24 +0,0 @@
-Singletons/T229.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| ___foo :: Bool -> Bool
-          ___foo _ = True |]
-  ======>
-    ___foo :: Bool -> Bool
-    ___foo _ = True
-    type US___fooSym1 (a0123456789876543210 :: Bool) =
-        US___foo a0123456789876543210
-    instance SuppressUnusedWarnings US___fooSym0 where
-      suppressUnusedWarnings = snd (((,) US___fooSym0KindInference) ())
-    data US___fooSym0 :: (~>) Bool Bool
-      where
-        US___fooSym0KindInference :: forall a0123456789876543210
-                                            arg. SameKind (Apply US___fooSym0 arg) (US___fooSym1 arg) =>
-                                     US___fooSym0 a0123456789876543210
-    type instance Apply US___fooSym0 a0123456789876543210 = US___foo a0123456789876543210
-    type family US___foo (a :: Bool) :: Bool where
-      US___foo _ = TrueSym0
-    ___sfoo ::
-      forall (t :: Bool). Sing t -> Sing (Apply US___fooSym0 t :: Bool)
-    ___sfoo _ = STrue
-    instance SingI (US___fooSym0 :: (~>) Bool Bool) where
-      sing = (singFun1 @US___fooSym0) ___sfoo
diff --git a/tests/compile-and-dump/Singletons/T229.golden b/tests/compile-and-dump/Singletons/T229.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T229.golden
@@ -0,0 +1,25 @@
+Singletons/T229.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| ___foo :: Bool -> Bool
+          ___foo _ = True |]
+  ======>
+    ___foo :: Bool -> Bool
+    ___foo _ = True
+    type US___fooSym0 :: (~>) Bool Bool
+    data US___fooSym0 a0123456789876543210
+      where
+        US___fooSym0KindInference :: SameKind (Apply US___fooSym0 arg) (US___fooSym1 arg) =>
+                                     US___fooSym0 a0123456789876543210
+    type instance Apply US___fooSym0 a0123456789876543210 = US___fooSym1 a0123456789876543210
+    instance SuppressUnusedWarnings US___fooSym0 where
+      suppressUnusedWarnings = snd (((,) US___fooSym0KindInference) ())
+    type US___fooSym1 (a0123456789876543210 :: Bool) =
+        US___foo a0123456789876543210 :: Bool
+    type US___foo :: Bool -> Bool
+    type family US___foo a where
+      US___foo _ = TrueSym0
+    ___sfoo ::
+      forall (t :: Bool). Sing t -> Sing (Apply US___fooSym0 t :: Bool)
+    ___sfoo _ = STrue
+    instance SingI (US___fooSym0 :: (~>) Bool Bool) where
+      sing = (singFun1 @US___fooSym0) ___sfoo
diff --git a/tests/compile-and-dump/Singletons/T249.ghc88.template b/tests/compile-and-dump/Singletons/T249.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T249.ghc88.template
+++ /dev/null
@@ -1,84 +0,0 @@
-Singletons/T249.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| data Foo1 a = MkFoo1 a
-          data Foo2 a where MkFoo2 :: x -> Foo2 x
-          data Foo3 a where MkFoo3 :: forall x. x -> Foo3 x |]
-  ======>
-    data Foo1 a = MkFoo1 a
-    data Foo2 a where MkFoo2 :: x -> Foo2 x
-    data Foo3 a where MkFoo3 :: forall x. x -> Foo3 x
-    type MkFoo1Sym1 (t0123456789876543210 :: a0123456789876543210) =
-        MkFoo1 t0123456789876543210
-    instance SuppressUnusedWarnings MkFoo1Sym0 where
-      suppressUnusedWarnings = snd (((,) MkFoo1Sym0KindInference) ())
-    data MkFoo1Sym0 :: forall a0123456789876543210.
-                       (~>) a0123456789876543210 (Foo1 a0123456789876543210)
-      where
-        MkFoo1Sym0KindInference :: forall t0123456789876543210
-                                          arg. SameKind (Apply MkFoo1Sym0 arg) (MkFoo1Sym1 arg) =>
-                                   MkFoo1Sym0 t0123456789876543210
-    type instance Apply MkFoo1Sym0 t0123456789876543210 = MkFoo1 t0123456789876543210
-    type MkFoo2Sym1 (t0123456789876543210 :: x0123456789876543210) =
-        MkFoo2 t0123456789876543210
-    instance SuppressUnusedWarnings MkFoo2Sym0 where
-      suppressUnusedWarnings = snd (((,) MkFoo2Sym0KindInference) ())
-    data MkFoo2Sym0 :: forall x0123456789876543210.
-                       (~>) x0123456789876543210 (Foo2 x0123456789876543210)
-      where
-        MkFoo2Sym0KindInference :: forall t0123456789876543210
-                                          arg. SameKind (Apply MkFoo2Sym0 arg) (MkFoo2Sym1 arg) =>
-                                   MkFoo2Sym0 t0123456789876543210
-    type instance Apply MkFoo2Sym0 t0123456789876543210 = MkFoo2 t0123456789876543210
-    type MkFoo3Sym1 (t0123456789876543210 :: x0123456789876543210) =
-        MkFoo3 t0123456789876543210
-    instance SuppressUnusedWarnings MkFoo3Sym0 where
-      suppressUnusedWarnings = snd (((,) MkFoo3Sym0KindInference) ())
-    data MkFoo3Sym0 :: forall x0123456789876543210.
-                       (~>) x0123456789876543210 (Foo3 x0123456789876543210)
-      where
-        MkFoo3Sym0KindInference :: forall t0123456789876543210
-                                          arg. SameKind (Apply MkFoo3Sym0 arg) (MkFoo3Sym1 arg) =>
-                                   MkFoo3Sym0 t0123456789876543210
-    type instance Apply MkFoo3Sym0 t0123456789876543210 = MkFoo3 t0123456789876543210
-    data SFoo1 :: forall a. Foo1 a -> Type
-      where
-        SMkFoo1 :: forall a (n :: a). (Sing (n :: a)) -> SFoo1 (MkFoo1 n)
-    type instance Sing @(Foo1 a) = SFoo1
-    instance SingKind a => SingKind (Foo1 a) where
-      type Demote (Foo1 a) = Foo1 (Demote a)
-      fromSing (SMkFoo1 b) = MkFoo1 (fromSing b)
-      toSing (MkFoo1 (b :: Demote a))
-        = case toSing b :: SomeSing a of {
-            SomeSing c -> SomeSing (SMkFoo1 c) }
-    data SFoo2 :: forall a. Foo2 a -> Type
-      where
-        SMkFoo2 :: forall x (n :: x). (Sing (n :: x)) -> SFoo2 (MkFoo2 n)
-    type instance Sing @(Foo2 a) = SFoo2
-    instance SingKind a => SingKind (Foo2 a) where
-      type Demote (Foo2 a) = Foo2 (Demote a)
-      fromSing (SMkFoo2 b) = MkFoo2 (fromSing b)
-      toSing (MkFoo2 (b :: Demote x))
-        = case toSing b :: SomeSing x of {
-            SomeSing c -> SomeSing (SMkFoo2 c) }
-    data SFoo3 :: forall a. Foo3 a -> Type
-      where
-        SMkFoo3 :: forall x (n :: x). (Sing (n :: x)) -> SFoo3 (MkFoo3 n)
-    type instance Sing @(Foo3 a) = SFoo3
-    instance SingKind a => SingKind (Foo3 a) where
-      type Demote (Foo3 a) = Foo3 (Demote a)
-      fromSing (SMkFoo3 b) = MkFoo3 (fromSing b)
-      toSing (MkFoo3 (b :: Demote x))
-        = case toSing b :: SomeSing x of {
-            SomeSing c -> SomeSing (SMkFoo3 c) }
-    instance SingI n => SingI (MkFoo1 (n :: a)) where
-      sing = SMkFoo1 sing
-    instance SingI (MkFoo1Sym0 :: (~>) a (Foo1 a)) where
-      sing = (singFun1 @MkFoo1Sym0) SMkFoo1
-    instance SingI n => SingI (MkFoo2 (n :: x)) where
-      sing = SMkFoo2 sing
-    instance SingI (MkFoo2Sym0 :: (~>) x (Foo2 x)) where
-      sing = (singFun1 @MkFoo2Sym0) SMkFoo2
-    instance SingI n => SingI (MkFoo3 (n :: x)) where
-      sing = SMkFoo3 sing
-    instance SingI (MkFoo3Sym0 :: (~>) x (Foo3 x)) where
-      sing = (singFun1 @MkFoo3Sym0) SMkFoo3
diff --git a/tests/compile-and-dump/Singletons/T249.golden b/tests/compile-and-dump/Singletons/T249.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T249.golden
@@ -0,0 +1,84 @@
+Singletons/T249.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| data Foo1 a = MkFoo1 a
+          data Foo2 a where MkFoo2 :: x -> Foo2 x
+          data Foo3 a where MkFoo3 :: forall x. x -> Foo3 x |]
+  ======>
+    data Foo1 a = MkFoo1 a
+    data Foo2 a where MkFoo2 :: x -> Foo2 x
+    data Foo3 a where MkFoo3 :: forall x. x -> Foo3 x
+    type MkFoo1Sym0 :: forall a. (~>) a (Foo1 a)
+    data MkFoo1Sym0 a0123456789876543210
+      where
+        MkFoo1Sym0KindInference :: SameKind (Apply MkFoo1Sym0 arg) (MkFoo1Sym1 arg) =>
+                                   MkFoo1Sym0 a0123456789876543210
+    type instance Apply MkFoo1Sym0 a0123456789876543210 = MkFoo1Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings MkFoo1Sym0 where
+      suppressUnusedWarnings = snd (((,) MkFoo1Sym0KindInference) ())
+    type MkFoo1Sym1 (a0123456789876543210 :: a) =
+        MkFoo1 a0123456789876543210 :: Foo1 a
+    type MkFoo2Sym0 :: (~>) x (Foo2 x)
+    data MkFoo2Sym0 a0123456789876543210
+      where
+        MkFoo2Sym0KindInference :: SameKind (Apply MkFoo2Sym0 arg) (MkFoo2Sym1 arg) =>
+                                   MkFoo2Sym0 a0123456789876543210
+    type instance Apply MkFoo2Sym0 a0123456789876543210 = MkFoo2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings MkFoo2Sym0 where
+      suppressUnusedWarnings = snd (((,) MkFoo2Sym0KindInference) ())
+    type MkFoo2Sym1 (a0123456789876543210 :: x) =
+        MkFoo2 a0123456789876543210 :: Foo2 x
+    type MkFoo3Sym0 :: forall x. (~>) x (Foo3 x)
+    data MkFoo3Sym0 a0123456789876543210
+      where
+        MkFoo3Sym0KindInference :: SameKind (Apply MkFoo3Sym0 arg) (MkFoo3Sym1 arg) =>
+                                   MkFoo3Sym0 a0123456789876543210
+    type instance Apply MkFoo3Sym0 a0123456789876543210 = MkFoo3Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings MkFoo3Sym0 where
+      suppressUnusedWarnings = snd (((,) MkFoo3Sym0KindInference) ())
+    type MkFoo3Sym1 (a0123456789876543210 :: x) =
+        MkFoo3 a0123456789876543210 :: Foo3 x
+    data SFoo1 :: forall a. Foo1 a -> Type
+      where
+        SMkFoo1 :: forall a (n :: a).
+                   (Sing n) -> SFoo1 (MkFoo1 n :: Foo1 a)
+    type instance Sing @(Foo1 a) = SFoo1
+    instance SingKind a => SingKind (Foo1 a) where
+      type Demote (Foo1 a) = Foo1 (Demote a)
+      fromSing (SMkFoo1 b) = MkFoo1 (fromSing b)
+      toSing (MkFoo1 (b :: Demote a))
+        = case toSing b :: SomeSing a of {
+            SomeSing c -> SomeSing (SMkFoo1 c) }
+    data SFoo2 :: forall a. Foo2 a -> Type
+      where
+        SMkFoo2 :: forall x (n :: x).
+                   (Sing n) -> SFoo2 (MkFoo2 n :: Foo2 x)
+    type instance Sing @(Foo2 a) = SFoo2
+    instance SingKind a => SingKind (Foo2 a) where
+      type Demote (Foo2 a) = Foo2 (Demote a)
+      fromSing (SMkFoo2 b) = MkFoo2 (fromSing b)
+      toSing (MkFoo2 (b :: Demote x))
+        = case toSing b :: SomeSing x of {
+            SomeSing c -> SomeSing (SMkFoo2 c) }
+    data SFoo3 :: forall a. Foo3 a -> Type
+      where
+        SMkFoo3 :: forall x (n :: x).
+                   (Sing n) -> SFoo3 (MkFoo3 n :: Foo3 x)
+    type instance Sing @(Foo3 a) = SFoo3
+    instance SingKind a => SingKind (Foo3 a) where
+      type Demote (Foo3 a) = Foo3 (Demote a)
+      fromSing (SMkFoo3 b) = MkFoo3 (fromSing b)
+      toSing (MkFoo3 (b :: Demote x))
+        = case toSing b :: SomeSing x of {
+            SomeSing c -> SomeSing (SMkFoo3 c) }
+    instance SingI n => SingI (MkFoo1 (n :: a)) where
+      sing = SMkFoo1 sing
+    instance SingI (MkFoo1Sym0 :: (~>) a (Foo1 a)) where
+      sing = (singFun1 @MkFoo1Sym0) SMkFoo1
+    instance SingI n => SingI (MkFoo2 (n :: x)) where
+      sing = SMkFoo2 sing
+    instance SingI (MkFoo2Sym0 :: (~>) x (Foo2 x)) where
+      sing = (singFun1 @MkFoo2Sym0) SMkFoo2
+    instance SingI n => SingI (MkFoo3 (n :: x)) where
+      sing = SMkFoo3 sing
+    instance SingI (MkFoo3Sym0 :: (~>) x (Foo3 x)) where
+      sing = (singFun1 @MkFoo3Sym0) SMkFoo3
diff --git a/tests/compile-and-dump/Singletons/T271.ghc88.template b/tests/compile-and-dump/Singletons/T271.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T271.ghc88.template
+++ /dev/null
@@ -1,215 +0,0 @@
-Singletons/T271.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| newtype Constant (a :: Type) (b :: Type)
-            = Constant a
-            deriving (Eq, Ord)
-          data Identity :: Type -> Type
-            where Identity :: a -> Identity a
-            deriving (Eq, Ord) |]
-  ======>
-    newtype Constant (a :: Type) (b :: Type)
-      = Constant a
-      deriving (Eq, Ord)
-    data Identity :: Type -> Type
-      where Identity :: a -> Identity a
-      deriving (Eq, Ord)
-    type ConstantSym1 (t0123456789876543210 :: a0123456789876543210) =
-        Constant t0123456789876543210
-    instance SuppressUnusedWarnings ConstantSym0 where
-      suppressUnusedWarnings = snd (((,) ConstantSym0KindInference) ())
-    data ConstantSym0 :: forall (a0123456789876543210 :: Type)
-                                (b0123456789876543210 :: Type).
-                         (~>) a0123456789876543210 (Constant (a0123456789876543210 :: Type) (b0123456789876543210 :: Type))
-      where
-        ConstantSym0KindInference :: forall t0123456789876543210
-                                            arg. SameKind (Apply ConstantSym0 arg) (ConstantSym1 arg) =>
-                                     ConstantSym0 t0123456789876543210
-    type instance Apply ConstantSym0 t0123456789876543210 = Constant t0123456789876543210
-    type IdentitySym1 (t0123456789876543210 :: a0123456789876543210) =
-        Identity t0123456789876543210
-    instance SuppressUnusedWarnings IdentitySym0 where
-      suppressUnusedWarnings = snd (((,) IdentitySym0KindInference) ())
-    data IdentitySym0 :: forall a0123456789876543210.
-                         (~>) a0123456789876543210 (Identity a0123456789876543210)
-      where
-        IdentitySym0KindInference :: forall t0123456789876543210
-                                            arg. SameKind (Apply IdentitySym0 arg) (IdentitySym1 arg) =>
-                                     IdentitySym0 t0123456789876543210
-    type instance Apply IdentitySym0 t0123456789876543210 = Identity t0123456789876543210
-    type family Compare_0123456789876543210 (a :: Constant a b) (a :: Constant a b) :: Ordering where
-      Compare_0123456789876543210 (Constant a_0123456789876543210) (Constant b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) '[])
-    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Constant a0123456789876543210 b0123456789876543210) (a0123456789876543210 :: Constant a0123456789876543210 b0123456789876543210) =
-        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
-    data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Constant a0123456789876543210 b0123456789876543210) :: (~>) (Constant a0123456789876543210 b0123456789876543210) Ordering
-      where
-        Compare_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                               a0123456789876543210
-                                                               arg. SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
-    data Compare_0123456789876543210Sym0 :: forall a0123456789876543210
-                                                   b0123456789876543210.
-                                            (~>) (Constant a0123456789876543210 b0123456789876543210) ((~>) (Constant a0123456789876543210 b0123456789876543210) Ordering)
-      where
-        Compare_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                               arg. SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
-                                                        Compare_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
-    instance POrd (Constant a b) where
-      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
-    type family Compare_0123456789876543210 (a :: Identity a) (a :: Identity a) :: Ordering where
-      Compare_0123456789876543210 (Identity a_0123456789876543210) (Identity b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) '[])
-    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Identity a0123456789876543210) (a0123456789876543210 :: Identity a0123456789876543210) =
-        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
-    data Compare_0123456789876543210Sym1 (a0123456789876543210 :: Identity a0123456789876543210) :: (~>) (Identity a0123456789876543210) Ordering
-      where
-        Compare_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                               a0123456789876543210
-                                                               arg. SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
-    data Compare_0123456789876543210Sym0 :: forall a0123456789876543210.
-                                            (~>) (Identity a0123456789876543210) ((~>) (Identity a0123456789876543210) Ordering)
-      where
-        Compare_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                               arg. SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
-                                                        Compare_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
-    instance POrd (Identity a) where
-      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
-    type family Equals_0123456789876543210 (a :: Constant a b) (b :: Constant a b) :: Bool where
-      Equals_0123456789876543210 (Constant a) (Constant b) = (==) a b
-      Equals_0123456789876543210 (_ :: Constant a b) (_ :: Constant a b) = FalseSym0
-    instance PEq (Constant a b) where
-      type (==) a b = Equals_0123456789876543210 a b
-    type family Equals_0123456789876543210 (a :: Identity a) (b :: Identity a) :: Bool where
-      Equals_0123456789876543210 (Identity a) (Identity b) = (==) a b
-      Equals_0123456789876543210 (_ :: Identity a) (_ :: Identity a) = FalseSym0
-    instance PEq (Identity a) where
-      type (==) a b = Equals_0123456789876543210 a b
-    data SConstant :: forall a b. Constant a b -> Type
-      where
-        SConstant :: forall a (n :: a).
-                     (Sing (n :: a)) -> SConstant (Constant n)
-    type instance Sing @(Constant a b) = SConstant
-    instance (SingKind a, SingKind b) => SingKind (Constant a b) where
-      type Demote (Constant a b) = Constant (Demote a) (Demote b)
-      fromSing (SConstant b) = Constant (fromSing b)
-      toSing (Constant (b :: Demote a))
-        = case toSing b :: SomeSing a of {
-            SomeSing c -> SomeSing (SConstant c) }
-    data SIdentity :: forall a. Identity a -> Type
-      where
-        SIdentity :: forall a (n :: a).
-                     (Sing (n :: a)) -> SIdentity (Identity n)
-    type instance Sing @(Identity a) = SIdentity
-    instance SingKind a => SingKind (Identity a) where
-      type Demote (Identity a) = Identity (Demote a)
-      fromSing (SIdentity b) = Identity (fromSing b)
-      toSing (Identity (b :: Demote a))
-        = case toSing b :: SomeSing a of {
-            SomeSing c -> SomeSing (SIdentity c) }
-    instance SOrd a => SOrd (Constant a b) where
-      sCompare ::
-        forall (t1 :: Constant a b) (t2 :: Constant a b).
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply (CompareSym0 :: TyFun (Constant a b) ((~>) (Constant a b) Ordering)
-                                                 -> Type) t1) t2)
-      sCompare
-        (SConstant (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        (SConstant (sB_0123456789876543210 :: Sing b_0123456789876543210))
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            ((applySing
-                ((applySing
-                    ((singFun2 @(:@#@$))
-                       Data.Singletons.Prelude.Instances.SCons))
-                   ((applySing
-                       ((applySing ((singFun2 @CompareSym0) sCompare))
-                          sA_0123456789876543210))
-                      sB_0123456789876543210)))
-               Data.Singletons.Prelude.Instances.SNil)
-    instance SOrd a => SOrd (Identity a) where
-      sCompare ::
-        forall (t1 :: Identity a) (t2 :: Identity a).
-        Sing t1
-        -> Sing t2
-           -> Sing (Apply (Apply (CompareSym0 :: TyFun (Identity a) ((~>) (Identity a) Ordering)
-                                                 -> Type) t1) t2)
-      sCompare
-        (SIdentity (sA_0123456789876543210 :: Sing a_0123456789876543210))
-        (SIdentity (sB_0123456789876543210 :: Sing b_0123456789876543210))
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
-                    ((singFun2 @ThenCmpSym0) sThenCmp)))
-                SEQ))
-            ((applySing
-                ((applySing
-                    ((singFun2 @(:@#@$))
-                       Data.Singletons.Prelude.Instances.SCons))
-                   ((applySing
-                       ((applySing ((singFun2 @CompareSym0) sCompare))
-                          sA_0123456789876543210))
-                      sB_0123456789876543210)))
-               Data.Singletons.Prelude.Instances.SNil)
-    instance SEq a => SEq (Constant a b) where
-      (%==) (SConstant a) (SConstant b) = ((%==) a) b
-    instance SDecide a => SDecide (Constant a b) where
-      (%~) (SConstant a) (SConstant b)
-        = case ((%~) a) b of
-            Proved Refl -> Proved Refl
-            Disproved contra
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-    instance SDecide a =>
-             Data.Type.Equality.TestEquality (SConstant :: Constant a b
-                                                           -> Type) where
-      Data.Type.Equality.testEquality
-        = Data.Singletons.Decide.decideEquality
-    instance SDecide a =>
-             Data.Type.Coercion.TestCoercion (SConstant :: Constant a b
-                                                           -> Type) where
-      Data.Type.Coercion.testCoercion
-        = Data.Singletons.Decide.decideCoercion
-    instance SEq a => SEq (Identity a) where
-      (%==) (SIdentity a) (SIdentity b) = ((%==) a) b
-    instance SDecide a => SDecide (Identity a) where
-      (%~) (SIdentity a) (SIdentity b)
-        = case ((%~) a) b of
-            Proved Refl -> Proved Refl
-            Disproved contra
-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
-    instance SDecide a =>
-             Data.Type.Equality.TestEquality (SIdentity :: Identity a
-                                                           -> Type) where
-      Data.Type.Equality.testEquality
-        = Data.Singletons.Decide.decideEquality
-    instance SDecide a =>
-             Data.Type.Coercion.TestCoercion (SIdentity :: Identity a
-                                                           -> Type) where
-      Data.Type.Coercion.testCoercion
-        = Data.Singletons.Decide.decideCoercion
-    instance SingI n => SingI (Constant (n :: a)) where
-      sing = SConstant sing
-    instance SingI (ConstantSym0 :: (~>) a (Constant (a :: Type) (b :: Type))) where
-      sing = (singFun1 @ConstantSym0) SConstant
-    instance SingI n => SingI (Identity (n :: a)) where
-      sing = SIdentity sing
-    instance SingI (IdentitySym0 :: (~>) a (Identity a)) where
-      sing = (singFun1 @IdentitySym0) SIdentity
diff --git a/tests/compile-and-dump/Singletons/T271.golden b/tests/compile-and-dump/Singletons/T271.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T271.golden
@@ -0,0 +1,219 @@
+Singletons/T271.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| newtype Constant (a :: Type) (b :: Type)
+            = Constant a
+            deriving (Eq, Ord)
+          data Identity :: Type -> Type
+            where Identity :: a -> Identity a
+            deriving (Eq, Ord) |]
+  ======>
+    newtype Constant (a :: Type) (b :: Type)
+      = Constant a
+      deriving (Eq, Ord)
+    data Identity :: Type -> Type
+      where Identity :: a -> Identity a
+      deriving (Eq, Ord)
+    type ConstantSym0 :: forall (a :: Type) (b :: Type).
+                         (~>) a (Constant (a :: Type) (b :: Type))
+    data ConstantSym0 a0123456789876543210
+      where
+        ConstantSym0KindInference :: SameKind (Apply ConstantSym0 arg) (ConstantSym1 arg) =>
+                                     ConstantSym0 a0123456789876543210
+    type instance Apply ConstantSym0 a0123456789876543210 = ConstantSym1 a0123456789876543210
+    instance SuppressUnusedWarnings ConstantSym0 where
+      suppressUnusedWarnings = snd (((,) ConstantSym0KindInference) ())
+    type ConstantSym1 (a0123456789876543210 :: a) =
+        Constant a0123456789876543210 :: Constant (a :: Type) (b :: Type)
+    type IdentitySym0 :: (~>) a (Identity a)
+    data IdentitySym0 a0123456789876543210
+      where
+        IdentitySym0KindInference :: SameKind (Apply IdentitySym0 arg) (IdentitySym1 arg) =>
+                                     IdentitySym0 a0123456789876543210
+    type instance Apply IdentitySym0 a0123456789876543210 = IdentitySym1 a0123456789876543210
+    instance SuppressUnusedWarnings IdentitySym0 where
+      suppressUnusedWarnings = snd (((,) IdentitySym0KindInference) ())
+    type IdentitySym1 (a0123456789876543210 :: a) =
+        Identity a0123456789876543210 :: Identity a
+    type Compare_0123456789876543210 :: Constant a b
+                                        -> Constant a b -> Ordering
+    type family Compare_0123456789876543210 a a where
+      Compare_0123456789876543210 (Constant a_0123456789876543210) (Constant b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0)
+    type Compare_0123456789876543210Sym0 :: (~>) (Constant a b) ((~>) (Constant a b) Ordering)
+    data Compare_0123456789876543210Sym0 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
+                                                        Compare_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
+    type Compare_0123456789876543210Sym1 :: Constant a b
+                                            -> (~>) (Constant a b) Ordering
+    data Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
+    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Constant a b) (a0123456789876543210 :: Constant a b) =
+        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    instance POrd (Constant a b) where
+      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
+    type Compare_0123456789876543210 :: Identity a
+                                        -> Identity a -> Ordering
+    type family Compare_0123456789876543210 a a where
+      Compare_0123456789876543210 (Identity a_0123456789876543210) (Identity b_0123456789876543210) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:@#@$) (Apply (Apply CompareSym0 a_0123456789876543210) b_0123456789876543210)) NilSym0)
+    type Compare_0123456789876543210Sym0 :: (~>) (Identity a) ((~>) (Identity a) Ordering)
+    data Compare_0123456789876543210Sym0 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym0KindInference :: SameKind (Apply Compare_0123456789876543210Sym0 arg) (Compare_0123456789876543210Sym1 arg) =>
+                                                        Compare_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Compare_0123456789876543210Sym0 a0123456789876543210 = Compare_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Compare_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym0KindInference) ())
+    type Compare_0123456789876543210Sym1 :: Identity a
+                                            -> (~>) (Identity a) Ordering
+    data Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Compare_0123456789876543210Sym1KindInference :: SameKind (Apply (Compare_0123456789876543210Sym1 a0123456789876543210) arg) (Compare_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                        Compare_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Compare_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Compare_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Compare_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Compare_0123456789876543210Sym1KindInference) ())
+    type Compare_0123456789876543210Sym2 (a0123456789876543210 :: Identity a) (a0123456789876543210 :: Identity a) =
+        Compare_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Ordering
+    instance POrd (Identity a) where
+      type Compare a a = Apply (Apply Compare_0123456789876543210Sym0 a) a
+    type Equals_0123456789876543210 :: Constant a b
+                                       -> Constant a b -> Bool
+    type family Equals_0123456789876543210 a b where
+      Equals_0123456789876543210 (Constant a) (Constant b) = (==) a b
+      Equals_0123456789876543210 (_ :: Constant a b) (_ :: Constant a b) = FalseSym0
+    instance PEq (Constant a b) where
+      type (==) a b = Equals_0123456789876543210 a b
+    type Equals_0123456789876543210 :: Identity a -> Identity a -> Bool
+    type family Equals_0123456789876543210 a b where
+      Equals_0123456789876543210 (Identity a) (Identity b) = (==) a b
+      Equals_0123456789876543210 (_ :: Identity a) (_ :: Identity a) = FalseSym0
+    instance PEq (Identity a) where
+      type (==) a b = Equals_0123456789876543210 a b
+    data SConstant :: forall a b.
+                      Constant (a :: Type) (b :: Type) -> Type
+      where
+        SConstant :: forall (a :: Type) (b :: Type) (n :: a).
+                     (Sing n)
+                     -> SConstant (Constant n :: Constant (a :: Type) (b :: Type))
+    type instance Sing @(Constant a b) = SConstant
+    instance (SingKind a, SingKind b) => SingKind (Constant a b) where
+      type Demote (Constant a b) = Constant (Demote a) (Demote b)
+      fromSing (SConstant b) = Constant (fromSing b)
+      toSing (Constant (b :: Demote a))
+        = case toSing b :: SomeSing a of {
+            SomeSing c -> SomeSing (SConstant c) }
+    data SIdentity :: forall a. Identity (a :: Type) -> Type
+      where
+        SIdentity :: forall a (n :: a).
+                     (Sing n) -> SIdentity (Identity n :: Identity a)
+    type instance Sing @(Identity a) = SIdentity
+    instance SingKind a => SingKind (Identity a) where
+      type Demote (Identity a) = Identity (Demote a)
+      fromSing (SIdentity b) = Identity (fromSing b)
+      toSing (Identity (b :: Demote a))
+        = case toSing b :: SomeSing a of {
+            SomeSing c -> SomeSing (SIdentity c) }
+    instance SOrd a => SOrd (Constant a b) where
+      sCompare ::
+        forall (t1 :: Constant a b) (t2 :: Constant a b).
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply (CompareSym0 :: TyFun (Constant a b) ((~>) (Constant a b) Ordering)
+                                                 -> Type) t1) t2)
+      sCompare
+        (SConstant (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        (SConstant (sB_0123456789876543210 :: Sing b_0123456789876543210))
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            ((applySing
+                ((applySing
+                    ((singFun2 @(:@#@$))
+                       Data.Singletons.Prelude.Instances.SCons))
+                   ((applySing
+                       ((applySing ((singFun2 @CompareSym0) sCompare))
+                          sA_0123456789876543210))
+                      sB_0123456789876543210)))
+               Data.Singletons.Prelude.Instances.SNil)
+    instance SOrd a => SOrd (Identity a) where
+      sCompare ::
+        forall (t1 :: Identity a) (t2 :: Identity a).
+        Sing t1
+        -> Sing t2
+           -> Sing (Apply (Apply (CompareSym0 :: TyFun (Identity a) ((~>) (Identity a) Ordering)
+                                                 -> Type) t1) t2)
+      sCompare
+        (SIdentity (sA_0123456789876543210 :: Sing a_0123456789876543210))
+        (SIdentity (sB_0123456789876543210 :: Sing b_0123456789876543210))
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @FoldlSym0) sFoldl))
+                    ((singFun2 @ThenCmpSym0) sThenCmp)))
+                SEQ))
+            ((applySing
+                ((applySing
+                    ((singFun2 @(:@#@$))
+                       Data.Singletons.Prelude.Instances.SCons))
+                   ((applySing
+                       ((applySing ((singFun2 @CompareSym0) sCompare))
+                          sA_0123456789876543210))
+                      sB_0123456789876543210)))
+               Data.Singletons.Prelude.Instances.SNil)
+    instance SEq a => SEq (Constant a b) where
+      (%==) (SConstant a) (SConstant b) = ((%==) a) b
+    instance SDecide a => SDecide (Constant a b) where
+      (%~) (SConstant a) (SConstant b)
+        = case ((%~) a) b of
+            Proved Refl -> Proved Refl
+            Disproved contra
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+    instance SDecide a =>
+             Data.Type.Equality.TestEquality (SConstant :: Constant a b
+                                                           -> Type) where
+      Data.Type.Equality.testEquality
+        = Data.Singletons.Decide.decideEquality
+    instance SDecide a =>
+             Data.Type.Coercion.TestCoercion (SConstant :: Constant a b
+                                                           -> Type) where
+      Data.Type.Coercion.testCoercion
+        = Data.Singletons.Decide.decideCoercion
+    instance SEq a => SEq (Identity a) where
+      (%==) (SIdentity a) (SIdentity b) = ((%==) a) b
+    instance SDecide a => SDecide (Identity a) where
+      (%~) (SIdentity a) (SIdentity b)
+        = case ((%~) a) b of
+            Proved Refl -> Proved Refl
+            Disproved contra
+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })
+    instance SDecide a =>
+             Data.Type.Equality.TestEquality (SIdentity :: Identity a
+                                                           -> Type) where
+      Data.Type.Equality.testEquality
+        = Data.Singletons.Decide.decideEquality
+    instance SDecide a =>
+             Data.Type.Coercion.TestCoercion (SIdentity :: Identity a
+                                                           -> Type) where
+      Data.Type.Coercion.testCoercion
+        = Data.Singletons.Decide.decideCoercion
+    instance SingI n => SingI (Constant (n :: a)) where
+      sing = SConstant sing
+    instance SingI (ConstantSym0 :: (~>) a (Constant (a :: Type) (b :: Type))) where
+      sing = (singFun1 @ConstantSym0) SConstant
+    instance SingI n => SingI (Identity (n :: a)) where
+      sing = SIdentity sing
+    instance SingI (IdentitySym0 :: (~>) a (Identity a)) where
+      sing = (singFun1 @IdentitySym0) SIdentity
diff --git a/tests/compile-and-dump/Singletons/T287.ghc88.template b/tests/compile-and-dump/Singletons/T287.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T287.ghc88.template
+++ /dev/null
@@ -1,116 +0,0 @@
-Singletons/T287.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| class S a where
-            (<<>>) :: a -> a -> a
-          
-          instance S b => S (a -> b) where
-            f <<>> g = \ x -> f x <<>> g x |]
-  ======>
-    class S a where
-      (<<>>) :: a -> a -> a
-    instance S b => S (a -> b) where
-      (<<>>) f g = \ x -> (f x <<>> g x)
-    type (<<>>@#@$$$) (arg0123456789876543210 :: a0123456789876543210) (arg0123456789876543210 :: a0123456789876543210) =
-        (<<>>) arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings ((<<>>@#@$$) arg0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (:<<>>@#@$$###)) ())
-    data (<<>>@#@$$) (arg0123456789876543210 :: a0123456789876543210) :: (~>) a0123456789876543210 a0123456789876543210
-      where
-        (:<<>>@#@$$###) :: forall arg0123456789876543210
-                                  arg0123456789876543210
-                                  arg. SameKind (Apply ((<<>>@#@$$) arg0123456789876543210) arg) ((<<>>@#@$$$) arg0123456789876543210 arg) =>
-                           (<<>>@#@$$) arg0123456789876543210 arg0123456789876543210
-    type instance Apply ((<<>>@#@$$) arg0123456789876543210) arg0123456789876543210 = (<<>>) arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings (<<>>@#@$) where
-      suppressUnusedWarnings = snd (((,) (:<<>>@#@$###)) ())
-    data (<<>>@#@$) :: forall a0123456789876543210.
-                       (~>) a0123456789876543210 ((~>) a0123456789876543210 a0123456789876543210)
-      where
-        (:<<>>@#@$###) :: forall arg0123456789876543210
-                                 arg. SameKind (Apply (<<>>@#@$) arg) ((<<>>@#@$$) arg) =>
-                          (<<>>@#@$) arg0123456789876543210
-    type instance Apply (<<>>@#@$) arg0123456789876543210 = (<<>>@#@$$) arg0123456789876543210
-    class PS (a :: GHC.Types.Type) where
-      type (<<>>) (arg :: a) (arg :: a) :: a
-    type family Lambda_0123456789876543210 f g t where
-      Lambda_0123456789876543210 f g x = Apply (Apply (<<>>@#@$) (Apply f x)) (Apply g x)
-    type Lambda_0123456789876543210Sym3 f0123456789876543210 g0123456789876543210 t0123456789876543210 =
-        Lambda_0123456789876543210 f0123456789876543210 g0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 g0123456789876543210 f0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
-    data Lambda_0123456789876543210Sym2 f0123456789876543210 g0123456789876543210 t0123456789876543210
-      where
-        Lambda_0123456789876543210Sym2KindInference :: forall f0123456789876543210
-                                                              g0123456789876543210
-                                                              t0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym2 f0123456789876543210 g0123456789876543210) arg) (Lambda_0123456789876543210Sym3 f0123456789876543210 g0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym2 f0123456789876543210 g0123456789876543210 t0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym2 g0123456789876543210 f0123456789876543210) t0123456789876543210 = Lambda_0123456789876543210 g0123456789876543210 f0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 f0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
-    data Lambda_0123456789876543210Sym1 f0123456789876543210 g0123456789876543210
-      where
-        Lambda_0123456789876543210Sym1KindInference :: forall f0123456789876543210
-                                                              g0123456789876543210
-                                                              arg. SameKind (Apply (Lambda_0123456789876543210Sym1 f0123456789876543210) arg) (Lambda_0123456789876543210Sym2 f0123456789876543210 arg) =>
-                                                       Lambda_0123456789876543210Sym1 f0123456789876543210 g0123456789876543210
-    type instance Apply (Lambda_0123456789876543210Sym1 f0123456789876543210) g0123456789876543210 = Lambda_0123456789876543210Sym2 f0123456789876543210 g0123456789876543210
-    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
-    data Lambda_0123456789876543210Sym0 f0123456789876543210
-      where
-        Lambda_0123456789876543210Sym0KindInference :: forall f0123456789876543210
-                                                              arg. SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
-                                                       Lambda_0123456789876543210Sym0 f0123456789876543210
-    type instance Apply Lambda_0123456789876543210Sym0 f0123456789876543210 = Lambda_0123456789876543210Sym1 f0123456789876543210
-    type family TFHelper_0123456789876543210 (a :: (~>) a b) (a :: (~>) a b) :: (~>) a b where
-      TFHelper_0123456789876543210 f g = Apply (Apply Lambda_0123456789876543210Sym0 f) g
-    type TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: (~>) a0123456789876543210 b0123456789876543210) (a0123456789876543210 :: (~>) a0123456789876543210 b0123456789876543210) =
-        TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) TFHelper_0123456789876543210Sym1KindInference) ())
-    data TFHelper_0123456789876543210Sym1 (a0123456789876543210 :: (~>) a0123456789876543210 b0123456789876543210) :: (~>) ((~>) a0123456789876543210 b0123456789876543210) ((~>) a0123456789876543210 b0123456789876543210)
-      where
-        TFHelper_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                a0123456789876543210
-                                                                arg. SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                         TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) TFHelper_0123456789876543210Sym0KindInference) ())
-    data TFHelper_0123456789876543210Sym0 :: forall a0123456789876543210
-                                                    b0123456789876543210.
-                                             (~>) ((~>) a0123456789876543210 b0123456789876543210) ((~>) ((~>) a0123456789876543210 b0123456789876543210) ((~>) a0123456789876543210 b0123456789876543210))
-      where
-        TFHelper_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                arg. SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) =>
-                                                         TFHelper_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210
-    instance PS ((~>) a b) where
-      type (<<>>) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a
-    class SS a where
-      (%<<>>) ::
-        forall (t :: a) (t :: a).
-        Sing t -> Sing t -> Sing (Apply (Apply (<<>>@#@$) t) t :: a)
-    instance SS b => SS ((~>) a b) where
-      (%<<>>) ::
-        forall (t :: (~>) a b) (t :: (~>) a b).
-        Sing t -> Sing t -> Sing (Apply (Apply (<<>>@#@$) t) t :: (~>) a b)
-      (%<<>>) (sF :: Sing f) (sG :: Sing g)
-        = (singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 f) g))
-            (\ sX
-               -> case sX of {
-                    (_ :: Sing x)
-                      -> (applySing
-                            ((applySing ((singFun2 @(<<>>@#@$)) (%<<>>))) ((applySing sF) sX)))
-                           ((applySing sG) sX) })
-    instance SS a => SingI ((<<>>@#@$) :: (~>) a ((~>) a a)) where
-      sing = (singFun2 @(<<>>@#@$)) (%<<>>)
-    instance (SS a, SingI d) =>
-             SingI ((<<>>@#@$$) (d :: a) :: (~>) a a) where
-      sing = (singFun1 @((<<>>@#@$$) (d :: a))) ((%<<>>) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T287.golden b/tests/compile-and-dump/Singletons/T287.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T287.golden
@@ -0,0 +1,108 @@
+Singletons/T287.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| class S a where
+            (<<>>) :: a -> a -> a
+          
+          instance S b => S (a -> b) where
+            f <<>> g = \ x -> f x <<>> g x |]
+  ======>
+    class S a where
+      (<<>>) :: a -> a -> a
+    instance S b => S (a -> b) where
+      (<<>>) f g = \ x -> (f x <<>> g x)
+    type (<<>>@#@$) :: forall a. (~>) a ((~>) a a)
+    data (<<>>@#@$) a0123456789876543210
+      where
+        (:<<>>@#@$###) :: SameKind (Apply (<<>>@#@$) arg) ((<<>>@#@$$) arg) =>
+                          (<<>>@#@$) a0123456789876543210
+    type instance Apply (<<>>@#@$) a0123456789876543210 = (<<>>@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (<<>>@#@$) where
+      suppressUnusedWarnings = snd (((,) (:<<>>@#@$###)) ())
+    type (<<>>@#@$$) :: forall a. a -> (~>) a a
+    data (<<>>@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (:<<>>@#@$$###) :: SameKind (Apply ((<<>>@#@$$) a0123456789876543210) arg) ((<<>>@#@$$$) a0123456789876543210 arg) =>
+                           (<<>>@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((<<>>@#@$$) a0123456789876543210) a0123456789876543210 = (<<>>@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((<<>>@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (:<<>>@#@$$###)) ())
+    type (<<>>@#@$$$) (a0123456789876543210 :: a) (a0123456789876543210 :: a) =
+        (<<>>) a0123456789876543210 a0123456789876543210 :: a
+    class PS a where
+      type (<<>>) (arg :: a) (arg :: a) :: a
+    type family Lambda_0123456789876543210 f g x where
+      Lambda_0123456789876543210 f g x = Apply (Apply (<<>>@#@$) (Apply f x)) (Apply g x)
+    data Lambda_0123456789876543210Sym0 f0123456789876543210
+      where
+        Lambda_0123456789876543210Sym0KindInference :: SameKind (Apply Lambda_0123456789876543210Sym0 arg) (Lambda_0123456789876543210Sym1 arg) =>
+                                                       Lambda_0123456789876543210Sym0 f0123456789876543210
+    type instance Apply Lambda_0123456789876543210Sym0 f0123456789876543210 = Lambda_0123456789876543210Sym1 f0123456789876543210
+    instance SuppressUnusedWarnings Lambda_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym0KindInference) ())
+    data Lambda_0123456789876543210Sym1 f0123456789876543210 g0123456789876543210
+      where
+        Lambda_0123456789876543210Sym1KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym1 f0123456789876543210) arg) (Lambda_0123456789876543210Sym2 f0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym1 f0123456789876543210 g0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym1 f0123456789876543210) g0123456789876543210 = Lambda_0123456789876543210Sym2 f0123456789876543210 g0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym1 f0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym1KindInference) ())
+    data Lambda_0123456789876543210Sym2 f0123456789876543210 g0123456789876543210 x0123456789876543210
+      where
+        Lambda_0123456789876543210Sym2KindInference :: SameKind (Apply (Lambda_0123456789876543210Sym2 f0123456789876543210 g0123456789876543210) arg) (Lambda_0123456789876543210Sym3 f0123456789876543210 g0123456789876543210 arg) =>
+                                                       Lambda_0123456789876543210Sym2 f0123456789876543210 g0123456789876543210 x0123456789876543210
+    type instance Apply (Lambda_0123456789876543210Sym2 f0123456789876543210 g0123456789876543210) x0123456789876543210 = Lambda_0123456789876543210Sym3 f0123456789876543210 g0123456789876543210 x0123456789876543210
+    instance SuppressUnusedWarnings (Lambda_0123456789876543210Sym2 f0123456789876543210 g0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Lambda_0123456789876543210Sym2KindInference) ())
+    type Lambda_0123456789876543210Sym3 f0123456789876543210 g0123456789876543210 x0123456789876543210 =
+        Lambda_0123456789876543210 f0123456789876543210 g0123456789876543210 x0123456789876543210
+    type TFHelper_0123456789876543210 :: (~>) a b
+                                         -> (~>) a b -> (~>) a b
+    type family TFHelper_0123456789876543210 a a where
+      TFHelper_0123456789876543210 f g = Apply (Apply Lambda_0123456789876543210Sym0 f) g
+    type TFHelper_0123456789876543210Sym0 :: (~>) ((~>) a b) ((~>) ((~>) a b) ((~>) a b))
+    data TFHelper_0123456789876543210Sym0 a0123456789876543210
+      where
+        TFHelper_0123456789876543210Sym0KindInference :: SameKind (Apply TFHelper_0123456789876543210Sym0 arg) (TFHelper_0123456789876543210Sym1 arg) =>
+                                                         TFHelper_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply TFHelper_0123456789876543210Sym0 a0123456789876543210 = TFHelper_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings TFHelper_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) TFHelper_0123456789876543210Sym0KindInference) ())
+    type TFHelper_0123456789876543210Sym1 :: (~>) a b
+                                             -> (~>) ((~>) a b) ((~>) a b)
+    data TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        TFHelper_0123456789876543210Sym1KindInference :: SameKind (Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) arg) (TFHelper_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                         TFHelper_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (TFHelper_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = TFHelper_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (TFHelper_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) TFHelper_0123456789876543210Sym1KindInference) ())
+    type TFHelper_0123456789876543210Sym2 (a0123456789876543210 :: (~>) a b) (a0123456789876543210 :: (~>) a b) =
+        TFHelper_0123456789876543210 a0123456789876543210 a0123456789876543210 :: (~>) a b
+    instance PS ((~>) a b) where
+      type (<<>>) a a = Apply (Apply TFHelper_0123456789876543210Sym0 a) a
+    class SS a where
+      (%<<>>) ::
+        forall (t :: a) (t :: a).
+        Sing t -> Sing t -> Sing (Apply (Apply (<<>>@#@$) t) t :: a)
+    instance SS b => SS ((~>) a b) where
+      (%<<>>) ::
+        forall (t :: (~>) a b) (t :: (~>) a b).
+        Sing t -> Sing t -> Sing (Apply (Apply (<<>>@#@$) t) t :: (~>) a b)
+      (%<<>>) (sF :: Sing f) (sG :: Sing g)
+        = (singFun1 @(Apply (Apply Lambda_0123456789876543210Sym0 f) g))
+            (\ sX
+               -> case sX of {
+                    (_ :: Sing x)
+                      -> (applySing
+                            ((applySing ((singFun2 @(<<>>@#@$)) (%<<>>))) ((applySing sF) sX)))
+                           ((applySing sG) sX) })
+    instance SS a => SingI ((<<>>@#@$) :: (~>) a ((~>) a a)) where
+      sing = (singFun2 @(<<>>@#@$)) (%<<>>)
+    instance (SS a, SingI d) =>
+             SingI ((<<>>@#@$$) (d :: a) :: (~>) a a) where
+      sing = (singFun1 @((<<>>@#@$$) (d :: a))) ((%<<>>) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T29.ghc88.template b/tests/compile-and-dump/Singletons/T29.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T29.ghc88.template
+++ /dev/null
@@ -1,115 +0,0 @@
-Singletons/T29.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| foo :: Bool -> Bool
-          foo x = not $ x
-          bar :: Bool -> Bool
-          bar x = not . not . not $ x
-          baz :: Bool -> Bool
-          baz x = not $! x
-          ban :: Bool -> Bool
-          ban x = not . not . not $! x |]
-  ======>
-    foo :: Bool -> Bool
-    foo x = (not $ x)
-    bar :: Bool -> Bool
-    bar x = ((not . (not . not)) $ x)
-    baz :: Bool -> Bool
-    baz x = (not $! x)
-    ban :: Bool -> Bool
-    ban x = ((not . (not . not)) $! x)
-    type BanSym1 (a0123456789876543210 :: Bool) =
-        Ban a0123456789876543210
-    instance SuppressUnusedWarnings BanSym0 where
-      suppressUnusedWarnings = snd (((,) BanSym0KindInference) ())
-    data BanSym0 :: (~>) Bool Bool
-      where
-        BanSym0KindInference :: forall a0123456789876543210
-                                       arg. SameKind (Apply BanSym0 arg) (BanSym1 arg) =>
-                                BanSym0 a0123456789876543210
-    type instance Apply BanSym0 a0123456789876543210 = Ban a0123456789876543210
-    type BazSym1 (a0123456789876543210 :: Bool) =
-        Baz a0123456789876543210
-    instance SuppressUnusedWarnings BazSym0 where
-      suppressUnusedWarnings = snd (((,) BazSym0KindInference) ())
-    data BazSym0 :: (~>) Bool Bool
-      where
-        BazSym0KindInference :: forall a0123456789876543210
-                                       arg. SameKind (Apply BazSym0 arg) (BazSym1 arg) =>
-                                BazSym0 a0123456789876543210
-    type instance Apply BazSym0 a0123456789876543210 = Baz a0123456789876543210
-    type BarSym1 (a0123456789876543210 :: Bool) =
-        Bar a0123456789876543210
-    instance SuppressUnusedWarnings BarSym0 where
-      suppressUnusedWarnings = snd (((,) BarSym0KindInference) ())
-    data BarSym0 :: (~>) Bool Bool
-      where
-        BarSym0KindInference :: forall a0123456789876543210
-                                       arg. SameKind (Apply BarSym0 arg) (BarSym1 arg) =>
-                                BarSym0 a0123456789876543210
-    type instance Apply BarSym0 a0123456789876543210 = Bar a0123456789876543210
-    type FooSym1 (a0123456789876543210 :: Bool) =
-        Foo a0123456789876543210
-    instance SuppressUnusedWarnings FooSym0 where
-      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
-    data FooSym0 :: (~>) Bool Bool
-      where
-        FooSym0KindInference :: forall a0123456789876543210
-                                       arg. SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
-                                FooSym0 a0123456789876543210
-    type instance Apply FooSym0 a0123456789876543210 = Foo a0123456789876543210
-    type family Ban (a :: Bool) :: Bool where
-      Ban x = Apply (Apply ($!@#@$) (Apply (Apply (.@#@$) NotSym0) (Apply (Apply (.@#@$) NotSym0) NotSym0))) x
-    type family Baz (a :: Bool) :: Bool where
-      Baz x = Apply (Apply ($!@#@$) NotSym0) x
-    type family Bar (a :: Bool) :: Bool where
-      Bar x = Apply (Apply ($@#@$) (Apply (Apply (.@#@$) NotSym0) (Apply (Apply (.@#@$) NotSym0) NotSym0))) x
-    type family Foo (a :: Bool) :: Bool where
-      Foo x = Apply (Apply ($@#@$) NotSym0) x
-    sBan ::
-      forall (t :: Bool). Sing t -> Sing (Apply BanSym0 t :: Bool)
-    sBaz ::
-      forall (t :: Bool). Sing t -> Sing (Apply BazSym0 t :: Bool)
-    sBar ::
-      forall (t :: Bool). Sing t -> Sing (Apply BarSym0 t :: Bool)
-    sFoo ::
-      forall (t :: Bool). Sing t -> Sing (Apply FooSym0 t :: Bool)
-    sBan (sX :: Sing x)
-      = (applySing
-           ((applySing ((singFun2 @($!@#@$)) (%$!)))
-              ((applySing
-                  ((applySing ((singFun3 @(.@#@$)) (%.)))
-                     ((singFun1 @NotSym0) sNot)))
-                 ((applySing
-                     ((applySing ((singFun3 @(.@#@$)) (%.)))
-                        ((singFun1 @NotSym0) sNot)))
-                    ((singFun1 @NotSym0) sNot)))))
-          sX
-    sBaz (sX :: Sing x)
-      = (applySing
-           ((applySing ((singFun2 @($!@#@$)) (%$!)))
-              ((singFun1 @NotSym0) sNot)))
-          sX
-    sBar (sX :: Sing x)
-      = (applySing
-           ((applySing ((singFun2 @($@#@$)) (%$)))
-              ((applySing
-                  ((applySing ((singFun3 @(.@#@$)) (%.)))
-                     ((singFun1 @NotSym0) sNot)))
-                 ((applySing
-                     ((applySing ((singFun3 @(.@#@$)) (%.)))
-                        ((singFun1 @NotSym0) sNot)))
-                    ((singFun1 @NotSym0) sNot)))))
-          sX
-    sFoo (sX :: Sing x)
-      = (applySing
-           ((applySing ((singFun2 @($@#@$)) (%$)))
-              ((singFun1 @NotSym0) sNot)))
-          sX
-    instance SingI (BanSym0 :: (~>) Bool Bool) where
-      sing = (singFun1 @BanSym0) sBan
-    instance SingI (BazSym0 :: (~>) Bool Bool) where
-      sing = (singFun1 @BazSym0) sBaz
-    instance SingI (BarSym0 :: (~>) Bool Bool) where
-      sing = (singFun1 @BarSym0) sBar
-    instance SingI (FooSym0 :: (~>) Bool Bool) where
-      sing = (singFun1 @FooSym0) sFoo
diff --git a/tests/compile-and-dump/Singletons/T29.golden b/tests/compile-and-dump/Singletons/T29.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T29.golden
@@ -0,0 +1,119 @@
+Singletons/T29.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| foo :: Bool -> Bool
+          foo x = not $ x
+          bar :: Bool -> Bool
+          bar x = not . not . not $ x
+          baz :: Bool -> Bool
+          baz x = not $! x
+          ban :: Bool -> Bool
+          ban x = not . not . not $! x |]
+  ======>
+    foo :: Bool -> Bool
+    foo x = (not $ x)
+    bar :: Bool -> Bool
+    bar x = ((not . (not . not)) $ x)
+    baz :: Bool -> Bool
+    baz x = (not $! x)
+    ban :: Bool -> Bool
+    ban x = ((not . (not . not)) $! x)
+    type BanSym0 :: (~>) Bool Bool
+    data BanSym0 a0123456789876543210
+      where
+        BanSym0KindInference :: SameKind (Apply BanSym0 arg) (BanSym1 arg) =>
+                                BanSym0 a0123456789876543210
+    type instance Apply BanSym0 a0123456789876543210 = BanSym1 a0123456789876543210
+    instance SuppressUnusedWarnings BanSym0 where
+      suppressUnusedWarnings = snd (((,) BanSym0KindInference) ())
+    type BanSym1 (a0123456789876543210 :: Bool) =
+        Ban a0123456789876543210 :: Bool
+    type BazSym0 :: (~>) Bool Bool
+    data BazSym0 a0123456789876543210
+      where
+        BazSym0KindInference :: SameKind (Apply BazSym0 arg) (BazSym1 arg) =>
+                                BazSym0 a0123456789876543210
+    type instance Apply BazSym0 a0123456789876543210 = BazSym1 a0123456789876543210
+    instance SuppressUnusedWarnings BazSym0 where
+      suppressUnusedWarnings = snd (((,) BazSym0KindInference) ())
+    type BazSym1 (a0123456789876543210 :: Bool) =
+        Baz a0123456789876543210 :: Bool
+    type BarSym0 :: (~>) Bool Bool
+    data BarSym0 a0123456789876543210
+      where
+        BarSym0KindInference :: SameKind (Apply BarSym0 arg) (BarSym1 arg) =>
+                                BarSym0 a0123456789876543210
+    type instance Apply BarSym0 a0123456789876543210 = BarSym1 a0123456789876543210
+    instance SuppressUnusedWarnings BarSym0 where
+      suppressUnusedWarnings = snd (((,) BarSym0KindInference) ())
+    type BarSym1 (a0123456789876543210 :: Bool) =
+        Bar a0123456789876543210 :: Bool
+    type FooSym0 :: (~>) Bool Bool
+    data FooSym0 a0123456789876543210
+      where
+        FooSym0KindInference :: SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
+                                FooSym0 a0123456789876543210
+    type instance Apply FooSym0 a0123456789876543210 = FooSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FooSym0 where
+      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
+    type FooSym1 (a0123456789876543210 :: Bool) =
+        Foo a0123456789876543210 :: Bool
+    type Ban :: Bool -> Bool
+    type family Ban a where
+      Ban x = Apply (Apply ($!@#@$) (Apply (Apply (.@#@$) NotSym0) (Apply (Apply (.@#@$) NotSym0) NotSym0))) x
+    type Baz :: Bool -> Bool
+    type family Baz a where
+      Baz x = Apply (Apply ($!@#@$) NotSym0) x
+    type Bar :: Bool -> Bool
+    type family Bar a where
+      Bar x = Apply (Apply ($@#@$) (Apply (Apply (.@#@$) NotSym0) (Apply (Apply (.@#@$) NotSym0) NotSym0))) x
+    type Foo :: Bool -> Bool
+    type family Foo a where
+      Foo x = Apply (Apply ($@#@$) NotSym0) x
+    sBan ::
+      forall (t :: Bool). Sing t -> Sing (Apply BanSym0 t :: Bool)
+    sBaz ::
+      forall (t :: Bool). Sing t -> Sing (Apply BazSym0 t :: Bool)
+    sBar ::
+      forall (t :: Bool). Sing t -> Sing (Apply BarSym0 t :: Bool)
+    sFoo ::
+      forall (t :: Bool). Sing t -> Sing (Apply FooSym0 t :: Bool)
+    sBan (sX :: Sing x)
+      = (applySing
+           ((applySing ((singFun2 @($!@#@$)) (%$!)))
+              ((applySing
+                  ((applySing ((singFun3 @(.@#@$)) (%.)))
+                     ((singFun1 @NotSym0) sNot)))
+                 ((applySing
+                     ((applySing ((singFun3 @(.@#@$)) (%.)))
+                        ((singFun1 @NotSym0) sNot)))
+                    ((singFun1 @NotSym0) sNot)))))
+          sX
+    sBaz (sX :: Sing x)
+      = (applySing
+           ((applySing ((singFun2 @($!@#@$)) (%$!)))
+              ((singFun1 @NotSym0) sNot)))
+          sX
+    sBar (sX :: Sing x)
+      = (applySing
+           ((applySing ((singFun2 @($@#@$)) (%$)))
+              ((applySing
+                  ((applySing ((singFun3 @(.@#@$)) (%.)))
+                     ((singFun1 @NotSym0) sNot)))
+                 ((applySing
+                     ((applySing ((singFun3 @(.@#@$)) (%.)))
+                        ((singFun1 @NotSym0) sNot)))
+                    ((singFun1 @NotSym0) sNot)))))
+          sX
+    sFoo (sX :: Sing x)
+      = (applySing
+           ((applySing ((singFun2 @($@#@$)) (%$)))
+              ((singFun1 @NotSym0) sNot)))
+          sX
+    instance SingI (BanSym0 :: (~>) Bool Bool) where
+      sing = (singFun1 @BanSym0) sBan
+    instance SingI (BazSym0 :: (~>) Bool Bool) where
+      sing = (singFun1 @BazSym0) sBaz
+    instance SingI (BarSym0 :: (~>) Bool Bool) where
+      sing = (singFun1 @BarSym0) sBar
+    instance SingI (FooSym0 :: (~>) Bool Bool) where
+      sing = (singFun1 @FooSym0) sFoo
diff --git a/tests/compile-and-dump/Singletons/T296.golden b/tests/compile-and-dump/Singletons/T296.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T296.golden
@@ -0,0 +1,69 @@
+Singletons/T296.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| f :: forall a. MyProxy a -> MyProxy a
+          f MyProxy
+            = let
+                x = let
+                      z :: MyProxy a
+                      z = MyProxy
+                    in z
+              in x
+          
+          data MyProxy (a :: Type) = MyProxy |]
+  ======>
+    data MyProxy (a :: Type) = MyProxy
+    f :: forall a. MyProxy a -> MyProxy a
+    f MyProxy
+      = let
+          x = let
+                z :: MyProxy a
+                z = MyProxy
+              in z
+        in x
+    type MyProxySym0 = MyProxy :: MyProxy (a :: Type)
+    type Let0123456789876543210ZSym0 =
+        Let0123456789876543210Z :: MyProxy a
+    type Let0123456789876543210Z :: MyProxy a
+    type family Let0123456789876543210Z where
+      Let0123456789876543210Z = MyProxySym0
+    type Let0123456789876543210XSym0 = Let0123456789876543210X
+    type family Let0123456789876543210X where
+      Let0123456789876543210X = Let0123456789876543210ZSym0
+    type FSym0 :: forall a. (~>) (MyProxy a) (MyProxy a)
+    data FSym0 a0123456789876543210
+      where
+        FSym0KindInference :: SameKind (Apply FSym0 arg) (FSym1 arg) =>
+                              FSym0 a0123456789876543210
+    type instance Apply FSym0 a0123456789876543210 = FSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FSym0 where
+      suppressUnusedWarnings = snd (((,) FSym0KindInference) ())
+    type FSym1 (a0123456789876543210 :: MyProxy a) =
+        F a0123456789876543210 :: MyProxy a
+    type F :: forall a. MyProxy a -> MyProxy a
+    type family F a where
+      F MyProxy = Let0123456789876543210XSym0
+    sF ::
+      forall a (t :: MyProxy a).
+      Sing t -> Sing (Apply FSym0 t :: MyProxy a)
+    sF SMyProxy
+      = let
+          sX :: Sing @_ Let0123456789876543210XSym0
+          sX
+            = let
+                sZ :: Sing (Let0123456789876543210ZSym0 :: MyProxy a)
+                sZ = SMyProxy
+              in sZ
+        in sX
+    instance SingI (FSym0 :: (~>) (MyProxy a) (MyProxy a)) where
+      sing = (singFun1 @FSym0) sF
+    data SMyProxy :: forall a. MyProxy (a :: Type) -> Type
+      where
+        SMyProxy :: forall (a :: Type).
+                    SMyProxy (MyProxy :: MyProxy (a :: Type))
+    type instance Sing @(MyProxy a) = SMyProxy
+    instance SingKind a => SingKind (MyProxy a) where
+      type Demote (MyProxy a) = MyProxy (Demote a)
+      fromSing SMyProxy = MyProxy
+      toSing MyProxy = SomeSing SMyProxy
+    instance SingI MyProxy where
+      sing = SMyProxy
diff --git a/tests/compile-and-dump/Singletons/T296.hs b/tests/compile-and-dump/Singletons/T296.hs
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T296.hs
@@ -0,0 +1,14 @@
+module T296 where
+
+import Data.Kind
+import Data.Singletons.TH
+
+$(singletons [d|
+  data MyProxy (a :: Type) = MyProxy
+
+  f :: forall a. MyProxy a -> MyProxy a
+  f MyProxy =
+    let x = let z :: MyProxy a
+                z = MyProxy in z
+    in x
+  |])
diff --git a/tests/compile-and-dump/Singletons/T297.ghc88.template b/tests/compile-and-dump/Singletons/T297.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T297.ghc88.template
+++ /dev/null
@@ -1,59 +0,0 @@
-Singletons/T297.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| f MyProxy
-            = let
-                x = let
-                      z :: MyProxy a
-                      z = MyProxy
-                    in z
-              in x
-          
-          data MyProxy (a :: Type) = MyProxy |]
-  ======>
-    data MyProxy (a :: Type) = MyProxy
-    f MyProxy
-      = let
-          x = let
-                z :: MyProxy a
-                z = MyProxy
-              in z
-        in x
-    type MyProxySym0 = MyProxy
-    type Let0123456789876543210ZSym0 = Let0123456789876543210Z
-    type family Let0123456789876543210Z :: MyProxy a where
-      Let0123456789876543210Z = MyProxySym0
-    type Let0123456789876543210XSym0 = Let0123456789876543210X
-    type family Let0123456789876543210X where
-      Let0123456789876543210X = Let0123456789876543210ZSym0
-    type FSym1 a0123456789876543210 = F a0123456789876543210
-    instance SuppressUnusedWarnings FSym0 where
-      suppressUnusedWarnings = snd (((,) FSym0KindInference) ())
-    data FSym0 a0123456789876543210
-      where
-        FSym0KindInference :: forall a0123456789876543210
-                                     arg. SameKind (Apply FSym0 arg) (FSym1 arg) =>
-                              FSym0 a0123456789876543210
-    type instance Apply FSym0 a0123456789876543210 = F a0123456789876543210
-    type family F a where
-      F MyProxy = Let0123456789876543210XSym0
-    sF :: forall arg. Sing arg -> Sing (Apply FSym0 arg)
-    sF SMyProxy
-      = let
-          sX :: Sing Let0123456789876543210XSym0
-          sX
-            = let
-                sZ :: forall a. Sing (Let0123456789876543210ZSym0 :: MyProxy a)
-                sZ = SMyProxy
-              in sZ
-        in sX
-    instance SingI FSym0 where
-      sing = (singFun1 @FSym0) sF
-    data SMyProxy :: forall a. MyProxy a -> Type
-      where SMyProxy :: SMyProxy MyProxy
-    type instance Sing @(MyProxy a) = SMyProxy
-    instance SingKind a => SingKind (MyProxy a) where
-      type Demote (MyProxy a) = MyProxy (Demote a)
-      fromSing SMyProxy = MyProxy
-      toSing MyProxy = SomeSing SMyProxy
-    instance SingI MyProxy where
-      sing = SMyProxy
diff --git a/tests/compile-and-dump/Singletons/T297.golden b/tests/compile-and-dump/Singletons/T297.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T297.golden
@@ -0,0 +1,62 @@
+Singletons/T297.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| f MyProxy
+            = let
+                x = let
+                      z :: MyProxy a
+                      z = MyProxy
+                    in z
+              in x
+          
+          data MyProxy (a :: Type) = MyProxy |]
+  ======>
+    data MyProxy (a :: Type) = MyProxy
+    f MyProxy
+      = let
+          x = let
+                z :: MyProxy a
+                z = MyProxy
+              in z
+        in x
+    type MyProxySym0 = MyProxy :: MyProxy (a :: Type)
+    type Let0123456789876543210ZSym0 =
+        Let0123456789876543210Z :: MyProxy a
+    type Let0123456789876543210Z :: MyProxy a
+    type family Let0123456789876543210Z where
+      Let0123456789876543210Z = MyProxySym0
+    type Let0123456789876543210XSym0 = Let0123456789876543210X
+    type family Let0123456789876543210X where
+      Let0123456789876543210X = Let0123456789876543210ZSym0
+    data FSym0 a0123456789876543210
+      where
+        FSym0KindInference :: SameKind (Apply FSym0 arg) (FSym1 arg) =>
+                              FSym0 a0123456789876543210
+    type instance Apply FSym0 a0123456789876543210 = FSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FSym0 where
+      suppressUnusedWarnings = snd (((,) FSym0KindInference) ())
+    type FSym1 a0123456789876543210 = F a0123456789876543210
+    type family F a where
+      F MyProxy = Let0123456789876543210XSym0
+    sF :: forall arg. Sing arg -> Sing (Apply FSym0 arg)
+    sF SMyProxy
+      = let
+          sX :: Sing @_ Let0123456789876543210XSym0
+          sX
+            = let
+                sZ :: forall a. Sing (Let0123456789876543210ZSym0 :: MyProxy a)
+                sZ = SMyProxy
+              in sZ
+        in sX
+    instance SingI FSym0 where
+      sing = (singFun1 @FSym0) sF
+    data SMyProxy :: forall a. MyProxy (a :: Type) -> Type
+      where
+        SMyProxy :: forall (a :: Type).
+                    SMyProxy (MyProxy :: MyProxy (a :: Type))
+    type instance Sing @(MyProxy a) = SMyProxy
+    instance SingKind a => SingKind (MyProxy a) where
+      type Demote (MyProxy a) = MyProxy (Demote a)
+      fromSing SMyProxy = MyProxy
+      toSing MyProxy = SomeSing SMyProxy
+    instance SingI MyProxy where
+      sing = SMyProxy
diff --git a/tests/compile-and-dump/Singletons/T312.ghc88.template b/tests/compile-and-dump/Singletons/T312.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T312.ghc88.template
+++ /dev/null
@@ -1,215 +0,0 @@
-Singletons/T312.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| class Foo a where
-            bar :: a -> b -> b
-            bar _ x = x
-            baz :: forall b. a -> b -> b
-            baz
-              = h
-              where
-                  h :: forall c. c -> b -> b
-                  h _ x = x |]
-  ======>
-    class Foo a where
-      bar :: a -> b -> b
-      baz :: forall b. a -> b -> b
-      bar _ x = x
-      baz
-        = h
-        where
-            h :: forall c. c -> b -> b
-            h _ x = x
-    type BarSym2 (arg0123456789876543210 :: a0123456789876543210) (arg0123456789876543210 :: b0123456789876543210) =
-        Bar arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings (BarSym1 arg0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) BarSym1KindInference) ())
-    data BarSym1 (arg0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                     (~>) b0123456789876543210 b0123456789876543210
-      where
-        BarSym1KindInference :: forall arg0123456789876543210
-                                       arg0123456789876543210
-                                       arg. SameKind (Apply (BarSym1 arg0123456789876543210) arg) (BarSym2 arg0123456789876543210 arg) =>
-                                BarSym1 arg0123456789876543210 arg0123456789876543210
-    type instance Apply (BarSym1 arg0123456789876543210) arg0123456789876543210 = Bar arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings BarSym0 where
-      suppressUnusedWarnings = snd (((,) BarSym0KindInference) ())
-    data BarSym0 :: forall a0123456789876543210 b0123456789876543210.
-                    (~>) a0123456789876543210 ((~>) b0123456789876543210 b0123456789876543210)
-      where
-        BarSym0KindInference :: forall arg0123456789876543210
-                                       arg. SameKind (Apply BarSym0 arg) (BarSym1 arg) =>
-                                BarSym0 arg0123456789876543210
-    type instance Apply BarSym0 arg0123456789876543210 = BarSym1 arg0123456789876543210
-    type BazSym2 (arg0123456789876543210 :: a0123456789876543210) (arg0123456789876543210 :: b0123456789876543210) =
-        Baz arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings (BazSym1 arg0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) BazSym1KindInference) ())
-    data BazSym1 (arg0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                     (~>) b0123456789876543210 b0123456789876543210
-      where
-        BazSym1KindInference :: forall arg0123456789876543210
-                                       arg0123456789876543210
-                                       arg. SameKind (Apply (BazSym1 arg0123456789876543210) arg) (BazSym2 arg0123456789876543210 arg) =>
-                                BazSym1 arg0123456789876543210 arg0123456789876543210
-    type instance Apply (BazSym1 arg0123456789876543210) arg0123456789876543210 = Baz arg0123456789876543210 arg0123456789876543210
-    instance SuppressUnusedWarnings BazSym0 where
-      suppressUnusedWarnings = snd (((,) BazSym0KindInference) ())
-    data BazSym0 :: forall a0123456789876543210 b0123456789876543210.
-                    (~>) a0123456789876543210 ((~>) b0123456789876543210 b0123456789876543210)
-      where
-        BazSym0KindInference :: forall arg0123456789876543210
-                                       arg. SameKind (Apply BazSym0 arg) (BazSym1 arg) =>
-                                BazSym0 arg0123456789876543210
-    type instance Apply BazSym0 arg0123456789876543210 = BazSym1 arg0123456789876543210
-    type family Bar_0123456789876543210 (a :: a) (a :: b) :: b where
-      Bar_0123456789876543210 _ x = x
-    type Bar_0123456789876543210Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: b0123456789876543210) =
-        Bar_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Bar_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Bar_0123456789876543210Sym1KindInference) ())
-    data Bar_0123456789876543210Sym1 (a0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                                       (~>) b0123456789876543210 b0123456789876543210
-      where
-        Bar_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                           a0123456789876543210
-                                                           arg. SameKind (Apply (Bar_0123456789876543210Sym1 a0123456789876543210) arg) (Bar_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                    Bar_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Bar_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Bar_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Bar_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Bar_0123456789876543210Sym0KindInference) ())
-    data Bar_0123456789876543210Sym0 :: forall a0123456789876543210
-                                               b0123456789876543210.
-                                        (~>) a0123456789876543210 ((~>) b0123456789876543210 b0123456789876543210)
-      where
-        Bar_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                           arg. SameKind (Apply Bar_0123456789876543210Sym0 arg) (Bar_0123456789876543210Sym1 arg) =>
-                                                    Bar_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Bar_0123456789876543210Sym0 a0123456789876543210 = Bar_0123456789876543210Sym1 a0123456789876543210
-    type Let0123456789876543210HSym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 (a0123456789876543210 :: c0123456789876543210) (a0123456789876543210 :: b0123456789876543210) =
-        Let0123456789876543210H a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210HSym3 a0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210HSym3KindInference) ())
-    data Let0123456789876543210HSym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 (a0123456789876543210 :: c0123456789876543210) :: forall b0123456789876543210.
-                                                                                                                                                                         (~>) b0123456789876543210 b0123456789876543210
-      where
-        Let0123456789876543210HSym3KindInference :: forall a_01234567898765432100123456789876543210
-                                                           a_01234567898765432100123456789876543210
-                                                           a0123456789876543210
-                                                           a0123456789876543210
-                                                           arg. SameKind (Apply (Let0123456789876543210HSym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a0123456789876543210) arg) (Let0123456789876543210HSym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a0123456789876543210 arg) =>
-                                                    Let0123456789876543210HSym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (Let0123456789876543210HSym3 a0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a0123456789876543210 = Let0123456789876543210H a0123456789876543210 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210HSym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210HSym2KindInference) ())
-    data Let0123456789876543210HSym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 :: forall c0123456789876543210
-                                                                                                                                 b0123456789876543210.
-                                                                                                                          (~>) c0123456789876543210 ((~>) b0123456789876543210 b0123456789876543210)
-      where
-        Let0123456789876543210HSym2KindInference :: forall a_01234567898765432100123456789876543210
-                                                           a_01234567898765432100123456789876543210
-                                                           a0123456789876543210
-                                                           arg. SameKind (Apply (Let0123456789876543210HSym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Let0123456789876543210HSym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
-                                                    Let0123456789876543210HSym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a0123456789876543210
-    type instance Apply (Let0123456789876543210HSym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a0123456789876543210 = Let0123456789876543210HSym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Let0123456789876543210HSym1 a_01234567898765432100123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210HSym1KindInference) ())
-    data Let0123456789876543210HSym1 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-      where
-        Let0123456789876543210HSym1KindInference :: forall a_01234567898765432100123456789876543210
-                                                           a_01234567898765432100123456789876543210
-                                                           arg. SameKind (Apply (Let0123456789876543210HSym1 a_01234567898765432100123456789876543210) arg) (Let0123456789876543210HSym2 a_01234567898765432100123456789876543210 arg) =>
-                                                    Let0123456789876543210HSym1 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    type instance Apply (Let0123456789876543210HSym1 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Let0123456789876543210HSym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210HSym0 where
-      suppressUnusedWarnings
-        = snd (((,) Let0123456789876543210HSym0KindInference) ())
-    data Let0123456789876543210HSym0 a_01234567898765432100123456789876543210
-      where
-        Let0123456789876543210HSym0KindInference :: forall a_01234567898765432100123456789876543210
-                                                           arg. SameKind (Apply Let0123456789876543210HSym0 arg) (Let0123456789876543210HSym1 arg) =>
-                                                    Let0123456789876543210HSym0 a_01234567898765432100123456789876543210
-    type instance Apply Let0123456789876543210HSym0 a_01234567898765432100123456789876543210 = Let0123456789876543210HSym1 a_01234567898765432100123456789876543210
-    type family Let0123456789876543210H a_0123456789876543210 a_0123456789876543210 (a :: c) (a :: b) :: b where
-      Let0123456789876543210H a_0123456789876543210 a_0123456789876543210 _ x = x
-    type family Baz_0123456789876543210 (a :: a) (a :: b) :: b where
-      Baz_0123456789876543210 a_0123456789876543210 a_0123456789876543210 = Apply (Apply (Let0123456789876543210HSym2 a_0123456789876543210 a_0123456789876543210) a_0123456789876543210) a_0123456789876543210
-    type Baz_0123456789876543210Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: b0123456789876543210) =
-        Baz_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (Baz_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) Baz_0123456789876543210Sym1KindInference) ())
-    data Baz_0123456789876543210Sym1 (a0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                                       (~>) b0123456789876543210 b0123456789876543210
-      where
-        Baz_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                           a0123456789876543210
-                                                           arg. SameKind (Apply (Baz_0123456789876543210Sym1 a0123456789876543210) arg) (Baz_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                    Baz_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Baz_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Baz_0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Baz_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Baz_0123456789876543210Sym0KindInference) ())
-    data Baz_0123456789876543210Sym0 :: forall a0123456789876543210
-                                               b0123456789876543210.
-                                        (~>) a0123456789876543210 ((~>) b0123456789876543210 b0123456789876543210)
-      where
-        Baz_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                           arg. SameKind (Apply Baz_0123456789876543210Sym0 arg) (Baz_0123456789876543210Sym1 arg) =>
-                                                    Baz_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Baz_0123456789876543210Sym0 a0123456789876543210 = Baz_0123456789876543210Sym1 a0123456789876543210
-    class PFoo (a :: GHC.Types.Type) where
-      type Bar (arg :: a) (arg :: b) :: b
-      type Baz (arg :: a) (arg :: b) :: b
-      type Bar a a = Apply (Apply Bar_0123456789876543210Sym0 a) a
-      type Baz a a = Apply (Apply Baz_0123456789876543210Sym0 a) a
-    class SFoo a where
-      sBar ::
-        forall b (t :: a) (t :: b).
-        Sing t -> Sing t -> Sing (Apply (Apply BarSym0 t) t :: b)
-      sBaz ::
-        forall b (t :: a) (t :: b).
-        Sing t -> Sing t -> Sing (Apply (Apply BazSym0 t) t :: b)
-      default sBar ::
-                forall b (t :: a) (t :: b).
-                ((Apply (Apply BarSym0 t) t :: b)
-                 ~ Apply (Apply Bar_0123456789876543210Sym0 t) t) =>
-                Sing t -> Sing t -> Sing (Apply (Apply BarSym0 t) t :: b)
-      default sBaz ::
-                forall b (t :: a) (t :: b).
-                ((Apply (Apply BazSym0 t) t :: b)
-                 ~ Apply (Apply Baz_0123456789876543210Sym0 t) t) =>
-                Sing t -> Sing t -> Sing (Apply (Apply BazSym0 t) t :: b)
-      sBar _ (sX :: Sing x) = sX
-      sBaz
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing
-                 (let
-                    sH ::
-                      forall c (t :: c) (t :: b).
-                      Sing t
-                      -> Sing t
-                         -> Sing (Apply (Apply (Let0123456789876543210HSym2 a_0123456789876543210 a_0123456789876543210) t) t :: b)
-                    sH _ (sX :: Sing x) = sX
-                  in
-                    (singFun2
-                       @(Let0123456789876543210HSym2 a_0123456789876543210 a_0123456789876543210))
-                      sH))
-                sA_0123456789876543210))
-            sA_0123456789876543210
-    instance SFoo a => SingI (BarSym0 :: (~>) a ((~>) b b)) where
-      sing = (singFun2 @BarSym0) sBar
-    instance (SFoo a, SingI d) =>
-             SingI (BarSym1 (d :: a) :: (~>) b b) where
-      sing = (singFun1 @(BarSym1 (d :: a))) (sBar (sing @d))
-    instance SFoo a => SingI (BazSym0 :: (~>) a ((~>) b b)) where
-      sing = (singFun2 @BazSym0) sBaz
-    instance (SFoo a, SingI d) =>
-             SingI (BazSym1 (d :: a) :: (~>) b b) where
-      sing = (singFun1 @(BazSym1 (d :: a))) (sBaz (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T312.golden b/tests/compile-and-dump/Singletons/T312.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T312.golden
@@ -0,0 +1,190 @@
+Singletons/T312.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| class Foo a where
+            bar :: a -> b -> b
+            bar _ x = x
+            baz :: forall b. a -> b -> b
+            baz
+              = h
+              where
+                  h :: forall c. c -> b -> b
+                  h _ x = x |]
+  ======>
+    class Foo a where
+      bar :: a -> b -> b
+      baz :: forall b. a -> b -> b
+      bar _ x = x
+      baz
+        = h
+        where
+            h :: forall c. c -> b -> b
+            h _ x = x
+    type BarSym0 :: forall a b. (~>) a ((~>) b b)
+    data BarSym0 a0123456789876543210
+      where
+        BarSym0KindInference :: SameKind (Apply BarSym0 arg) (BarSym1 arg) =>
+                                BarSym0 a0123456789876543210
+    type instance Apply BarSym0 a0123456789876543210 = BarSym1 a0123456789876543210
+    instance SuppressUnusedWarnings BarSym0 where
+      suppressUnusedWarnings = snd (((,) BarSym0KindInference) ())
+    type BarSym1 :: forall a b. a -> (~>) b b
+    data BarSym1 a0123456789876543210 a0123456789876543210
+      where
+        BarSym1KindInference :: SameKind (Apply (BarSym1 a0123456789876543210) arg) (BarSym2 a0123456789876543210 arg) =>
+                                BarSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (BarSym1 a0123456789876543210) a0123456789876543210 = BarSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (BarSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) BarSym1KindInference) ())
+    type BarSym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        Bar a0123456789876543210 a0123456789876543210 :: b
+    type BazSym0 :: forall a b. (~>) a ((~>) b b)
+    data BazSym0 a0123456789876543210
+      where
+        BazSym0KindInference :: SameKind (Apply BazSym0 arg) (BazSym1 arg) =>
+                                BazSym0 a0123456789876543210
+    type instance Apply BazSym0 a0123456789876543210 = BazSym1 a0123456789876543210
+    instance SuppressUnusedWarnings BazSym0 where
+      suppressUnusedWarnings = snd (((,) BazSym0KindInference) ())
+    type BazSym1 :: forall a b. a -> (~>) b b
+    data BazSym1 a0123456789876543210 a0123456789876543210
+      where
+        BazSym1KindInference :: SameKind (Apply (BazSym1 a0123456789876543210) arg) (BazSym2 a0123456789876543210 arg) =>
+                                BazSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (BazSym1 a0123456789876543210) a0123456789876543210 = BazSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (BazSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) BazSym1KindInference) ())
+    type BazSym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        Baz a0123456789876543210 a0123456789876543210 :: b
+    type Bar_0123456789876543210 :: a -> b -> b
+    type family Bar_0123456789876543210 a a where
+      Bar_0123456789876543210 _ x = x
+    type Bar_0123456789876543210Sym0 :: (~>) a ((~>) b b)
+    data Bar_0123456789876543210Sym0 a0123456789876543210
+      where
+        Bar_0123456789876543210Sym0KindInference :: SameKind (Apply Bar_0123456789876543210Sym0 arg) (Bar_0123456789876543210Sym1 arg) =>
+                                                    Bar_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Bar_0123456789876543210Sym0 a0123456789876543210 = Bar_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Bar_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Bar_0123456789876543210Sym0KindInference) ())
+    type Bar_0123456789876543210Sym1 :: a -> (~>) b b
+    data Bar_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Bar_0123456789876543210Sym1KindInference :: SameKind (Apply (Bar_0123456789876543210Sym1 a0123456789876543210) arg) (Bar_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                    Bar_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Bar_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Bar_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Bar_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Bar_0123456789876543210Sym1KindInference) ())
+    type Bar_0123456789876543210Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        Bar_0123456789876543210 a0123456789876543210 a0123456789876543210 :: b
+    data Let0123456789876543210HSym0 a_01234567898765432100123456789876543210
+      where
+        Let0123456789876543210HSym0KindInference :: SameKind (Apply Let0123456789876543210HSym0 arg) (Let0123456789876543210HSym1 arg) =>
+                                                    Let0123456789876543210HSym0 a_01234567898765432100123456789876543210
+    type instance Apply Let0123456789876543210HSym0 a_01234567898765432100123456789876543210 = Let0123456789876543210HSym1 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210HSym0 where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210HSym0KindInference) ())
+    data Let0123456789876543210HSym1 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+      where
+        Let0123456789876543210HSym1KindInference :: SameKind (Apply (Let0123456789876543210HSym1 a_01234567898765432100123456789876543210) arg) (Let0123456789876543210HSym2 a_01234567898765432100123456789876543210 arg) =>
+                                                    Let0123456789876543210HSym1 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    type instance Apply (Let0123456789876543210HSym1 a_01234567898765432100123456789876543210) a_01234567898765432100123456789876543210 = Let0123456789876543210HSym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210HSym1 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210HSym1KindInference) ())
+    data Let0123456789876543210HSym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 :: (~>) c0123456789876543210 ((~>) b0123456789876543210 b0123456789876543210)
+      where
+        Let0123456789876543210HSym2KindInference :: SameKind (Apply (Let0123456789876543210HSym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) arg) (Let0123456789876543210HSym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 arg) =>
+                                                    Let0123456789876543210HSym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a0123456789876543210
+    type instance Apply (Let0123456789876543210HSym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) a0123456789876543210 = Let0123456789876543210HSym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210HSym2 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210HSym2KindInference) ())
+    data Let0123456789876543210HSym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 (a0123456789876543210 :: c0123456789876543210) :: (~>) b0123456789876543210 b0123456789876543210
+      where
+        Let0123456789876543210HSym3KindInference :: SameKind (Apply (Let0123456789876543210HSym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a0123456789876543210) arg) (Let0123456789876543210HSym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a0123456789876543210 arg) =>
+                                                    Let0123456789876543210HSym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (Let0123456789876543210HSym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a0123456789876543210) a0123456789876543210 = Let0123456789876543210HSym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Let0123456789876543210HSym3 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Let0123456789876543210HSym3KindInference) ())
+    type Let0123456789876543210HSym4 a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 (a0123456789876543210 :: c0123456789876543210) (a0123456789876543210 :: b0123456789876543210) =
+        Let0123456789876543210H a_01234567898765432100123456789876543210 a_01234567898765432100123456789876543210 a0123456789876543210 a0123456789876543210 :: b0123456789876543210
+    type family Let0123456789876543210H a_0123456789876543210 a_0123456789876543210 (a :: c) (a :: b) :: b where
+      Let0123456789876543210H a_0123456789876543210 a_0123456789876543210 _ x = x
+    type Baz_0123456789876543210 :: a -> b -> b
+    type family Baz_0123456789876543210 a a where
+      Baz_0123456789876543210 a_0123456789876543210 a_0123456789876543210 = Apply (Apply (Let0123456789876543210HSym2 a_0123456789876543210 a_0123456789876543210) a_0123456789876543210) a_0123456789876543210
+    type Baz_0123456789876543210Sym0 :: (~>) a ((~>) b b)
+    data Baz_0123456789876543210Sym0 a0123456789876543210
+      where
+        Baz_0123456789876543210Sym0KindInference :: SameKind (Apply Baz_0123456789876543210Sym0 arg) (Baz_0123456789876543210Sym1 arg) =>
+                                                    Baz_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Baz_0123456789876543210Sym0 a0123456789876543210 = Baz_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Baz_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Baz_0123456789876543210Sym0KindInference) ())
+    type Baz_0123456789876543210Sym1 :: a -> (~>) b b
+    data Baz_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Baz_0123456789876543210Sym1KindInference :: SameKind (Apply (Baz_0123456789876543210Sym1 a0123456789876543210) arg) (Baz_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                    Baz_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Baz_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Baz_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (Baz_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) Baz_0123456789876543210Sym1KindInference) ())
+    type Baz_0123456789876543210Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        Baz_0123456789876543210 a0123456789876543210 a0123456789876543210 :: b
+    class PFoo a where
+      type Bar (arg :: a) (arg :: b) :: b
+      type Baz (arg :: a) (arg :: b) :: b
+      type Bar a a = Apply (Apply Bar_0123456789876543210Sym0 a) a
+      type Baz a a = Apply (Apply Baz_0123456789876543210Sym0 a) a
+    class SFoo a where
+      sBar ::
+        forall b (t :: a) (t :: b).
+        Sing t -> Sing t -> Sing (Apply (Apply BarSym0 t) t :: b)
+      sBaz ::
+        forall b (t :: a) (t :: b).
+        Sing t -> Sing t -> Sing (Apply (Apply BazSym0 t) t :: b)
+      default sBar ::
+                forall b (t :: a) (t :: b).
+                ((Apply (Apply BarSym0 t) t :: b)
+                 ~ Apply (Apply Bar_0123456789876543210Sym0 t) t) =>
+                Sing t -> Sing t -> Sing (Apply (Apply BarSym0 t) t :: b)
+      default sBaz ::
+                forall b (t :: a) (t :: b).
+                ((Apply (Apply BazSym0 t) t :: b)
+                 ~ Apply (Apply Baz_0123456789876543210Sym0 t) t) =>
+                Sing t -> Sing t -> Sing (Apply (Apply BazSym0 t) t :: b)
+      sBar _ (sX :: Sing x) = sX
+      sBaz
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing
+                 (let
+                    sH ::
+                      forall c (t :: c) (t :: b).
+                      Sing t
+                      -> Sing t
+                         -> Sing (Apply (Apply (Let0123456789876543210HSym2 a_0123456789876543210 a_0123456789876543210) t) t :: b)
+                    sH _ (sX :: Sing x) = sX
+                  in
+                    (singFun2
+                       @(Let0123456789876543210HSym2 a_0123456789876543210 a_0123456789876543210))
+                      sH))
+                sA_0123456789876543210))
+            sA_0123456789876543210
+    instance SFoo a => SingI (BarSym0 :: (~>) a ((~>) b b)) where
+      sing = (singFun2 @BarSym0) sBar
+    instance (SFoo a, SingI d) =>
+             SingI (BarSym1 (d :: a) :: (~>) b b) where
+      sing = (singFun1 @(BarSym1 (d :: a))) (sBar (sing @d))
+    instance SFoo a => SingI (BazSym0 :: (~>) a ((~>) b b)) where
+      sing = (singFun2 @BazSym0) sBaz
+    instance (SFoo a, SingI d) =>
+             SingI (BazSym1 (d :: a) :: (~>) b b) where
+      sing = (singFun1 @(BazSym1 (d :: a))) (sBaz (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T313.ghc88.template b/tests/compile-and-dump/Singletons/T313.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T313.ghc88.template
+++ /dev/null
@@ -1,130 +0,0 @@
-Singletons/T313.hs:(0,0)-(0,0): Splicing declarations
-    promote
-      [d| type PFoo1 a = Maybe a
-          type family PFoo2 a
-          type family PFoo3 a where
-            PFoo3 a = Maybe a
-          class PC (a :: Type) where
-            type PFoo4 a
-            type PFoo4 a = Maybe a
-          
-          type instance PFoo2 a = Maybe a
-          instance PC a where
-            type PFoo4 a = Maybe a |]
-  ======>
-    type PFoo1 a = Maybe a
-    type family PFoo2 a
-    type instance PFoo2 a = Maybe a
-    type family PFoo3 a where
-      PFoo3 a = Maybe a
-    class PC (a :: Type) where
-      type PFoo4 a
-      type PFoo4 a = Maybe a
-    instance PC a where
-      type PFoo4 a = Maybe a
-    type PFoo1Sym1 a0123456789876543210 = PFoo1 a0123456789876543210
-    instance SuppressUnusedWarnings PFoo1Sym0 where
-      suppressUnusedWarnings = snd (((,) PFoo1Sym0KindInference) ())
-    data PFoo1Sym0 a0123456789876543210
-      where
-        PFoo1Sym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply PFoo1Sym0 arg) (PFoo1Sym1 arg) =>
-                                  PFoo1Sym0 a0123456789876543210
-    type instance Apply PFoo1Sym0 a0123456789876543210 = PFoo1 a0123456789876543210
-    type PFoo3Sym1 a0123456789876543210 = PFoo3 a0123456789876543210
-    instance SuppressUnusedWarnings PFoo3Sym0 where
-      suppressUnusedWarnings = snd (((,) PFoo3Sym0KindInference) ())
-    data PFoo3Sym0 a0123456789876543210
-      where
-        PFoo3Sym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply PFoo3Sym0 arg) (PFoo3Sym1 arg) =>
-                                  PFoo3Sym0 a0123456789876543210
-    type instance Apply PFoo3Sym0 a0123456789876543210 = PFoo3 a0123456789876543210
-    type PFoo2Sym1 (a0123456789876543210 :: Type) =
-        PFoo2 a0123456789876543210
-    instance SuppressUnusedWarnings PFoo2Sym0 where
-      suppressUnusedWarnings = snd (((,) PFoo2Sym0KindInference) ())
-    data PFoo2Sym0 :: (~>) Type Type
-      where
-        PFoo2Sym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply PFoo2Sym0 arg) (PFoo2Sym1 arg) =>
-                                  PFoo2Sym0 a0123456789876543210
-    type instance Apply PFoo2Sym0 a0123456789876543210 = PFoo2 a0123456789876543210
-    type PFoo4Sym1 (a0123456789876543210 :: Type) =
-        PFoo4 a0123456789876543210
-    instance SuppressUnusedWarnings PFoo4Sym0 where
-      suppressUnusedWarnings = snd (((,) PFoo4Sym0KindInference) ())
-    data PFoo4Sym0 :: (~>) Type Type
-      where
-        PFoo4Sym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply PFoo4Sym0 arg) (PFoo4Sym1 arg) =>
-                                  PFoo4Sym0 a0123456789876543210
-    type instance Apply PFoo4Sym0 a0123456789876543210 = PFoo4 a0123456789876543210
-    class PPC (a :: Type)
-    instance PPC a
-Singletons/T313.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| type SFoo1 a = Maybe a
-          type family SFoo2 a
-          type family SFoo3 a where
-            SFoo3 a = Maybe a
-          class SC (a :: Type) where
-            type SFoo4 a
-            type SFoo4 a = Maybe a
-          
-          type instance SFoo2 a = Maybe a
-          instance SC a where
-            type SFoo4 a = Maybe a |]
-  ======>
-    type SFoo1 a = Maybe a
-    type family SFoo2 a
-    type instance SFoo2 a = Maybe a
-    type family SFoo3 a where
-      SFoo3 a = Maybe a
-    class SC (a :: Type) where
-      type SFoo4 a
-      type SFoo4 a = Maybe a
-    instance SC a where
-      type SFoo4 a = Maybe a
-    type SFoo1Sym1 a0123456789876543210 = SFoo1 a0123456789876543210
-    instance SuppressUnusedWarnings SFoo1Sym0 where
-      suppressUnusedWarnings = snd (((,) SFoo1Sym0KindInference) ())
-    data SFoo1Sym0 a0123456789876543210
-      where
-        SFoo1Sym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply SFoo1Sym0 arg) (SFoo1Sym1 arg) =>
-                                  SFoo1Sym0 a0123456789876543210
-    type instance Apply SFoo1Sym0 a0123456789876543210 = SFoo1 a0123456789876543210
-    type SFoo3Sym1 a0123456789876543210 = SFoo3 a0123456789876543210
-    instance SuppressUnusedWarnings SFoo3Sym0 where
-      suppressUnusedWarnings = snd (((,) SFoo3Sym0KindInference) ())
-    data SFoo3Sym0 a0123456789876543210
-      where
-        SFoo3Sym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply SFoo3Sym0 arg) (SFoo3Sym1 arg) =>
-                                  SFoo3Sym0 a0123456789876543210
-    type instance Apply SFoo3Sym0 a0123456789876543210 = SFoo3 a0123456789876543210
-    type SFoo2Sym1 (a0123456789876543210 :: Type) =
-        SFoo2 a0123456789876543210
-    instance SuppressUnusedWarnings SFoo2Sym0 where
-      suppressUnusedWarnings = snd (((,) SFoo2Sym0KindInference) ())
-    data SFoo2Sym0 :: (~>) Type Type
-      where
-        SFoo2Sym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply SFoo2Sym0 arg) (SFoo2Sym1 arg) =>
-                                  SFoo2Sym0 a0123456789876543210
-    type instance Apply SFoo2Sym0 a0123456789876543210 = SFoo2 a0123456789876543210
-    type SFoo4Sym1 (a0123456789876543210 :: Type) =
-        SFoo4 a0123456789876543210
-    instance SuppressUnusedWarnings SFoo4Sym0 where
-      suppressUnusedWarnings = snd (((,) SFoo4Sym0KindInference) ())
-    data SFoo4Sym0 :: (~>) Type Type
-      where
-        SFoo4Sym0KindInference :: forall a0123456789876543210
-                                         arg. SameKind (Apply SFoo4Sym0 arg) (SFoo4Sym1 arg) =>
-                                  SFoo4Sym0 a0123456789876543210
-    type instance Apply SFoo4Sym0 a0123456789876543210 = SFoo4 a0123456789876543210
-    class PSC (a :: Type)
-    instance PSC a
-    class SSC (a :: Type)
-    instance SSC a
diff --git a/tests/compile-and-dump/Singletons/T313.golden b/tests/compile-and-dump/Singletons/T313.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T313.golden
@@ -0,0 +1,122 @@
+Singletons/T313.hs:(0,0)-(0,0): Splicing declarations
+    promote
+      [d| type PFoo1 a = Maybe a
+          type family PFoo2 a
+          type family PFoo3 a where
+            PFoo3 a = Maybe a
+          class PC (a :: Type) where
+            type PFoo4 a
+            type PFoo4 a = Maybe a
+          
+          type instance PFoo2 a = Maybe a
+          instance PC a where
+            type PFoo4 a = Maybe a |]
+  ======>
+    type PFoo1 a = Maybe a
+    type family PFoo2 a
+    type instance PFoo2 a = Maybe a
+    type family PFoo3 a where
+      PFoo3 a = Maybe a
+    class PC (a :: Type) where
+      type PFoo4 a
+      type PFoo4 a = Maybe a
+    instance PC a where
+      type PFoo4 a = Maybe a
+    data PFoo1Sym0 a0123456789876543210
+      where
+        PFoo1Sym0KindInference :: SameKind (Apply PFoo1Sym0 arg) (PFoo1Sym1 arg) =>
+                                  PFoo1Sym0 a0123456789876543210
+    type instance Apply PFoo1Sym0 a0123456789876543210 = PFoo1Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings PFoo1Sym0 where
+      suppressUnusedWarnings = snd (((,) PFoo1Sym0KindInference) ())
+    type PFoo1Sym1 a0123456789876543210 = PFoo1 a0123456789876543210
+    data PFoo3Sym0 a0123456789876543210
+      where
+        PFoo3Sym0KindInference :: SameKind (Apply PFoo3Sym0 arg) (PFoo3Sym1 arg) =>
+                                  PFoo3Sym0 a0123456789876543210
+    type instance Apply PFoo3Sym0 a0123456789876543210 = PFoo3Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings PFoo3Sym0 where
+      suppressUnusedWarnings = snd (((,) PFoo3Sym0KindInference) ())
+    type PFoo3Sym1 a0123456789876543210 = PFoo3 a0123456789876543210
+    data PFoo2Sym0 :: (~>) Type Type
+      where
+        PFoo2Sym0KindInference :: SameKind (Apply PFoo2Sym0 arg) (PFoo2Sym1 arg) =>
+                                  PFoo2Sym0 a0123456789876543210
+    type instance Apply PFoo2Sym0 a0123456789876543210 = PFoo2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings PFoo2Sym0 where
+      suppressUnusedWarnings = snd (((,) PFoo2Sym0KindInference) ())
+    type PFoo2Sym1 (a0123456789876543210 :: Type) =
+        PFoo2 a0123456789876543210 :: Type
+    data PFoo4Sym0 a0123456789876543210
+      where
+        PFoo4Sym0KindInference :: SameKind (Apply PFoo4Sym0 arg) (PFoo4Sym1 arg) =>
+                                  PFoo4Sym0 a0123456789876543210
+    type instance Apply PFoo4Sym0 a0123456789876543210 = PFoo4Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings PFoo4Sym0 where
+      suppressUnusedWarnings = snd (((,) PFoo4Sym0KindInference) ())
+    type PFoo4Sym1 (a0123456789876543210 :: Type) =
+        PFoo4 a0123456789876543210
+    class PPC (a :: Type)
+    instance PPC a
+Singletons/T313.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| type SFoo1 a = Maybe a
+          type family SFoo2 a
+          type family SFoo3 a where
+            SFoo3 a = Maybe a
+          class SC (a :: Type) where
+            type SFoo4 a
+            type SFoo4 a = Maybe a
+          
+          type instance SFoo2 a = Maybe a
+          instance SC a where
+            type SFoo4 a = Maybe a |]
+  ======>
+    type SFoo1 a = Maybe a
+    type family SFoo2 a
+    type instance SFoo2 a = Maybe a
+    type family SFoo3 a where
+      SFoo3 a = Maybe a
+    class SC (a :: Type) where
+      type SFoo4 a
+      type SFoo4 a = Maybe a
+    instance SC a where
+      type SFoo4 a = Maybe a
+    data SFoo1Sym0 a0123456789876543210
+      where
+        SFoo1Sym0KindInference :: SameKind (Apply SFoo1Sym0 arg) (SFoo1Sym1 arg) =>
+                                  SFoo1Sym0 a0123456789876543210
+    type instance Apply SFoo1Sym0 a0123456789876543210 = SFoo1Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings SFoo1Sym0 where
+      suppressUnusedWarnings = snd (((,) SFoo1Sym0KindInference) ())
+    type SFoo1Sym1 a0123456789876543210 = SFoo1 a0123456789876543210
+    data SFoo3Sym0 a0123456789876543210
+      where
+        SFoo3Sym0KindInference :: SameKind (Apply SFoo3Sym0 arg) (SFoo3Sym1 arg) =>
+                                  SFoo3Sym0 a0123456789876543210
+    type instance Apply SFoo3Sym0 a0123456789876543210 = SFoo3Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings SFoo3Sym0 where
+      suppressUnusedWarnings = snd (((,) SFoo3Sym0KindInference) ())
+    type SFoo3Sym1 a0123456789876543210 = SFoo3 a0123456789876543210
+    data SFoo2Sym0 :: (~>) Type Type
+      where
+        SFoo2Sym0KindInference :: SameKind (Apply SFoo2Sym0 arg) (SFoo2Sym1 arg) =>
+                                  SFoo2Sym0 a0123456789876543210
+    type instance Apply SFoo2Sym0 a0123456789876543210 = SFoo2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings SFoo2Sym0 where
+      suppressUnusedWarnings = snd (((,) SFoo2Sym0KindInference) ())
+    type SFoo2Sym1 (a0123456789876543210 :: Type) =
+        SFoo2 a0123456789876543210 :: Type
+    data SFoo4Sym0 a0123456789876543210
+      where
+        SFoo4Sym0KindInference :: SameKind (Apply SFoo4Sym0 arg) (SFoo4Sym1 arg) =>
+                                  SFoo4Sym0 a0123456789876543210
+    type instance Apply SFoo4Sym0 a0123456789876543210 = SFoo4Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings SFoo4Sym0 where
+      suppressUnusedWarnings = snd (((,) SFoo4Sym0KindInference) ())
+    type SFoo4Sym1 (a0123456789876543210 :: Type) =
+        SFoo4 a0123456789876543210
+    class PSC (a :: Type)
+    instance PSC a
+    class SSC (a :: Type)
+    instance SSC a
diff --git a/tests/compile-and-dump/Singletons/T316.ghc88.template b/tests/compile-and-dump/Singletons/T316.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T316.ghc88.template
+++ /dev/null
@@ -1,40 +0,0 @@
-Singletons/T316.hs:(0,0)-(0,0): Splicing declarations
-    promoteOnly
-      [d| replaceAllGTypes :: (a -> Type -> a) -> [Type] -> [a] -> [a]
-          replaceAllGTypes f types as = zipWith f as types |]
-  ======>
-    type ReplaceAllGTypesSym3 (a0123456789876543210 :: (~>) a0123456789876543210 ((~>) Type a0123456789876543210)) (a0123456789876543210 :: [Type]) (a0123456789876543210 :: [a0123456789876543210]) =
-        ReplaceAllGTypes a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ReplaceAllGTypesSym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ReplaceAllGTypesSym2KindInference) ())
-    data ReplaceAllGTypesSym2 (a0123456789876543210 :: (~>) a0123456789876543210 ((~>) Type a0123456789876543210)) (a0123456789876543210 :: [Type]) :: (~>) [a0123456789876543210] [a0123456789876543210]
-      where
-        ReplaceAllGTypesSym2KindInference :: forall a0123456789876543210
-                                                    a0123456789876543210
-                                                    a0123456789876543210
-                                                    arg. SameKind (Apply (ReplaceAllGTypesSym2 a0123456789876543210 a0123456789876543210) arg) (ReplaceAllGTypesSym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                             ReplaceAllGTypesSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (ReplaceAllGTypesSym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ReplaceAllGTypes a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ReplaceAllGTypesSym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ReplaceAllGTypesSym1KindInference) ())
-    data ReplaceAllGTypesSym1 (a0123456789876543210 :: (~>) a0123456789876543210 ((~>) Type a0123456789876543210)) :: (~>) [Type] ((~>) [a0123456789876543210] [a0123456789876543210])
-      where
-        ReplaceAllGTypesSym1KindInference :: forall a0123456789876543210
-                                                    a0123456789876543210
-                                                    arg. SameKind (Apply (ReplaceAllGTypesSym1 a0123456789876543210) arg) (ReplaceAllGTypesSym2 a0123456789876543210 arg) =>
-                                             ReplaceAllGTypesSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ReplaceAllGTypesSym1 a0123456789876543210) a0123456789876543210 = ReplaceAllGTypesSym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ReplaceAllGTypesSym0 where
-      suppressUnusedWarnings
-        = snd (((,) ReplaceAllGTypesSym0KindInference) ())
-    data ReplaceAllGTypesSym0 :: forall a0123456789876543210.
-                                 (~>) ((~>) a0123456789876543210 ((~>) Type a0123456789876543210)) ((~>) [Type] ((~>) [a0123456789876543210] [a0123456789876543210]))
-      where
-        ReplaceAllGTypesSym0KindInference :: forall a0123456789876543210
-                                                    arg. SameKind (Apply ReplaceAllGTypesSym0 arg) (ReplaceAllGTypesSym1 arg) =>
-                                             ReplaceAllGTypesSym0 a0123456789876543210
-    type instance Apply ReplaceAllGTypesSym0 a0123456789876543210 = ReplaceAllGTypesSym1 a0123456789876543210
-    type family ReplaceAllGTypes (a :: (~>) a ((~>) Type a)) (a :: [Type]) (a :: [a]) :: [a] where
-      ReplaceAllGTypes f types as = Apply (Apply (Apply ZipWithSym0 f) as) types
diff --git a/tests/compile-and-dump/Singletons/T316.golden b/tests/compile-and-dump/Singletons/T316.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T316.golden
@@ -0,0 +1,40 @@
+Singletons/T316.hs:(0,0)-(0,0): Splicing declarations
+    promoteOnly
+      [d| replaceAllGTypes :: (a -> Type -> a) -> [Type] -> [a] -> [a]
+          replaceAllGTypes f types as = zipWith f as types |]
+  ======>
+    type ReplaceAllGTypesSym0 :: (~>) ((~>) a ((~>) Type a)) ((~>) [Type] ((~>) [a] [a]))
+    data ReplaceAllGTypesSym0 a0123456789876543210
+      where
+        ReplaceAllGTypesSym0KindInference :: SameKind (Apply ReplaceAllGTypesSym0 arg) (ReplaceAllGTypesSym1 arg) =>
+                                             ReplaceAllGTypesSym0 a0123456789876543210
+    type instance Apply ReplaceAllGTypesSym0 a0123456789876543210 = ReplaceAllGTypesSym1 a0123456789876543210
+    instance SuppressUnusedWarnings ReplaceAllGTypesSym0 where
+      suppressUnusedWarnings
+        = snd (((,) ReplaceAllGTypesSym0KindInference) ())
+    type ReplaceAllGTypesSym1 :: (~>) a ((~>) Type a)
+                                 -> (~>) [Type] ((~>) [a] [a])
+    data ReplaceAllGTypesSym1 a0123456789876543210 a0123456789876543210
+      where
+        ReplaceAllGTypesSym1KindInference :: SameKind (Apply (ReplaceAllGTypesSym1 a0123456789876543210) arg) (ReplaceAllGTypesSym2 a0123456789876543210 arg) =>
+                                             ReplaceAllGTypesSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ReplaceAllGTypesSym1 a0123456789876543210) a0123456789876543210 = ReplaceAllGTypesSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ReplaceAllGTypesSym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ReplaceAllGTypesSym1KindInference) ())
+    type ReplaceAllGTypesSym2 :: (~>) a ((~>) Type a)
+                                 -> [Type] -> (~>) [a] [a]
+    data ReplaceAllGTypesSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ReplaceAllGTypesSym2KindInference :: SameKind (Apply (ReplaceAllGTypesSym2 a0123456789876543210 a0123456789876543210) arg) (ReplaceAllGTypesSym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                             ReplaceAllGTypesSym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ReplaceAllGTypesSym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ReplaceAllGTypesSym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ReplaceAllGTypesSym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ReplaceAllGTypesSym2KindInference) ())
+    type ReplaceAllGTypesSym3 (a0123456789876543210 :: (~>) a ((~>) Type a)) (a0123456789876543210 :: [Type]) (a0123456789876543210 :: [a]) =
+        ReplaceAllGTypes a0123456789876543210 a0123456789876543210 a0123456789876543210 :: [a]
+    type ReplaceAllGTypes :: (~>) a ((~>) Type a)
+                             -> [Type] -> [a] -> [a]
+    type family ReplaceAllGTypes a a a where
+      ReplaceAllGTypes f types as = Apply (Apply (Apply ZipWithSym0 f) as) types
diff --git a/tests/compile-and-dump/Singletons/T322.ghc88.template b/tests/compile-and-dump/Singletons/T322.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T322.ghc88.template
+++ /dev/null
@@ -1,48 +0,0 @@
-Singletons/T322.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| infixr 2 !
-          
-          (!) :: Bool -> Bool -> Bool
-          (!) = (||) |]
-  ======>
-    (!) :: Bool -> Bool -> Bool
-    (!) = (||)
-    infixr 2 !
-    type (!@#@$$$) (a0123456789876543210 :: Bool) (a0123456789876543210 :: Bool) =
-        (!) a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ((!@#@$$) a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) (:!@#@$$###)) ())
-    data (!@#@$$) (a0123456789876543210 :: Bool) :: (~>) Bool Bool
-      where
-        (:!@#@$$###) :: forall a0123456789876543210
-                               a0123456789876543210
-                               arg. SameKind (Apply ((!@#@$$) a0123456789876543210) arg) ((!@#@$$$) a0123456789876543210 arg) =>
-                        (!@#@$$) a0123456789876543210 a0123456789876543210
-    type instance Apply ((!@#@$$) a0123456789876543210) a0123456789876543210 = (!) a0123456789876543210 a0123456789876543210
-    infixr 2 !@#@$$
-    instance SuppressUnusedWarnings (!@#@$) where
-      suppressUnusedWarnings = snd (((,) (:!@#@$###)) ())
-    data (!@#@$) :: (~>) Bool ((~>) Bool Bool)
-      where
-        (:!@#@$###) :: forall a0123456789876543210
-                              arg. SameKind (Apply (!@#@$) arg) ((!@#@$$) arg) =>
-                       (!@#@$) a0123456789876543210
-    type instance Apply (!@#@$) a0123456789876543210 = (!@#@$$) a0123456789876543210
-    infixr 2 !@#@$
-    type family (!) (a :: Bool) (a :: Bool) :: Bool where
-      (!) a_0123456789876543210 a_0123456789876543210 = Apply (Apply (||@#@$) a_0123456789876543210) a_0123456789876543210
-    infixr 2 %!
-    (%!) ::
-      forall (t :: Bool) (t :: Bool).
-      Sing t -> Sing t -> Sing (Apply (Apply (!@#@$) t) t :: Bool)
-    (%!)
-      (sA_0123456789876543210 :: Sing a_0123456789876543210)
-      (sA_0123456789876543210 :: Sing a_0123456789876543210)
-      = (applySing
-           ((applySing ((singFun2 @(||@#@$)) (%||))) sA_0123456789876543210))
-          sA_0123456789876543210
-    instance SingI ((!@#@$) :: (~>) Bool ((~>) Bool Bool)) where
-      sing = (singFun2 @(!@#@$)) (%!)
-    instance SingI d =>
-             SingI ((!@#@$$) (d :: Bool) :: (~>) Bool Bool) where
-      sing = (singFun1 @((!@#@$$) (d :: Bool))) ((%!) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T322.golden b/tests/compile-and-dump/Singletons/T322.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T322.golden
@@ -0,0 +1,49 @@
+Singletons/T322.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| infixr 2 !
+          
+          (!) :: Bool -> Bool -> Bool
+          (!) = (||) |]
+  ======>
+    (!) :: Bool -> Bool -> Bool
+    (!) = (||)
+    infixr 2 !
+    type (!@#@$) :: (~>) Bool ((~>) Bool Bool)
+    data (!@#@$) a0123456789876543210
+      where
+        (:!@#@$###) :: SameKind (Apply (!@#@$) arg) ((!@#@$$) arg) =>
+                       (!@#@$) a0123456789876543210
+    type instance Apply (!@#@$) a0123456789876543210 = (!@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (!@#@$) where
+      suppressUnusedWarnings = snd (((,) (:!@#@$###)) ())
+    infixr 2 !@#@$
+    type (!@#@$$) :: Bool -> (~>) Bool Bool
+    data (!@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (:!@#@$$###) :: SameKind (Apply ((!@#@$$) a0123456789876543210) arg) ((!@#@$$$) a0123456789876543210 arg) =>
+                        (!@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((!@#@$$) a0123456789876543210) a0123456789876543210 = (!@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((!@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (:!@#@$$###)) ())
+    infixr 2 !@#@$$
+    type (!@#@$$$) (a0123456789876543210 :: Bool) (a0123456789876543210 :: Bool) =
+        (!) a0123456789876543210 a0123456789876543210 :: Bool
+    infixr 2 !@#@$$$
+    type (!) :: Bool -> Bool -> Bool
+    type family (!) a a where
+      (!) a_0123456789876543210 a_0123456789876543210 = Apply (Apply (||@#@$) a_0123456789876543210) a_0123456789876543210
+    infixr 2 %!
+    (%!) ::
+      forall (t :: Bool) (t :: Bool).
+      Sing t -> Sing t -> Sing (Apply (Apply (!@#@$) t) t :: Bool)
+    (%!)
+      (sA_0123456789876543210 :: Sing a_0123456789876543210)
+      (sA_0123456789876543210 :: Sing a_0123456789876543210)
+      = (applySing
+           ((applySing ((singFun2 @(||@#@$)) (%||))) sA_0123456789876543210))
+          sA_0123456789876543210
+    instance SingI ((!@#@$) :: (~>) Bool ((~>) Bool Bool)) where
+      sing = (singFun2 @(!@#@$)) (%!)
+    instance SingI d =>
+             SingI ((!@#@$$) (d :: Bool) :: (~>) Bool Bool) where
+      sing = (singFun1 @((!@#@$$) (d :: Bool))) ((%!) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T323.ghc88.template b/tests/compile-and-dump/Singletons/T323.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T323.ghc88.template
+++ /dev/null
diff --git a/tests/compile-and-dump/Singletons/T323.golden b/tests/compile-and-dump/Singletons/T323.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T323.golden
diff --git a/tests/compile-and-dump/Singletons/T326.golden b/tests/compile-and-dump/Singletons/T326.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T326.golden
@@ -0,0 +1,67 @@
+Singletons/T326.hs:0:0:: Splicing declarations
+    genPromotions [''C1]
+  ======>
+    type (<%>@#@$) :: forall a. (~>) a ((~>) a a)
+    data (<%>@#@$) a0123456789876543210
+      where
+        (:<%>@#@$###) :: SameKind (Apply (<%>@#@$) arg) ((<%>@#@$$) arg) =>
+                         (<%>@#@$) a0123456789876543210
+    type instance Apply (<%>@#@$) a0123456789876543210 = (<%>@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (<%>@#@$) where
+      suppressUnusedWarnings = snd (((,) (:<%>@#@$###)) ())
+    infixl 9 <%>@#@$
+    type (<%>@#@$$) :: forall a. a -> (~>) a a
+    data (<%>@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (:<%>@#@$$###) :: SameKind (Apply ((<%>@#@$$) a0123456789876543210) arg) ((<%>@#@$$$) a0123456789876543210 arg) =>
+                          (<%>@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((<%>@#@$$) a0123456789876543210) a0123456789876543210 = (<%>@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((<%>@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (:<%>@#@$$###)) ())
+    infixl 9 <%>@#@$$
+    type (<%>@#@$$$) (a0123456789876543210 :: a) (a0123456789876543210 :: a) =
+        (<%>) a0123456789876543210 a0123456789876543210 :: a
+    infixl 9 <%>@#@$$$
+    type PC1 :: GHC.Types.Type -> Constraint
+    class PC1 (a :: GHC.Types.Type) where
+      type (<%>) (arg :: a) (arg :: a) :: a
+    infixl 9 <%>
+Singletons/T326.hs:0:0:: Splicing declarations
+    genSingletons [''C2]
+  ======>
+    type (<%%>@#@$) :: forall a. (~>) a ((~>) a a)
+    data (<%%>@#@$) a0123456789876543210
+      where
+        (:<%%>@#@$###) :: SameKind (Apply (<%%>@#@$) arg) ((<%%>@#@$$) arg) =>
+                          (<%%>@#@$) a0123456789876543210
+    type instance Apply (<%%>@#@$) a0123456789876543210 = (<%%>@#@$$) a0123456789876543210
+    instance SuppressUnusedWarnings (<%%>@#@$) where
+      suppressUnusedWarnings = snd (((,) (:<%%>@#@$###)) ())
+    infixl 9 <%%>@#@$
+    type (<%%>@#@$$) :: forall a. a -> (~>) a a
+    data (<%%>@#@$$) a0123456789876543210 a0123456789876543210
+      where
+        (:<%%>@#@$$###) :: SameKind (Apply ((<%%>@#@$$) a0123456789876543210) arg) ((<%%>@#@$$$) a0123456789876543210 arg) =>
+                           (<%%>@#@$$) a0123456789876543210 a0123456789876543210
+    type instance Apply ((<%%>@#@$$) a0123456789876543210) a0123456789876543210 = (<%%>@#@$$$) a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings ((<%%>@#@$$) a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) (:<%%>@#@$$###)) ())
+    infixl 9 <%%>@#@$$
+    type (<%%>@#@$$$) (a0123456789876543210 :: a) (a0123456789876543210 :: a) =
+        (<%%>) a0123456789876543210 a0123456789876543210 :: a
+    infixl 9 <%%>@#@$$$
+    type PC2 :: GHC.Types.Type -> Constraint
+    class PC2 (a :: GHC.Types.Type) where
+      type (<%%>) (arg :: a) (arg :: a) :: a
+    infixl 9 <%%>
+    class SC2 (a :: GHC.Types.Type) where
+      (%<%%>) ::
+        forall (t :: a) (t :: a).
+        Sing t -> Sing t -> Sing (Apply (Apply (<%%>@#@$) t) t :: a)
+    type SC2 :: GHC.Types.Type -> Constraint
+    infixl 9 %<%%>
+    instance SC2 a => SingI ((<%%>@#@$) :: (~>) a ((~>) a a)) where
+      sing = (singFun2 @(<%%>@#@$)) (%<%%>)
+    instance (SC2 a, SingI d) =>
+             SingI ((<%%>@#@$$) (d :: a) :: (~>) a a) where
+      sing = (singFun1 @((<%%>@#@$$) (d :: a))) ((%<%%>) (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T326.hs b/tests/compile-and-dump/Singletons/T326.hs
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T326.hs
@@ -0,0 +1,23 @@
+module T326 where
+
+import Data.Singletons.TH
+import Data.Type.Equality
+
+class C1 a where
+  infixl 9 <%>
+  (<%>) :: a -> a -> a
+
+class C2 a where
+  infixl 9 <%%>
+  (<%%>) :: a -> a -> a
+
+$(genPromotions [''C1])
+$(genSingletons [''C2])
+
+test1 :: Proxy f -> Proxy g -> Proxy h
+      -> (f <%> g) <%> h :~: f <%> g <%> h
+test1 _ _ _ = Refl
+
+test2 :: Proxy f -> Proxy g -> Proxy h
+      -> (f <%%> g) <%%> h :~: f <%%> g <%%> h
+test2 _ _ _ = Refl
diff --git a/tests/compile-and-dump/Singletons/T33.ghc88.template b/tests/compile-and-dump/Singletons/T33.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T33.ghc88.template
+++ /dev/null
@@ -1,36 +0,0 @@
-Singletons/T33.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| foo :: (Bool, Bool) -> ()
-          foo ~(_, _) = () |]
-  ======>
-    foo :: (Bool, Bool) -> ()
-    foo ~(_, _) = ()
-    type FooSym1 (a0123456789876543210 :: (Bool, Bool)) =
-        Foo a0123456789876543210
-    instance SuppressUnusedWarnings FooSym0 where
-      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
-    data FooSym0 :: (~>) (Bool, Bool) ()
-      where
-        FooSym0KindInference :: forall a0123456789876543210
-                                       arg. SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
-                                FooSym0 a0123456789876543210
-    type instance Apply FooSym0 a0123456789876543210 = Foo a0123456789876543210
-    type family Foo (a :: (Bool, Bool)) :: () where
-      Foo '(_, _) = Tuple0Sym0
-    sFoo ::
-      forall (t :: (Bool, Bool)). Sing t -> Sing (Apply FooSym0 t :: ())
-    sFoo (STuple2 _ _) = STuple0
-    instance SingI (FooSym0 :: (~>) (Bool, Bool) ()) where
-      sing = (singFun1 @FooSym0) sFoo
-
-Singletons/T33.hs:0:0: warning:
-    Lazy pattern converted into regular pattern in promotion
-  |
-6 | $(singletons [d|
-  |   ^^^^^^^^^^^^^^...
-
-Singletons/T33.hs:0:0: warning:
-    Lazy pattern converted into regular pattern during singleton generation.
-  |
-6 | $(singletons [d|
-  |   ^^^^^^^^^^^^^^...
diff --git a/tests/compile-and-dump/Singletons/T33.golden b/tests/compile-and-dump/Singletons/T33.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T33.golden
@@ -0,0 +1,37 @@
+Singletons/T33.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| foo :: (Bool, Bool) -> ()
+          foo ~(_, _) = () |]
+  ======>
+    foo :: (Bool, Bool) -> ()
+    foo ~(_, _) = ()
+    type FooSym0 :: (~>) (Bool, Bool) ()
+    data FooSym0 a0123456789876543210
+      where
+        FooSym0KindInference :: SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
+                                FooSym0 a0123456789876543210
+    type instance Apply FooSym0 a0123456789876543210 = FooSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FooSym0 where
+      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
+    type FooSym1 (a0123456789876543210 :: (Bool, Bool)) =
+        Foo a0123456789876543210 :: ()
+    type Foo :: (Bool, Bool) -> ()
+    type family Foo a where
+      Foo '(_, _) = Tuple0Sym0
+    sFoo ::
+      forall (t :: (Bool, Bool)). Sing t -> Sing (Apply FooSym0 t :: ())
+    sFoo (STuple2 _ _) = STuple0
+    instance SingI (FooSym0 :: (~>) (Bool, Bool) ()) where
+      sing = (singFun1 @FooSym0) sFoo
+
+Singletons/T33.hs:0:0: warning:
+    Lazy pattern converted into regular pattern in promotion
+  |
+6 | $(singletons [d|
+  |   ^^^^^^^^^^^^^^...
+
+Singletons/T33.hs:0:0: warning:
+    Lazy pattern converted into regular pattern during singleton generation.
+  |
+6 | $(singletons [d|
+  |   ^^^^^^^^^^^^^^...
diff --git a/tests/compile-and-dump/Singletons/T332.ghc88.template b/tests/compile-and-dump/Singletons/T332.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T332.ghc88.template
+++ /dev/null
@@ -1,56 +0,0 @@
-Singletons/T332.hs:(0,0)-(0,0): Splicing declarations
-    promote
-      [d| f :: Foo -> ()
-          f MkFoo {} = ()
-          
-          data Foo = MkFoo |]
-  ======>
-    data Foo = MkFoo
-    f :: Foo -> ()
-    f MkFoo {} = ()
-    type FSym1 (a0123456789876543210 :: Foo) = F a0123456789876543210
-    instance SuppressUnusedWarnings FSym0 where
-      suppressUnusedWarnings = snd (((,) FSym0KindInference) ())
-    data FSym0 :: (~>) Foo ()
-      where
-        FSym0KindInference :: forall a0123456789876543210
-                                     arg. SameKind (Apply FSym0 arg) (FSym1 arg) =>
-                              FSym0 a0123456789876543210
-    type instance Apply FSym0 a0123456789876543210 = F a0123456789876543210
-    type family F (a :: Foo) :: () where
-      F MkFoo = Tuple0Sym0
-    type MkFooSym0 = MkFoo
-Singletons/T332.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| b :: Bar -> ()
-          b MkBar {} = ()
-          
-          data Bar = MkBar |]
-  ======>
-    data Bar = MkBar
-    b :: Bar -> ()
-    b MkBar {} = ()
-    type MkBarSym0 = MkBar
-    type BSym1 (a0123456789876543210 :: Bar) = B a0123456789876543210
-    instance SuppressUnusedWarnings BSym0 where
-      suppressUnusedWarnings = snd (((,) BSym0KindInference) ())
-    data BSym0 :: (~>) Bar ()
-      where
-        BSym0KindInference :: forall a0123456789876543210
-                                     arg. SameKind (Apply BSym0 arg) (BSym1 arg) =>
-                              BSym0 a0123456789876543210
-    type instance Apply BSym0 a0123456789876543210 = B a0123456789876543210
-    type family B (a :: Bar) :: () where
-      B MkBar = Tuple0Sym0
-    sB :: forall (t :: Bar). Sing t -> Sing (Apply BSym0 t :: ())
-    sB SMkBar = STuple0
-    instance SingI (BSym0 :: (~>) Bar ()) where
-      sing = (singFun1 @BSym0) sB
-    data SBar :: Bar -> GHC.Types.Type where SMkBar :: SBar MkBar
-    type instance Sing @Bar = SBar
-    instance SingKind Bar where
-      type Demote Bar = Bar
-      fromSing SMkBar = MkBar
-      toSing MkBar = SomeSing SMkBar
-    instance SingI MkBar where
-      sing = SMkBar
diff --git a/tests/compile-and-dump/Singletons/T332.golden b/tests/compile-and-dump/Singletons/T332.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T332.golden
@@ -0,0 +1,61 @@
+Singletons/T332.hs:(0,0)-(0,0): Splicing declarations
+    promote
+      [d| f :: Foo -> ()
+          f MkFoo {} = ()
+          
+          data Foo = MkFoo |]
+  ======>
+    data Foo = MkFoo
+    f :: Foo -> ()
+    f MkFoo {} = ()
+    type MkFooSym0 = MkFoo :: Foo
+    type FSym0 :: (~>) Foo ()
+    data FSym0 a0123456789876543210
+      where
+        FSym0KindInference :: SameKind (Apply FSym0 arg) (FSym1 arg) =>
+                              FSym0 a0123456789876543210
+    type instance Apply FSym0 a0123456789876543210 = FSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FSym0 where
+      suppressUnusedWarnings = snd (((,) FSym0KindInference) ())
+    type FSym1 (a0123456789876543210 :: Foo) =
+        F a0123456789876543210 :: ()
+    type F :: Foo -> ()
+    type family F a where
+      F MkFoo = Tuple0Sym0
+Singletons/T332.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| b :: Bar -> ()
+          b MkBar {} = ()
+          
+          data Bar = MkBar |]
+  ======>
+    data Bar = MkBar
+    b :: Bar -> ()
+    b MkBar {} = ()
+    type MkBarSym0 = MkBar :: Bar
+    type BSym0 :: (~>) Bar ()
+    data BSym0 a0123456789876543210
+      where
+        BSym0KindInference :: SameKind (Apply BSym0 arg) (BSym1 arg) =>
+                              BSym0 a0123456789876543210
+    type instance Apply BSym0 a0123456789876543210 = BSym1 a0123456789876543210
+    instance SuppressUnusedWarnings BSym0 where
+      suppressUnusedWarnings = snd (((,) BSym0KindInference) ())
+    type BSym1 (a0123456789876543210 :: Bar) =
+        B a0123456789876543210 :: ()
+    type B :: Bar -> ()
+    type family B a where
+      B MkBar = Tuple0Sym0
+    sB :: forall (t :: Bar). Sing t -> Sing (Apply BSym0 t :: ())
+    sB SMkBar = STuple0
+    instance SingI (BSym0 :: (~>) Bar ()) where
+      sing = (singFun1 @BSym0) sB
+    data SBar :: Bar -> GHC.Types.Type
+      where SMkBar :: SBar (MkBar :: Bar)
+    type instance Sing @Bar = SBar
+    instance SingKind Bar where
+      type Demote Bar = Bar
+      fromSing SMkBar = MkBar
+      toSing MkBar = SomeSing SMkBar
+    instance SingI MkBar where
+      sing = SMkBar
diff --git a/tests/compile-and-dump/Singletons/T342.ghc88.template b/tests/compile-and-dump/Singletons/T342.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T342.ghc88.template
+++ /dev/null
@@ -1,17 +0,0 @@
-Singletons/T342.hs:(0,0)-(0,0): Splicing declarations
-    do synName <- newName "MyId"
-       a <- newName "a"
-       let syn = TySynD synName [PlainTV a] (VarT a)
-       defuns <- withLocalDeclarations [syn] $ genDefunSymbols [synName]
-       pure $ syn : defuns
-  ======>
-    type MyId a = a
-    type MyIdSym1 a0123456789876543210 = MyId a0123456789876543210
-    instance SuppressUnusedWarnings MyIdSym0 where
-      suppressUnusedWarnings = snd (((,) MyIdSym0KindInference) ())
-    data MyIdSym0 a0123456789876543210
-      where
-        MyIdSym0KindInference :: forall a0123456789876543210
-                                        arg. SameKind (Apply MyIdSym0 arg) (MyIdSym1 arg) =>
-                                 MyIdSym0 a0123456789876543210
-    type instance Apply MyIdSym0 a0123456789876543210 = MyId a0123456789876543210
diff --git a/tests/compile-and-dump/Singletons/T342.golden b/tests/compile-and-dump/Singletons/T342.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T342.golden
@@ -0,0 +1,16 @@
+Singletons/T342.hs:(0,0)-(0,0): Splicing declarations
+    do synName <- newName "MyId"
+       a <- newName "a"
+       let syn = TySynD synName [PlainTV a] (VarT a)
+       defuns <- withLocalDeclarations [syn] $ genDefunSymbols [synName]
+       pure $ syn : defuns
+  ======>
+    type MyId a = a
+    data MyIdSym0 a0123456789876543210
+      where
+        MyIdSym0KindInference :: SameKind (Apply MyIdSym0 arg) (MyIdSym1 arg) =>
+                                 MyIdSym0 a0123456789876543210
+    type instance Apply MyIdSym0 a0123456789876543210 = MyIdSym1 a0123456789876543210
+    instance SuppressUnusedWarnings MyIdSym0 where
+      suppressUnusedWarnings = snd (((,) MyIdSym0KindInference) ())
+    type MyIdSym1 a0123456789876543210 = MyId a0123456789876543210
diff --git a/tests/compile-and-dump/Singletons/T353.ghc88.template b/tests/compile-and-dump/Singletons/T353.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T353.ghc88.template
+++ /dev/null
@@ -1,104 +0,0 @@
-Singletons/T353.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| type family Symmetry (a :: Proxy t) (y :: Proxy t) (e :: (a :: Proxy (t :: k))
-                                                                   :~:
-                                                                   (y :: Proxy (t :: k))) :: Type where
-            Symmetry a y _ = y :~: a |]
-  ======>
-    type family Symmetry (a :: Proxy t) (y :: Proxy t) (e :: (:~:) (a :: Proxy (t :: k)) (y :: Proxy (t :: k))) :: Type where
-      Symmetry a y _ = (:~:) y a
-    type SymmetrySym3 (a0123456789876543210 :: Proxy t0123456789876543210) (y0123456789876543210 :: Proxy t0123456789876543210) (e0123456789876543210 :: (:~:) (a0123456789876543210 :: Proxy (t0123456789876543210 :: k0123456789876543210)) (y0123456789876543210 :: Proxy (t0123456789876543210 :: k0123456789876543210))) =
-        Symmetry a0123456789876543210 y0123456789876543210 e0123456789876543210
-    instance SuppressUnusedWarnings (SymmetrySym2 y0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) SymmetrySym2KindInference) ())
-    data SymmetrySym2 (a0123456789876543210 :: Proxy (t0123456789876543210 :: k0123456789876543210)) (y0123456789876543210 :: Proxy (t0123456789876543210 :: k0123456789876543210)) :: (~>) ((:~:) (a0123456789876543210 :: Proxy (t0123456789876543210 :: k0123456789876543210)) (y0123456789876543210 :: Proxy (t0123456789876543210 :: k0123456789876543210))) Type
-      where
-        SymmetrySym2KindInference :: forall a0123456789876543210
-                                            y0123456789876543210
-                                            e0123456789876543210
-                                            arg. SameKind (Apply (SymmetrySym2 a0123456789876543210 y0123456789876543210) arg) (SymmetrySym3 a0123456789876543210 y0123456789876543210 arg) =>
-                                     SymmetrySym2 a0123456789876543210 y0123456789876543210 e0123456789876543210
-    type instance Apply (SymmetrySym2 y0123456789876543210 a0123456789876543210) e0123456789876543210 = Symmetry y0123456789876543210 a0123456789876543210 e0123456789876543210
-    instance SuppressUnusedWarnings (SymmetrySym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) SymmetrySym1KindInference) ())
-    data SymmetrySym1 (a0123456789876543210 :: Proxy (t0123456789876543210 :: k0123456789876543210)) :: forall (y0123456789876543210 :: Proxy t0123456789876543210).
-                                                                                                        (~>) (Proxy t0123456789876543210) ((~>) ((:~:) (a0123456789876543210 :: Proxy (t0123456789876543210 :: k0123456789876543210)) (y0123456789876543210 :: Proxy (t0123456789876543210 :: k0123456789876543210))) Type)
-      where
-        SymmetrySym1KindInference :: forall a0123456789876543210
-                                            y0123456789876543210
-                                            arg. SameKind (Apply (SymmetrySym1 a0123456789876543210) arg) (SymmetrySym2 a0123456789876543210 arg) =>
-                                     SymmetrySym1 a0123456789876543210 y0123456789876543210
-    type instance Apply (SymmetrySym1 a0123456789876543210) y0123456789876543210 = SymmetrySym2 a0123456789876543210 y0123456789876543210
-    instance SuppressUnusedWarnings SymmetrySym0 where
-      suppressUnusedWarnings = snd (((,) SymmetrySym0KindInference) ())
-    data SymmetrySym0 :: forall k0123456789876543210
-                                (t0123456789876543210 :: k0123456789876543210)
-                                (a0123456789876543210 :: Proxy t0123456789876543210)
-                                (y0123456789876543210 :: Proxy t0123456789876543210).
-                         (~>) (Proxy t0123456789876543210) ((~>) (Proxy t0123456789876543210) ((~>) ((:~:) (a0123456789876543210 :: Proxy (t0123456789876543210 :: k0123456789876543210)) (y0123456789876543210 :: Proxy (t0123456789876543210 :: k0123456789876543210))) Type))
-      where
-        SymmetrySym0KindInference :: forall a0123456789876543210
-                                            arg. SameKind (Apply SymmetrySym0 arg) (SymmetrySym1 arg) =>
-                                     SymmetrySym0 a0123456789876543210
-    type instance Apply SymmetrySym0 a0123456789876543210 = SymmetrySym1 a0123456789876543210
-Singletons/T353.hs:0:0:: Splicing declarations
-    genDefunSymbols [''Prod]
-  ======>
-    type MkProdSym2 (t0123456789876543210 :: f0123456789876543210 p0123456789876543210) (t0123456789876543210 :: g0123456789876543210 p0123456789876543210) =
-        'MkProd t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (MkProdSym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) MkProdSym1KindInference) ())
-    data MkProdSym1 (t0123456789876543210 :: (f0123456789876543210 :: k0123456789876543210
-                                                                      -> Type) (p0123456789876543210 :: k0123456789876543210)) :: forall (g0123456789876543210 :: k0123456789876543210
-                                                                                                                                                                  -> Type).
-                                                                                                                                  (~>) (g0123456789876543210 p0123456789876543210) (Prod (f0123456789876543210 :: k0123456789876543210
-                                                                                                                                                                                                                  -> Type) (g0123456789876543210 :: k0123456789876543210
-                                                                                                                                                                                                                                                    -> Type) (p0123456789876543210 :: k0123456789876543210))
-      where
-        MkProdSym1KindInference :: forall t0123456789876543210
-                                          t0123456789876543210
-                                          arg. SameKind (Apply (MkProdSym1 t0123456789876543210) arg) (MkProdSym2 t0123456789876543210 arg) =>
-                                   MkProdSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (MkProdSym1 t0123456789876543210) t0123456789876543210 = 'MkProd t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings MkProdSym0 where
-      suppressUnusedWarnings = snd (((,) MkProdSym0KindInference) ())
-    data MkProdSym0 :: forall k0123456789876543210
-                              (f0123456789876543210 :: k0123456789876543210 -> Type)
-                              (p0123456789876543210 :: k0123456789876543210)
-                              (g0123456789876543210 :: k0123456789876543210 -> Type).
-                       (~>) (f0123456789876543210 p0123456789876543210) ((~>) (g0123456789876543210 p0123456789876543210) (Prod (f0123456789876543210 :: k0123456789876543210
-                                                                                                                                                         -> Type) (g0123456789876543210 :: k0123456789876543210
-                                                                                                                                                                                           -> Type) (p0123456789876543210 :: k0123456789876543210)))
-      where
-        MkProdSym0KindInference :: forall t0123456789876543210
-                                          arg. SameKind (Apply MkProdSym0 arg) (MkProdSym1 arg) =>
-                                   MkProdSym0 t0123456789876543210
-    type instance Apply MkProdSym0 t0123456789876543210 = MkProdSym1 t0123456789876543210
-Singletons/T353.hs:0:0:: Splicing declarations
-    genDefunSymbols [''Foo]
-  ======>
-    type MkFooSym2 (t0123456789876543210 :: Proxy a0123456789876543210) (t0123456789876543210 :: Proxy b0123456789876543210) =
-        'MkFoo t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (MkFooSym1 t0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) MkFooSym1KindInference) ())
-    data MkFooSym1 (t0123456789876543210 :: Proxy (a0123456789876543210 :: k0123456789876543210)) :: forall k0123456789876543210
-                                                                                                            (b0123456789876543210 :: k0123456789876543210).
-                                                                                                     (~>) (Proxy b0123456789876543210) (Foo (a0123456789876543210 :: k0123456789876543210) (b0123456789876543210 :: k0123456789876543210))
-      where
-        MkFooSym1KindInference :: forall t0123456789876543210
-                                         t0123456789876543210
-                                         arg. SameKind (Apply (MkFooSym1 t0123456789876543210) arg) (MkFooSym2 t0123456789876543210 arg) =>
-                                  MkFooSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (MkFooSym1 t0123456789876543210) t0123456789876543210 = 'MkFoo t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings MkFooSym0 where
-      suppressUnusedWarnings = snd (((,) MkFooSym0KindInference) ())
-    data MkFooSym0 :: forall k0123456789876543210
-                             (a0123456789876543210 :: k0123456789876543210)
-                             k0123456789876543210
-                             (b0123456789876543210 :: k0123456789876543210).
-                      (~>) (Proxy a0123456789876543210) ((~>) (Proxy b0123456789876543210) (Foo (a0123456789876543210 :: k0123456789876543210) (b0123456789876543210 :: k0123456789876543210)))
-      where
-        MkFooSym0KindInference :: forall t0123456789876543210
-                                         arg. SameKind (Apply MkFooSym0 arg) (MkFooSym1 arg) =>
-                                  MkFooSym0 t0123456789876543210
-    type instance Apply MkFooSym0 t0123456789876543210 = MkFooSym1 t0123456789876543210
diff --git a/tests/compile-and-dump/Singletons/T353.golden b/tests/compile-and-dump/Singletons/T353.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T353.golden
@@ -0,0 +1,87 @@
+Singletons/T353.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| type family Symmetry (a :: Proxy t) (y :: Proxy t) (e :: (a :: Proxy (t :: k))
+                                                                   :~:
+                                                                   (y :: Proxy (t :: k))) :: Type where
+            Symmetry a y _ = y :~: a |]
+  ======>
+    type family Symmetry (a :: Proxy t) (y :: Proxy t) (e :: (:~:) (a :: Proxy (t :: k)) (y :: Proxy (t :: k))) :: Type where
+      Symmetry a y _ = (:~:) y a
+    data SymmetrySym0 :: (~>) (Proxy t0123456789876543210) ((~>) (Proxy t0123456789876543210) ((~>) ((:~:) (a0123456789876543210 :: Proxy (t0123456789876543210 :: k0123456789876543210)) (y0123456789876543210 :: Proxy (t0123456789876543210 :: k0123456789876543210))) Type))
+      where
+        SymmetrySym0KindInference :: SameKind (Apply SymmetrySym0 arg) (SymmetrySym1 arg) =>
+                                     SymmetrySym0 a0123456789876543210
+    type instance Apply SymmetrySym0 a0123456789876543210 = SymmetrySym1 a0123456789876543210
+    instance SuppressUnusedWarnings SymmetrySym0 where
+      suppressUnusedWarnings = snd (((,) SymmetrySym0KindInference) ())
+    data SymmetrySym1 (a0123456789876543210 :: Proxy t0123456789876543210) :: (~>) (Proxy t0123456789876543210) ((~>) ((:~:) (a0123456789876543210 :: Proxy (t0123456789876543210 :: k0123456789876543210)) (y0123456789876543210 :: Proxy (t0123456789876543210 :: k0123456789876543210))) Type)
+      where
+        SymmetrySym1KindInference :: SameKind (Apply (SymmetrySym1 a0123456789876543210) arg) (SymmetrySym2 a0123456789876543210 arg) =>
+                                     SymmetrySym1 a0123456789876543210 y0123456789876543210
+    type instance Apply (SymmetrySym1 a0123456789876543210) y0123456789876543210 = SymmetrySym2 a0123456789876543210 y0123456789876543210
+    instance SuppressUnusedWarnings (SymmetrySym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) SymmetrySym1KindInference) ())
+    data SymmetrySym2 (a0123456789876543210 :: Proxy t0123456789876543210) (y0123456789876543210 :: Proxy t0123456789876543210) :: (~>) ((:~:) (a0123456789876543210 :: Proxy (t0123456789876543210 :: k0123456789876543210)) (y0123456789876543210 :: Proxy (t0123456789876543210 :: k0123456789876543210))) Type
+      where
+        SymmetrySym2KindInference :: SameKind (Apply (SymmetrySym2 a0123456789876543210 y0123456789876543210) arg) (SymmetrySym3 a0123456789876543210 y0123456789876543210 arg) =>
+                                     SymmetrySym2 a0123456789876543210 y0123456789876543210 e0123456789876543210
+    type instance Apply (SymmetrySym2 a0123456789876543210 y0123456789876543210) e0123456789876543210 = SymmetrySym3 a0123456789876543210 y0123456789876543210 e0123456789876543210
+    instance SuppressUnusedWarnings (SymmetrySym2 a0123456789876543210 y0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) SymmetrySym2KindInference) ())
+    type SymmetrySym3 (a0123456789876543210 :: Proxy t0123456789876543210) (y0123456789876543210 :: Proxy t0123456789876543210) (e0123456789876543210 :: (:~:) (a0123456789876543210 :: Proxy (t0123456789876543210 :: k0123456789876543210)) (y0123456789876543210 :: Proxy (t0123456789876543210 :: k0123456789876543210))) =
+        Symmetry a0123456789876543210 y0123456789876543210 e0123456789876543210 :: Type
+Singletons/T353.hs:0:0:: Splicing declarations
+    genDefunSymbols [''Prod]
+  ======>
+    type MkProdSym0 :: forall k
+                              (f :: k -> Type)
+                              (g :: k -> Type)
+                              (p :: k).
+                       (~>) (f p) ((~>) (g p) (Prod (f :: k -> Type) (g :: k
+                                                                           -> Type) (p :: k)))
+    data MkProdSym0 a0123456789876543210
+      where
+        MkProdSym0KindInference :: SameKind (Apply MkProdSym0 arg) (MkProdSym1 arg) =>
+                                   MkProdSym0 a0123456789876543210
+    type instance Apply MkProdSym0 a0123456789876543210 = MkProdSym1 a0123456789876543210
+    instance SuppressUnusedWarnings MkProdSym0 where
+      suppressUnusedWarnings = snd (((,) MkProdSym0KindInference) ())
+    type MkProdSym1 :: forall k
+                              (f :: k -> Type)
+                              (g :: k -> Type)
+                              (p :: k).
+                       f p -> (~>) (g p) (Prod (f :: k -> Type) (g :: k -> Type) (p :: k))
+    data MkProdSym1 a0123456789876543210 a0123456789876543210
+      where
+        MkProdSym1KindInference :: SameKind (Apply (MkProdSym1 a0123456789876543210) arg) (MkProdSym2 a0123456789876543210 arg) =>
+                                   MkProdSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (MkProdSym1 a0123456789876543210) a0123456789876543210 = MkProdSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (MkProdSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) MkProdSym1KindInference) ())
+    type MkProdSym2 (a0123456789876543210 :: f p) (a0123456789876543210 :: g p) =
+        'MkProd a0123456789876543210 a0123456789876543210 :: Prod (f :: k
+                                                                        -> Type) (g :: k
+                                                                                       -> Type) (p :: k)
+Singletons/T353.hs:0:0:: Splicing declarations
+    genDefunSymbols [''Foo]
+  ======>
+    type MkFooSym0 :: forall k k (a :: k) (b :: k).
+                      (~>) (Proxy a) ((~>) (Proxy b) (Foo (a :: k) (b :: k)))
+    data MkFooSym0 a0123456789876543210
+      where
+        MkFooSym0KindInference :: SameKind (Apply MkFooSym0 arg) (MkFooSym1 arg) =>
+                                  MkFooSym0 a0123456789876543210
+    type instance Apply MkFooSym0 a0123456789876543210 = MkFooSym1 a0123456789876543210
+    instance SuppressUnusedWarnings MkFooSym0 where
+      suppressUnusedWarnings = snd (((,) MkFooSym0KindInference) ())
+    type MkFooSym1 :: forall k k (a :: k) (b :: k).
+                      Proxy a -> (~>) (Proxy b) (Foo (a :: k) (b :: k))
+    data MkFooSym1 a0123456789876543210 a0123456789876543210
+      where
+        MkFooSym1KindInference :: SameKind (Apply (MkFooSym1 a0123456789876543210) arg) (MkFooSym2 a0123456789876543210 arg) =>
+                                  MkFooSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (MkFooSym1 a0123456789876543210) a0123456789876543210 = MkFooSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (MkFooSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) MkFooSym1KindInference) ())
+    type MkFooSym2 (a0123456789876543210 :: Proxy a) (a0123456789876543210 :: Proxy b) =
+        'MkFoo a0123456789876543210 a0123456789876543210 :: Foo (a :: k) (b :: k)
diff --git a/tests/compile-and-dump/Singletons/T358.ghc88.template b/tests/compile-and-dump/Singletons/T358.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T358.ghc88.template
+++ /dev/null
@@ -1,116 +0,0 @@
-Singletons/T358.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| class C1 (f :: k -> Type) where
-            method1 :: f a
-          class C2 a where
-            method2a, method2b :: forall b. b -> a
-          
-          instance C1 [] where
-            method1 :: [a]
-            method1 = []
-          instance C2 [a] where
-            method2a _ = []
-            method2b :: forall b. b -> [a]
-            method2b _ = [] |]
-  ======>
-    class C1 (f :: k -> Type) where
-      method1 :: f a
-    instance C1 [] where
-      method1 :: [a]
-      method1 = []
-    class C2 a where
-      method2a :: forall b. b -> a
-      method2b :: forall b. b -> a
-    instance C2 [a] where
-      method2b :: forall b. b -> [a]
-      method2a _ = []
-      method2b _ = []
-    type Method1Sym0 = Method1
-    class PC1 (f :: k -> Type) where
-      type Method1 :: f a
-    type Method2aSym1 (arg0123456789876543210 :: b0123456789876543210) =
-        Method2a arg0123456789876543210
-    instance SuppressUnusedWarnings Method2aSym0 where
-      suppressUnusedWarnings = snd (((,) Method2aSym0KindInference) ())
-    data Method2aSym0 :: forall b0123456789876543210
-                                a0123456789876543210.
-                         (~>) b0123456789876543210 a0123456789876543210
-      where
-        Method2aSym0KindInference :: forall arg0123456789876543210
-                                            arg. SameKind (Apply Method2aSym0 arg) (Method2aSym1 arg) =>
-                                     Method2aSym0 arg0123456789876543210
-    type instance Apply Method2aSym0 arg0123456789876543210 = Method2a arg0123456789876543210
-    type Method2bSym1 (arg0123456789876543210 :: b0123456789876543210) =
-        Method2b arg0123456789876543210
-    instance SuppressUnusedWarnings Method2bSym0 where
-      suppressUnusedWarnings = snd (((,) Method2bSym0KindInference) ())
-    data Method2bSym0 :: forall b0123456789876543210
-                                a0123456789876543210.
-                         (~>) b0123456789876543210 a0123456789876543210
-      where
-        Method2bSym0KindInference :: forall arg0123456789876543210
-                                            arg. SameKind (Apply Method2bSym0 arg) (Method2bSym1 arg) =>
-                                     Method2bSym0 arg0123456789876543210
-    type instance Apply Method2bSym0 arg0123456789876543210 = Method2b arg0123456789876543210
-    class PC2 (a :: Type) where
-      type Method2a (arg :: b) :: a
-      type Method2b (arg :: b) :: a
-    type family Method1_0123456789876543210 :: [a] where
-      Method1_0123456789876543210 = '[]
-    type Method1_0123456789876543210Sym0 = Method1_0123456789876543210
-    instance PC1 [] where
-      type Method1 = Method1_0123456789876543210Sym0
-    type family Method2a_0123456789876543210 (a :: b) :: [a] where
-      Method2a_0123456789876543210 _ = '[]
-    type Method2a_0123456789876543210Sym1 (a0123456789876543210 :: b0123456789876543210) =
-        Method2a_0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Method2a_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Method2a_0123456789876543210Sym0KindInference) ())
-    data Method2a_0123456789876543210Sym0 :: forall b0123456789876543210
-                                                    a0123456789876543210.
-                                             (~>) b0123456789876543210 [a0123456789876543210]
-      where
-        Method2a_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                arg. SameKind (Apply Method2a_0123456789876543210Sym0 arg) (Method2a_0123456789876543210Sym1 arg) =>
-                                                         Method2a_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Method2a_0123456789876543210Sym0 a0123456789876543210 = Method2a_0123456789876543210 a0123456789876543210
-    type family Method2b_0123456789876543210 (a :: b) :: [a] where
-      Method2b_0123456789876543210 _ = '[]
-    type Method2b_0123456789876543210Sym1 (a0123456789876543210 :: b0123456789876543210) =
-        Method2b_0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings Method2b_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) Method2b_0123456789876543210Sym0KindInference) ())
-    data Method2b_0123456789876543210Sym0 :: forall b0123456789876543210
-                                                    a0123456789876543210.
-                                             (~>) b0123456789876543210 [a0123456789876543210]
-      where
-        Method2b_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                arg. SameKind (Apply Method2b_0123456789876543210Sym0 arg) (Method2b_0123456789876543210Sym1 arg) =>
-                                                         Method2b_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply Method2b_0123456789876543210Sym0 a0123456789876543210 = Method2b_0123456789876543210 a0123456789876543210
-    instance PC2 [a] where
-      type Method2a a = Apply Method2a_0123456789876543210Sym0 a
-      type Method2b a = Apply Method2b_0123456789876543210Sym0 a
-    class SC1 (f :: k -> Type) where
-      sMethod1 :: forall a. Sing (Method1Sym0 :: f a)
-    class SC2 a where
-      sMethod2a ::
-        forall b (t :: b). Sing t -> Sing (Apply Method2aSym0 t :: a)
-      sMethod2b ::
-        forall b (t :: b). Sing t -> Sing (Apply Method2bSym0 t :: a)
-    instance SC1 [] where
-      sMethod1 :: forall a. Sing (Method1Sym0 :: [a])
-      sMethod1 = Data.Singletons.Prelude.Instances.SNil
-    instance SC2 [a] where
-      sMethod2a ::
-        forall b (t :: b). Sing t -> Sing (Apply Method2aSym0 t :: [a])
-      sMethod2b ::
-        forall b (t :: b). Sing t -> Sing (Apply Method2bSym0 t :: [a])
-      sMethod2a _ = Data.Singletons.Prelude.Instances.SNil
-      sMethod2b _ = Data.Singletons.Prelude.Instances.SNil
-    instance SC2 a => SingI (Method2aSym0 :: (~>) b a) where
-      sing = (singFun1 @Method2aSym0) sMethod2a
-    instance SC2 a => SingI (Method2bSym0 :: (~>) b a) where
-      sing = (singFun1 @Method2bSym0) sMethod2b
diff --git a/tests/compile-and-dump/Singletons/T358.golden b/tests/compile-and-dump/Singletons/T358.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T358.golden
@@ -0,0 +1,112 @@
+Singletons/T358.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| class C1 (f :: k -> Type) where
+            method1 :: f a
+          class C2 a where
+            method2a, method2b :: forall b. b -> a
+          
+          instance C1 [] where
+            method1 :: [a]
+            method1 = []
+          instance C2 [a] where
+            method2a _ = []
+            method2b :: forall b. b -> [a]
+            method2b _ = [] |]
+  ======>
+    class C1 (f :: k -> Type) where
+      method1 :: f a
+    instance C1 [] where
+      method1 :: [a]
+      method1 = []
+    class C2 a where
+      method2a :: forall b. b -> a
+      method2b :: forall b. b -> a
+    instance C2 [a] where
+      method2b :: forall b. b -> [a]
+      method2a _ = []
+      method2b _ = []
+    type Method1Sym0 = Method1 :: f a
+    class PC1 (f :: k -> Type) where
+      type Method1 :: f a
+    type Method2aSym0 :: forall b a. (~>) b a
+    data Method2aSym0 a0123456789876543210
+      where
+        Method2aSym0KindInference :: SameKind (Apply Method2aSym0 arg) (Method2aSym1 arg) =>
+                                     Method2aSym0 a0123456789876543210
+    type instance Apply Method2aSym0 a0123456789876543210 = Method2aSym1 a0123456789876543210
+    instance SuppressUnusedWarnings Method2aSym0 where
+      suppressUnusedWarnings = snd (((,) Method2aSym0KindInference) ())
+    type Method2aSym1 (a0123456789876543210 :: b) =
+        Method2a a0123456789876543210 :: a
+    type Method2bSym0 :: forall b a. (~>) b a
+    data Method2bSym0 a0123456789876543210
+      where
+        Method2bSym0KindInference :: SameKind (Apply Method2bSym0 arg) (Method2bSym1 arg) =>
+                                     Method2bSym0 a0123456789876543210
+    type instance Apply Method2bSym0 a0123456789876543210 = Method2bSym1 a0123456789876543210
+    instance SuppressUnusedWarnings Method2bSym0 where
+      suppressUnusedWarnings = snd (((,) Method2bSym0KindInference) ())
+    type Method2bSym1 (a0123456789876543210 :: b) =
+        Method2b a0123456789876543210 :: a
+    class PC2 a where
+      type Method2a (arg :: b) :: a
+      type Method2b (arg :: b) :: a
+    type Method1_0123456789876543210 :: [a]
+    type family Method1_0123456789876543210 where
+      Method1_0123456789876543210 = NilSym0
+    type Method1_0123456789876543210Sym0 =
+        Method1_0123456789876543210 :: [a]
+    instance PC1 [] where
+      type Method1 = Method1_0123456789876543210Sym0
+    type Method2a_0123456789876543210 :: b -> [a]
+    type family Method2a_0123456789876543210 a where
+      Method2a_0123456789876543210 _ = NilSym0
+    type Method2a_0123456789876543210Sym0 :: (~>) b [a]
+    data Method2a_0123456789876543210Sym0 a0123456789876543210
+      where
+        Method2a_0123456789876543210Sym0KindInference :: SameKind (Apply Method2a_0123456789876543210Sym0 arg) (Method2a_0123456789876543210Sym1 arg) =>
+                                                         Method2a_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Method2a_0123456789876543210Sym0 a0123456789876543210 = Method2a_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Method2a_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Method2a_0123456789876543210Sym0KindInference) ())
+    type Method2a_0123456789876543210Sym1 (a0123456789876543210 :: b) =
+        Method2a_0123456789876543210 a0123456789876543210 :: [a]
+    type Method2b_0123456789876543210 :: b -> [a]
+    type family Method2b_0123456789876543210 a where
+      Method2b_0123456789876543210 _ = NilSym0
+    type Method2b_0123456789876543210Sym0 :: (~>) b [a]
+    data Method2b_0123456789876543210Sym0 a0123456789876543210
+      where
+        Method2b_0123456789876543210Sym0KindInference :: SameKind (Apply Method2b_0123456789876543210Sym0 arg) (Method2b_0123456789876543210Sym1 arg) =>
+                                                         Method2b_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Method2b_0123456789876543210Sym0 a0123456789876543210 = Method2b_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Method2b_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) Method2b_0123456789876543210Sym0KindInference) ())
+    type Method2b_0123456789876543210Sym1 (a0123456789876543210 :: b) =
+        Method2b_0123456789876543210 a0123456789876543210 :: [a]
+    instance PC2 [a] where
+      type Method2a a = Apply Method2a_0123456789876543210Sym0 a
+      type Method2b a = Apply Method2b_0123456789876543210Sym0 a
+    class SC1 (f :: k -> Type) where
+      sMethod1 :: forall a. Sing (Method1Sym0 :: f a)
+    class SC2 a where
+      sMethod2a ::
+        forall b (t :: b). Sing t -> Sing (Apply Method2aSym0 t :: a)
+      sMethod2b ::
+        forall b (t :: b). Sing t -> Sing (Apply Method2bSym0 t :: a)
+    instance SC1 [] where
+      sMethod1 :: forall a. Sing (Method1Sym0 :: [a])
+      sMethod1 = Data.Singletons.Prelude.Instances.SNil
+    instance SC2 [a] where
+      sMethod2a ::
+        forall b (t :: b). Sing t -> Sing (Apply Method2aSym0 t :: [a])
+      sMethod2b ::
+        forall b (t :: b). Sing t -> Sing (Apply Method2bSym0 t :: [a])
+      sMethod2a _ = Data.Singletons.Prelude.Instances.SNil
+      sMethod2b _ = Data.Singletons.Prelude.Instances.SNil
+    instance SC2 a => SingI (Method2aSym0 :: (~>) b a) where
+      sing = (singFun1 @Method2aSym0) sMethod2a
+    instance SC2 a => SingI (Method2bSym0 :: (~>) b a) where
+      sing = (singFun1 @Method2bSym0) sMethod2b
diff --git a/tests/compile-and-dump/Singletons/T367.ghc88.template b/tests/compile-and-dump/Singletons/T367.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T367.ghc88.template
+++ /dev/null
@@ -1,39 +0,0 @@
-Singletons/T367.hs:(0,0)-(0,0): Splicing declarations
-    singletonsOnly
-      [d| const' :: a -> b -> a
-          const' x _ = x |]
-  ======>
-    type Const'Sym2 (a0123456789876543210 :: a0123456789876543210) (a0123456789876543210 :: b0123456789876543210) =
-        Const' a0123456789876543210 a0123456789876543210
-    instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings (Const'Sym1 a0123456789876543210) where
-      Data.Singletons.SuppressUnusedWarnings.suppressUnusedWarnings
-        = snd (((,) Const'Sym1KindInference) ())
-    data Const'Sym1 (a0123456789876543210 :: a0123456789876543210) :: forall b0123456789876543210.
-                                                                      (~>) b0123456789876543210 a0123456789876543210
-      where
-        Const'Sym1KindInference :: forall a0123456789876543210
-                                          a0123456789876543210
-                                          arg. SameKind (Apply (Const'Sym1 a0123456789876543210) arg) (Const'Sym2 a0123456789876543210 arg) =>
-                                   Const'Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (Const'Sym1 a0123456789876543210) a0123456789876543210 = Const' a0123456789876543210 a0123456789876543210
-    instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings Const'Sym0 where
-      Data.Singletons.SuppressUnusedWarnings.suppressUnusedWarnings
-        = snd (((,) Const'Sym0KindInference) ())
-    data Const'Sym0 :: forall a0123456789876543210
-                              b0123456789876543210.
-                       (~>) a0123456789876543210 ((~>) b0123456789876543210 a0123456789876543210)
-      where
-        Const'Sym0KindInference :: forall a0123456789876543210
-                                          arg. SameKind (Apply Const'Sym0 arg) (Const'Sym1 arg) =>
-                                   Const'Sym0 a0123456789876543210
-    type instance Apply Const'Sym0 a0123456789876543210 = Const'Sym1 a0123456789876543210
-    type family Const' (a :: a) (a :: b) :: a where
-      Const' x _ = x
-    sConst' ::
-      forall a b (t :: a) (t :: b).
-      Sing t -> Sing t -> Sing (Apply (Apply Const'Sym0 t) t :: a)
-    sConst' (sX :: Sing x) _ = sX
-    instance SingI (Const'Sym0 :: (~>) a ((~>) b a)) where
-      sing = (singFun2 @Const'Sym0) sConst'
-    instance SingI d => SingI (Const'Sym1 (d :: a) :: (~>) b a) where
-      sing = (singFun1 @(Const'Sym1 (d :: a))) (sConst' (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T367.golden b/tests/compile-and-dump/Singletons/T367.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T367.golden
@@ -0,0 +1,36 @@
+Singletons/T367.hs:(0,0)-(0,0): Splicing declarations
+    singletonsOnly
+      [d| const' :: a -> b -> a
+          const' x _ = x |]
+  ======>
+    type Const'Sym0 :: (~>) a ((~>) b a)
+    data Const'Sym0 a0123456789876543210
+      where
+        Const'Sym0KindInference :: SameKind (Apply Const'Sym0 arg) (Const'Sym1 arg) =>
+                                   Const'Sym0 a0123456789876543210
+    type instance Apply Const'Sym0 a0123456789876543210 = Const'Sym1 a0123456789876543210
+    instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings Const'Sym0 where
+      Data.Singletons.SuppressUnusedWarnings.suppressUnusedWarnings
+        = snd (((,) Const'Sym0KindInference) ())
+    type Const'Sym1 :: a -> (~>) b a
+    data Const'Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Const'Sym1KindInference :: SameKind (Apply (Const'Sym1 a0123456789876543210) arg) (Const'Sym2 a0123456789876543210 arg) =>
+                                   Const'Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Const'Sym1 a0123456789876543210) a0123456789876543210 = Const'Sym2 a0123456789876543210 a0123456789876543210
+    instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings (Const'Sym1 a0123456789876543210) where
+      Data.Singletons.SuppressUnusedWarnings.suppressUnusedWarnings
+        = snd (((,) Const'Sym1KindInference) ())
+    type Const'Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        Const' a0123456789876543210 a0123456789876543210 :: a
+    type Const' :: a -> b -> a
+    type family Const' a a where
+      Const' x _ = x
+    sConst' ::
+      forall a b (t :: a) (t :: b).
+      Sing t -> Sing t -> Sing (Apply (Apply Const'Sym0 t) t :: a)
+    sConst' (sX :: Sing x) _ = sX
+    instance SingI (Const'Sym0 :: (~>) a ((~>) b a)) where
+      sing = (singFun2 @Const'Sym0) sConst'
+    instance SingI d => SingI (Const'Sym1 (d :: a) :: (~>) b a) where
+      sing = (singFun1 @(Const'Sym1 (d :: a))) (sConst' (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T371.ghc88.template b/tests/compile-and-dump/Singletons/T371.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T371.ghc88.template
+++ /dev/null
@@ -1,247 +0,0 @@
-Singletons/T371.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| data Y (a :: Type)
-            = Y1 | Y2 (X a)
-            deriving Show
-          data X (a :: Type)
-            = X1 | X2 (Y a)
-            deriving Show |]
-  ======>
-    data X (a :: Type)
-      = X1 | X2 (Y a)
-      deriving Show
-    data Y (a :: Type)
-      = Y1 | Y2 (X a)
-      deriving Show
-    type X1Sym0 = X1
-    type X2Sym1 (t0123456789876543210 :: Y a0123456789876543210) =
-        X2 t0123456789876543210
-    instance SuppressUnusedWarnings X2Sym0 where
-      suppressUnusedWarnings = snd (((,) X2Sym0KindInference) ())
-    data X2Sym0 :: forall (a0123456789876543210 :: Type).
-                   (~>) (Y a0123456789876543210) (X (a0123456789876543210 :: Type))
-      where
-        X2Sym0KindInference :: forall t0123456789876543210
-                                      arg. SameKind (Apply X2Sym0 arg) (X2Sym1 arg) =>
-                               X2Sym0 t0123456789876543210
-    type instance Apply X2Sym0 t0123456789876543210 = X2 t0123456789876543210
-    type Y1Sym0 = Y1
-    type Y2Sym1 (t0123456789876543210 :: X a0123456789876543210) =
-        Y2 t0123456789876543210
-    instance SuppressUnusedWarnings Y2Sym0 where
-      suppressUnusedWarnings = snd (((,) Y2Sym0KindInference) ())
-    data Y2Sym0 :: forall (a0123456789876543210 :: Type).
-                   (~>) (X a0123456789876543210) (Y (a0123456789876543210 :: Type))
-      where
-        Y2Sym0KindInference :: forall t0123456789876543210
-                                      arg. SameKind (Apply Y2Sym0 arg) (Y2Sym1 arg) =>
-                               Y2Sym0 t0123456789876543210
-    type instance Apply Y2Sym0 t0123456789876543210 = Y2 t0123456789876543210
-    type family ShowsPrec_0123456789876543210 (a :: GHC.Types.Nat) (a :: X a) (a :: GHC.Types.Symbol) :: GHC.Types.Symbol where
-      ShowsPrec_0123456789876543210 _ X1 a_0123456789876543210 = Apply (Apply ShowStringSym0 "X1") a_0123456789876543210
-      ShowsPrec_0123456789876543210 p_0123456789876543210 (X2 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (Data.Singletons.Prelude.Num.FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "X2 ")) (Apply (Apply ShowsPrecSym0 (Data.Singletons.Prelude.Num.FromInteger 11)) arg_0123456789876543210))) a_0123456789876543210
-    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: X a0123456789876543210) (a0123456789876543210 :: GHC.Types.Symbol) =
-        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
-    data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: X a0123456789876543210) :: (~>) GHC.Types.Symbol GHC.Types.Symbol
-      where
-        ShowsPrec_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
-    data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) :: forall a0123456789876543210.
-                                                                                      (~>) (X a0123456789876543210) ((~>) GHC.Types.Symbol GHC.Types.Symbol)
-      where
-        ShowsPrec_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
-    data ShowsPrec_0123456789876543210Sym0 :: forall a0123456789876543210.
-                                              (~>) GHC.Types.Nat ((~>) (X a0123456789876543210) ((~>) GHC.Types.Symbol GHC.Types.Symbol))
-      where
-        ShowsPrec_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
-    instance PShow (X a) where
-      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
-    type family ShowsPrec_0123456789876543210 (a :: GHC.Types.Nat) (a :: Y a) (a :: GHC.Types.Symbol) :: GHC.Types.Symbol where
-      ShowsPrec_0123456789876543210 _ Y1 a_0123456789876543210 = Apply (Apply ShowStringSym0 "Y1") a_0123456789876543210
-      ShowsPrec_0123456789876543210 p_0123456789876543210 (Y2 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (Data.Singletons.Prelude.Num.FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Y2 ")) (Apply (Apply ShowsPrecSym0 (Data.Singletons.Prelude.Num.FromInteger 11)) arg_0123456789876543210))) a_0123456789876543210
-    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Y a0123456789876543210) (a0123456789876543210 :: GHC.Types.Symbol) =
-        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
-    data ShowsPrec_0123456789876543210Sym2 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Y a0123456789876543210) :: (~>) GHC.Types.Symbol GHC.Types.Symbol
-      where
-        ShowsPrec_0123456789876543210Sym2KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
-    data ShowsPrec_0123456789876543210Sym1 (a0123456789876543210 :: GHC.Types.Nat) :: forall a0123456789876543210.
-                                                                                      (~>) (Y a0123456789876543210) ((~>) GHC.Types.Symbol GHC.Types.Symbol)
-      where
-        ShowsPrec_0123456789876543210Sym1KindInference :: forall a0123456789876543210
-                                                                 a0123456789876543210
-                                                                 arg. SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
-    data ShowsPrec_0123456789876543210Sym0 :: forall a0123456789876543210.
-                                              (~>) GHC.Types.Nat ((~>) (Y a0123456789876543210) ((~>) GHC.Types.Symbol GHC.Types.Symbol))
-      where
-        ShowsPrec_0123456789876543210Sym0KindInference :: forall a0123456789876543210
-                                                                 arg. SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
-                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
-    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
-    instance PShow (Y a) where
-      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
-    data SX :: forall a. X a -> Type
-      where
-        SX1 :: SX X1
-        SX2 :: forall a (n :: Y a). (Sing (n :: Y a)) -> SX (X2 n)
-    type instance Sing @(X a) = SX
-    instance SingKind a => SingKind (X a) where
-      type Demote (X a) = X (Demote a)
-      fromSing SX1 = X1
-      fromSing (SX2 b) = X2 (fromSing b)
-      toSing X1 = SomeSing SX1
-      toSing (X2 (b :: Demote (Y a)))
-        = case toSing b :: SomeSing (Y a) of {
-            SomeSing c -> SomeSing (SX2 c) }
-    data SY :: forall a. Y a -> Type
-      where
-        SY1 :: SY Y1
-        SY2 :: forall a (n :: X a). (Sing (n :: X a)) -> SY (Y2 n)
-    type instance Sing @(Y a) = SY
-    instance SingKind a => SingKind (Y a) where
-      type Demote (Y a) = Y (Demote a)
-      fromSing SY1 = Y1
-      fromSing (SY2 b) = Y2 (fromSing b)
-      toSing Y1 = SomeSing SY1
-      toSing (Y2 (b :: Demote (X a)))
-        = case toSing b :: SomeSing (X a) of {
-            SomeSing c -> SomeSing (SY2 c) }
-    instance SShow (Y a) => SShow (X a) where
-      sShowsPrec ::
-        forall (t1 :: GHC.Types.Nat) (t2 :: X a) (t3 :: GHC.Types.Symbol).
-        Sing t1
-        -> Sing t2
-           -> Sing t3
-              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) (X a) ((~>) GHC.Types.Symbol GHC.Types.Symbol))
-                                                             -> Type) t1) t2) t3)
-      sShowsPrec
-        _
-        SX1
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "X1")))
-            sA_0123456789876543210
-      sShowsPrec
-        (sP_0123456789876543210 :: Sing p_0123456789876543210)
-        (SX2 (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
-                    ((applySing
-                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
-                       (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 10)))))
-                ((applySing
-                    ((applySing ((singFun3 @(.@#@$)) (%.)))
-                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                          (sing :: Sing "X2 "))))
-                   ((applySing
-                       ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                          (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 11))))
-                      sArg_0123456789876543210))))
-            sA_0123456789876543210
-    instance SShow (X a) => SShow (Y a) where
-      sShowsPrec ::
-        forall (t1 :: GHC.Types.Nat) (t2 :: Y a) (t3 :: GHC.Types.Symbol).
-        Sing t1
-        -> Sing t2
-           -> Sing t3
-              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) (Y a) ((~>) GHC.Types.Symbol GHC.Types.Symbol))
-                                                             -> Type) t1) t2) t3)
-      sShowsPrec
-        _
-        SY1
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                (sing :: Sing "Y1")))
-            sA_0123456789876543210
-      sShowsPrec
-        (sP_0123456789876543210 :: Sing p_0123456789876543210)
-        (SY2 (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
-        (sA_0123456789876543210 :: Sing a_0123456789876543210)
-        = (applySing
-             ((applySing
-                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
-                    ((applySing
-                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
-                       (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 10)))))
-                ((applySing
-                    ((applySing ((singFun3 @(.@#@$)) (%.)))
-                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
-                          (sing :: Sing "Y2 "))))
-                   ((applySing
-                       ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
-                          (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 11))))
-                      sArg_0123456789876543210))))
-            sA_0123456789876543210
-    instance Data.Singletons.ShowSing.ShowSing (Y a) =>
-             Show (SX (z :: X a)) where
-      showsPrec _ SX1 = showString "SX1"
-      showsPrec
-        p_0123456789876543210
-        (SX2 (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
-        = (showParen (((>) p_0123456789876543210) 10))
-            (((.) (showString "SX2 "))
-               ((showsPrec 11) arg_0123456789876543210)) ::
-            Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210 =>
-            ShowS
-    instance Data.Singletons.ShowSing.ShowSing (X a) =>
-             Show (SY (z :: Y a)) where
-      showsPrec _ SY1 = showString "SY1"
-      showsPrec
-        p_0123456789876543210
-        (SY2 (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
-        = (showParen (((>) p_0123456789876543210) 10))
-            (((.) (showString "SY2 "))
-               ((showsPrec 11) arg_0123456789876543210)) ::
-            Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210 =>
-            ShowS
-    instance SingI X1 where
-      sing = SX1
-    instance SingI n => SingI (X2 (n :: Y a)) where
-      sing = SX2 sing
-    instance SingI (X2Sym0 :: (~>) (Y a) (X (a :: Type))) where
-      sing = (singFun1 @X2Sym0) SX2
-    instance SingI Y1 where
-      sing = SY1
-    instance SingI n => SingI (Y2 (n :: X a)) where
-      sing = SY2 sing
-    instance SingI (Y2Sym0 :: (~>) (X a) (Y (a :: Type))) where
-      sing = (singFun1 @Y2Sym0) SY2
diff --git a/tests/compile-and-dump/Singletons/T371.golden b/tests/compile-and-dump/Singletons/T371.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T371.golden
@@ -0,0 +1,245 @@
+Singletons/T371.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| data Y (a :: Type)
+            = Y1 | Y2 (X a)
+            deriving Show
+          data X (a :: Type)
+            = X1 | X2 (Y a)
+            deriving Show |]
+  ======>
+    data X (a :: Type)
+      = X1 | X2 (Y a)
+      deriving Show
+    data Y (a :: Type)
+      = Y1 | Y2 (X a)
+      deriving Show
+    type X1Sym0 = X1 :: X (a :: Type)
+    type X2Sym0 :: forall (a :: Type). (~>) (Y a) (X (a :: Type))
+    data X2Sym0 a0123456789876543210
+      where
+        X2Sym0KindInference :: SameKind (Apply X2Sym0 arg) (X2Sym1 arg) =>
+                               X2Sym0 a0123456789876543210
+    type instance Apply X2Sym0 a0123456789876543210 = X2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings X2Sym0 where
+      suppressUnusedWarnings = snd (((,) X2Sym0KindInference) ())
+    type X2Sym1 (a0123456789876543210 :: Y a) =
+        X2 a0123456789876543210 :: X (a :: Type)
+    type Y1Sym0 = Y1 :: Y (a :: Type)
+    type Y2Sym0 :: forall (a :: Type). (~>) (X a) (Y (a :: Type))
+    data Y2Sym0 a0123456789876543210
+      where
+        Y2Sym0KindInference :: SameKind (Apply Y2Sym0 arg) (Y2Sym1 arg) =>
+                               Y2Sym0 a0123456789876543210
+    type instance Apply Y2Sym0 a0123456789876543210 = Y2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings Y2Sym0 where
+      suppressUnusedWarnings = snd (((,) Y2Sym0KindInference) ())
+    type Y2Sym1 (a0123456789876543210 :: X a) =
+        Y2 a0123456789876543210 :: Y (a :: Type)
+    type ShowsPrec_0123456789876543210 :: GHC.Types.Nat
+                                          -> X a -> GHC.Types.Symbol -> GHC.Types.Symbol
+    type family ShowsPrec_0123456789876543210 a a a where
+      ShowsPrec_0123456789876543210 _ X1 a_0123456789876543210 = Apply (Apply ShowStringSym0 "X1") a_0123456789876543210
+      ShowsPrec_0123456789876543210 p_0123456789876543210 (X2 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (Data.Singletons.Prelude.Num.FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "X2 ")) (Apply (Apply ShowsPrecSym0 (Data.Singletons.Prelude.Num.FromInteger 11)) arg_0123456789876543210))) a_0123456789876543210
+    type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) (X a) ((~>) GHC.Types.Symbol GHC.Types.Symbol))
+    data ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
+    type ShowsPrec_0123456789876543210Sym1 :: GHC.Types.Nat
+                                              -> (~>) (X a) ((~>) GHC.Types.Symbol GHC.Types.Symbol)
+    data ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
+    type ShowsPrec_0123456789876543210Sym2 :: GHC.Types.Nat
+                                              -> X a -> (~>) GHC.Types.Symbol GHC.Types.Symbol
+    data ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
+    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: X a) (a0123456789876543210 :: GHC.Types.Symbol) =
+        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: GHC.Types.Symbol
+    instance PShow (X a) where
+      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
+    type ShowsPrec_0123456789876543210 :: GHC.Types.Nat
+                                          -> Y a -> GHC.Types.Symbol -> GHC.Types.Symbol
+    type family ShowsPrec_0123456789876543210 a a a where
+      ShowsPrec_0123456789876543210 _ Y1 a_0123456789876543210 = Apply (Apply ShowStringSym0 "Y1") a_0123456789876543210
+      ShowsPrec_0123456789876543210 p_0123456789876543210 (Y2 arg_0123456789876543210) a_0123456789876543210 = Apply (Apply (Apply ShowParenSym0 (Apply (Apply (>@#@$) p_0123456789876543210) (Data.Singletons.Prelude.Num.FromInteger 10))) (Apply (Apply (.@#@$) (Apply ShowStringSym0 "Y2 ")) (Apply (Apply ShowsPrecSym0 (Data.Singletons.Prelude.Num.FromInteger 11)) arg_0123456789876543210))) a_0123456789876543210
+    type ShowsPrec_0123456789876543210Sym0 :: (~>) GHC.Types.Nat ((~>) (Y a) ((~>) GHC.Types.Symbol GHC.Types.Symbol))
+    data ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym0KindInference :: SameKind (Apply ShowsPrec_0123456789876543210Sym0 arg) (ShowsPrec_0123456789876543210Sym1 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply ShowsPrec_0123456789876543210Sym0 a0123456789876543210 = ShowsPrec_0123456789876543210Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings ShowsPrec_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym0KindInference) ())
+    type ShowsPrec_0123456789876543210Sym1 :: GHC.Types.Nat
+                                              -> (~>) (Y a) ((~>) GHC.Types.Symbol GHC.Types.Symbol)
+    data ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym1KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym1KindInference) ())
+    type ShowsPrec_0123456789876543210Sym2 :: GHC.Types.Nat
+                                              -> Y a -> (~>) GHC.Types.Symbol GHC.Types.Symbol
+    data ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+      where
+        ShowsPrec_0123456789876543210Sym2KindInference :: SameKind (Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) arg) (ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 arg) =>
+                                                          ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    type instance Apply (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) a0123456789876543210 = ShowsPrec_0123456789876543210Sym3 a0123456789876543210 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ShowsPrec_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210) where
+      suppressUnusedWarnings
+        = snd (((,) ShowsPrec_0123456789876543210Sym2KindInference) ())
+    type ShowsPrec_0123456789876543210Sym3 (a0123456789876543210 :: GHC.Types.Nat) (a0123456789876543210 :: Y a) (a0123456789876543210 :: GHC.Types.Symbol) =
+        ShowsPrec_0123456789876543210 a0123456789876543210 a0123456789876543210 a0123456789876543210 :: GHC.Types.Symbol
+    instance PShow (Y a) where
+      type ShowsPrec a a a = Apply (Apply (Apply ShowsPrec_0123456789876543210Sym0 a) a) a
+    data SX :: forall a. X (a :: Type) -> Type
+      where
+        SX1 :: forall (a :: Type). SX (X1 :: X (a :: Type))
+        SX2 :: forall (a :: Type) (n :: Y a).
+               (Sing n) -> SX (X2 n :: X (a :: Type))
+    type instance Sing @(X a) = SX
+    instance SingKind a => SingKind (X a) where
+      type Demote (X a) = X (Demote a)
+      fromSing SX1 = X1
+      fromSing (SX2 b) = X2 (fromSing b)
+      toSing X1 = SomeSing SX1
+      toSing (X2 (b :: Demote (Y a)))
+        = case toSing b :: SomeSing (Y a) of {
+            SomeSing c -> SomeSing (SX2 c) }
+    data SY :: forall a. Y (a :: Type) -> Type
+      where
+        SY1 :: forall (a :: Type). SY (Y1 :: Y (a :: Type))
+        SY2 :: forall (a :: Type) (n :: X a).
+               (Sing n) -> SY (Y2 n :: Y (a :: Type))
+    type instance Sing @(Y a) = SY
+    instance SingKind a => SingKind (Y a) where
+      type Demote (Y a) = Y (Demote a)
+      fromSing SY1 = Y1
+      fromSing (SY2 b) = Y2 (fromSing b)
+      toSing Y1 = SomeSing SY1
+      toSing (Y2 (b :: Demote (X a)))
+        = case toSing b :: SomeSing (X a) of {
+            SomeSing c -> SomeSing (SY2 c) }
+    instance SShow (Y a) => SShow (X a) where
+      sShowsPrec ::
+        forall (t1 :: GHC.Types.Nat) (t2 :: X a) (t3 :: GHC.Types.Symbol).
+        Sing t1
+        -> Sing t2
+           -> Sing t3
+              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) (X a) ((~>) GHC.Types.Symbol GHC.Types.Symbol))
+                                                             -> Type) t1) t2) t3)
+      sShowsPrec
+        _
+        SX1
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "X1")))
+            sA_0123456789876543210
+      sShowsPrec
+        (sP_0123456789876543210 :: Sing p_0123456789876543210)
+        (SX2 (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
+                    ((applySing
+                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
+                       (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 10)))))
+                ((applySing
+                    ((applySing ((singFun3 @(.@#@$)) (%.)))
+                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                          (sing :: Sing "X2 "))))
+                   ((applySing
+                       ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                          (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 11))))
+                      sArg_0123456789876543210))))
+            sA_0123456789876543210
+    instance SShow (X a) => SShow (Y a) where
+      sShowsPrec ::
+        forall (t1 :: GHC.Types.Nat) (t2 :: Y a) (t3 :: GHC.Types.Symbol).
+        Sing t1
+        -> Sing t2
+           -> Sing t3
+              -> Sing (Apply (Apply (Apply (ShowsPrecSym0 :: TyFun GHC.Types.Nat ((~>) (Y a) ((~>) GHC.Types.Symbol GHC.Types.Symbol))
+                                                             -> Type) t1) t2) t3)
+      sShowsPrec
+        _
+        SY1
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                (sing :: Sing "Y1")))
+            sA_0123456789876543210
+      sShowsPrec
+        (sP_0123456789876543210 :: Sing p_0123456789876543210)
+        (SY2 (sArg_0123456789876543210 :: Sing arg_0123456789876543210))
+        (sA_0123456789876543210 :: Sing a_0123456789876543210)
+        = (applySing
+             ((applySing
+                 ((applySing ((singFun3 @ShowParenSym0) sShowParen))
+                    ((applySing
+                        ((applySing ((singFun2 @(>@#@$)) (%>))) sP_0123456789876543210))
+                       (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 10)))))
+                ((applySing
+                    ((applySing ((singFun3 @(.@#@$)) (%.)))
+                       ((applySing ((singFun2 @ShowStringSym0) sShowString))
+                          (sing :: Sing "Y2 "))))
+                   ((applySing
+                       ((applySing ((singFun3 @ShowsPrecSym0) sShowsPrec))
+                          (Data.Singletons.Prelude.Num.sFromInteger (sing :: Sing 11))))
+                      sArg_0123456789876543210))))
+            sA_0123456789876543210
+    instance Data.Singletons.ShowSing.ShowSing (Y a) =>
+             Show (SX (z :: X a)) where
+      showsPrec _ SX1 = showString "SX1"
+      showsPrec
+        p_0123456789876543210
+        (SX2 (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
+        = (showParen (((>) p_0123456789876543210) 10))
+            (((.) (showString "SX2 "))
+               ((showsPrec 11) arg_0123456789876543210)) ::
+            Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210 =>
+            ShowS
+    instance Data.Singletons.ShowSing.ShowSing (X a) =>
+             Show (SY (z :: Y a)) where
+      showsPrec _ SY1 = showString "SY1"
+      showsPrec
+        p_0123456789876543210
+        (SY2 (arg_0123456789876543210 :: Sing argTy_0123456789876543210))
+        = (showParen (((>) p_0123456789876543210) 10))
+            (((.) (showString "SY2 "))
+               ((showsPrec 11) arg_0123456789876543210)) ::
+            Data.Singletons.ShowSing.ShowSing' argTy_0123456789876543210 =>
+            ShowS
+    instance SingI X1 where
+      sing = SX1
+    instance SingI n => SingI (X2 (n :: Y a)) where
+      sing = SX2 sing
+    instance SingI (X2Sym0 :: (~>) (Y a) (X (a :: Type))) where
+      sing = (singFun1 @X2Sym0) SX2
+    instance SingI Y1 where
+      sing = SY1
+    instance SingI n => SingI (Y2 (n :: X a)) where
+      sing = SY2 sing
+    instance SingI (Y2Sym0 :: (~>) (X a) (Y (a :: Type))) where
+      sing = (singFun1 @Y2Sym0) SY2
diff --git a/tests/compile-and-dump/Singletons/T376.ghc88.template b/tests/compile-and-dump/Singletons/T376.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T376.ghc88.template
+++ /dev/null
@@ -1,40 +0,0 @@
-Singletons/T376.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| f :: (() -> ()) -> (() -> ())
-          f g = g :: () -> () |]
-  ======>
-    f :: (() -> ()) -> () -> ()
-    f g = g :: () -> ()
-    type FSym2 (a0123456789876543210 :: (~>) () ()) (a0123456789876543210 :: ()) =
-        F a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings (FSym1 a0123456789876543210) where
-      suppressUnusedWarnings = snd (((,) FSym1KindInference) ())
-    data FSym1 (a0123456789876543210 :: (~>) () ()) :: (~>) () ()
-      where
-        FSym1KindInference :: forall a0123456789876543210
-                                     a0123456789876543210
-                                     arg. SameKind (Apply (FSym1 a0123456789876543210) arg) (FSym2 a0123456789876543210 arg) =>
-                              FSym1 a0123456789876543210 a0123456789876543210
-    type instance Apply (FSym1 a0123456789876543210) a0123456789876543210 = F a0123456789876543210 a0123456789876543210
-    instance SuppressUnusedWarnings FSym0 where
-      suppressUnusedWarnings = snd (((,) FSym0KindInference) ())
-    data FSym0 :: (~>) ((~>) () ()) ((~>) () ())
-      where
-        FSym0KindInference :: forall a0123456789876543210
-                                     arg. SameKind (Apply FSym0 arg) (FSym1 arg) =>
-                              FSym0 a0123456789876543210
-    type instance Apply FSym0 a0123456789876543210 = FSym1 a0123456789876543210
-    type family F (a :: (~>) () ()) (a :: ()) :: () where
-      F g a_0123456789876543210 = Apply (g :: (~>) () ()) a_0123456789876543210
-    sF ::
-      forall (t :: (~>) () ()) (t :: ()).
-      Sing t -> Sing t -> Sing (Apply (Apply FSym0 t) t :: ())
-    sF
-      (sG :: Sing g)
-      (sA_0123456789876543210 :: Sing a_0123456789876543210)
-      = (applySing (sG :: Sing (g :: (~>) () ()))) sA_0123456789876543210
-    instance SingI (FSym0 :: (~>) ((~>) () ()) ((~>) () ())) where
-      sing = (singFun2 @FSym0) sF
-    instance SingI d =>
-             SingI (FSym1 (d :: (~>) () ()) :: (~>) () ()) where
-      sing = (singFun1 @(FSym1 (d :: (~>) () ()))) (sF (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T376.golden b/tests/compile-and-dump/Singletons/T376.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T376.golden
@@ -0,0 +1,40 @@
+Singletons/T376.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| f :: (() -> ()) -> (() -> ())
+          f g = g :: () -> () |]
+  ======>
+    f :: (() -> ()) -> () -> ()
+    f g = g :: () -> ()
+    type FSym0 :: (~>) ((~>) () ()) ((~>) () ())
+    data FSym0 a0123456789876543210
+      where
+        FSym0KindInference :: SameKind (Apply FSym0 arg) (FSym1 arg) =>
+                              FSym0 a0123456789876543210
+    type instance Apply FSym0 a0123456789876543210 = FSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FSym0 where
+      suppressUnusedWarnings = snd (((,) FSym0KindInference) ())
+    type FSym1 :: (~>) () () -> (~>) () ()
+    data FSym1 a0123456789876543210 a0123456789876543210
+      where
+        FSym1KindInference :: SameKind (Apply (FSym1 a0123456789876543210) arg) (FSym2 a0123456789876543210 arg) =>
+                              FSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (FSym1 a0123456789876543210) a0123456789876543210 = FSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (FSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) FSym1KindInference) ())
+    type FSym2 (a0123456789876543210 :: (~>) () ()) (a0123456789876543210 :: ()) =
+        F a0123456789876543210 a0123456789876543210 :: ()
+    type F :: (~>) () () -> () -> ()
+    type family F a a where
+      F g a_0123456789876543210 = Apply (g :: (~>) () ()) a_0123456789876543210
+    sF ::
+      forall (t :: (~>) () ()) (t :: ()).
+      Sing t -> Sing t -> Sing (Apply (Apply FSym0 t) t :: ())
+    sF
+      (sG :: Sing g)
+      (sA_0123456789876543210 :: Sing a_0123456789876543210)
+      = (applySing (sG :: Sing (g :: (~>) () ()))) sA_0123456789876543210
+    instance SingI (FSym0 :: (~>) ((~>) () ()) ((~>) () ())) where
+      sing = (singFun2 @FSym0) sF
+    instance SingI d =>
+             SingI (FSym1 (d :: (~>) () ()) :: (~>) () ()) where
+      sing = (singFun1 @(FSym1 (d :: (~>) () ()))) (sF (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T378a.golden b/tests/compile-and-dump/Singletons/T378a.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T378a.golden
@@ -0,0 +1,78 @@
+Singletons/T378a.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| constBA :: forall b a. a -> b -> a
+          constBA x _ = x
+          
+          data Proxy :: forall k. k -> Type
+            where
+              Proxy1 :: Proxy a
+              Proxy2 :: Proxy (a :: k)
+              Proxy3 :: forall a. Proxy a
+              Proxy4 :: forall k (a :: k). Proxy a |]
+  ======>
+    constBA :: forall b a. a -> b -> a
+    constBA x _ = x
+    data Proxy :: forall k. k -> Type
+      where
+        Proxy1 :: Proxy a
+        Proxy2 :: Proxy (a :: k)
+        Proxy3 :: forall a. Proxy a
+        Proxy4 :: forall k (a :: k). Proxy a
+    type Proxy1Sym0 = Proxy1 :: Proxy a
+    type Proxy2Sym0 = Proxy2 :: Proxy (a :: k)
+    type Proxy3Sym0 = Proxy3 :: Proxy a
+    type Proxy4Sym0 = Proxy4 :: Proxy a
+    type ConstBASym0 :: forall b a. (~>) a ((~>) b a)
+    data ConstBASym0 a0123456789876543210
+      where
+        ConstBASym0KindInference :: SameKind (Apply ConstBASym0 arg) (ConstBASym1 arg) =>
+                                    ConstBASym0 a0123456789876543210
+    type instance Apply ConstBASym0 a0123456789876543210 = ConstBASym1 a0123456789876543210
+    instance SuppressUnusedWarnings ConstBASym0 where
+      suppressUnusedWarnings = snd (((,) ConstBASym0KindInference) ())
+    type ConstBASym1 :: forall b a. a -> (~>) b a
+    data ConstBASym1 a0123456789876543210 a0123456789876543210
+      where
+        ConstBASym1KindInference :: SameKind (Apply (ConstBASym1 a0123456789876543210) arg) (ConstBASym2 a0123456789876543210 arg) =>
+                                    ConstBASym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (ConstBASym1 a0123456789876543210) a0123456789876543210 = ConstBASym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (ConstBASym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) ConstBASym1KindInference) ())
+    type ConstBASym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        ConstBA a0123456789876543210 a0123456789876543210 :: a
+    type ConstBA :: forall b a. a -> b -> a
+    type family ConstBA a a where
+      ConstBA x _ = x
+    sConstBA ::
+      forall b a (t :: a) (t :: b).
+      Sing t -> Sing t -> Sing (Apply (Apply ConstBASym0 t) t :: a)
+    sConstBA (sX :: Sing x) _ = sX
+    instance SingI (ConstBASym0 :: (~>) a ((~>) b a)) where
+      sing = (singFun2 @ConstBASym0) sConstBA
+    instance SingI d => SingI (ConstBASym1 (d :: a) :: (~>) b a) where
+      sing = (singFun1 @(ConstBASym1 (d :: a))) (sConstBA (sing @d))
+    data SProxy :: forall a. Proxy (a :: k) -> Type
+      where
+        SProxy1 :: forall a. SProxy (Proxy1 :: Proxy a)
+        SProxy2 :: forall k (a :: k). SProxy (Proxy2 :: Proxy (a :: k))
+        SProxy3 :: forall a. SProxy (Proxy3 :: Proxy a)
+        SProxy4 :: forall k (a :: k). SProxy (Proxy4 :: Proxy a)
+    type instance Sing @(Proxy a) = SProxy
+    instance SingKind a => SingKind (Proxy a) where
+      type Demote (Proxy a) = Proxy (Demote a)
+      fromSing SProxy1 = Proxy1
+      fromSing SProxy2 = Proxy2
+      fromSing SProxy3 = Proxy3
+      fromSing SProxy4 = Proxy4
+      toSing Proxy1 = SomeSing SProxy1
+      toSing Proxy2 = SomeSing SProxy2
+      toSing Proxy3 = SomeSing SProxy3
+      toSing Proxy4 = SomeSing SProxy4
+    instance SingI Proxy1 where
+      sing = SProxy1
+    instance SingI Proxy2 where
+      sing = SProxy2
+    instance SingI Proxy3 where
+      sing = SProxy3
+    instance SingI Proxy4 where
+      sing = SProxy4
diff --git a/tests/compile-and-dump/Singletons/T378a.hs b/tests/compile-and-dump/Singletons/T378a.hs
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T378a.hs
@@ -0,0 +1,64 @@
+module T378a where
+
+import Data.Kind
+import Data.Singletons.Prelude hiding (Proxy(..))
+import Data.Singletons.TH hiding (Proxy(..))
+
+$(singletons [d|
+  constBA :: forall b a. a -> b -> a
+  constBA x _ = x
+
+  data Proxy :: forall k. k -> Type where
+    Proxy1 :: Proxy a
+    Proxy2 :: Proxy (a :: k)
+    Proxy3 :: forall a. Proxy a
+    Proxy4 :: forall k (a :: k). Proxy a
+  |])
+
+ex1 :: [Bool]
+ex1 = [] @Bool
+
+type PEx1 :: [Bool]
+type PEx1 = '[] @Bool
+
+sEx1 :: SList ('[] @Bool)
+sEx1 = SNil @Bool
+
+ex2 :: Bool
+ex2 = constBA @Ordering @Bool True LT
+
+type PEx2 :: Bool
+type PEx2 = ConstBA @Ordering @Bool True LT
+
+sEx2 :: Sing (ConstBA True LT)
+sEx2 = sConstBA @Ordering @Bool STrue SLT
+
+proxyEx1, proxyEx2, proxyEx3, proxyEx4 :: Proxy True
+proxyEx1 = Proxy1 @True
+proxyEx2 = Proxy2 @Bool @True
+proxyEx3 = Proxy3 @True
+proxyEx4 = Proxy4 @Bool @True
+
+type ProxyEx1 :: Proxy True
+type ProxyEx1 = Proxy1 @True
+
+type ProxyEx2 :: Proxy True
+type ProxyEx2 = Proxy2 @Bool @True
+
+type ProxyEx3 :: Proxy True
+type ProxyEx3 = Proxy3 @True
+
+type ProxyEx4 :: Proxy True
+type ProxyEx4 = Proxy4 @Bool @True
+
+sProxyEx1 :: SProxy (Proxy1 @True)
+sProxyEx1 = SProxy1 @True
+
+sProxyEx2 :: SProxy (Proxy2 @Bool @True)
+sProxyEx2 = SProxy2 @Bool @True
+
+sProxyEx3 :: SProxy (Proxy3 @True)
+sProxyEx3 = SProxy3 @True
+
+sProxyEx4 :: SProxy (Proxy4 @Bool @True)
+sProxyEx4 = SProxy4 @Bool @True
diff --git a/tests/compile-and-dump/Singletons/T378b.golden b/tests/compile-and-dump/Singletons/T378b.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T378b.golden
diff --git a/tests/compile-and-dump/Singletons/T378b.hs b/tests/compile-and-dump/Singletons/T378b.hs
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T378b.hs
@@ -0,0 +1,42 @@
+module T378b where
+
+import Data.Kind
+import Data.Singletons.TH
+
+$(singletons [d|
+  type C :: forall b a. a -> b -> Constraint
+  class C x y
+
+  type D :: forall b a. a -> b -> Type
+  data D x y
+
+  f :: forall b a. a -> b -> ()
+  f _ _ = ()
+
+  type Nat :: Type
+  data Nat = Z | S Nat
+
+  -- This will only typecheck if ZSym0 is a type synonym.
+  -- See Note [No SAKs for fully saturated defunctionalization symbols]
+  -- in D.S.Promote.Defun for more information.
+  natMinus :: Nat -> Nat -> Nat
+  natMinus Z     _     = Z
+  natMinus (S a) (S b) = natMinus a b
+  natMinus a     Z     = a
+  |])
+
+-- Test some type variable orderings
+type CExP :: Bool -> Ordering -> Constraint
+type CExP = PC @Ordering @Bool
+
+type CExS :: Bool -> Ordering -> Constraint
+type CExS = SC @Ordering @Bool
+
+type DExS :: D (x :: Bool) (y :: Ordering) -> Type
+type DExS = SD @Ordering @Bool
+
+type FEx0 :: Bool ~> Ordering ~> ()
+type FEx0 = FSym0 @Ordering @Bool
+
+type FEx1 :: Bool -> Ordering ~> ()
+type FEx1 = FSym1 @Ordering @Bool
diff --git a/tests/compile-and-dump/Singletons/T401.golden b/tests/compile-and-dump/Singletons/T401.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T401.golden
@@ -0,0 +1,13 @@
+
+Singletons/T401.hs:0:0: error:
+    `singletons` does not support higher-rank `forall`s
+In the type: (forall a_0 . a_0 -> a_0) -> b_1 -> b_1
+
+  |
+5 | $(singletons [d|
+  |   ^^^^^^^^^^^^^^...
+
+Singletons/T401.hs:0:0: error: Q monad failure
+  |
+5 | $(singletons [d|
+  |   ^^^^^^^^^^^^^^...
diff --git a/tests/compile-and-dump/Singletons/T401.hs b/tests/compile-and-dump/Singletons/T401.hs
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T401.hs
@@ -0,0 +1,8 @@
+module T401 where
+
+import Data.Singletons.TH
+
+$(singletons [d|
+  f :: (forall a. a -> a) -> b -> b
+  f _ x = x
+  |])
diff --git a/tests/compile-and-dump/Singletons/T401b.golden b/tests/compile-and-dump/Singletons/T401b.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T401b.golden
@@ -0,0 +1,13 @@
+
+Singletons/T401b.hs:0:0: error:
+    `singletons` does not support higher-rank `forall`s
+In the type: (forall a_0 . a_0) -> T_1
+
+  |
+5 | $(singletons [d|
+  |   ^^^^^^^^^^^^^^...
+
+Singletons/T401b.hs:0:0: error: Q monad failure
+  |
+5 | $(singletons [d|
+  |   ^^^^^^^^^^^^^^...
diff --git a/tests/compile-and-dump/Singletons/T401b.hs b/tests/compile-and-dump/Singletons/T401b.hs
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T401b.hs
@@ -0,0 +1,8 @@
+module T401b where
+
+import Data.Singletons.TH
+
+$(singletons [d|
+  newtype T where
+    MkT :: (forall a. a) -> T
+  |])
diff --git a/tests/compile-and-dump/Singletons/T402.ghc88.template b/tests/compile-and-dump/Singletons/T402.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T402.ghc88.template
+++ /dev/null
@@ -1,15 +0,0 @@
-Singletons/T402.hs:0:0:: Splicing declarations
-    singletons [d| type AnyOfKind (k :: Type) = Any :: k |]
-  ======>
-    type AnyOfKind (k :: Type) = Any :: k
-    type AnyOfKindSym1 (k0123456789876543210 :: Type) =
-        AnyOfKind k0123456789876543210
-    instance SuppressUnusedWarnings AnyOfKindSym0 where
-      suppressUnusedWarnings = snd (((,) AnyOfKindSym0KindInference) ())
-    data AnyOfKindSym0 :: forall (k0123456789876543210 :: Type).
-                          (~>) Type k0123456789876543210
-      where
-        AnyOfKindSym0KindInference :: forall k0123456789876543210
-                                             arg. SameKind (Apply AnyOfKindSym0 arg) (AnyOfKindSym1 arg) =>
-                                      AnyOfKindSym0 k0123456789876543210
-    type instance Apply AnyOfKindSym0 k0123456789876543210 = AnyOfKind k0123456789876543210
diff --git a/tests/compile-and-dump/Singletons/T402.golden b/tests/compile-and-dump/Singletons/T402.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T402.golden
@@ -0,0 +1,13 @@
+Singletons/T402.hs:0:0:: Splicing declarations
+    singletons [d| type AnyOfKind (k :: Type) = Any :: k |]
+  ======>
+    type AnyOfKind (k :: Type) = Any :: k
+    data AnyOfKindSym0 :: (~>) Type k0123456789876543210
+      where
+        AnyOfKindSym0KindInference :: SameKind (Apply AnyOfKindSym0 arg) (AnyOfKindSym1 arg) =>
+                                      AnyOfKindSym0 k0123456789876543210
+    type instance Apply AnyOfKindSym0 k0123456789876543210 = AnyOfKindSym1 k0123456789876543210
+    instance SuppressUnusedWarnings AnyOfKindSym0 where
+      suppressUnusedWarnings = snd (((,) AnyOfKindSym0KindInference) ())
+    type AnyOfKindSym1 (k0123456789876543210 :: Type) =
+        AnyOfKind k0123456789876543210 :: k0123456789876543210
diff --git a/tests/compile-and-dump/Singletons/T410.golden b/tests/compile-and-dump/Singletons/T410.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T410.golden
@@ -0,0 +1,59 @@
+Singletons/T410.hs:(0,0)-(0,0): Splicing declarations
+    promote
+      [d| class Eq a where
+            equals :: a -> a -> Bool
+          
+          instance Eq () where
+            equals () () = True |]
+  ======>
+    class Eq a where
+      equals :: a -> a -> Bool
+    instance Eq () where
+      equals () () = True
+    type EqualsSym0 :: forall a. (~>) a ((~>) a Bool)
+    data EqualsSym0 a0123456789876543210
+      where
+        EqualsSym0KindInference :: SameKind (Apply EqualsSym0 arg) (EqualsSym1 arg) =>
+                                   EqualsSym0 a0123456789876543210
+    type instance Apply EqualsSym0 a0123456789876543210 = EqualsSym1 a0123456789876543210
+    instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings EqualsSym0 where
+      Data.Singletons.SuppressUnusedWarnings.suppressUnusedWarnings
+        = snd (((,) EqualsSym0KindInference) ())
+    type EqualsSym1 :: forall a. a -> (~>) a Bool
+    data EqualsSym1 a0123456789876543210 a0123456789876543210
+      where
+        EqualsSym1KindInference :: SameKind (Apply (EqualsSym1 a0123456789876543210) arg) (EqualsSym2 a0123456789876543210 arg) =>
+                                   EqualsSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (EqualsSym1 a0123456789876543210) a0123456789876543210 = EqualsSym2 a0123456789876543210 a0123456789876543210
+    instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings (EqualsSym1 a0123456789876543210) where
+      Data.Singletons.SuppressUnusedWarnings.suppressUnusedWarnings
+        = snd (((,) EqualsSym1KindInference) ())
+    type EqualsSym2 (a0123456789876543210 :: a) (a0123456789876543210 :: a) =
+        Equals a0123456789876543210 a0123456789876543210 :: Bool
+    class PEq a where
+      type Equals (arg :: a) (arg :: a) :: Bool
+    type Equals_0123456789876543210 :: () -> () -> Bool
+    type family Equals_0123456789876543210 a a where
+      Equals_0123456789876543210 '() '() = TrueSym0
+    type Equals_0123456789876543210Sym0 :: (~>) () ((~>) () Bool)
+    data Equals_0123456789876543210Sym0 a0123456789876543210
+      where
+        Equals_0123456789876543210Sym0KindInference :: SameKind (Apply Equals_0123456789876543210Sym0 arg) (Equals_0123456789876543210Sym1 arg) =>
+                                                       Equals_0123456789876543210Sym0 a0123456789876543210
+    type instance Apply Equals_0123456789876543210Sym0 a0123456789876543210 = Equals_0123456789876543210Sym1 a0123456789876543210
+    instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings Equals_0123456789876543210Sym0 where
+      Data.Singletons.SuppressUnusedWarnings.suppressUnusedWarnings
+        = snd (((,) Equals_0123456789876543210Sym0KindInference) ())
+    type Equals_0123456789876543210Sym1 :: () -> (~>) () Bool
+    data Equals_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+      where
+        Equals_0123456789876543210Sym1KindInference :: SameKind (Apply (Equals_0123456789876543210Sym1 a0123456789876543210) arg) (Equals_0123456789876543210Sym2 a0123456789876543210 arg) =>
+                                                       Equals_0123456789876543210Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (Equals_0123456789876543210Sym1 a0123456789876543210) a0123456789876543210 = Equals_0123456789876543210Sym2 a0123456789876543210 a0123456789876543210
+    instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings (Equals_0123456789876543210Sym1 a0123456789876543210) where
+      Data.Singletons.SuppressUnusedWarnings.suppressUnusedWarnings
+        = snd (((,) Equals_0123456789876543210Sym1KindInference) ())
+    type Equals_0123456789876543210Sym2 (a0123456789876543210 :: ()) (a0123456789876543210 :: ()) =
+        Equals_0123456789876543210 a0123456789876543210 a0123456789876543210 :: Bool
+    instance PEq () where
+      type Equals a a = Apply (Apply Equals_0123456789876543210Sym0 a) a
diff --git a/tests/compile-and-dump/Singletons/T410.hs b/tests/compile-and-dump/Singletons/T410.hs
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T410.hs
@@ -0,0 +1,12 @@
+module T410 where
+
+import Data.Singletons
+import Data.Singletons.Prelude.Bool
+import Data.Singletons.TH (promote)
+
+$(promote [d|
+  class Eq a where
+    equals :: a -> a -> Bool
+  instance Eq () where
+    equals () () = True
+  |])
diff --git a/tests/compile-and-dump/Singletons/T412.golden b/tests/compile-and-dump/Singletons/T412.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T412.golden
@@ -0,0 +1,374 @@
+Singletons/T412.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| infixr 5 `D1`, `MkD1`, `d1A`, `d1B`
+          infixl 5 `T1a`, `T1b`
+          infix 6 `m1`
+          infix 5 `C1`
+          
+          class C1 a b where
+            infix 6 `m1`
+            m1 :: a -> b -> Bool
+          type T1a a b = Either a b
+          type family T1b a b where
+            T1b a b = Either a b
+          data D1 a b = MkD1 {d1A :: a, d1B :: b} |]
+  ======>
+    infix 5 `C1`
+    class C1 a b where
+      m1 :: a -> b -> Bool
+    infix 6 `m1`
+    infixl 5 `T1a`
+    infixl 5 `T1b`
+    type T1a a b = Either a b
+    type family T1b a b where
+      T1b a b = Either a b
+    infixr 5 `D1`
+    infixr 5 `MkD1`
+    infixr 5 `d1A`
+    infixr 5 `d1B`
+    data D1 a b = MkD1 {d1A :: a, d1B :: b}
+    data T1aSym0 a0123456789876543210
+      where
+        T1aSym0KindInference :: SameKind (Apply T1aSym0 arg) (T1aSym1 arg) =>
+                                T1aSym0 a0123456789876543210
+    type instance Apply T1aSym0 a0123456789876543210 = T1aSym1 a0123456789876543210
+    instance SuppressUnusedWarnings T1aSym0 where
+      suppressUnusedWarnings = snd (((,) T1aSym0KindInference) ())
+    infixl 5 `T1aSym0`
+    data T1aSym1 a0123456789876543210 b0123456789876543210
+      where
+        T1aSym1KindInference :: SameKind (Apply (T1aSym1 a0123456789876543210) arg) (T1aSym2 a0123456789876543210 arg) =>
+                                T1aSym1 a0123456789876543210 b0123456789876543210
+    type instance Apply (T1aSym1 a0123456789876543210) b0123456789876543210 = T1aSym2 a0123456789876543210 b0123456789876543210
+    instance SuppressUnusedWarnings (T1aSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) T1aSym1KindInference) ())
+    infixl 5 `T1aSym1`
+    type T1aSym2 a0123456789876543210 b0123456789876543210 =
+        T1a a0123456789876543210 b0123456789876543210
+    infixl 5 `T1aSym2`
+    data T1bSym0 a0123456789876543210
+      where
+        T1bSym0KindInference :: SameKind (Apply T1bSym0 arg) (T1bSym1 arg) =>
+                                T1bSym0 a0123456789876543210
+    type instance Apply T1bSym0 a0123456789876543210 = T1bSym1 a0123456789876543210
+    instance SuppressUnusedWarnings T1bSym0 where
+      suppressUnusedWarnings = snd (((,) T1bSym0KindInference) ())
+    infixl 5 `T1bSym0`
+    data T1bSym1 a0123456789876543210 b0123456789876543210
+      where
+        T1bSym1KindInference :: SameKind (Apply (T1bSym1 a0123456789876543210) arg) (T1bSym2 a0123456789876543210 arg) =>
+                                T1bSym1 a0123456789876543210 b0123456789876543210
+    type instance Apply (T1bSym1 a0123456789876543210) b0123456789876543210 = T1bSym2 a0123456789876543210 b0123456789876543210
+    instance SuppressUnusedWarnings (T1bSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) T1bSym1KindInference) ())
+    infixl 5 `T1bSym1`
+    type T1bSym2 a0123456789876543210 b0123456789876543210 =
+        T1b a0123456789876543210 b0123456789876543210
+    infixl 5 `T1bSym2`
+    type MkD1Sym0 :: forall a b. (~>) a ((~>) b (D1 a b))
+    data MkD1Sym0 a0123456789876543210
+      where
+        MkD1Sym0KindInference :: SameKind (Apply MkD1Sym0 arg) (MkD1Sym1 arg) =>
+                                 MkD1Sym0 a0123456789876543210
+    type instance Apply MkD1Sym0 a0123456789876543210 = MkD1Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings MkD1Sym0 where
+      suppressUnusedWarnings = snd (((,) MkD1Sym0KindInference) ())
+    infixr 5 `MkD1Sym0`
+    type MkD1Sym1 :: forall a b. a -> (~>) b (D1 a b)
+    data MkD1Sym1 a0123456789876543210 a0123456789876543210
+      where
+        MkD1Sym1KindInference :: SameKind (Apply (MkD1Sym1 a0123456789876543210) arg) (MkD1Sym2 a0123456789876543210 arg) =>
+                                 MkD1Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (MkD1Sym1 a0123456789876543210) a0123456789876543210 = MkD1Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (MkD1Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) MkD1Sym1KindInference) ())
+    infixr 5 `MkD1Sym1`
+    type MkD1Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        MkD1 a0123456789876543210 a0123456789876543210 :: D1 a b
+    infixr 5 `MkD1Sym2`
+    type D1BSym0 :: forall a b. (~>) (D1 a b) b
+    data D1BSym0 a0123456789876543210
+      where
+        D1BSym0KindInference :: SameKind (Apply D1BSym0 arg) (D1BSym1 arg) =>
+                                D1BSym0 a0123456789876543210
+    type instance Apply D1BSym0 a0123456789876543210 = D1BSym1 a0123456789876543210
+    instance SuppressUnusedWarnings D1BSym0 where
+      suppressUnusedWarnings = snd (((,) D1BSym0KindInference) ())
+    infixr 5 `D1BSym0`
+    type D1BSym1 (a0123456789876543210 :: D1 a b) =
+        D1B a0123456789876543210 :: b
+    infixr 5 `D1BSym1`
+    type D1ASym0 :: forall a b. (~>) (D1 a b) a
+    data D1ASym0 a0123456789876543210
+      where
+        D1ASym0KindInference :: SameKind (Apply D1ASym0 arg) (D1ASym1 arg) =>
+                                D1ASym0 a0123456789876543210
+    type instance Apply D1ASym0 a0123456789876543210 = D1ASym1 a0123456789876543210
+    instance SuppressUnusedWarnings D1ASym0 where
+      suppressUnusedWarnings = snd (((,) D1ASym0KindInference) ())
+    infixr 5 `D1ASym0`
+    type D1ASym1 (a0123456789876543210 :: D1 a b) =
+        D1A a0123456789876543210 :: a
+    infixr 5 `D1ASym1`
+    type D1B :: forall a b. D1 a b -> b
+    type family D1B a where
+      D1B (MkD1 _ field) = field
+    type D1A :: forall a b. D1 a b -> a
+    type family D1A a where
+      D1A (MkD1 field _) = field
+    infixr 5 `D1B`
+    infixr 5 `D1A`
+    infix 6 `M1`
+    infix 5 `PC1`
+    type M1Sym0 :: forall a b. (~>) a ((~>) b Bool)
+    data M1Sym0 a0123456789876543210
+      where
+        M1Sym0KindInference :: SameKind (Apply M1Sym0 arg) (M1Sym1 arg) =>
+                               M1Sym0 a0123456789876543210
+    type instance Apply M1Sym0 a0123456789876543210 = M1Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings M1Sym0 where
+      suppressUnusedWarnings = snd (((,) M1Sym0KindInference) ())
+    infix 6 `M1Sym0`
+    type M1Sym1 :: forall a b. a -> (~>) b Bool
+    data M1Sym1 a0123456789876543210 a0123456789876543210
+      where
+        M1Sym1KindInference :: SameKind (Apply (M1Sym1 a0123456789876543210) arg) (M1Sym2 a0123456789876543210 arg) =>
+                               M1Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (M1Sym1 a0123456789876543210) a0123456789876543210 = M1Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (M1Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) M1Sym1KindInference) ())
+    infix 6 `M1Sym1`
+    type M1Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        M1 a0123456789876543210 a0123456789876543210 :: Bool
+    infix 6 `M1Sym2`
+    class PC1 a b where
+      type M1 (arg :: a) (arg :: b) :: Bool
+    infixr 5 `sD1B`
+    infixr 5 `sD1A`
+    infixr 5 `SMkD1`
+    infix 6 `sM1`
+    infix 5 `SC1`
+    sD1B ::
+      forall a b (t :: D1 a b). Sing t -> Sing (Apply D1BSym0 t :: b)
+    sD1A ::
+      forall a b (t :: D1 a b). Sing t -> Sing (Apply D1ASym0 t :: a)
+    sD1B (SMkD1 _ (sField :: Sing field)) = sField
+    sD1A (SMkD1 (sField :: Sing field) _) = sField
+    instance SingI (D1BSym0 :: (~>) (D1 a b) b) where
+      sing = (singFun1 @D1BSym0) sD1B
+    instance SingI (D1ASym0 :: (~>) (D1 a b) a) where
+      sing = (singFun1 @D1ASym0) sD1A
+    data SD1 :: forall a b. D1 a b -> GHC.Types.Type
+      where
+        SMkD1 :: forall a b (n :: a) (n :: b).
+                 (Sing n) -> (Sing n) -> SD1 (MkD1 n n :: D1 a b)
+    type instance Sing @(D1 a b) = SD1
+    instance (SingKind a, SingKind b) => SingKind (D1 a b) where
+      type Demote (D1 a b) = D1 (Demote a) (Demote b)
+      fromSing (SMkD1 b b) = (MkD1 (fromSing b)) (fromSing b)
+      toSing (MkD1 (b :: Demote a) (b :: Demote b))
+        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b) of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SMkD1 c) c) }
+    class SC1 a b where
+      sM1 ::
+        forall (t :: a) (t :: b).
+        Sing t -> Sing t -> Sing (Apply (Apply M1Sym0 t) t :: Bool)
+    instance (SingI n, SingI n) => SingI (MkD1 (n :: a) (n :: b)) where
+      sing = (SMkD1 sing) sing
+    instance SingI (MkD1Sym0 :: (~>) a ((~>) b (D1 a b))) where
+      sing = (singFun2 @MkD1Sym0) SMkD1
+    instance SingI d =>
+             SingI (MkD1Sym1 (d :: a) :: (~>) b (D1 a b)) where
+      sing = (singFun1 @(MkD1Sym1 (d :: a))) (SMkD1 (sing @d))
+    instance SC1 a b => SingI (M1Sym0 :: (~>) a ((~>) b Bool)) where
+      sing = (singFun2 @M1Sym0) sM1
+    instance (SC1 a b, SingI d) =>
+             SingI (M1Sym1 (d :: a) :: (~>) b Bool) where
+      sing = (singFun1 @(M1Sym1 (d :: a))) (sM1 (sing @d))
+Singletons/T412.hs:0:0:: Splicing declarations
+    genSingletons [''C2, ''T2a, ''T2b, ''D2]
+  ======>
+    type M2Sym0 :: forall a b. (~>) a ((~>) b Bool)
+    data M2Sym0 a0123456789876543210
+      where
+        M2Sym0KindInference :: SameKind (Apply M2Sym0 arg) (M2Sym1 arg) =>
+                               M2Sym0 a0123456789876543210
+    type instance Apply M2Sym0 a0123456789876543210 = M2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings M2Sym0 where
+      suppressUnusedWarnings = snd (((,) M2Sym0KindInference) ())
+    infix 6 `M2Sym0`
+    type M2Sym1 :: forall a b. a -> (~>) b Bool
+    data M2Sym1 a0123456789876543210 a0123456789876543210
+      where
+        M2Sym1KindInference :: SameKind (Apply (M2Sym1 a0123456789876543210) arg) (M2Sym2 a0123456789876543210 arg) =>
+                               M2Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (M2Sym1 a0123456789876543210) a0123456789876543210 = M2Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (M2Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) M2Sym1KindInference) ())
+    infix 6 `M2Sym1`
+    type M2Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        M2 a0123456789876543210 a0123456789876543210 :: Bool
+    infix 6 `M2Sym2`
+    type PC2 :: GHC.Types.Type -> GHC.Types.Type -> Constraint
+    class PC2 (a :: GHC.Types.Type) (b :: GHC.Types.Type) where
+      type M2 (arg :: a) (arg :: b) :: Bool
+    infix 5 `PC2`
+    infix 6 `M2`
+    class SC2 (a :: GHC.Types.Type) (b :: GHC.Types.Type) where
+      sM2 ::
+        forall (t :: a) (t :: b).
+        Sing t -> Sing t -> Sing (Apply (Apply M2Sym0 t) t :: Bool)
+    type SC2 :: GHC.Types.Type -> GHC.Types.Type -> Constraint
+    infix 5 `SC2`
+    infix 6 `sM2`
+    instance SC2 a b => SingI (M2Sym0 :: (~>) a ((~>) b Bool)) where
+      sing = (singFun2 @M2Sym0) sM2
+    instance (SC2 a b, SingI d) =>
+             SingI (M2Sym1 (d :: a) :: (~>) b Bool) where
+      sing = (singFun1 @(M2Sym1 (d :: a))) (sM2 (sing @d))
+    type T2aSym0 :: (~>) GHC.Types.Type ((~>) GHC.Types.Type GHC.Types.Type)
+    data T2aSym0 a0123456789876543210
+      where
+        T2aSym0KindInference :: SameKind (Apply T2aSym0 arg) (T2aSym1 arg) =>
+                                T2aSym0 a0123456789876543210
+    type instance Apply T2aSym0 a0123456789876543210 = T2aSym1 a0123456789876543210
+    instance SuppressUnusedWarnings T2aSym0 where
+      suppressUnusedWarnings = snd (((,) T2aSym0KindInference) ())
+    infixl 5 `T2aSym0`
+    type T2aSym1 :: GHC.Types.Type
+                    -> (~>) GHC.Types.Type GHC.Types.Type
+    data T2aSym1 a0123456789876543210 a0123456789876543210
+      where
+        T2aSym1KindInference :: SameKind (Apply (T2aSym1 a0123456789876543210) arg) (T2aSym2 a0123456789876543210 arg) =>
+                                T2aSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (T2aSym1 a0123456789876543210) a0123456789876543210 = T2aSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (T2aSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) T2aSym1KindInference) ())
+    infixl 5 `T2aSym1`
+    type T2aSym2 (a0123456789876543210 :: GHC.Types.Type) (a0123456789876543210 :: GHC.Types.Type) =
+        T2a a0123456789876543210 a0123456789876543210 :: GHC.Types.Type
+    infixl 5 `T2aSym2`
+    type T2bSym0 :: (~>) GHC.Types.Type ((~>) GHC.Types.Type GHC.Types.Type)
+    data T2bSym0 a0123456789876543210
+      where
+        T2bSym0KindInference :: SameKind (Apply T2bSym0 arg) (T2bSym1 arg) =>
+                                T2bSym0 a0123456789876543210
+    type instance Apply T2bSym0 a0123456789876543210 = T2bSym1 a0123456789876543210
+    instance SuppressUnusedWarnings T2bSym0 where
+      suppressUnusedWarnings = snd (((,) T2bSym0KindInference) ())
+    infixl 5 `T2bSym0`
+    type T2bSym1 :: GHC.Types.Type
+                    -> (~>) GHC.Types.Type GHC.Types.Type
+    data T2bSym1 a0123456789876543210 a0123456789876543210
+      where
+        T2bSym1KindInference :: SameKind (Apply (T2bSym1 a0123456789876543210) arg) (T2bSym2 a0123456789876543210 arg) =>
+                                T2bSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (T2bSym1 a0123456789876543210) a0123456789876543210 = T2bSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (T2bSym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) T2bSym1KindInference) ())
+    infixl 5 `T2bSym1`
+    type T2bSym2 (a0123456789876543210 :: GHC.Types.Type) (a0123456789876543210 :: GHC.Types.Type) =
+        T2b a0123456789876543210 a0123456789876543210 :: GHC.Types.Type
+    infixl 5 `T2bSym2`
+    type MkD2Sym0 :: forall (a :: GHC.Types.Type)
+                            (b :: GHC.Types.Type).
+                     (~>) a ((~>) b (D2 (a :: GHC.Types.Type) (b :: GHC.Types.Type)))
+    data MkD2Sym0 a0123456789876543210
+      where
+        MkD2Sym0KindInference :: SameKind (Apply MkD2Sym0 arg) (MkD2Sym1 arg) =>
+                                 MkD2Sym0 a0123456789876543210
+    type instance Apply MkD2Sym0 a0123456789876543210 = MkD2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings MkD2Sym0 where
+      suppressUnusedWarnings = snd (((,) MkD2Sym0KindInference) ())
+    infixr 5 `MkD2Sym0`
+    type MkD2Sym1 :: forall (a :: GHC.Types.Type)
+                            (b :: GHC.Types.Type).
+                     a -> (~>) b (D2 (a :: GHC.Types.Type) (b :: GHC.Types.Type))
+    data MkD2Sym1 a0123456789876543210 a0123456789876543210
+      where
+        MkD2Sym1KindInference :: SameKind (Apply (MkD2Sym1 a0123456789876543210) arg) (MkD2Sym2 a0123456789876543210 arg) =>
+                                 MkD2Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (MkD2Sym1 a0123456789876543210) a0123456789876543210 = MkD2Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (MkD2Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) MkD2Sym1KindInference) ())
+    infixr 5 `MkD2Sym1`
+    type MkD2Sym2 (a0123456789876543210 :: a) (a0123456789876543210 :: b) =
+        'MkD2 a0123456789876543210 a0123456789876543210 :: D2 (a :: GHC.Types.Type) (b :: GHC.Types.Type)
+    infixr 5 `MkD2Sym2`
+    infixr 5 `D2A`
+    infixr 5 `D2B`
+    type D2BSym0 :: forall (a :: GHC.Types.Type) (b :: GHC.Types.Type).
+                    (~>) (D2 (a :: GHC.Types.Type) (b :: GHC.Types.Type)) b
+    data D2BSym0 a0123456789876543210
+      where
+        D2BSym0KindInference :: SameKind (Apply D2BSym0 arg) (D2BSym1 arg) =>
+                                D2BSym0 a0123456789876543210
+    type instance Apply D2BSym0 a0123456789876543210 = D2BSym1 a0123456789876543210
+    instance SuppressUnusedWarnings D2BSym0 where
+      suppressUnusedWarnings = snd (((,) D2BSym0KindInference) ())
+    type D2BSym1 (a0123456789876543210 :: D2 (a :: GHC.Types.Type) (b :: GHC.Types.Type)) =
+        D2B a0123456789876543210 :: b
+    type D2ASym0 :: forall (a :: GHC.Types.Type) (b :: GHC.Types.Type).
+                    (~>) (D2 (a :: GHC.Types.Type) (b :: GHC.Types.Type)) a
+    data D2ASym0 a0123456789876543210
+      where
+        D2ASym0KindInference :: SameKind (Apply D2ASym0 arg) (D2ASym1 arg) =>
+                                D2ASym0 a0123456789876543210
+    type instance Apply D2ASym0 a0123456789876543210 = D2ASym1 a0123456789876543210
+    instance SuppressUnusedWarnings D2ASym0 where
+      suppressUnusedWarnings = snd (((,) D2ASym0KindInference) ())
+    type D2ASym1 (a0123456789876543210 :: D2 (a :: GHC.Types.Type) (b :: GHC.Types.Type)) =
+        D2A a0123456789876543210 :: a
+    type D2B :: forall (a :: GHC.Types.Type) (b :: GHC.Types.Type).
+                D2 (a :: GHC.Types.Type) (b :: GHC.Types.Type) -> b
+    type family D2B a where
+      D2B ('MkD2 _ field) = field
+    type D2A :: forall (a :: GHC.Types.Type) (b :: GHC.Types.Type).
+                D2 (a :: GHC.Types.Type) (b :: GHC.Types.Type) -> a
+    type family D2A a where
+      D2A ('MkD2 field _) = field
+    sD2B ::
+      forall (a :: GHC.Types.Type)
+             (b :: GHC.Types.Type)
+             (t :: D2 (a :: GHC.Types.Type) (b :: GHC.Types.Type)).
+      Sing t -> Sing (Apply D2BSym0 t :: b)
+    sD2A ::
+      forall (a :: GHC.Types.Type)
+             (b :: GHC.Types.Type)
+             (t :: D2 (a :: GHC.Types.Type) (b :: GHC.Types.Type)).
+      Sing t -> Sing (Apply D2ASym0 t :: a)
+    sD2B (SMkD2 _ (sField :: Sing field)) = sField
+    sD2A (SMkD2 (sField :: Sing field) _) = sField
+    instance SingI (D2BSym0 :: (~>) (D2 (a :: GHC.Types.Type) (b :: GHC.Types.Type)) b) where
+      sing = (singFun1 @D2BSym0) sD2B
+    instance SingI (D2ASym0 :: (~>) (D2 (a :: GHC.Types.Type) (b :: GHC.Types.Type)) a) where
+      sing = (singFun1 @D2ASym0) sD2A
+    type SD2 :: forall (a :: GHC.Types.Type) (b :: GHC.Types.Type).
+                D2 (a :: GHC.Types.Type) (b :: GHC.Types.Type) -> GHC.Types.Type
+    data SD2 z
+      where
+        SMkD2 :: forall (a :: GHC.Types.Type)
+                        (b :: GHC.Types.Type)
+                        (n :: a)
+                        (n :: b).
+                 (Sing n)
+                 -> (Sing n)
+                    -> SD2 ('MkD2 n n :: D2 (a :: GHC.Types.Type) (b :: GHC.Types.Type))
+    type instance Sing @(D2 a b) = SD2
+    instance (SingKind a, SingKind b) => SingKind (D2 a b) where
+      type Demote (D2 a b) = D2 (Demote a) (Demote b)
+      fromSing (SMkD2 b b) = (MkD2 (fromSing b)) (fromSing b)
+      toSing (MkD2 (b :: Demote a) (b :: Demote b))
+        = case ((,) (toSing b :: SomeSing a)) (toSing b :: SomeSing b) of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SMkD2 c) c) }
+    infixr 5 `SMkD2`
+    infixr 5 `sD2A`
+    infixr 5 `sD2B`
+    instance (SingI n, SingI n) =>
+             SingI ('MkD2 (n :: a) (n :: b)) where
+      sing = (SMkD2 sing) sing
+    instance SingI (MkD2Sym0 :: (~>) a ((~>) b (D2 (a :: GHC.Types.Type) (b :: GHC.Types.Type)))) where
+      sing = (singFun2 @MkD2Sym0) SMkD2
+    instance SingI d =>
+             SingI (MkD2Sym1 (d :: a) :: (~>) b (D2 (a :: GHC.Types.Type) (b :: GHC.Types.Type))) where
+      sing = (singFun1 @(MkD2Sym1 (d :: a))) (SMkD2 (sing @d))
diff --git a/tests/compile-and-dump/Singletons/T412.hs b/tests/compile-and-dump/Singletons/T412.hs
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T412.hs
@@ -0,0 +1,33 @@
+module T412 where
+
+import Data.Singletons.TH
+
+$(singletons [d|
+  infix 5 `C1`
+  class C1 a b where
+    infix 6 `m1`
+    m1 :: a -> b -> Bool
+
+  infixl 5 `T1a`, `T1b`
+  type T1a a b = Either a b
+  type family T1b a b where
+    T1b a b = Either a b
+
+  infixr 5 `D1`, `MkD1`, `d1A`, `d1B`
+  data D1 a b = MkD1 { d1A :: a, d1B :: b }
+  |])
+
+infix 5 `C2`
+class C2 a b where
+  infix 6 `m2`
+  m2 :: a -> b -> Bool
+
+infixl 5 `T2a`, `T2b`
+type T2a a b = Either a b
+type family T2b a b where
+  T2b a b = Either a b
+
+infixr 5 `D2`, `MkD2`, `d2A`, `d2B`
+data D2 a b = MkD2 { d2A :: a, d2B :: b }
+
+$(genSingletons [''C2, ''T2a, ''T2b, ''D2])
diff --git a/tests/compile-and-dump/Singletons/T414.golden b/tests/compile-and-dump/Singletons/T414.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T414.golden
@@ -0,0 +1,76 @@
+Singletons/T414.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| type C3 :: Bool -> Constraint
+          
+          class C1 (a :: Bool) where
+            type T1 a b
+          class C2 a where
+            type T2 a b
+          class C3 a where
+            type T3 a b |]
+  ======>
+    class C1 (a :: Bool) where
+      type T1 a b
+    class C2 a where
+      type T2 a b
+    type C3 :: Bool -> Constraint
+    class C3 a where
+      type T3 a b
+    data T1Sym0 a0123456789876543210
+      where
+        T1Sym0KindInference :: SameKind (Apply T1Sym0 arg) (T1Sym1 arg) =>
+                               T1Sym0 a0123456789876543210
+    type instance Apply T1Sym0 a0123456789876543210 = T1Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings T1Sym0 where
+      suppressUnusedWarnings = snd (((,) T1Sym0KindInference) ())
+    data T1Sym1 (a0123456789876543210 :: Bool) b0123456789876543210
+      where
+        T1Sym1KindInference :: SameKind (Apply (T1Sym1 a0123456789876543210) arg) (T1Sym2 a0123456789876543210 arg) =>
+                               T1Sym1 a0123456789876543210 b0123456789876543210
+    type instance Apply (T1Sym1 a0123456789876543210) b0123456789876543210 = T1Sym2 a0123456789876543210 b0123456789876543210
+    instance SuppressUnusedWarnings (T1Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) T1Sym1KindInference) ())
+    type T1Sym2 (a0123456789876543210 :: Bool) b0123456789876543210 =
+        T1 a0123456789876543210 b0123456789876543210
+    class PC1 (a :: Bool)
+    data T2Sym0 a0123456789876543210
+      where
+        T2Sym0KindInference :: SameKind (Apply T2Sym0 arg) (T2Sym1 arg) =>
+                               T2Sym0 a0123456789876543210
+    type instance Apply T2Sym0 a0123456789876543210 = T2Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings T2Sym0 where
+      suppressUnusedWarnings = snd (((,) T2Sym0KindInference) ())
+    data T2Sym1 a0123456789876543210 b0123456789876543210
+      where
+        T2Sym1KindInference :: SameKind (Apply (T2Sym1 a0123456789876543210) arg) (T2Sym2 a0123456789876543210 arg) =>
+                               T2Sym1 a0123456789876543210 b0123456789876543210
+    type instance Apply (T2Sym1 a0123456789876543210) b0123456789876543210 = T2Sym2 a0123456789876543210 b0123456789876543210
+    instance SuppressUnusedWarnings (T2Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) T2Sym1KindInference) ())
+    type T2Sym2 a0123456789876543210 b0123456789876543210 =
+        T2 a0123456789876543210 b0123456789876543210
+    class PC2 a
+    type T3Sym0 :: (~>) Bool ((~>) Type Type)
+    data T3Sym0 a0123456789876543210
+      where
+        T3Sym0KindInference :: SameKind (Apply T3Sym0 arg) (T3Sym1 arg) =>
+                               T3Sym0 a0123456789876543210
+    type instance Apply T3Sym0 a0123456789876543210 = T3Sym1 a0123456789876543210
+    instance SuppressUnusedWarnings T3Sym0 where
+      suppressUnusedWarnings = snd (((,) T3Sym0KindInference) ())
+    type T3Sym1 :: Bool -> (~>) Type Type
+    data T3Sym1 a0123456789876543210 a0123456789876543210
+      where
+        T3Sym1KindInference :: SameKind (Apply (T3Sym1 a0123456789876543210) arg) (T3Sym2 a0123456789876543210 arg) =>
+                               T3Sym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (T3Sym1 a0123456789876543210) a0123456789876543210 = T3Sym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (T3Sym1 a0123456789876543210) where
+      suppressUnusedWarnings = snd (((,) T3Sym1KindInference) ())
+    type T3Sym2 (a0123456789876543210 :: Bool) (a0123456789876543210 :: Type) =
+        T3 a0123456789876543210 a0123456789876543210 :: Type
+    type PC3 :: Bool -> Constraint
+    class PC3 a
+    class SC1 (a :: Bool)
+    class SC2 a
+    class SC3 a
+    type SC3 :: Bool -> Constraint
diff --git a/tests/compile-and-dump/Singletons/T414.hs b/tests/compile-and-dump/Singletons/T414.hs
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T414.hs
@@ -0,0 +1,16 @@
+module T414 where
+
+import Data.Kind
+import Data.Singletons.TH
+
+$(singletons [d|
+  class C1 (a :: Bool) where
+    type T1 a b
+
+  class C2 a where
+    type T2 a b
+
+  type C3 :: Bool -> Constraint
+  class C3 a where
+    type T3 a b
+  |])
diff --git a/tests/compile-and-dump/Singletons/T54.ghc88.template b/tests/compile-and-dump/Singletons/T54.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T54.ghc88.template
+++ /dev/null
@@ -1,55 +0,0 @@
-Singletons/T54.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| g :: Bool -> Bool
-          g e = (case [not] of { [_] -> not }) e |]
-  ======>
-    g :: Bool -> Bool
-    g e = (case [not] of { [_] -> not }) e
-    type Let0123456789876543210Scrutinee_0123456789876543210Sym1 e0123456789876543210 =
-        Let0123456789876543210Scrutinee_0123456789876543210 e0123456789876543210
-    instance SuppressUnusedWarnings Let0123456789876543210Scrutinee_0123456789876543210Sym0 where
-      suppressUnusedWarnings
-        = snd
-            (((,)
-                Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference)
-               ())
-    data Let0123456789876543210Scrutinee_0123456789876543210Sym0 e0123456789876543210
-      where
-        Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference :: forall e0123456789876543210
-                                                                                       arg. SameKind (Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym1 arg) =>
-                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym0 e0123456789876543210
-    type instance Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 e0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210 e0123456789876543210
-    type family Let0123456789876543210Scrutinee_0123456789876543210 e where
-      Let0123456789876543210Scrutinee_0123456789876543210 e = Apply (Apply (:@#@$) NotSym0) '[]
-    type family Case_0123456789876543210 e t where
-      Case_0123456789876543210 e '[_] = NotSym0
-    type GSym1 (a0123456789876543210 :: Bool) = G a0123456789876543210
-    instance SuppressUnusedWarnings GSym0 where
-      suppressUnusedWarnings = snd (((,) GSym0KindInference) ())
-    data GSym0 :: (~>) Bool Bool
-      where
-        GSym0KindInference :: forall a0123456789876543210
-                                     arg. SameKind (Apply GSym0 arg) (GSym1 arg) =>
-                              GSym0 a0123456789876543210
-    type instance Apply GSym0 a0123456789876543210 = G a0123456789876543210
-    type family G (a :: Bool) :: Bool where
-      G e = Apply (Case_0123456789876543210 e (Let0123456789876543210Scrutinee_0123456789876543210Sym1 e)) e
-    sG :: forall (t :: Bool). Sing t -> Sing (Apply GSym0 t :: Bool)
-    sG (sE :: Sing e)
-      = (applySing
-           (let
-              sScrutinee_0123456789876543210 ::
-                Sing (Let0123456789876543210Scrutinee_0123456789876543210Sym1 e)
-              sScrutinee_0123456789876543210
-                = (applySing
-                     ((applySing ((singFun2 @(:@#@$)) SCons))
-                        ((singFun1 @NotSym0) sNot)))
-                    SNil
-            in
-              (id
-                 @(Sing (Case_0123456789876543210 e (Let0123456789876543210Scrutinee_0123456789876543210Sym1 e))))
-                (case sScrutinee_0123456789876543210 of {
-                   SCons _ SNil -> (singFun1 @NotSym0) sNot })))
-          sE
-    instance SingI (GSym0 :: (~>) Bool Bool) where
-      sing = (singFun1 @GSym0) sG
diff --git a/tests/compile-and-dump/Singletons/T54.golden b/tests/compile-and-dump/Singletons/T54.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T54.golden
@@ -0,0 +1,56 @@
+Singletons/T54.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| g :: Bool -> Bool
+          g e = (case [not] of { [_] -> not }) e |]
+  ======>
+    g :: Bool -> Bool
+    g e = (case [not] of { [_] -> not }) e
+    data Let0123456789876543210Scrutinee_0123456789876543210Sym0 e0123456789876543210
+      where
+        Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference :: SameKind (Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 arg) (Let0123456789876543210Scrutinee_0123456789876543210Sym1 arg) =>
+                                                                                Let0123456789876543210Scrutinee_0123456789876543210Sym0 e0123456789876543210
+    type instance Apply Let0123456789876543210Scrutinee_0123456789876543210Sym0 e0123456789876543210 = Let0123456789876543210Scrutinee_0123456789876543210Sym1 e0123456789876543210
+    instance SuppressUnusedWarnings Let0123456789876543210Scrutinee_0123456789876543210Sym0 where
+      suppressUnusedWarnings
+        = snd
+            (((,)
+                Let0123456789876543210Scrutinee_0123456789876543210Sym0KindInference)
+               ())
+    type Let0123456789876543210Scrutinee_0123456789876543210Sym1 e0123456789876543210 =
+        Let0123456789876543210Scrutinee_0123456789876543210 e0123456789876543210
+    type family Let0123456789876543210Scrutinee_0123456789876543210 e where
+      Let0123456789876543210Scrutinee_0123456789876543210 e = Apply (Apply (:@#@$) NotSym0) NilSym0
+    type family Case_0123456789876543210 e t where
+      Case_0123456789876543210 e '[_] = NotSym0
+    type GSym0 :: (~>) Bool Bool
+    data GSym0 a0123456789876543210
+      where
+        GSym0KindInference :: SameKind (Apply GSym0 arg) (GSym1 arg) =>
+                              GSym0 a0123456789876543210
+    type instance Apply GSym0 a0123456789876543210 = GSym1 a0123456789876543210
+    instance SuppressUnusedWarnings GSym0 where
+      suppressUnusedWarnings = snd (((,) GSym0KindInference) ())
+    type GSym1 (a0123456789876543210 :: Bool) =
+        G a0123456789876543210 :: Bool
+    type G :: Bool -> Bool
+    type family G a where
+      G e = Apply (Case_0123456789876543210 e (Let0123456789876543210Scrutinee_0123456789876543210Sym1 e)) e
+    sG :: forall (t :: Bool). Sing t -> Sing (Apply GSym0 t :: Bool)
+    sG (sE :: Sing e)
+      = (applySing
+           (let
+              sScrutinee_0123456789876543210 ::
+                Sing @_ (Let0123456789876543210Scrutinee_0123456789876543210Sym1 e)
+              sScrutinee_0123456789876543210
+                = (applySing
+                     ((applySing ((singFun2 @(:@#@$)) SCons))
+                        ((singFun1 @NotSym0) sNot)))
+                    SNil
+            in
+              (id
+                 @(Sing (Case_0123456789876543210 e (Let0123456789876543210Scrutinee_0123456789876543210Sym1 e))))
+                (case sScrutinee_0123456789876543210 of {
+                   SCons _ SNil -> (singFun1 @NotSym0) sNot })))
+          sE
+    instance SingI (GSym0 :: (~>) Bool Bool) where
+      sing = (singFun1 @GSym0) sG
diff --git a/tests/compile-and-dump/Singletons/T78.ghc88.template b/tests/compile-and-dump/Singletons/T78.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/T78.ghc88.template
+++ /dev/null
@@ -1,32 +0,0 @@
-Singletons/T78.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| foo :: MaybeBool -> Bool
-          foo (Just False) = False
-          foo (Just True) = True
-          foo Nothing = False |]
-  ======>
-    foo :: MaybeBool -> Bool
-    foo (Just False) = False
-    foo (Just True) = True
-    foo Nothing = False
-    type FooSym1 (a0123456789876543210 :: Maybe Bool) =
-        Foo a0123456789876543210
-    instance SuppressUnusedWarnings FooSym0 where
-      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
-    data FooSym0 :: (~>) (Maybe Bool) Bool
-      where
-        FooSym0KindInference :: forall a0123456789876543210
-                                       arg. SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
-                                FooSym0 a0123456789876543210
-    type instance Apply FooSym0 a0123456789876543210 = Foo a0123456789876543210
-    type family Foo (a :: Maybe Bool) :: Bool where
-      Foo ('Just 'False) = FalseSym0
-      Foo ('Just 'True) = TrueSym0
-      Foo 'Nothing = FalseSym0
-    sFoo ::
-      forall (t :: Maybe Bool). Sing t -> Sing (Apply FooSym0 t :: Bool)
-    sFoo (SJust SFalse) = SFalse
-    sFoo (SJust STrue) = STrue
-    sFoo SNothing = SFalse
-    instance SingI (FooSym0 :: (~>) (Maybe Bool) Bool) where
-      sing = (singFun1 @FooSym0) sFoo
diff --git a/tests/compile-and-dump/Singletons/T78.golden b/tests/compile-and-dump/Singletons/T78.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/T78.golden
@@ -0,0 +1,33 @@
+Singletons/T78.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| foo :: MaybeBool -> Bool
+          foo (Just False) = False
+          foo (Just True) = True
+          foo Nothing = False |]
+  ======>
+    foo :: MaybeBool -> Bool
+    foo (Just False) = False
+    foo (Just True) = True
+    foo Nothing = False
+    type FooSym0 :: (~>) (Maybe Bool) Bool
+    data FooSym0 a0123456789876543210
+      where
+        FooSym0KindInference :: SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
+                                FooSym0 a0123456789876543210
+    type instance Apply FooSym0 a0123456789876543210 = FooSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FooSym0 where
+      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
+    type FooSym1 (a0123456789876543210 :: Maybe Bool) =
+        Foo a0123456789876543210 :: Bool
+    type Foo :: Maybe Bool -> Bool
+    type family Foo a where
+      Foo ('Just 'False) = FalseSym0
+      Foo ('Just 'True) = TrueSym0
+      Foo 'Nothing = FalseSym0
+    sFoo ::
+      forall (t :: Maybe Bool). Sing t -> Sing (Apply FooSym0 t :: Bool)
+    sFoo (SJust SFalse) = SFalse
+    sFoo (SJust STrue) = STrue
+    sFoo SNothing = SFalse
+    instance SingI (FooSym0 :: (~>) (Maybe Bool) Bool) where
+      sing = (singFun1 @FooSym0) sFoo
diff --git a/tests/compile-and-dump/Singletons/TopLevelPatterns.ghc88.template b/tests/compile-and-dump/Singletons/TopLevelPatterns.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/TopLevelPatterns.ghc88.template
+++ /dev/null
@@ -1,350 +0,0 @@
-Singletons/TopLevelPatterns.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| data Bool = False | True
-          data Foo = Bar Bool Bool |]
-  ======>
-    data Bool = False | True
-    data Foo = Bar Bool Bool
-    type FalseSym0 = False
-    type TrueSym0 = True
-    type BarSym2 (t0123456789876543210 :: Bool) (t0123456789876543210 :: Bool) =
-        Bar t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings (BarSym1 t0123456789876543210) where
-      suppressUnusedWarnings
-        = Data.Tuple.snd (((,) BarSym1KindInference) ())
-    data BarSym1 (t0123456789876543210 :: Bool) :: (~>) Bool Foo
-      where
-        BarSym1KindInference :: forall t0123456789876543210
-                                       t0123456789876543210
-                                       arg. SameKind (Apply (BarSym1 t0123456789876543210) arg) (BarSym2 t0123456789876543210 arg) =>
-                                BarSym1 t0123456789876543210 t0123456789876543210
-    type instance Apply (BarSym1 t0123456789876543210) t0123456789876543210 = Bar t0123456789876543210 t0123456789876543210
-    instance SuppressUnusedWarnings BarSym0 where
-      suppressUnusedWarnings
-        = Data.Tuple.snd (((,) BarSym0KindInference) ())
-    data BarSym0 :: (~>) Bool ((~>) Bool Foo)
-      where
-        BarSym0KindInference :: forall t0123456789876543210
-                                       arg. SameKind (Apply BarSym0 arg) (BarSym1 arg) =>
-                                BarSym0 t0123456789876543210
-    type instance Apply BarSym0 t0123456789876543210 = BarSym1 t0123456789876543210
-    data SBool :: Bool -> GHC.Types.Type
-      where
-        SFalse :: SBool False
-        STrue :: SBool True
-    type instance Sing @Bool = SBool
-    instance SingKind Bool where
-      type Demote Bool = Bool
-      fromSing SFalse = False
-      fromSing STrue = True
-      toSing False = SomeSing SFalse
-      toSing True = SomeSing STrue
-    data SFoo :: Foo -> GHC.Types.Type
-      where
-        SBar :: forall (n :: Bool) (n :: Bool).
-                (Sing (n :: Bool)) -> (Sing (n :: Bool)) -> SFoo (Bar n n)
-    type instance Sing @Foo = SFoo
-    instance SingKind Foo where
-      type Demote Foo = Foo
-      fromSing (SBar b b) = (Bar (fromSing b)) (fromSing b)
-      toSing (Bar (b :: Demote Bool) (b :: Demote Bool))
-        = case
-              ((,) (toSing b :: SomeSing Bool)) (toSing b :: SomeSing Bool)
-          of {
-            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SBar c) c) }
-    instance SingI False where
-      sing = SFalse
-    instance SingI True where
-      sing = STrue
-    instance (SingI n, SingI n) =>
-             SingI (Bar (n :: Bool) (n :: Bool)) where
-      sing = (SBar sing) sing
-    instance SingI (BarSym0 :: (~>) Bool ((~>) Bool Foo)) where
-      sing = (singFun2 @BarSym0) SBar
-    instance SingI d =>
-             SingI (BarSym1 (d :: Bool) :: (~>) Bool Foo) where
-      sing = (singFun1 @(BarSym1 (d :: Bool))) (SBar (sing @d))
-Singletons/TopLevelPatterns.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| otherwise :: Bool
-          otherwise = True
-          id :: a -> a
-          id x = x
-          not :: Bool -> Bool
-          not True = False
-          not False = True
-          false_ = False
-          f, g :: Bool -> Bool
-          [f, g] = [not, id]
-          h, i :: Bool -> Bool
-          (h, i) = (f, g)
-          j, k :: Bool
-          (Bar j k) = Bar True (h False)
-          l, m :: Bool
-          [l, m] = [not True, id False] |]
-  ======>
-    otherwise :: Bool
-    otherwise = True
-    id :: a -> a
-    id x = x
-    not :: Bool -> Bool
-    not True = False
-    not False = True
-    false_ = False
-    f :: Bool -> Bool
-    g :: Bool -> Bool
-    [f, g] = [not, id]
-    h :: Bool -> Bool
-    i :: Bool -> Bool
-    (h, i) = (f, g)
-    j :: Bool
-    k :: Bool
-    Bar j k = (Bar True) (h False)
-    l :: Bool
-    m :: Bool
-    [l, m] = [not True, id False]
-    type family Case_0123456789876543210 t where
-      Case_0123456789876543210 '[_,
-                                 y_0123456789876543210] = y_0123456789876543210
-    type family Case_0123456789876543210 t where
-      Case_0123456789876543210 '[y_0123456789876543210,
-                                 _] = y_0123456789876543210
-    type family Case_0123456789876543210 t where
-      Case_0123456789876543210 ('Bar _ y_0123456789876543210) = y_0123456789876543210
-    type family Case_0123456789876543210 t where
-      Case_0123456789876543210 ('Bar y_0123456789876543210 _) = y_0123456789876543210
-    type family Case_0123456789876543210 a_0123456789876543210 t where
-      Case_0123456789876543210 a_0123456789876543210 '(_,
-                                                       y_0123456789876543210) = y_0123456789876543210
-    type family Case_0123456789876543210 a_0123456789876543210 t where
-      Case_0123456789876543210 a_0123456789876543210 '(y_0123456789876543210,
-                                                       _) = y_0123456789876543210
-    type family Case_0123456789876543210 a_0123456789876543210 t where
-      Case_0123456789876543210 a_0123456789876543210 '[_,
-                                                       y_0123456789876543210] = y_0123456789876543210
-    type family Case_0123456789876543210 a_0123456789876543210 t where
-      Case_0123456789876543210 a_0123456789876543210 '[y_0123456789876543210,
-                                                       _] = y_0123456789876543210
-    type MSym0 = M
-    type LSym0 = L
-    type X_0123456789876543210Sym0 = X_0123456789876543210
-    type KSym0 = K
-    type JSym0 = J
-    type X_0123456789876543210Sym0 = X_0123456789876543210
-    type ISym1 (a0123456789876543210 :: Bool) = I a0123456789876543210
-    instance SuppressUnusedWarnings ISym0 where
-      suppressUnusedWarnings
-        = Data.Tuple.snd (((,) ISym0KindInference) ())
-    data ISym0 :: (~>) Bool Bool
-      where
-        ISym0KindInference :: forall a0123456789876543210
-                                     arg. SameKind (Apply ISym0 arg) (ISym1 arg) =>
-                              ISym0 a0123456789876543210
-    type instance Apply ISym0 a0123456789876543210 = I a0123456789876543210
-    type HSym1 (a0123456789876543210 :: Bool) = H a0123456789876543210
-    instance SuppressUnusedWarnings HSym0 where
-      suppressUnusedWarnings
-        = Data.Tuple.snd (((,) HSym0KindInference) ())
-    data HSym0 :: (~>) Bool Bool
-      where
-        HSym0KindInference :: forall a0123456789876543210
-                                     arg. SameKind (Apply HSym0 arg) (HSym1 arg) =>
-                              HSym0 a0123456789876543210
-    type instance Apply HSym0 a0123456789876543210 = H a0123456789876543210
-    type X_0123456789876543210Sym0 = X_0123456789876543210
-    type GSym1 (a0123456789876543210 :: Bool) = G a0123456789876543210
-    instance SuppressUnusedWarnings GSym0 where
-      suppressUnusedWarnings
-        = Data.Tuple.snd (((,) GSym0KindInference) ())
-    data GSym0 :: (~>) Bool Bool
-      where
-        GSym0KindInference :: forall a0123456789876543210
-                                     arg. SameKind (Apply GSym0 arg) (GSym1 arg) =>
-                              GSym0 a0123456789876543210
-    type instance Apply GSym0 a0123456789876543210 = G a0123456789876543210
-    type FSym1 (a0123456789876543210 :: Bool) = F a0123456789876543210
-    instance SuppressUnusedWarnings FSym0 where
-      suppressUnusedWarnings
-        = Data.Tuple.snd (((,) FSym0KindInference) ())
-    data FSym0 :: (~>) Bool Bool
-      where
-        FSym0KindInference :: forall a0123456789876543210
-                                     arg. SameKind (Apply FSym0 arg) (FSym1 arg) =>
-                              FSym0 a0123456789876543210
-    type instance Apply FSym0 a0123456789876543210 = F a0123456789876543210
-    type X_0123456789876543210Sym0 = X_0123456789876543210
-    type False_Sym0 = False_
-    type NotSym1 (a0123456789876543210 :: Bool) =
-        Not a0123456789876543210
-    instance SuppressUnusedWarnings NotSym0 where
-      suppressUnusedWarnings
-        = Data.Tuple.snd (((,) NotSym0KindInference) ())
-    data NotSym0 :: (~>) Bool Bool
-      where
-        NotSym0KindInference :: forall a0123456789876543210
-                                       arg. SameKind (Apply NotSym0 arg) (NotSym1 arg) =>
-                                NotSym0 a0123456789876543210
-    type instance Apply NotSym0 a0123456789876543210 = Not a0123456789876543210
-    type IdSym1 (a0123456789876543210 :: a0123456789876543210) =
-        Id a0123456789876543210
-    instance SuppressUnusedWarnings IdSym0 where
-      suppressUnusedWarnings
-        = Data.Tuple.snd (((,) IdSym0KindInference) ())
-    data IdSym0 :: forall a0123456789876543210.
-                   (~>) a0123456789876543210 a0123456789876543210
-      where
-        IdSym0KindInference :: forall a0123456789876543210
-                                      arg. SameKind (Apply IdSym0 arg) (IdSym1 arg) =>
-                               IdSym0 a0123456789876543210
-    type instance Apply IdSym0 a0123456789876543210 = Id a0123456789876543210
-    type OtherwiseSym0 = Otherwise
-    type family M :: Bool where
-      M = Case_0123456789876543210 X_0123456789876543210Sym0
-    type family L :: Bool where
-      L = Case_0123456789876543210 X_0123456789876543210Sym0
-    type family X_0123456789876543210 where
-      X_0123456789876543210 = Apply (Apply (:@#@$) (Apply NotSym0 TrueSym0)) (Apply (Apply (:@#@$) (Apply IdSym0 FalseSym0)) '[])
-    type family K :: Bool where
-      K = Case_0123456789876543210 X_0123456789876543210Sym0
-    type family J :: Bool where
-      J = Case_0123456789876543210 X_0123456789876543210Sym0
-    type family X_0123456789876543210 where
-      X_0123456789876543210 = Apply (Apply BarSym0 TrueSym0) (Apply HSym0 FalseSym0)
-    type family I (a :: Bool) :: Bool where
-      I a_0123456789876543210 = Apply (Case_0123456789876543210 a_0123456789876543210 X_0123456789876543210Sym0) a_0123456789876543210
-    type family H (a :: Bool) :: Bool where
-      H a_0123456789876543210 = Apply (Case_0123456789876543210 a_0123456789876543210 X_0123456789876543210Sym0) a_0123456789876543210
-    type family X_0123456789876543210 where
-      X_0123456789876543210 = Apply (Apply Tuple2Sym0 FSym0) GSym0
-    type family G (a :: Bool) :: Bool where
-      G a_0123456789876543210 = Apply (Case_0123456789876543210 a_0123456789876543210 X_0123456789876543210Sym0) a_0123456789876543210
-    type family F (a :: Bool) :: Bool where
-      F a_0123456789876543210 = Apply (Case_0123456789876543210 a_0123456789876543210 X_0123456789876543210Sym0) a_0123456789876543210
-    type family X_0123456789876543210 where
-      X_0123456789876543210 = Apply (Apply (:@#@$) NotSym0) (Apply (Apply (:@#@$) IdSym0) '[])
-    type family False_ where
-      False_ = FalseSym0
-    type family Not (a :: Bool) :: Bool where
-      Not 'True = FalseSym0
-      Not 'False = TrueSym0
-    type family Id (a :: a) :: a where
-      Id x = x
-    type family Otherwise :: Bool where
-      Otherwise = TrueSym0
-    sM :: Sing (MSym0 :: Bool)
-    sL :: Sing (LSym0 :: Bool)
-    sX_0123456789876543210 :: Sing X_0123456789876543210Sym0
-    sK :: Sing (KSym0 :: Bool)
-    sJ :: Sing (JSym0 :: Bool)
-    sX_0123456789876543210 :: Sing X_0123456789876543210Sym0
-    sI :: forall (t :: Bool). Sing t -> Sing (Apply ISym0 t :: Bool)
-    sH :: forall (t :: Bool). Sing t -> Sing (Apply HSym0 t :: Bool)
-    sX_0123456789876543210 :: Sing X_0123456789876543210Sym0
-    sG :: forall (t :: Bool). Sing t -> Sing (Apply GSym0 t :: Bool)
-    sF :: forall (t :: Bool). Sing t -> Sing (Apply FSym0 t :: Bool)
-    sX_0123456789876543210 :: Sing X_0123456789876543210Sym0
-    sFalse_ :: Sing False_Sym0
-    sNot ::
-      forall (t :: Bool). Sing t -> Sing (Apply NotSym0 t :: Bool)
-    sId :: forall a (t :: a). Sing t -> Sing (Apply IdSym0 t :: a)
-    sOtherwise :: Sing (OtherwiseSym0 :: Bool)
-    sM
-      = (GHC.Base.id
-           @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0 :: Bool)))
-          (case sX_0123456789876543210 of {
-             SCons _
-                   (SCons (sY_0123456789876543210 :: Sing y_0123456789876543210) SNil)
-               -> sY_0123456789876543210 })
-    sL
-      = (GHC.Base.id
-           @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0 :: Bool)))
-          (case sX_0123456789876543210 of {
-             SCons (sY_0123456789876543210 :: Sing y_0123456789876543210)
-                   (SCons _ SNil)
-               -> sY_0123456789876543210 })
-    sX_0123456789876543210
-      = (applySing
-           ((applySing ((singFun2 @(:@#@$)) SCons))
-              ((applySing ((singFun1 @NotSym0) sNot)) STrue)))
-          ((applySing
-              ((applySing ((singFun2 @(:@#@$)) SCons))
-                 ((applySing ((singFun1 @IdSym0) sId)) SFalse)))
-             SNil)
-    sK
-      = (GHC.Base.id
-           @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0 :: Bool)))
-          (case sX_0123456789876543210 of {
-             SBar _ (sY_0123456789876543210 :: Sing y_0123456789876543210)
-               -> sY_0123456789876543210 })
-    sJ
-      = (GHC.Base.id
-           @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0 :: Bool)))
-          (case sX_0123456789876543210 of {
-             SBar (sY_0123456789876543210 :: Sing y_0123456789876543210) _
-               -> sY_0123456789876543210 })
-    sX_0123456789876543210
-      = (applySing ((applySing ((singFun2 @BarSym0) SBar)) STrue))
-          ((applySing ((singFun1 @HSym0) sH)) SFalse)
-    sI (sA_0123456789876543210 :: Sing a_0123456789876543210)
-      = (applySing
-           ((GHC.Base.id
-               @(Sing (Case_0123456789876543210 a_0123456789876543210 X_0123456789876543210Sym0)))
-              (case sX_0123456789876543210 of {
-                 STuple2 _ (sY_0123456789876543210 :: Sing y_0123456789876543210)
-                   -> sY_0123456789876543210 })))
-          sA_0123456789876543210
-    sH (sA_0123456789876543210 :: Sing a_0123456789876543210)
-      = (applySing
-           ((GHC.Base.id
-               @(Sing (Case_0123456789876543210 a_0123456789876543210 X_0123456789876543210Sym0)))
-              (case sX_0123456789876543210 of {
-                 STuple2 (sY_0123456789876543210 :: Sing y_0123456789876543210) _
-                   -> sY_0123456789876543210 })))
-          sA_0123456789876543210
-    sX_0123456789876543210
-      = (applySing
-           ((applySing ((singFun2 @Tuple2Sym0) STuple2))
-              ((singFun1 @FSym0) sF)))
-          ((singFun1 @GSym0) sG)
-    sG (sA_0123456789876543210 :: Sing a_0123456789876543210)
-      = (applySing
-           ((GHC.Base.id
-               @(Sing (Case_0123456789876543210 a_0123456789876543210 X_0123456789876543210Sym0)))
-              (case sX_0123456789876543210 of {
-                 SCons _
-                       (SCons (sY_0123456789876543210 :: Sing y_0123456789876543210) SNil)
-                   -> sY_0123456789876543210 })))
-          sA_0123456789876543210
-    sF (sA_0123456789876543210 :: Sing a_0123456789876543210)
-      = (applySing
-           ((GHC.Base.id
-               @(Sing (Case_0123456789876543210 a_0123456789876543210 X_0123456789876543210Sym0)))
-              (case sX_0123456789876543210 of {
-                 SCons (sY_0123456789876543210 :: Sing y_0123456789876543210)
-                       (SCons _ SNil)
-                   -> sY_0123456789876543210 })))
-          sA_0123456789876543210
-    sX_0123456789876543210
-      = (applySing
-           ((applySing ((singFun2 @(:@#@$)) SCons))
-              ((singFun1 @NotSym0) sNot)))
-          ((applySing
-              ((applySing ((singFun2 @(:@#@$)) SCons)) ((singFun1 @IdSym0) sId)))
-             SNil)
-    sFalse_ = SFalse
-    sNot STrue = SFalse
-    sNot SFalse = STrue
-    sId (sX :: Sing x) = sX
-    sOtherwise = STrue
-    instance SingI (ISym0 :: (~>) Bool Bool) where
-      sing = (singFun1 @ISym0) sI
-    instance SingI (HSym0 :: (~>) Bool Bool) where
-      sing = (singFun1 @HSym0) sH
-    instance SingI (GSym0 :: (~>) Bool Bool) where
-      sing = (singFun1 @GSym0) sG
-    instance SingI (FSym0 :: (~>) Bool Bool) where
-      sing = (singFun1 @FSym0) sF
-    instance SingI (NotSym0 :: (~>) Bool Bool) where
-      sing = (singFun1 @NotSym0) sNot
-    instance SingI (IdSym0 :: (~>) a a) where
-      sing = (singFun1 @IdSym0) sId
diff --git a/tests/compile-and-dump/Singletons/TopLevelPatterns.golden b/tests/compile-and-dump/Singletons/TopLevelPatterns.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/TopLevelPatterns.golden
@@ -0,0 +1,363 @@
+Singletons/TopLevelPatterns.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| data Bool = False | True
+          data Foo = Bar Bool Bool |]
+  ======>
+    data Bool = False | True
+    data Foo = Bar Bool Bool
+    type FalseSym0 = False :: Bool
+    type TrueSym0 = True :: Bool
+    type BarSym0 :: (~>) Bool ((~>) Bool Foo)
+    data BarSym0 a0123456789876543210
+      where
+        BarSym0KindInference :: SameKind (Apply BarSym0 arg) (BarSym1 arg) =>
+                                BarSym0 a0123456789876543210
+    type instance Apply BarSym0 a0123456789876543210 = BarSym1 a0123456789876543210
+    instance SuppressUnusedWarnings BarSym0 where
+      suppressUnusedWarnings
+        = Data.Tuple.snd (((,) BarSym0KindInference) ())
+    type BarSym1 :: Bool -> (~>) Bool Foo
+    data BarSym1 a0123456789876543210 a0123456789876543210
+      where
+        BarSym1KindInference :: SameKind (Apply (BarSym1 a0123456789876543210) arg) (BarSym2 a0123456789876543210 arg) =>
+                                BarSym1 a0123456789876543210 a0123456789876543210
+    type instance Apply (BarSym1 a0123456789876543210) a0123456789876543210 = BarSym2 a0123456789876543210 a0123456789876543210
+    instance SuppressUnusedWarnings (BarSym1 a0123456789876543210) where
+      suppressUnusedWarnings
+        = Data.Tuple.snd (((,) BarSym1KindInference) ())
+    type BarSym2 (a0123456789876543210 :: Bool) (a0123456789876543210 :: Bool) =
+        Bar a0123456789876543210 a0123456789876543210 :: Foo
+    data SBool :: Bool -> GHC.Types.Type
+      where
+        SFalse :: SBool (False :: Bool)
+        STrue :: SBool (True :: Bool)
+    type instance Sing @Bool = SBool
+    instance SingKind Bool where
+      type Demote Bool = Bool
+      fromSing SFalse = False
+      fromSing STrue = True
+      toSing False = SomeSing SFalse
+      toSing True = SomeSing STrue
+    data SFoo :: Foo -> GHC.Types.Type
+      where
+        SBar :: forall (n :: Bool) (n :: Bool).
+                (Sing n) -> (Sing n) -> SFoo (Bar n n :: Foo)
+    type instance Sing @Foo = SFoo
+    instance SingKind Foo where
+      type Demote Foo = Foo
+      fromSing (SBar b b) = (Bar (fromSing b)) (fromSing b)
+      toSing (Bar (b :: Demote Bool) (b :: Demote Bool))
+        = case
+              ((,) (toSing b :: SomeSing Bool)) (toSing b :: SomeSing Bool)
+          of {
+            (,) (SomeSing c) (SomeSing c) -> SomeSing ((SBar c) c) }
+    instance SingI False where
+      sing = SFalse
+    instance SingI True where
+      sing = STrue
+    instance (SingI n, SingI n) =>
+             SingI (Bar (n :: Bool) (n :: Bool)) where
+      sing = (SBar sing) sing
+    instance SingI (BarSym0 :: (~>) Bool ((~>) Bool Foo)) where
+      sing = (singFun2 @BarSym0) SBar
+    instance SingI d =>
+             SingI (BarSym1 (d :: Bool) :: (~>) Bool Foo) where
+      sing = (singFun1 @(BarSym1 (d :: Bool))) (SBar (sing @d))
+Singletons/TopLevelPatterns.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| otherwise :: Bool
+          otherwise = True
+          id :: a -> a
+          id x = x
+          not :: Bool -> Bool
+          not True = False
+          not False = True
+          false_ = False
+          f, g :: Bool -> Bool
+          [f, g] = [not, id]
+          h, i :: Bool -> Bool
+          (h, i) = (f, g)
+          j, k :: Bool
+          (Bar j k) = Bar True (h False)
+          l, m :: Bool
+          [l, m] = [not True, id False] |]
+  ======>
+    otherwise :: Bool
+    otherwise = True
+    id :: a -> a
+    id x = x
+    not :: Bool -> Bool
+    not True = False
+    not False = True
+    false_ = False
+    f :: Bool -> Bool
+    g :: Bool -> Bool
+    [f, g] = [not, id]
+    h :: Bool -> Bool
+    i :: Bool -> Bool
+    (h, i) = (f, g)
+    j :: Bool
+    k :: Bool
+    Bar j k = (Bar True) (h False)
+    l :: Bool
+    m :: Bool
+    [l, m] = [not True, id False]
+    type family Case_0123456789876543210 t where
+      Case_0123456789876543210 '[_,
+                                 y_0123456789876543210] = y_0123456789876543210
+    type family Case_0123456789876543210 t where
+      Case_0123456789876543210 '[y_0123456789876543210,
+                                 _] = y_0123456789876543210
+    type family Case_0123456789876543210 t where
+      Case_0123456789876543210 ('Bar _ y_0123456789876543210) = y_0123456789876543210
+    type family Case_0123456789876543210 t where
+      Case_0123456789876543210 ('Bar y_0123456789876543210 _) = y_0123456789876543210
+    type family Case_0123456789876543210 a_0123456789876543210 t where
+      Case_0123456789876543210 a_0123456789876543210 '(_,
+                                                       y_0123456789876543210) = y_0123456789876543210
+    type family Case_0123456789876543210 a_0123456789876543210 t where
+      Case_0123456789876543210 a_0123456789876543210 '(y_0123456789876543210,
+                                                       _) = y_0123456789876543210
+    type family Case_0123456789876543210 a_0123456789876543210 t where
+      Case_0123456789876543210 a_0123456789876543210 '[_,
+                                                       y_0123456789876543210] = y_0123456789876543210
+    type family Case_0123456789876543210 a_0123456789876543210 t where
+      Case_0123456789876543210 a_0123456789876543210 '[y_0123456789876543210,
+                                                       _] = y_0123456789876543210
+    type MSym0 = M :: Bool
+    type LSym0 = L :: Bool
+    type X_0123456789876543210Sym0 = X_0123456789876543210
+    type KSym0 = K :: Bool
+    type JSym0 = J :: Bool
+    type X_0123456789876543210Sym0 = X_0123456789876543210
+    type ISym0 :: (~>) Bool Bool
+    data ISym0 a0123456789876543210
+      where
+        ISym0KindInference :: SameKind (Apply ISym0 arg) (ISym1 arg) =>
+                              ISym0 a0123456789876543210
+    type instance Apply ISym0 a0123456789876543210 = ISym1 a0123456789876543210
+    instance SuppressUnusedWarnings ISym0 where
+      suppressUnusedWarnings
+        = Data.Tuple.snd (((,) ISym0KindInference) ())
+    type ISym1 (a0123456789876543210 :: Bool) =
+        I a0123456789876543210 :: Bool
+    type HSym0 :: (~>) Bool Bool
+    data HSym0 a0123456789876543210
+      where
+        HSym0KindInference :: SameKind (Apply HSym0 arg) (HSym1 arg) =>
+                              HSym0 a0123456789876543210
+    type instance Apply HSym0 a0123456789876543210 = HSym1 a0123456789876543210
+    instance SuppressUnusedWarnings HSym0 where
+      suppressUnusedWarnings
+        = Data.Tuple.snd (((,) HSym0KindInference) ())
+    type HSym1 (a0123456789876543210 :: Bool) =
+        H a0123456789876543210 :: Bool
+    type X_0123456789876543210Sym0 = X_0123456789876543210
+    type GSym0 :: (~>) Bool Bool
+    data GSym0 a0123456789876543210
+      where
+        GSym0KindInference :: SameKind (Apply GSym0 arg) (GSym1 arg) =>
+                              GSym0 a0123456789876543210
+    type instance Apply GSym0 a0123456789876543210 = GSym1 a0123456789876543210
+    instance SuppressUnusedWarnings GSym0 where
+      suppressUnusedWarnings
+        = Data.Tuple.snd (((,) GSym0KindInference) ())
+    type GSym1 (a0123456789876543210 :: Bool) =
+        G a0123456789876543210 :: Bool
+    type FSym0 :: (~>) Bool Bool
+    data FSym0 a0123456789876543210
+      where
+        FSym0KindInference :: SameKind (Apply FSym0 arg) (FSym1 arg) =>
+                              FSym0 a0123456789876543210
+    type instance Apply FSym0 a0123456789876543210 = FSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FSym0 where
+      suppressUnusedWarnings
+        = Data.Tuple.snd (((,) FSym0KindInference) ())
+    type FSym1 (a0123456789876543210 :: Bool) =
+        F a0123456789876543210 :: Bool
+    type X_0123456789876543210Sym0 = X_0123456789876543210
+    type False_Sym0 = False_
+    type NotSym0 :: (~>) Bool Bool
+    data NotSym0 a0123456789876543210
+      where
+        NotSym0KindInference :: SameKind (Apply NotSym0 arg) (NotSym1 arg) =>
+                                NotSym0 a0123456789876543210
+    type instance Apply NotSym0 a0123456789876543210 = NotSym1 a0123456789876543210
+    instance SuppressUnusedWarnings NotSym0 where
+      suppressUnusedWarnings
+        = Data.Tuple.snd (((,) NotSym0KindInference) ())
+    type NotSym1 (a0123456789876543210 :: Bool) =
+        Not a0123456789876543210 :: Bool
+    type IdSym0 :: (~>) a a
+    data IdSym0 a0123456789876543210
+      where
+        IdSym0KindInference :: SameKind (Apply IdSym0 arg) (IdSym1 arg) =>
+                               IdSym0 a0123456789876543210
+    type instance Apply IdSym0 a0123456789876543210 = IdSym1 a0123456789876543210
+    instance SuppressUnusedWarnings IdSym0 where
+      suppressUnusedWarnings
+        = Data.Tuple.snd (((,) IdSym0KindInference) ())
+    type IdSym1 (a0123456789876543210 :: a) =
+        Id a0123456789876543210 :: a
+    type OtherwiseSym0 = Otherwise :: Bool
+    type M :: Bool
+    type family M where
+      M = Case_0123456789876543210 X_0123456789876543210Sym0
+    type L :: Bool
+    type family L where
+      L = Case_0123456789876543210 X_0123456789876543210Sym0
+    type family X_0123456789876543210 where
+      X_0123456789876543210 = Apply (Apply (:@#@$) (Apply NotSym0 TrueSym0)) (Apply (Apply (:@#@$) (Apply IdSym0 FalseSym0)) NilSym0)
+    type K :: Bool
+    type family K where
+      K = Case_0123456789876543210 X_0123456789876543210Sym0
+    type J :: Bool
+    type family J where
+      J = Case_0123456789876543210 X_0123456789876543210Sym0
+    type family X_0123456789876543210 where
+      X_0123456789876543210 = Apply (Apply BarSym0 TrueSym0) (Apply HSym0 FalseSym0)
+    type I :: Bool -> Bool
+    type family I a where
+      I a_0123456789876543210 = Apply (Case_0123456789876543210 a_0123456789876543210 X_0123456789876543210Sym0) a_0123456789876543210
+    type H :: Bool -> Bool
+    type family H a where
+      H a_0123456789876543210 = Apply (Case_0123456789876543210 a_0123456789876543210 X_0123456789876543210Sym0) a_0123456789876543210
+    type family X_0123456789876543210 where
+      X_0123456789876543210 = Apply (Apply Tuple2Sym0 FSym0) GSym0
+    type G :: Bool -> Bool
+    type family G a where
+      G a_0123456789876543210 = Apply (Case_0123456789876543210 a_0123456789876543210 X_0123456789876543210Sym0) a_0123456789876543210
+    type F :: Bool -> Bool
+    type family F a where
+      F a_0123456789876543210 = Apply (Case_0123456789876543210 a_0123456789876543210 X_0123456789876543210Sym0) a_0123456789876543210
+    type family X_0123456789876543210 where
+      X_0123456789876543210 = Apply (Apply (:@#@$) NotSym0) (Apply (Apply (:@#@$) IdSym0) NilSym0)
+    type family False_ where
+      False_ = FalseSym0
+    type Not :: Bool -> Bool
+    type family Not a where
+      Not 'True = FalseSym0
+      Not 'False = TrueSym0
+    type Id :: a -> a
+    type family Id a where
+      Id x = x
+    type Otherwise :: Bool
+    type family Otherwise where
+      Otherwise = TrueSym0
+    sM :: Sing (MSym0 :: Bool)
+    sL :: Sing (LSym0 :: Bool)
+    sX_0123456789876543210 :: Sing @_ X_0123456789876543210Sym0
+    sK :: Sing (KSym0 :: Bool)
+    sJ :: Sing (JSym0 :: Bool)
+    sX_0123456789876543210 :: Sing @_ X_0123456789876543210Sym0
+    sI :: forall (t :: Bool). Sing t -> Sing (Apply ISym0 t :: Bool)
+    sH :: forall (t :: Bool). Sing t -> Sing (Apply HSym0 t :: Bool)
+    sX_0123456789876543210 :: Sing @_ X_0123456789876543210Sym0
+    sG :: forall (t :: Bool). Sing t -> Sing (Apply GSym0 t :: Bool)
+    sF :: forall (t :: Bool). Sing t -> Sing (Apply FSym0 t :: Bool)
+    sX_0123456789876543210 :: Sing @_ X_0123456789876543210Sym0
+    sFalse_ :: Sing @_ False_Sym0
+    sNot ::
+      forall (t :: Bool). Sing t -> Sing (Apply NotSym0 t :: Bool)
+    sId :: forall a (t :: a). Sing t -> Sing (Apply IdSym0 t :: a)
+    sOtherwise :: Sing (OtherwiseSym0 :: Bool)
+    sM
+      = (GHC.Base.id
+           @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0 :: Bool)))
+          (case sX_0123456789876543210 of {
+             SCons _
+                   (SCons (sY_0123456789876543210 :: Sing y_0123456789876543210) SNil)
+               -> sY_0123456789876543210 })
+    sL
+      = (GHC.Base.id
+           @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0 :: Bool)))
+          (case sX_0123456789876543210 of {
+             SCons (sY_0123456789876543210 :: Sing y_0123456789876543210)
+                   (SCons _ SNil)
+               -> sY_0123456789876543210 })
+    sX_0123456789876543210
+      = (applySing
+           ((applySing ((singFun2 @(:@#@$)) SCons))
+              ((applySing ((singFun1 @NotSym0) sNot)) STrue)))
+          ((applySing
+              ((applySing ((singFun2 @(:@#@$)) SCons))
+                 ((applySing ((singFun1 @IdSym0) sId)) SFalse)))
+             SNil)
+    sK
+      = (GHC.Base.id
+           @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0 :: Bool)))
+          (case sX_0123456789876543210 of {
+             SBar _ (sY_0123456789876543210 :: Sing y_0123456789876543210)
+               -> sY_0123456789876543210 })
+    sJ
+      = (GHC.Base.id
+           @(Sing (Case_0123456789876543210 X_0123456789876543210Sym0 :: Bool)))
+          (case sX_0123456789876543210 of {
+             SBar (sY_0123456789876543210 :: Sing y_0123456789876543210) _
+               -> sY_0123456789876543210 })
+    sX_0123456789876543210
+      = (applySing ((applySing ((singFun2 @BarSym0) SBar)) STrue))
+          ((applySing ((singFun1 @HSym0) sH)) SFalse)
+    sI (sA_0123456789876543210 :: Sing a_0123456789876543210)
+      = (applySing
+           ((GHC.Base.id
+               @(Sing (Case_0123456789876543210 a_0123456789876543210 X_0123456789876543210Sym0)))
+              (case sX_0123456789876543210 of {
+                 STuple2 _ (sY_0123456789876543210 :: Sing y_0123456789876543210)
+                   -> sY_0123456789876543210 })))
+          sA_0123456789876543210
+    sH (sA_0123456789876543210 :: Sing a_0123456789876543210)
+      = (applySing
+           ((GHC.Base.id
+               @(Sing (Case_0123456789876543210 a_0123456789876543210 X_0123456789876543210Sym0)))
+              (case sX_0123456789876543210 of {
+                 STuple2 (sY_0123456789876543210 :: Sing y_0123456789876543210) _
+                   -> sY_0123456789876543210 })))
+          sA_0123456789876543210
+    sX_0123456789876543210
+      = (applySing
+           ((applySing ((singFun2 @Tuple2Sym0) STuple2))
+              ((singFun1 @FSym0) sF)))
+          ((singFun1 @GSym0) sG)
+    sG (sA_0123456789876543210 :: Sing a_0123456789876543210)
+      = (applySing
+           ((GHC.Base.id
+               @(Sing (Case_0123456789876543210 a_0123456789876543210 X_0123456789876543210Sym0)))
+              (case sX_0123456789876543210 of {
+                 SCons _
+                       (SCons (sY_0123456789876543210 :: Sing y_0123456789876543210) SNil)
+                   -> sY_0123456789876543210 })))
+          sA_0123456789876543210
+    sF (sA_0123456789876543210 :: Sing a_0123456789876543210)
+      = (applySing
+           ((GHC.Base.id
+               @(Sing (Case_0123456789876543210 a_0123456789876543210 X_0123456789876543210Sym0)))
+              (case sX_0123456789876543210 of {
+                 SCons (sY_0123456789876543210 :: Sing y_0123456789876543210)
+                       (SCons _ SNil)
+                   -> sY_0123456789876543210 })))
+          sA_0123456789876543210
+    sX_0123456789876543210
+      = (applySing
+           ((applySing ((singFun2 @(:@#@$)) SCons))
+              ((singFun1 @NotSym0) sNot)))
+          ((applySing
+              ((applySing ((singFun2 @(:@#@$)) SCons)) ((singFun1 @IdSym0) sId)))
+             SNil)
+    sFalse_ = SFalse
+    sNot STrue = SFalse
+    sNot SFalse = STrue
+    sId (sX :: Sing x) = sX
+    sOtherwise = STrue
+    instance SingI (ISym0 :: (~>) Bool Bool) where
+      sing = (singFun1 @ISym0) sI
+    instance SingI (HSym0 :: (~>) Bool Bool) where
+      sing = (singFun1 @HSym0) sH
+    instance SingI (GSym0 :: (~>) Bool Bool) where
+      sing = (singFun1 @GSym0) sG
+    instance SingI (FSym0 :: (~>) Bool Bool) where
+      sing = (singFun1 @FSym0) sF
+    instance SingI (NotSym0 :: (~>) Bool Bool) where
+      sing = (singFun1 @NotSym0) sNot
+    instance SingI (IdSym0 :: (~>) a a) where
+      sing = (singFun1 @IdSym0) sId
diff --git a/tests/compile-and-dump/Singletons/TypeRepTYPE.ghc88.template b/tests/compile-and-dump/Singletons/TypeRepTYPE.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/TypeRepTYPE.ghc88.template
+++ /dev/null
diff --git a/tests/compile-and-dump/Singletons/TypeRepTYPE.golden b/tests/compile-and-dump/Singletons/TypeRepTYPE.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/TypeRepTYPE.golden
diff --git a/tests/compile-and-dump/Singletons/Undef.ghc88.template b/tests/compile-and-dump/Singletons/Undef.ghc88.template
deleted file mode 100644
--- a/tests/compile-and-dump/Singletons/Undef.ghc88.template
+++ /dev/null
@@ -1,47 +0,0 @@
-Singletons/Undef.hs:(0,0)-(0,0): Splicing declarations
-    singletons
-      [d| foo :: Bool -> Bool
-          foo = undefined
-          bar :: Bool -> Bool
-          bar = error "urk" |]
-  ======>
-    foo :: Bool -> Bool
-    foo = undefined
-    bar :: Bool -> Bool
-    bar = error "urk"
-    type BarSym1 (a0123456789876543210 :: Bool) =
-        Bar a0123456789876543210
-    instance SuppressUnusedWarnings BarSym0 where
-      suppressUnusedWarnings = snd (((,) BarSym0KindInference) ())
-    data BarSym0 :: (~>) Bool Bool
-      where
-        BarSym0KindInference :: forall a0123456789876543210
-                                       arg. SameKind (Apply BarSym0 arg) (BarSym1 arg) =>
-                                BarSym0 a0123456789876543210
-    type instance Apply BarSym0 a0123456789876543210 = Bar a0123456789876543210
-    type FooSym1 (a0123456789876543210 :: Bool) =
-        Foo a0123456789876543210
-    instance SuppressUnusedWarnings FooSym0 where
-      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
-    data FooSym0 :: (~>) Bool Bool
-      where
-        FooSym0KindInference :: forall a0123456789876543210
-                                       arg. SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
-                                FooSym0 a0123456789876543210
-    type instance Apply FooSym0 a0123456789876543210 = Foo a0123456789876543210
-    type family Bar (a :: Bool) :: Bool where
-      Bar a_0123456789876543210 = Apply (Apply ErrorSym0 "urk") a_0123456789876543210
-    type family Foo (a :: Bool) :: Bool where
-      Foo a_0123456789876543210 = Apply UndefinedSym0 a_0123456789876543210
-    sBar ::
-      forall (t :: Bool). Sing t -> Sing (Apply BarSym0 t :: Bool)
-    sFoo ::
-      forall (t :: Bool). Sing t -> Sing (Apply FooSym0 t :: Bool)
-    sBar (sA_0123456789876543210 :: Sing a_0123456789876543210)
-      = (sError (sing :: Sing "urk")) sA_0123456789876543210
-    sFoo (sA_0123456789876543210 :: Sing a_0123456789876543210)
-      = sUndefined sA_0123456789876543210
-    instance SingI (BarSym0 :: (~>) Bool Bool) where
-      sing = (singFun1 @BarSym0) sBar
-    instance SingI (FooSym0 :: (~>) Bool Bool) where
-      sing = (singFun1 @FooSym0) sFoo
diff --git a/tests/compile-and-dump/Singletons/Undef.golden b/tests/compile-and-dump/Singletons/Undef.golden
new file mode 100644
--- /dev/null
+++ b/tests/compile-and-dump/Singletons/Undef.golden
@@ -0,0 +1,49 @@
+Singletons/Undef.hs:(0,0)-(0,0): Splicing declarations
+    singletons
+      [d| foo :: Bool -> Bool
+          foo = undefined
+          bar :: Bool -> Bool
+          bar = error "urk" |]
+  ======>
+    foo :: Bool -> Bool
+    foo = undefined
+    bar :: Bool -> Bool
+    bar = error "urk"
+    type BarSym0 :: (~>) Bool Bool
+    data BarSym0 a0123456789876543210
+      where
+        BarSym0KindInference :: SameKind (Apply BarSym0 arg) (BarSym1 arg) =>
+                                BarSym0 a0123456789876543210
+    type instance Apply BarSym0 a0123456789876543210 = BarSym1 a0123456789876543210
+    instance SuppressUnusedWarnings BarSym0 where
+      suppressUnusedWarnings = snd (((,) BarSym0KindInference) ())
+    type BarSym1 (a0123456789876543210 :: Bool) =
+        Bar a0123456789876543210 :: Bool
+    type FooSym0 :: (~>) Bool Bool
+    data FooSym0 a0123456789876543210
+      where
+        FooSym0KindInference :: SameKind (Apply FooSym0 arg) (FooSym1 arg) =>
+                                FooSym0 a0123456789876543210
+    type instance Apply FooSym0 a0123456789876543210 = FooSym1 a0123456789876543210
+    instance SuppressUnusedWarnings FooSym0 where
+      suppressUnusedWarnings = snd (((,) FooSym0KindInference) ())
+    type FooSym1 (a0123456789876543210 :: Bool) =
+        Foo a0123456789876543210 :: Bool
+    type Bar :: Bool -> Bool
+    type family Bar a where
+      Bar a_0123456789876543210 = Apply (Apply ErrorSym0 "urk") a_0123456789876543210
+    type Foo :: Bool -> Bool
+    type family Foo a where
+      Foo a_0123456789876543210 = Apply UndefinedSym0 a_0123456789876543210
+    sBar ::
+      forall (t :: Bool). Sing t -> Sing (Apply BarSym0 t :: Bool)
+    sFoo ::
+      forall (t :: Bool). Sing t -> Sing (Apply FooSym0 t :: Bool)
+    sBar (sA_0123456789876543210 :: Sing a_0123456789876543210)
+      = (sError (sing :: Sing "urk")) sA_0123456789876543210
+    sFoo (sA_0123456789876543210 :: Sing a_0123456789876543210)
+      = sUndefined sA_0123456789876543210
+    instance SingI (BarSym0 :: (~>) Bool Bool) where
+      sing = (singFun1 @BarSym0) sBar
+    instance SingI (FooSym0 :: (~>) Bool Bool) where
+      sing = (singFun1 @FooSym0) sFoo
diff --git a/tests/compile-and-dump/buildGoldenFiles.awk b/tests/compile-and-dump/buildGoldenFiles.awk
deleted file mode 100644
--- a/tests/compile-and-dump/buildGoldenFiles.awk
+++ /dev/null
@@ -1,1 +0,0 @@
-/INSERT/{while((getline line < $2) > 0 ){if(line !~ /INSERT/){print line}}close($2);next}1
