packages feed

singletons 1.1.2.1 → 2.0

raw patch · 162 files changed

+18842/−14042 lines, 162 filesdep +directorydep +sybdep −constraintsdep ~basedep ~mtldep ~th-desugar

Dependencies added: directory, syb

Dependencies removed: constraints

Dependency ranges changed: base, mtl, th-desugar

Files

CHANGES.md view
@@ -1,16 +1,44 @@ Changelog for singletons project ================================ +2.0+---++* Instance promotion now works properly -- it was quite buggy in 1.0.++* Classes and instances can now be singletonized.++* Limited support for functional dependencies.++* We now have promoted and singletonized versions of `Enum`, as well as `Bounded`.++* Deriving `Enum` is also now supported.++* Ditto for `Num`, which includes an instance for `Nat`, naturally.++* Promoting a literal number now uses overloaded literals at the type level,+using a type-level `FromInteger` in the type-level `Num` class.++* Better support for dealing with constraints. Some previously-unsingletonizable+functions that have constrained parameters now work.++* No more orphan `Quasi` instances!++* Support for functions of arity 8 (instead of the old limit, 7).++* Full support for fixity declarations.++* A raft of bugfixes.+ 1.1.2.1 -------  Fix bug #116, thus allowing locally-declared symbols to be used in GHC 7.10. - 1.1.2 ----- -Fix warnings and Haddock failure with GHC 7.10.1.+* No more GHC 7.8.2 support -- you must have GHC 7.8.3.  1.1.1 -----
README.md view
@@ -1,4 +1,4 @@-singletons 1.0+singletons 2.0 ==============  [![Build Status](https://travis-ci.org/goldfirere/singletons.svg?branch=master)](https://travis-ci.org/goldfirere/singletons)@@ -12,8 +12,9 @@ programming with singletons_, is available [here](http://www.cis.upenn.edu/~eir/papers/2012/singletons/paper.pdf) and will be referenced in this documentation as the "singletons paper". A follow-up-paper, _Promoting Functions to Type Families in Haskell_, will be available-online Real Soon Now and will be referenced in this documentation as the+paper, _Promoting Functions to Type Families in Haskell_, is available+[here](http://www.cis.upenn.edu/~eir/papers/2014/promotion/promotion.pdf)+and will be referenced in this documentation as the "promotion paper".  Purpose of the singletons library@@ -32,9 +33,8 @@ Compatibility ------------- -The singletons library requires GHC 7.8.2 or greater. We plan to restore GHC-7.6.3 support, but no promises as to when will this happen. Any code that uses-the singleton generation primitives needs to enable a long list of GHC+The singletons library requires GHC 7.10.2 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: @@ -50,6 +50,8 @@ * `RankNTypes` * `UndecidableInstances` * `FlexibleInstances`+* `InstanceSigs`+* `DefaultSignatures`  Modules for singleton types ---------------------------@@ -74,18 +76,11 @@ `Data.Singletons.Decide` exports type classes for propositional equality.  `Data.Singletons.TypeLits` exports definitions for working with `GHC.TypeLits`.-In GHC 7.6.3, `Data.Singletons.TypeLits` defines and exports `KnownNat` and-`KnownSymbol`, which are part of `GHC.TypeLits` in GHC 7.8. This makes-cross-version support a little easier.  `Data.Singletons.Void` exports a `Void` type, shamelessly copied from Edward Kmett's `void` package, but without the great many package dependencies in `void`. -`Data.Singletons.Types` exports a few type-level definitions that are in-`base` for GHC 7.8, but not in GHC 7.6.3. By importing this package, users-of both GHC versions can access these definitions.- Modules for function promotion ------------------------------ @@ -251,8 +246,90 @@ `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. +Classes and instances+---------------------++This is best understood by example. Let's look at a stripped down `Ord`:++```haskell+class Eq a => Ord a where+  compare :: a -> a -> Ordering+  (<)     :: a -> a -> Bool+  x < y = case x `compare` y of+            LT -> True+	    EQ -> False+	    GT -> False+```++This class gets promoted to a "kind class" thus:++```haskell+class (kproxy ~ 'KProxy, PEq kproxy) => POrd (kproxy :: KProxy a) where+  type Compare (x :: a) (y :: a) :: Ordering+  type (:<)    (x :: a) (y :: a) :: Bool+  type x :< y = ... -- promoting `case` is yucky.+```++Note that default method definitions become default associated type family+instances. This works out quite nicely.++We also get this singleton class:++```haskell+class (kproxy ~ 'KProxy, SEq kproxy) => SOrd (kproxy :: KProxy 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)++  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+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.++Instances work roughly similarly.++```haskell+instance Ord Bool where+  compare False False = EQ+  compare False True  = LT+  compare True  False = GT+  compare True  True  = EQ++instance POrd ('KProxy :: KProxy Bool) where+  type Compare 'False 'False = 'EQ+  type Compare 'False 'True  = 'LT+  type Compare 'True  'False = 'GT+  type Compare 'True  'True  = 'EQ++instance SOrd ('KProxy :: KProxy Bool) where+  sCompare :: forall (x :: a) (y :: a). Sing x -> Sing y -> Sing (Compare x y)+  sCompare SFalse SFalse = SEQ+  sCompare SFalse STrue  = SLT+  sCompare STrue  SFalse = SGT+  sCompare STrue  STrue  = SEQ+```++The only interesting bit here is the instance signature. It's not necessary+in such a simple scenario, but more complicated functions need to refer to+scoped type variables, which the instance signature can bring into scope.+The defaults all just work.+ On names -------- @@ -310,6 +387,20 @@    symbols: `:+$`, `:+$$`, `:+$$$`  +7. original class: `Num`++   promoted class: `PNum`++   singleton class: `SNum`+++8. original class: `~>`++   promoted class: `#~>`++   singleton class: `:%~>`++ Special names ------------- @@ -376,24 +467,25 @@ * sections * undefined * error-* deriving Eq+* deriving `Eq`, `Ord`, `Bounded`, and `Enum` * class constraints (though these sometimes fail with `let`, `lambda`, and `case`)-* literals (for `Nat` and `Symbol`)+* 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+* functional dependencies (with limitations -- see below)  The following constructs are supported for promotion but not singleton generation: -* `!` and `~` patterns (silently but successfully ignored during promotion)-* class and instance declarations-* deriving of promoted `Eq`, `Ord` and `Bounded` instances * scoped type variables-* overlapping patterns (GHC 7.8.2+ only). Note that overlapping patterns are-  sometime not obvious. For example `filter` function does not singletonize due+* overlapping patterns. Note that overlapping patterns are+  sometimes not obvious. For example, the `filter` function does not+  singletonize due   to overlapping patterns: ```haskell filter :: (a -> Bool) -> [a] -> [a]@@ -410,8 +502,8 @@ * list comprehensions * do * arithmetic sequences-* datatypes that store arrows-* literals+* datatypes that store arrows, `Nat`, or `Symbol`+* literals (limited support)  Why are these out of reach? First two depend on monads, which mention a higher-kinded type variable. GHC does not support higher-sorted kind variables,@@ -435,6 +527,10 @@ `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 `*` --------------- @@ -462,36 +558,12 @@ Known bugs ---------- -* Due to GHC bug #9081 deriving of hand-written instances of `Ord`, `Eq` and-  `Bounded` is not supported. Your only option here is to have these instances-  derived automatically.-* Fixity declarations don't promote due to GHC bug #9066.-* Instances with overlapping patterns don't promote. This will be fixed Real-  Soon Now.-* Top-level eta-reduced patterns don't singletonize * Record updates don't singletonize--Changes from earlier versions--------------------------------singletons 1.0 provides promotion mechanism that supports case expressions, let-statements, anonymous functions, higher order functions and many other-features. This version of the library was published together with the promotion-paper.--singletons 0.9 contains a bit of an API change from previous versions. Here is-a summary:--* There are no more "smart" constructors. Those were necessary because each-singleton used to carry both explicit and implicit versions of any children-nodes. However, this leads to exponential overhead! Now, the magic (i.e., a-use of `unsafeCoerce`) in `singInstance` gets rid of the need for storing-implicit singletons. The smart constructors did some of the work of managing-the stored implicits, so they are no longer needed.--* `SingE` and `SingRep` are gone. If you need to carry an implicit singleton,-use `SingI`. Otherwise, you probably want `SingKind`.--* The Template Haskell functions are now exported from `Data.Singletons.TH`.--* The Prelude singletons are now exported from `Data.Singletons.Prelude`.+* In obscure scenarios, GHC "forgets" constraints on functions. This should+  happen only with certain uses where the constraint is needed inside of a+  `case` or lambda-expression. Having type inference on result types nearby+  makes this more likely to bite.+* 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.
singletons.cabal view
@@ -1,5 +1,5 @@ name:           singletons-version:        1.1.2.1+version:        2.0                 -- Remember to bump version in the Makefile as well cabal-version:  >= 1.10 synopsis:       A framework for generating singleton types@@ -9,17 +9,17 @@ maintainer:     Richard Eisenberg <eir@cis.upenn.edu>, Jan Stolarek <jan.stolarek@p.lodz.pl> bug-reports:    https://github.com/goldfirere/singletons/issues stability:      experimental-tested-with:    GHC ==7.8.3+tested-with:    GHC >= 7.10.2 extra-source-files: README.md, CHANGES.md,                     tests/compile-and-dump/buildGoldenFiles.awk,                     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/*.ghc78.template,-                    tests/compile-and-dump/InsertionSort/*.ghc78.template,-                    tests/compile-and-dump/Promote/*.ghc78.template,-                    tests/compile-and-dump/Singletons/*.ghc78.template+                    tests/compile-and-dump/GradingClient/*.ghc710.template,+                    tests/compile-and-dump/InsertionSort/*.ghc710.template,+                    tests/compile-and-dump/Promote/*.ghc710.template,+                    tests/compile-and-dump/Singletons/*.ghc710.template license:        BSD3 license-file:   LICENSE build-type:     Simple@@ -38,17 +38,18 @@ source-repository this   type:     git   location: https://github.com/goldfirere/singletons.git-  tag:      v1.1.2.1+  tag:      v2.0  library   hs-source-dirs:     src-  build-depends:      base >= 4.7 && < 5,-                      mtl >= 2.1.1,+  build-depends:      base >= 4.7.0.1 && < 5,+                      mtl >= 2.1.2,                       template-haskell,                       containers >= 0.5,-                      th-desugar >= 1.5.2 && < 1.6+                      th-desugar >= 1.5.4.1 && < 1.6,+                      syb >= 0.4   default-language:   Haskell2010-  default-extensions: TemplateHaskell+  other-extensions:   TemplateHaskell         -- TemplateHaskell must be listed in cabal file to work with         -- ghc7.8   exposed-modules:    Data.Singletons,@@ -59,10 +60,12 @@                       Data.Singletons.Prelude.Base,                       Data.Singletons.Prelude.Bool,                       Data.Singletons.Prelude.Either,+                      Data.Singletons.Prelude.Enum,                       Data.Singletons.Prelude.Eq,                       Data.Singletons.Prelude.Ord,                       Data.Singletons.Prelude.List,                       Data.Singletons.Prelude.Maybe,+                      Data.Singletons.Prelude.Num                       Data.Singletons.Prelude.Tuple,                       Data.Promotion.Prelude,                       Data.Promotion.TH,@@ -71,24 +74,26 @@                       Data.Promotion.Prelude.Either,                       Data.Promotion.Prelude.Eq,                       Data.Promotion.Prelude.Ord,-                      Data.Promotion.Prelude.Bounded,+                      Data.Promotion.Prelude.Enum,                       Data.Promotion.Prelude.List,                       Data.Promotion.Prelude.Maybe,+                      Data.Promotion.Prelude.Num,                       Data.Promotion.Prelude.Tuple,-                      Data.Singletons.Types,                       Data.Singletons.TypeLits,                       Data.Singletons.Decide,-                      Data.Singletons.Void,                       Data.Singletons.SuppressUnusedWarnings -  other-modules:      Data.Singletons.Promote,+  other-modules:      Data.Singletons.Deriving.Infer,+                      Data.Singletons.Deriving.Bounded,+                      Data.Singletons.Deriving.Enum,+                      Data.Singletons.Deriving.Ord,+                      Data.Singletons.Promote,                       Data.Singletons.Promote.Monad,                       Data.Singletons.Promote.Eq,-                      Data.Singletons.Promote.Ord,-                      Data.Singletons.Promote.Bounded,                       Data.Singletons.Promote.Type,                       Data.Singletons.Promote.Defun,                       Data.Singletons.Util,+                      Data.Singletons.Partition,                       Data.Singletons.Prelude.Instances,                       Data.Singletons.Names,                       Data.Singletons.Single.Monad,@@ -96,6 +101,7 @@                       Data.Singletons.Single.Eq,                       Data.Singletons.Single.Data,                       Data.Singletons.Single,+                      Data.Singletons.TypeLits.Internal,                       Data.Singletons.Syntax    ghc-options:        -Wall@@ -108,10 +114,10 @@   main-is:            SingletonsTestSuite.hs   other-modules:      SingletonsTestSuiteUtils -  build-depends:      base >= 4.6 && < 5,-                      constraints,+  build-depends:      base >= 4.7.0.1 && < 5,                       filepath >= 1.3,                       process >= 1.1,                       tasty >= 0.6,                       tasty-golden >= 2.2,-                      Cabal >= 1.16+                      Cabal >= 1.16,+                      directory >= 1
src/Data/Promotion/Prelude.hs view
@@ -32,16 +32,19 @@   -- * Promoted comparisons   module Data.Promotion.Prelude.Ord, -  -- * Promoted bounds-  module Data.Promotion.Prelude.Bounded,+  -- * Promoted enumerations+  -- | As a matter of convenience, the promoted Prelude does /not/ export+  -- promoted @succ@ and @pred@, due to likely conflicts with+  -- unary numbers. Please import 'Data.Promotion.Prelude.Enum' directly if+  -- you want these.+  module Data.Promotion.Prelude.Enum, -  -- * Promoted arithmetic operations-  Nat, (:+), (:-), (:*), (:^),+  -- * Promoted numbers+  module Data.Promotion.Prelude.Num,    -- ** Miscellaneous functions   Id, Const, (:.), type ($), type ($!), Flip, AsTypeOf, Until, Seq, -   -- * List operations   Map, (:++), Filter,   Head, Last, Tail, Init, Null, Length, (:!!),@@ -68,7 +71,7 @@   Zip, Zip3, ZipWith, ZipWith3, Unzip, Unzip3,    -- * Other datatypes-  KProxy(..),+  Proxy(..), KProxy(..),    -- * Defunctionalization symbols   FalseSym0, TrueSym0,@@ -92,8 +95,7 @@   CurrySym0, CurrySym1, CurrySym2, CurrySym3,   UncurrySym0, UncurrySym1, UncurrySym2, -  (:+$), (:+$$), (:-$), (:-$$),-  (:*$), (:*$$), (:^$), (:^$$),+  (:^$), (:^$$),    IdSym0, IdSym1, ConstSym0, ConstSym1, ConstSym2,   (:.$), (:.$$), (:.$$$),@@ -151,7 +153,7 @@   (:!!$), (:!!$$), (:!!$$$),   ) where -import Data.Singletons.Types ( KProxy(..) )+import Data.Proxy ( Proxy(..), KProxy(..) ) import Data.Promotion.Prelude.Base import Data.Promotion.Prelude.Bool import Data.Promotion.Prelude.Either@@ -160,5 +162,7 @@ import Data.Promotion.Prelude.Tuple import Data.Promotion.Prelude.Eq import Data.Promotion.Prelude.Ord-import Data.Promotion.Prelude.Bounded+import Data.Promotion.Prelude.Enum+  hiding (Succ, Pred, SuccSym0, SuccSym1, PredSym0, PredSym1)+import Data.Promotion.Prelude.Num import Data.Singletons.TypeLits
src/Data/Promotion/Prelude/Base.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE CPP, TemplateHaskell, KindSignatures, PolyKinds, TypeOperators,+{-# LANGUAGE TemplateHaskell, KindSignatures, PolyKinds, TypeOperators,              DataKinds, ScopedTypeVariables, TypeFamilies, GADTs,              UndecidableInstances #-} @@ -29,14 +29,14 @@   -- * Defunctionalization symbols   FoldrSym0, FoldrSym1, FoldrSym2, FoldrSym3,   MapSym0, MapSym1, MapSym2,-  (:++$), (:++$$),+  (:++$), (:++$$), (:++$$$),   OtherwiseSym0,   IdSym0, IdSym1,   ConstSym0, ConstSym1, ConstSym2,-  (:.$), (:.$$), (:.$$$),+  (:.$), (:.$$), (:.$$$), (:.$$$$),   type ($$), type ($$$), type ($$$$),   type ($!$), type ($!$$), type ($!$$$),-  FlipSym0, FlipSym1, FlipSym2,+  FlipSym0, FlipSym1, FlipSym2, FlipSym3,   UntilSym0, UntilSym1, UntilSym2, UntilSym3,   AsTypeOfSym0, AsTypeOfSym1, AsTypeOfSym2,   SeqSym0, SeqSym1, SeqSym2
− src/Data/Promotion/Prelude/Bounded.hs
@@ -1,34 +0,0 @@-{-# LANGUAGE TemplateHaskell, DataKinds, PolyKinds, ScopedTypeVariables,-             TypeFamilies, TypeOperators, GADTs, UndecidableInstances,-             FlexibleContexts, DefaultSignatures #-}---------------------------------------------------------------------------------- |--- Module      :  Data.Promotion.Prelude.Bounded--- Copyright   :  (C) 2014 Jan Stolarek--- License     :  BSD-style (see LICENSE)--- Maintainer  :  Jan Stolarek (jan.stolarek@p.lodz.pl)--- Stability   :  experimental--- Portability :  non-portable------ Defines the promoted version of Bounded, 'PBounded'-----------------------------------------------------------------------------------module Data.Promotion.Prelude.Bounded (-  PBounded(..),--  -- ** Defunctionalization symbols-  MaxBoundSym0,-  MinBoundSym0-  ) where--import Data.Singletons.Promote-import Data.Singletons.Util--$(promoteOnly [d|-  class Bounded a  where-    minBound, maxBound :: a-  |])--$(promoteBoundedInstances boundedBasicTypes)
+ src/Data/Promotion/Prelude/Enum.hs view
@@ -0,0 +1,36 @@+{-# LANGUAGE TemplateHaskell, PolyKinds, DataKinds, TypeFamilies,+             UndecidableInstances, GADTs #-}++-- Suppress orphan instance warning for PEnum KProxy. This will go away once #25+-- is fixed and instance declaration for Enum Nat is moved to+-- Data.Singletons.Prelude.Enum module.+{-# OPTIONS_GHC -fno-warn-orphans #-}+-----------------------------------------------------------------------------+-- |+-- Module      :  Data.Promotion.Prelude.Enum+-- Copyright   :  (C) 2014 Jan Stolarek, Richard Eisenberg+-- License     :  BSD-style (see LICENSE)+-- Maintainer  :  Jan Stolarek (jan.stolarek@p.lodz.pl)+-- Stability   :  experimental+-- Portability :  non-portable+--+-- Exports promoted versions of 'Enum' and 'Bounded'+--+-----------------------------------------------------------------------------++module Data.Promotion.Prelude.Enum (+  PBounded(..), PEnum(..),++  -- ** Defunctionalization symbols+  MinBoundSym0,+  MaxBoundSym0,+  SuccSym0, SuccSym1,+  PredSym0, PredSym1,+  ToEnumSym0, ToEnumSym1,+  FromEnumSym0, FromEnumSym1,+  EnumFromToSym0, EnumFromToSym1, EnumFromToSym2,+  EnumFromThenToSym0, EnumFromThenToSym1, EnumFromThenToSym2,+  EnumFromThenToSym3+  ) where++import Data.Singletons.Prelude.Enum
src/Data/Promotion/Prelude/List.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE CPP, TypeOperators, DataKinds, PolyKinds, TypeFamilies,+{-# LANGUAGE TypeOperators, DataKinds, PolyKinds, TypeFamilies,              TemplateHaskell, GADTs, UndecidableInstances, RankNTypes,              ScopedTypeVariables, MultiWayIf #-} @@ -104,7 +104,7 @@   NilSym0,   (:$), (:$$), (:$$$), -  (:++$$), (:++$), HeadSym0, HeadSym1, LastSym0, LastSym1,+  (:++$$$), (:++$$), (:++$), HeadSym0, HeadSym1, LastSym0, LastSym1,   TailSym0, TailSym1, InitSym0, InitSym1, NullSym0, NullSym1,    MapSym0, MapSym1, MapSym2, ReverseSym0, ReverseSym1,@@ -148,7 +148,7 @@   ZipSym0, ZipSym1, ZipSym2,   Zip3Sym0, Zip3Sym1, Zip3Sym2, Zip3Sym3,   ZipWithSym0, ZipWithSym1, ZipWithSym2, ZipWithSym3,-  ZipWith3Sym0, ZipWith3Sym1, ZipWith3Sym2, ZipWith3Sym3,+  ZipWith3Sym0, ZipWith3Sym1, ZipWith3Sym2, ZipWith3Sym3, ZipWith3Sym4,   UnzipSym0, UnzipSym1,   Unzip3Sym0, Unzip3Sym1,   Unzip4Sym0, Unzip4Sym1,@@ -183,7 +183,7 @@   DropWhileEndSym0, DropWhileEndSym1, DropWhileEndSym2,   SpanSym0, SpanSym1, SpanSym2,   BreakSym0, BreakSym1, BreakSym2,-  StripPrefixSym0, StripPrefixSym1,+  StripPrefixSym0, StripPrefixSym1, StripPrefixSym2,   MaximumSym0, MaximumSym1,   MinimumSym0, MinimumSym1,   GroupSym0, GroupSym1,@@ -205,10 +205,10 @@   Zip6Sym0, Zip6Sym1, Zip6Sym2, Zip6Sym3, Zip6Sym4, Zip6Sym5, Zip6Sym6,   Zip7Sym0, Zip7Sym1, Zip7Sym2, Zip7Sym3, Zip7Sym4, Zip7Sym5, Zip7Sym6, Zip7Sym7, -  ZipWith4Sym0, ZipWith4Sym1, ZipWith4Sym2, ZipWith4Sym3, ZipWith4Sym4,-  ZipWith5Sym0, ZipWith5Sym1, ZipWith5Sym2, ZipWith5Sym3, ZipWith5Sym4, ZipWith5Sym5,-  ZipWith6Sym0, ZipWith6Sym1, ZipWith6Sym2, ZipWith6Sym3, ZipWith6Sym4, ZipWith6Sym5, ZipWith6Sym6,-  ZipWith7Sym0, ZipWith7Sym1, ZipWith7Sym2, ZipWith7Sym3, ZipWith7Sym4, ZipWith7Sym5, ZipWith7Sym6, ZipWith7Sym7,+  ZipWith4Sym0, ZipWith4Sym1, ZipWith4Sym2, ZipWith4Sym3, ZipWith4Sym4, ZipWith4Sym5,+  ZipWith5Sym0, ZipWith5Sym1, ZipWith5Sym2, ZipWith5Sym3, ZipWith5Sym4, ZipWith5Sym5, ZipWith5Sym6,+  ZipWith6Sym0, ZipWith6Sym1, ZipWith6Sym2, ZipWith6Sym3, ZipWith6Sym4, ZipWith6Sym5, ZipWith6Sym6, ZipWith6Sym7,+  ZipWith7Sym0, ZipWith7Sym1, ZipWith7Sym2, ZipWith7Sym3, ZipWith7Sym4, ZipWith7Sym5, ZipWith7Sym6, ZipWith7Sym7, ZipWith7Sym8,    NubSym0, NubSym1,   NubBySym0, NubBySym1, NubBySym2,@@ -225,19 +225,20 @@   ) where  import Data.Singletons.Prelude.Base-import Data.Singletons.Prelude.Bool import Data.Singletons.Prelude.Eq import Data.Promotion.Prelude.Ord import Data.Singletons.Prelude.List import Data.Singletons.Prelude.Maybe import Data.Singletons.Prelude.Tuple+import Data.Singletons.Prelude.Bool import Data.Singletons.TH import Data.Singletons.TypeLits+import Data.Singletons.Prelude.Num  import Data.Maybe (listToMaybe) -- these imports are required fir functions that singletonize but are used -- in this module by a function that can't be singletonized-import Data.List  (deleteBy, sortBy, insertBy)+import Data.List  (sortBy, insertBy, deleteBy)  $(promoteOnly [d| -- Can't be promoted because of limitations of Int promotion@@ -327,15 +328,14 @@ --  splitAt                :: Int -> [a] -> ([a],[a]) --  splitAt n xs           =  (take n xs, drop n xs) -  -- Implementation changed to use case expression to work around #60   take                   :: Nat -> [a] -> [a]+  take n _      | n <= 0 =  []   take _ []              =  []-  take 0 (_:_)           =  []   take n (x:xs)          =  x : take (n-1) xs    drop                   :: Nat -> [a] -> [a]+  drop n xs     | n <= 0 =  xs   drop _ []              =  []-  drop 0 xs@(_:_)        =  xs   drop n (_:xs)          =  drop (n-1) xs    splitAt                :: Nat -> [a] -> ([a],[a])@@ -430,7 +430,6 @@                      | otherwise = (ts, x:fs)  -- Can't be promoted because of limitations of Int promotion.--- Also, #60 and th-desugar #6 get in the way. -- Below is a re-implementation using Nat --  (!!)                    :: [a] -> Int -> a --  xs     !! n | n < 0 =  error "Data.Singletons.List.!!: negative index"@@ -439,9 +438,10 @@ --  (_:xs) !! n         =  xs !! (n-1)    (!!)                    :: [a] -> Nat -> a-  []     !! _ = error "Data.Singletons.List.!!: index too large"-  (x:xs) !! n = if | n == 0    -> x-                   | otherwise -> xs !! (n-1)+  _      !! n | n < 0 =  error "Data.Singletons.List.!!: negative index"+  []     !! _         =  error "Data.Singletons.List.!!: index too large"+  (x:_)  !! 0         =  x+  (_:xs) !! n         =  xs !! (n-1)  -- These three rely on findIndices, which does not promote. -- Since we have our own implementation of findIndices these are perfectly valid
+ src/Data/Promotion/Prelude/Num.hs view
@@ -0,0 +1,30 @@+-----------------------------------------------------------------------------+-- |+-- Module      :  Data.Promotion.Prelude.Num+-- Copyright   :  (C) 2014 Richard Eisenberg+-- License     :  BSD-style (see LICENSE)+-- Maintainer  :  Richard Eisenberg (eir@cis.upenn.edu)+-- Stability   :  experimental+-- Portability :  non-portable+--+-- Defines and exports promoted and singleton versions of definitions from+-- GHC.Num.+--+----------------------------------------------------------------------------++module Data.Promotion.Prelude.Num (+  PNum(..), Subtract,++  -- ** Defunctionalization symbols+  (:+$), (:+$$), (:+$$$),+  (:-$), (:-$$), (:-$$$),+  (:*$), (:*$$), (:*$$$),+  NegateSym0, NegateSym1,+  AbsSym0, AbsSym1,+  SignumSym0, SignumSym1,+  FromIntegerSym0, FromIntegerSym1,+  SubtractSym0, SubtractSym1, SubtractSym2+  ) where++import Data.Singletons.Prelude.Num+import Data.Singletons.TypeLits ()   -- for the Num instance!
src/Data/Promotion/TH.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE ExplicitNamespaces, CPP #-}+{-# LANGUAGE ExplicitNamespaces #-}  ----------------------------------------------------------------------------- -- |@@ -27,6 +27,9 @@   -- ** Functions to generate @Bounded@ instances   promoteBoundedInstances, promoteBoundedInstance, +  -- ** Functions to generate @Enum@ instances+  promoteEnumInstances, promoteEnumInstance,+   -- ** defunctionalization   TyFun, Apply, type (@@), @@ -37,7 +40,7 @@   PEq(..), If, (:&&),   POrd(..),   Any,-  Proxy(..), KProxy(..), ThenCmp,+  Proxy(..), KProxy(..), ThenCmp, Foldl,    Error, ErrorSym0,   TrueSym0, FalseSym0,@@ -49,12 +52,13 @@   Tuple5Sym0, Tuple5Sym1, Tuple5Sym2, Tuple5Sym3, Tuple5Sym4, Tuple5Sym5,   Tuple6Sym0, Tuple6Sym1, Tuple6Sym2, Tuple6Sym3, Tuple6Sym4, Tuple6Sym5, Tuple6Sym6,   Tuple7Sym0, Tuple7Sym1, Tuple7Sym2, Tuple7Sym3, Tuple7Sym4, Tuple7Sym5, Tuple7Sym6, Tuple7Sym7,+  ThenCmpSym0, FoldlSym0,    SuppressUnusedWarnings(..)   ) where -import Data.Singletons.Types ( Proxy(..) )+import Data.Proxy import Data.Singletons import Data.Singletons.Promote import Data.Singletons.Prelude.Instances
src/Data/Singletons.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE MagicHash, RankNTypes, PolyKinds, GADTs, DataKinds,-             FlexibleContexts, CPP, TypeFamilies, TypeOperators,+             FlexibleContexts, TypeFamilies, TypeOperators,              UndecidableInstances #-}  -----------------------------------------------------------------------------@@ -22,11 +22,6 @@ -- ---------------------------------------------------------------------------- -#if __GLASGOW_HASKELL__ < 707-  -- optimizing instances of SDecide cause GHC to die (#8467)-{-# OPTIONS_GHC -O0 #-}-#endif- module Data.Singletons (   -- * Main singleton definitions @@ -40,26 +35,25 @@   SingInstance(..), SomeSing(..),   singInstance, withSingI, withSomeSing, singByProxy, -#if __GLASGOW_HASKELL__ >= 707   singByProxy#,-#endif   withSing, singThat,    -- ** Defunctionalization-  TyFun, TyCon1, TyCon2, TyCon3, TyCon4, TyCon5, TyCon6, TyCon7,+  TyFun, TyCon1, TyCon2, TyCon3, TyCon4, TyCon5, TyCon6, TyCon7, TyCon8,   Apply, type (@@),    -- ** Defunctionalized singletons   -- | When calling a higher-order singleton function, you need to use a   -- @singFun...@ function to wrap it. See 'singFun1'.   singFun1, singFun2, singFun3, singFun4, singFun5, singFun6, singFun7,+  singFun8,   unSingFun1, unSingFun2, unSingFun3, unSingFun4, unSingFun5,-  unSingFun6, unSingFun7,+  unSingFun6, unSingFun7, unSingFun8, --- | These type synonyms are exported only to improve error messages; users+  -- | These type synonyms are exported only to improve error messages; users   -- should not have to mention them.   SingFunction1, SingFunction2, SingFunction3, SingFunction4, SingFunction5,-  SingFunction6, SingFunction7, +  SingFunction6, SingFunction7, SingFunction8,    -- * Auxiliary functions   bugInGHC,@@ -67,10 +61,8 @@   ) where  import Unsafe.Coerce-import Data.Singletons.Types-#if __GLASGOW_HASKELL__ >= 707+import Data.Proxy ( Proxy(..), KProxy(..) ) import GHC.Exts ( Proxy# )-#endif  -- | Convenient synonym to refer to the kind of a type variable: -- @type KindOf (a :: k) = ('KProxy :: KProxy k)@@@ -79,7 +71,7 @@ ---------------------------------------------------------------------- ---- Sing & friends -------------------------------------------------- -----------------------------------------------------------------------                        + -- | The singleton kind-indexed data family. data family Sing (a :: k) @@ -125,7 +117,7 @@ ---------------------------------------------------------------------- ---- SingInstance ---------------------------------------------------- -----------------------------------------------------------------------                  + -- | A 'SingInstance' wraps up a 'SingI' instance for explicit handling. data SingInstance (a :: k) where   SingInstance :: SingI a => SingInstance a@@ -170,6 +162,7 @@ data TyCon5 :: (k1 -> k2 -> k3 -> k4 -> k5 -> k6) -> TyFun k1 (TyFun k2 (TyFun k3 (TyFun k4 (TyFun k5 k6 -> *) -> *) -> *) -> *) -> * data TyCon6 :: (k1 -> k2 -> k3 -> k4 -> k5 -> k6 -> k7) -> TyFun k1 (TyFun k2 (TyFun k3 (TyFun k4 (TyFun k5 (TyFun k6 k7 -> *) -> *) -> *) -> *) -> *) -> * data TyCon7 :: (k1 -> k2 -> k3 -> k4 -> k5 -> k6 -> k7 -> k8) -> TyFun k1 (TyFun k2 (TyFun k3 (TyFun k4 (TyFun k5 (TyFun k6 (TyFun k7 k8 -> *) -> *) -> *) -> *) -> *) -> *) -> *+data TyCon8 :: (k1 -> k2 -> k3 -> k4 -> k5 -> k6 -> k7 -> k8 -> k9) -> TyFun k1 (TyFun k2 (TyFun k3 (TyFun k4 (TyFun k5 (TyFun k6 (TyFun k7 (TyFun k8 k9 -> *) -> *) -> *) -> *) -> *) -> *) -> *) -> *  -- | Type level function application type family Apply (f :: TyFun k1 k2 -> *) (x :: k1) :: k2@@ -180,6 +173,7 @@ type instance Apply (TyCon5 f) x = TyCon4 (f x) type instance Apply (TyCon6 f) x = TyCon5 (f x) type instance Apply (TyCon7 f) x = TyCon6 (f x)+type instance Apply (TyCon8 f) x = TyCon7 (f x)  -- | An infix synonym for `Apply` type a @@ b = Apply a b@@ -205,7 +199,7 @@ -- a higher-order function. You will often need an explicit type -- annotation to get this to work. For example: ----- > falses = sMap (singFun1 sNot :: Sing NotSym0)+-- > falses = sMap (singFun1 (Proxy :: Proxy NotSym0) sNot) -- >               (STrue `SCons` STrue `SCons` SNil) -- -- There are a family of @singFun...@ functions, keyed by the number@@ -237,6 +231,10 @@ singFun7 :: Proxy f -> SingFunction7 f -> Sing f singFun7 _ f = SLambda (\x -> singFun6 Proxy (f x)) +type SingFunction8 f = forall t. Sing t -> SingFunction7 (f @@ t)+singFun8 :: Proxy f -> SingFunction8 f -> Sing f+singFun8 _ f = SLambda (\x -> singFun7 Proxy (f x))+ -- | This is the inverse of 'singFun1', and likewise for the other -- @unSingFun...@ functions. unSingFun1 :: Proxy f -> Sing f -> SingFunction1 f@@ -260,6 +258,9 @@ unSingFun7 :: Proxy f -> Sing f -> SingFunction7 f unSingFun7 _ sf x = unSingFun6 Proxy (sf `applySing` x) +unSingFun8 :: Proxy f -> Sing f -> SingFunction8 f+unSingFun8 _ sf x = unSingFun7 Proxy (sf `applySing` x)+ ---------------------------------------------------------------------- ---- Convenience ----------------------------------------------------- ----------------------------------------------------------------------@@ -300,11 +301,9 @@ singByProxy :: SingI a => proxy a -> Sing a singByProxy _ = sing -#if __GLASGOW_HASKELL__ >= 707 -- | Allows creation of a singleton when a @proxy#@ is at hand. singByProxy# :: SingI a => Proxy# a -> Sing a singByProxy# _ = sing-#endif  -- | GHC 7.8 sometimes warns about incomplete pattern matches when no such -- patterns are possible, due to GADT constraints.@@ -313,4 +312,3 @@ -- 'bugInGHC' as its right-hand side. bugInGHC :: forall a. a bugInGHC = error "Bug encountered in GHC -- this should never happen"-
src/Data/Singletons/CustomStar.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE DataKinds, TypeFamilies, KindSignatures, CPP, TemplateHaskell #-}+{-# LANGUAGE DataKinds, TypeFamilies, KindSignatures, TemplateHaskell, CPP #-}  ----------------------------------------------------------------------------- -- |@@ -25,10 +25,12 @@  import Language.Haskell.TH import Data.Singletons.Util+import Data.Singletons.Deriving.Ord import Data.Singletons.Promote import Data.Singletons.Promote.Monad import Data.Singletons.Single.Monad import Data.Singletons.Single.Data+import Data.Singletons.Single import Data.Singletons.Syntax import Data.Singletons.Names import Control.Monad@@ -37,10 +39,6 @@ import Data.Singletons.Prelude.Eq import Data.Singletons.Prelude.Bool -#if __GLASGOW_HASKELL__ < 709-import Control.Applicative-#endif- -- | Produce a representation and singleton for the collection of types given. -- -- A datatype @Rep@ is created, with one constructor per type in the declared@@ -76,9 +74,13 @@   let repDecl = DDataD Data [] repName [] ctors                        [''Eq, ''Show, ''Read]   fakeCtors <- zipWithM (mkCtor False) names kinds-  let dataDecl = DataDecl Data repName [] fakeCtors [''Show, ''Read , ''Eq, ''Ord]-  promDecls      <- promoteM_ [] $ promoteDataDec dataDecl-  singletonDecls <- singDecsM [] $ singDataD dataDecl+  let dataDecl = DataDecl Data repName [] fakeCtors [''Show, ''Read , ''Eq]+  ordInst <- mkOrdInstance (DConT repName) fakeCtors+  (pOrdInst, promDecls) <- promoteM [] $ do promoteDataDec dataDecl+                                            promoteInstanceDec mempty ordInst+  singletonDecls <- singDecsM [] $ do decs1 <- singDataD dataDecl+                                      dec2  <- singInstD pOrdInst+                                      return (dec2 : decs1)   return $ decsToTH $ repDecl :                       promDecls ++                       singletonDecls
src/Data/Singletons/Decide.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE CPP, RankNTypes, PolyKinds, DataKinds, TypeOperators,+{-# LANGUAGE RankNTypes, PolyKinds, DataKinds, TypeOperators,              TypeFamilies, FlexibleContexts, UndecidableInstances, GADTs #-} {-# OPTIONS_GHC -fno-warn-orphans #-} @@ -24,8 +24,8 @@   ) where  import Data.Singletons-import Data.Singletons.Types-import Data.Singletons.Void+import Data.Type.Equality+import Data.Void  ---------------------------------------------------------------------- ---- SDecide ---------------------------------------------------------@@ -40,7 +40,7 @@ -- cannot exist. 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.
+ src/Data/Singletons/Deriving/Bounded.hs view
@@ -0,0 +1,57 @@+-----------------------------------------------------------------------------+-- |+-- Module      :  Data.Singletons.Deriving.Bounded+-- Copyright   :  (C) 2015 Richard Eisenberg+-- License     :  BSD-style (see LICENSE)+-- Maintainer  :  Richard Eisenberg (eir@cis.upenn.edu+-- Stability   :  experimental+-- Portability :  non-portable+--+-- Implements deriving of Bounded instances+--+----------------------------------------------------------------------------++module Data.Singletons.Deriving.Bounded where++import Language.Haskell.TH.Syntax+import Language.Haskell.TH.Ppr+import Language.Haskell.TH.Desugar+import Data.Singletons.Names+import Data.Singletons.Util+import Data.Singletons.Syntax+import Data.Singletons.Deriving.Infer+import Control.Monad++-- monadic only for failure and parallelism with other functions+-- that make instances+mkBoundedInstance :: Quasi q => DType -> [DCon] -> q UInstDecl+mkBoundedInstance ty cons = do+  -- We can derive instance of Bounded if datatype is an enumeration (all+  -- constructors must be nullary) or has only one constructor. See Section 11+  -- of Haskell 2010 Language Report.+  -- Note that order of conditions below is important.+  when (null cons+       || (any (\(DCon _ _ _ f) -> not . null . tysOfConFields $ f) cons+            && (not . null . tail $ cons))) $+       fail ("Can't derive Bounded instance for "+             ++ pprint (typeToTH ty) ++ ".")+  -- at this point we know that either we have a datatype that has only one+  -- constructor or a datatype where each constructor is nullary+  let (DCon _ _ minName fields) = head cons+      (DCon _ _ maxName _)      = last cons+      fieldsCount   = length $ tysOfConFields fields+      (minRHS, maxRHS) = case fieldsCount of+        0 -> (DConE minName, DConE maxName)+        _ ->+          let minEqnRHS = foldExp (DConE minName)+                                  (replicate fieldsCount (DVarE minBoundName))+              maxEqnRHS = foldExp (DConE maxName)+                                  (replicate fieldsCount (DVarE maxBoundName))+          in (minEqnRHS, maxEqnRHS)++      mk_rhs rhs = UFunction [DClause [] rhs]+  return $ InstDecl { id_cxt = inferConstraints (DConPr boundedName) cons+                    , id_name = boundedName+                    , id_arg_tys = [ty]+                    , id_meths = [ (minBoundName, mk_rhs minRHS)+                                 , (maxBoundName, mk_rhs maxRHS) ] }
+ src/Data/Singletons/Deriving/Enum.hs view
@@ -0,0 +1,51 @@+-----------------------------------------------------------------------------+-- |+-- Module      :  Data.Singletons.Deriving.Enum+-- Copyright   :  (C) 2015 Richard Eisenberg+-- License     :  BSD-style (see LICENSE)+-- Maintainer  :  Richard Eisenberg (eir@cis.upenn.edu)+-- Stability   :  experimental+-- Portability :  non-portable+--+-- Implements deriving of Enum instances+--+----------------------------------------------------------------------------++module Data.Singletons.Deriving.Enum ( mkEnumInstance ) where++import Language.Haskell.TH.Syntax+import Language.Haskell.TH.Ppr+import Language.Haskell.TH.Desugar+import Data.Singletons.Syntax+import Data.Singletons.Util+import Data.Singletons.Names+import Control.Monad++-- monadic for failure only+mkEnumInstance :: Quasi q => DType -> [DCon] -> q UInstDecl+mkEnumInstance ty cons = do+  when (null cons ||+        any (\(DCon tvbs cxt _ f) -> or [ not $ null $ tysOfConFields f+                                        , not $ null tvbs+                                        , not $ null cxt ]) cons) $+    fail ("Can't derive Enum instance for " ++ pprint (typeToTH ty) ++ ".")+  n <- qNewName "n"+  let to_enum = UFunction [DClause [DVarPa n] (to_enum_rhs cons [0..])]+      to_enum_rhs [] _ = DVarE errorName `DAppE` DLitE (StringL "toEnum: bad argument")+      to_enum_rhs (DCon _ _ name _ : rest) (num:nums) =+        DCaseE (DVarE equalsName `DAppE` DVarE n `DAppE` DLitE (IntegerL num))+          [ DMatch (DConPa trueName []) (DConE name)+          , DMatch (DConPa falseName []) (to_enum_rhs rest nums) ]+      to_enum_rhs _ _ = error "Internal error: exhausted infinite list in to_enum_rhs"++      from_enum = UFunction (zipWith (\i con -> DClause [DConPa (extractName con) []]+                                                        (DLitE (IntegerL i)))+                                     [0..] cons)+  return (InstDecl { id_cxt     = []+                   , id_name    = singletonsEnumName+                      -- need to use singletons's Enum class to get the types+                      -- to use Nat instead of Int++                   , id_arg_tys = [ty]+                   , id_meths   = [ (singletonsToEnumName, to_enum)+                                  , (singletonsFromEnumName, from_enum) ] })
+ src/Data/Singletons/Deriving/Infer.hs view
@@ -0,0 +1,24 @@+-----------------------------------------------------------------------------+-- |+-- Module      :  Data.Singletons.Deriving.Infer+-- Copyright   :  (C) 2015 Richard Eisenberg+-- License     :  BSD-style (see LICENSE)+-- Maintainer  :  Richard Eisenberg (eir@cis.upenn.edu+-- Stability   :  experimental+-- Portability :  non-portable+--+-- Infers constraints for a `deriving` class+--+----------------------------------------------------------------------------++module Data.Singletons.Deriving.Infer ( inferConstraints ) where++import Language.Haskell.TH.Desugar+import Data.Singletons.Util+import Data.List+import Data.Generics.Twins++inferConstraints :: DPred -> [DCon] -> DCxt+inferConstraints pr = nubBy geq . concatMap infer_ct+  where+    infer_ct (DCon _ _ _ fields) = map (pr `DAppPr`) (tysOfConFields fields)
+ src/Data/Singletons/Deriving/Ord.hs view
@@ -0,0 +1,65 @@+-----------------------------------------------------------------------------+-- |+-- Module      :  Data.Singletons.Deriving.Ord+-- Copyright   :  (C) 2015 Richard Eisenberg+-- License     :  BSD-style (see LICENSE)+-- Maintainer  :  Richard Eisenberg (eir@cis.upenn.edu+-- Stability   :  experimental+-- Portability :  non-portable+--+-- Implements deriving of Ord instances+--+----------------------------------------------------------------------------++module Data.Singletons.Deriving.Ord ( mkOrdInstance ) where++import Language.Haskell.TH.Desugar+import Data.Singletons.Names+import Data.Singletons.Util+import Language.Haskell.TH.Syntax+import Data.Singletons.Deriving.Infer+import Data.Singletons.Syntax++-- | Make a *non-singleton* Ord instance+mkOrdInstance :: Quasi q => DType -> [DCon] -> q UInstDecl+mkOrdInstance ty cons = do+  let constraints = inferConstraints (DConPr ordName) cons+  compare_eq_clauses <- mapM mk_equal_clause cons+  let compare_noneq_clauses = map (uncurry mk_nonequal_clause)+                                  [ (con1, con2)+                                  | con1 <- zip cons [1..]+                                  , con2 <- zip cons [1..]+                                  , extractName (fst con1) /=+                                    extractName (fst con2) ]+  return (InstDecl { id_cxt = constraints+                   , id_name = ordName+                   , id_arg_tys = [ty]+                   , id_meths = [( compareName+                                 , UFunction (compare_eq_clauses +++                                              compare_noneq_clauses) )] })++mk_equal_clause :: Quasi q => DCon -> q DClause+mk_equal_clause (DCon _tvbs _cxt name fields) = do+  let tys = tysOfConFields fields+  a_names <- mapM (const $ newUniqueName "a") tys+  b_names <- mapM (const $ newUniqueName "b") tys+  let pat1 = DConPa name (map DVarPa a_names)+      pat2 = DConPa name (map DVarPa b_names)+  return $ DClause [pat1, pat2] (DVarE foldlName `DAppE`+                                 DVarE thenCmpName `DAppE`+                                 DConE cmpEQName `DAppE`+                                 mkListE (zipWith+                                          (\a b -> DVarE compareName `DAppE` DVarE a+                                                                     `DAppE` DVarE b)+                                          a_names b_names))++mk_nonequal_clause :: (DCon, Int) -> (DCon, Int) -> DClause+mk_nonequal_clause (DCon _tvbs1 _cxt1 name1 fields1, n1)+                   (DCon _tvbs2 _cxt2 name2 fields2, n2) =+  DClause [pat1, pat2] (case n1 `compare` n2 of+                          LT -> DConE cmpLTName+                          EQ -> DConE cmpEQName+                          GT -> DConE cmpGTName)+  where+    pat1 = DConPa name1 (map (const DWildPa) (tysOfConFields fields1))+    pat2 = DConPa name2 (map (const DWildPa) (tysOfConFields fields2))
src/Data/Singletons/Names.hs view
@@ -6,27 +6,27 @@ Defining names and manipulations on names for use in promotion and singling. -} -{-# LANGUAGE CPP, TemplateHaskell #-}+{-# LANGUAGE TemplateHaskell #-}  module Data.Singletons.Names where  import Data.Singletons import Data.Singletons.SuppressUnusedWarnings-import Data.Singletons.Types import Data.Singletons.Decide import Language.Haskell.TH.Syntax import Language.Haskell.TH.Desugar-import GHC.TypeLits ( Symbol )+import GHC.TypeLits ( Nat, Symbol ) import GHC.Exts ( Any ) import Data.Typeable ( TypeRep ) import Data.Singletons.Util+import Data.Proxy ( Proxy(..) )+import Control.Monad -anyTypeName, boolName, andName, tyEqName, tyCompareName, tyminBoundName,-  tymaxBoundName, repName,+anyTypeName, boolName, andName, tyEqName, compareName, minBoundName,+  maxBoundName, repName,   nilName, consName, listName, tyFunName,-  applyName, symbolName, undefinedName, typeRepName, stringName,-  eqName, ordName, boundedName, orderingName, ordLTSymName, ordEQSymName,-  ordGTSymName,+  applyName, natName, symbolName, undefinedName, typeRepName, stringName,+  eqName, ordName, boundedName, orderingName,   singFamilyName, singIName, singMethName, demoteRepName,   singKindClassName, sEqClassName, sEqMethName, sconsName, snilName,   sIfName, kProxyDataName, kProxyTypeName, proxyTypeName, proxyDataName,@@ -34,21 +34,26 @@   sListName, sDecideClassName, sDecideMethName,   provedName, disprovedName, reflName, toSingName, fromSingName,   equalityName, applySingName, suppressClassName, suppressMethodName,-  tyThenCmpName, kindOfName :: Name+  thenCmpName,+  kindOfName, tyFromIntegerName, tyNegateName, sFromIntegerName,+  sNegateName, errorName, foldlName, cmpEQName, cmpLTName, cmpGTName,+  singletonsToEnumName, singletonsFromEnumName, enumName, singletonsEnumName,+  equalsName :: Name anyTypeName = ''Any boolName = ''Bool andName = '(&&)-tyCompareName = mkName "Compare"-tyminBoundName = mkName "MinBound"-tymaxBoundName = mkName "MaxBound"-tyEqName = mkName ":=="-repName = mkName "Rep"+compareName = 'compare+minBoundName = 'minBound+maxBoundName = 'maxBound+tyEqName = mk_name_tc "Data.Singletons.Prelude.Eq" ":=="+repName = mkName "Rep"   -- this is actually defined in client code! nilName = '[] consName = '(:) listName = ''[] tyFunName = ''TyFun applyName = ''Apply symbolName = ''Symbol+natName = ''Nat undefinedName = 'undefined typeRepName = ''TypeRep stringName = ''String@@ -56,9 +61,6 @@ ordName = ''Ord boundedName = ''Bounded orderingName = ''Ordering-ordLTSymName = mkName "LTSym0"-ordEQSymName = mkName "EQSym0"-ordGTSymName = mkName "GTSym0" singFamilyName = ''Sing singIName = ''SingI singMethName = 'sing@@ -66,18 +68,18 @@ fromSingName = 'fromSing demoteRepName = ''DemoteRep singKindClassName = ''SingKind-sEqClassName = mkName "SEq"-sEqMethName = mkName "%:=="-sIfName = mkName "sIf"-sconsName = mkName "SCons"-snilName = mkName "SNil"+sEqClassName = mk_name_tc "Data.Singletons.Prelude.Eq" "SEq"+sEqMethName = mk_name_v "Data.Singletons.Prelude.Eq" "%:=="+sIfName = mk_name_v "Data.Singletons.Prelude.Bool" "sIf"+sconsName = mk_name_d "Data.Singletons.Prelude.Instances" "SCons"+snilName = mk_name_d "Data.Singletons.Prelude.Instances" "SNil" kProxyDataName = 'KProxy kProxyTypeName = ''KProxy someSingTypeName = ''SomeSing someSingDataName = 'SomeSing proxyTypeName = ''Proxy proxyDataName = 'Proxy-sListName = mkName "SList"+sListName = mk_name_tc "Data.Singletons.Prelude.Instances" "SList" sDecideClassName = ''SDecide sDecideMethName = '(%~) provedName = 'Proved@@ -87,12 +89,43 @@ applySingName = 'applySing suppressClassName = ''SuppressUnusedWarnings suppressMethodName = 'suppressUnusedWarnings-tyThenCmpName = mkName "ThenCmp"+thenCmpName = mk_name_v "Data.Singletons.Prelude.Ord" "thenCmp" kindOfName = ''KindOf+tyFromIntegerName = mk_name_tc "Data.Singletons.Prelude.Num" "FromInteger"+tyNegateName = mk_name_tc "Data.Singletons.Prelude.Num" "Negate"+sFromIntegerName = mk_name_v "Data.Singletons.Prelude.Num" "sFromInteger"+sNegateName = mk_name_v "Data.Singletons.Prelude.Num" "sNegate"+errorName = 'error+foldlName = 'foldl+cmpEQName = 'EQ+cmpLTName = 'LT+cmpGTName = 'GT+singletonsToEnumName = mk_name_v "Data.Singletons.Prelude.Enum" "toEnum"+singletonsFromEnumName = mk_name_v "Data.Singletons.Prelude.Enum" "fromEnum"+enumName = ''Enum+singletonsEnumName = mk_name_tc "Data.Singletons.Prelude.Enum" "Enum"+equalsName = '(==) -mkTupleName :: Int -> Name-mkTupleName n = mkName $ "STuple" ++ (show n)+singPkg :: String+singPkg = $( (LitE . StringL . loc_package) `liftM` location ) +mk_name_tc :: String -> String -> Name+mk_name_tc = mkNameG_tc singPkg++mk_name_d :: String -> String -> Name+mk_name_d = mkNameG_d singPkg++mk_name_v :: String -> String -> Name+mk_name_v = mkNameG_v singPkg++mkTupleTypeName :: Int -> Name+mkTupleTypeName n = mk_name_tc "Data.Singletons.Prelude.Instances" $+                    "STuple" ++ (show n)++mkTupleDataName :: Int -> Name+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@@ -124,12 +157,11 @@     | name == nilName     = mkName $ "NilSym" ++ (show sat) -    | Just degree <- tupleNameDegree_maybe name-    = mkName $ "Tuple" ++ show degree ++ "Sym" ++ (show sat)-        -- treat unboxed tuples like tuples-    | Just degree <- unboxedTupleNameDegree_maybe name-    = mkName $ "Tuple" ++ show degree ++ "Sym" ++ (show sat)+    | Just degree <- tupleNameDegree_maybe name `mplus`+                     unboxedTupleNameDegree_maybe name+    = mk_name_tc "Data.Singletons.Prelude.Instances" $+                 "Tuple" ++ show degree ++ "Sym" ++ (show sat)      | otherwise     = let capped = toUpcaseStr noPrefix name in@@ -145,7 +177,7 @@ classTvsName :: Name -> Name classTvsName = suffixName "TyVars" "^^^" -mkTyName :: DsMonad q => Name -> q Name+mkTyName :: Quasi q => Name -> q Name mkTyName tmName = do   let nameStr  = nameBase tmName       symbolic = not (isHsLetter (head nameStr))@@ -163,53 +195,21 @@ andTySym :: DType andTySym = promoteValRhs andName --- make a Name with an unknown kind into a DTyVarBndr.--- Uses a fresh kind variable for GHC 7.6.3 and PlainTV for 7.8+--- because 7.8+ has kind inference-inferKindTV :: DsMonad q => Name -> q DTyVarBndr-inferKindTV n = do-#if __GLASGOW_HASKELL__ < 707-  ki <- fmap DVarK $ qNewName "k"-  return $ DKindedTV n _ki-#else-  return $ DPlainTV n-#endif--inferMaybeKindTV :: DsMonad q => Name -> Maybe DKind -> q DTyVarBndr-inferMaybeKindTV n Nothing =-#if __GLASGOW_HASKELL__ < 707-  do k <- qNewName "k"-     return $ DKindedTV n (DVarK k)-#else-  return $ DPlainTV n-#endif-inferMaybeKindTV n (Just k) = return $ DKindedTV n k---- similar to above, this is for annotating the result kind of--- a closed type family. Makes it polymorphic in 7.6.3, inferred--- in 7.8-unknownResult :: DKind -> Maybe DKind-#if __GLASGOW_HASKELL__ < 707-unknownResult = Just-#else-unknownResult = const Nothing-#endif- -- Singletons  singDataConName :: Name -> Name singDataConName nm   | nm == nilName                                  = snilName   | nm == consName                                 = sconsName-  | Just degree <- tupleNameDegree_maybe nm        = mkTupleName degree-  | Just degree <- unboxedTupleNameDegree_maybe nm = mkTupleName degree+  | Just degree <- tupleNameDegree_maybe nm        = mkTupleDataName degree+  | Just degree <- unboxedTupleNameDegree_maybe nm = mkTupleDataName degree   | otherwise                                      = prefixUCName "S" ":%" nm  singTyConName :: Name -> Name singTyConName name   | name == listName                                 = sListName-  | Just degree <- tupleNameDegree_maybe name        = mkTupleName degree-  | Just degree <- unboxedTupleNameDegree_maybe name = mkTupleName degree+  | Just degree <- tupleNameDegree_maybe name        = mkTupleTypeName degree+  | Just degree <- unboxedTupleNameDegree_maybe name = mkTupleTypeName degree   | otherwise                                        = prefixUCName "S" ":%" name  singClassName :: Name -> Name@@ -240,7 +240,25 @@ apply :: DType -> DType -> DType apply t1 t2 = DAppT (DAppT (DConT applyName) t1) t2 +mkListE :: [DExp] -> DExp+mkListE =+  foldr (\h t -> DConE consName `DAppE` h `DAppE` t) (DConE nilName)+ -- apply a type to a list of types using Apply type family -- This is defined here, not in Utils, to avoid cyclic dependencies foldApply :: DType -> [DType] -> DType foldApply = foldl apply++-- make and equality predicate+mkEqPred :: DType -> DType -> DPred+mkEqPred ty1 ty2 = foldl DAppPr (DConPr equalityName) [ty1, ty2]++-- create a bunch of kproxy vars, and constrain them all to be 'KProxy+mkKProxies :: Quasi q+           => [Name]   -- for the kinds of the kproxies+           -> q ([DTyVarBndr], DCxt)+mkKProxies ns = do+  kproxies <- mapM (const $ qNewName "kproxy") ns+  return ( zipWith (\kp kv -> DKindedTV kp (DConK kProxyTypeName [DVarK kv]))+                   kproxies ns+         , map (\kp -> mkEqPred (DVarT kp) (DConT kProxyDataName)) kproxies )
+ src/Data/Singletons/Partition.hs view
@@ -0,0 +1,111 @@+-----------------------------------------------------------------------------+-- |+-- Module      :  Data.Singletons.Partition+-- Copyright   :  (C) 2015 Richard Eisenberg+-- License     :  BSD-style (see LICENSE)+-- Maintainer  :  Richard Eisenberg (eir@cis.upenn.edu+-- Stability   :  experimental+-- Portability :  non-portable+--+-- Partitions a list of declarations into its bits+--+----------------------------------------------------------------------------++module Data.Singletons.Partition where++import Prelude hiding ( exp )+import Data.Singletons.Syntax+import Data.Singletons.Deriving.Ord+import Data.Singletons.Deriving.Bounded+import Data.Singletons.Deriving.Enum+import Data.Singletons.Names+import Language.Haskell.TH.Syntax+import Language.Haskell.TH.Ppr+import Language.Haskell.TH.Desugar+import Data.Singletons.Util++import Data.Monoid+import Control.Monad+import Data.Maybe++data PartitionedDecs =+  PDecs { pd_let_decs :: [DLetDec]+        , pd_class_decs :: [UClassDecl]+        , pd_instance_decs :: [UInstDecl]+        , pd_data_decs :: [DataDecl]+        }++instance Monoid PartitionedDecs where+  mempty = PDecs [] [] [] []+  mappend (PDecs a1 b1 c1 d1) (PDecs a2 b2 c2 d2) =+    PDecs (a1 <> a2) (b1 <> b2) (c1 <> c2) (d1 <> d2)++-- | Split up a @[DDec]@ into its pieces, extracting 'Ord' instances+-- from deriving clauses+partitionDecs :: Quasi m => [DDec] -> m PartitionedDecs+partitionDecs = concatMapM partitionDec++partitionDec :: Quasi m => DDec -> m PartitionedDecs+partitionDec (DLetDec letdec) = return $ mempty { pd_let_decs = [letdec] }++partitionDec (DDataD nd _cxt name tvbs cons derivings) = do+  (derivings', derived_instances) <- partitionWithM part_derivings derivings+  return $ mempty { pd_data_decs = [DataDecl nd name tvbs cons derivings']+                  , pd_instance_decs = derived_instances }+  where+    ty = foldType (DConT name) (map tvbToType tvbs)+    part_derivings :: Quasi m => Name -> m (Either Name UInstDecl)+    part_derivings deriv_name+      | deriv_name == ordName+      = Right <$> mkOrdInstance ty cons+      | deriv_name == boundedName+      = Right <$> mkBoundedInstance ty cons+      | deriv_name == enumName+      = Right <$> mkEnumInstance ty cons+      | otherwise+      = return (Left deriv_name)++partitionDec (DClassD cxt name tvbs fds decs) = do+  env <- concatMapM partitionClassDec decs+  return $ mempty { pd_class_decs = [ClassDecl { cd_cxt  = cxt+                                               , cd_name = name+                                               , cd_tvbs = tvbs+                                               , cd_fds  = fds+                                               , cd_lde  = env }] }+partitionDec (DInstanceD cxt ty decs) = do+  defns <- liftM catMaybes $ mapM partitionInstanceDec decs+  (name, tys) <- split_app_tys [] ty+  return $ mempty { pd_instance_decs = [InstDecl { id_cxt = cxt+                                                 , id_name = name+                                                 , id_arg_tys = tys+                                                 , id_meths = defns }] }+  where+    split_app_tys acc (DAppT t1 t2) = split_app_tys (t2:acc) t1+    split_app_tys acc (DConT name)  = return (name, acc)+    split_app_tys acc (DSigT t _)   = split_app_tys acc t+    split_app_tys _ _ = fail $ "Illegal instance head: " ++ show ty+partitionDec (DRoleAnnotD {}) = return mempty  -- ignore these+partitionDec (DPragmaD {}) = return mempty+partitionDec dec =+  fail $ "Declaration cannot be promoted: " ++ pprint (decToTH dec)++partitionClassDec :: Monad m => DDec -> m ULetDecEnv+partitionClassDec (DLetDec (DSigD name ty)) = return $ typeBinding name ty+partitionClassDec (DLetDec (DValD (DVarPa name) exp)) =+  return $ valueBinding name (UValue exp)+partitionClassDec (DLetDec (DFunD name clauses)) =+  return $ valueBinding name (UFunction clauses)+partitionClassDec (DLetDec (DInfixD fixity name)) =+  return $ infixDecl fixity name+partitionClassDec (DPragmaD {}) = return mempty+partitionClassDec _ =+  fail "Only method declarations can be promoted within a class."++partitionInstanceDec :: Monad m => DDec -> m (Maybe (Name, ULetDecRHS))+partitionInstanceDec (DLetDec (DValD (DVarPa name) exp)) =+  return $ Just (name, UValue exp)+partitionInstanceDec (DLetDec (DFunD name clauses)) =+  return $ Just (name, UFunction clauses)+partitionInstanceDec (DPragmaD {}) = return Nothing+partitionInstanceDec _ =+  fail "Only method bodies can be promoted within an instance."
src/Data/Singletons/Prelude.hs view
@@ -90,6 +90,16 @@   -- * Singleton comparisons   module Data.Singletons.Prelude.Ord, +  -- * Singleton Enum and Bounded+  -- | As a matter of convenience, the singletons Prelude does /not/ export+  -- promoted/singletonized @succ@ and @pred@, due to likely conflicts with+  -- unary numbers. Please import 'Data.Singletons.Prelude.Enum' directly if+  -- you want these.+  module Data.Singletons.Prelude.Enum,++  -- * Singletons numbers+  module Data.Singletons.Prelude.Num,+   -- ** Miscellaneous functions   Id, sId, Const, sConst, (:.), (%:.), type ($), (%$), type ($!), (%$!),   Flip, sFlip, AsTypeOf, sAsTypeOf,@@ -193,4 +203,7 @@ import Data.Singletons.Prelude.Eq import Data.Singletons.Prelude.Ord import Data.Singletons.Prelude.Instances+import Data.Singletons.Prelude.Enum+  hiding (Succ, Pred, SuccSym0, SuccSym1, PredSym0, PredSym1, sSucc, sPred)+import Data.Singletons.Prelude.Num import Data.Singletons.TypeLits
src/Data/Singletons/Prelude/Base.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE CPP, TemplateHaskell, KindSignatures, PolyKinds, TypeOperators,+{-# LANGUAGE TemplateHaskell, KindSignatures, PolyKinds, TypeOperators,              DataKinds, ScopedTypeVariables, TypeFamilies, GADTs,              UndecidableInstances, BangPatterns #-} @@ -31,20 +31,21 @@   -- * Defunctionalization symbols   FoldrSym0, FoldrSym1, FoldrSym2, FoldrSym3,   MapSym0, MapSym1, MapSym2,-  (:++$), (:++$$),+  (:++$), (:++$$), (:++$$$),   OtherwiseSym0,   IdSym0, IdSym1,   ConstSym0, ConstSym1, ConstSym2,-  (:.$), (:.$$), (:.$$$),+  (:.$), (:.$$), (:.$$$), (:.$$$$),   type ($$), type ($$$), type ($$$$),   type ($!$), type ($!$$), type ($!$$$),-  FlipSym0, FlipSym1, FlipSym2,+  FlipSym0, FlipSym1, FlipSym2, FlipSym3,   AsTypeOfSym0, AsTypeOfSym1, AsTypeOfSym2,   SeqSym0, SeqSym1, SeqSym2   ) where  import Data.Singletons.Prelude.Instances-import Data.Singletons.TH+import Data.Singletons.Single+import Data.Singletons import Data.Singletons.Prelude.Bool  -- Promoted and singletonized versions of "otherwise" are imported and@@ -65,6 +66,7 @@   (++)                    :: [a] -> [a] -> [a]   (++) []     ys          = ys   (++) (x:xs) ys          = x : xs ++ ys+  infixr 5 ++    id                      :: a -> a   id x                    =  x@@ -74,6 +76,7 @@    (.)    :: (b -> c) -> (a -> b) -> a -> c   (.) f g = \x -> f (g x)+  infixr 9 .    flip                    :: (a -> b -> c) -> b -> a -> c   flip f x y              =  f y x@@ -85,12 +88,14 @@   -- place to do it.   seq :: a -> b -> b   seq _ x = x+  infixr 0 `seq`  |])  -- ($) is a special case, because its kind-inference data constructors -- clash with (:). See #29. type family (f :: TyFun a b -> *) $ (x :: a) :: b type instance f $ x = f @@ x+infixr 0 $  data ($$) :: TyFun (TyFun a b -> *) (TyFun a b -> *) -> * type instance Apply ($$) arg = ($$$) arg@@ -103,9 +108,11 @@ (%$) :: forall (f :: TyFun a b -> *) (x :: a).         Sing f -> Sing x -> Sing (($$) @@ f @@ x) f %$ x = applySing f x+infixr 0 %$  type family (f :: TyFun a b -> *) $! (x :: a) :: b type instance f $! x = f @@ x+infixr 0 $!  data ($!$) :: TyFun (TyFun a b -> *) (TyFun a b -> *) -> * type instance Apply ($!$) arg = ($!$$) arg@@ -118,3 +125,4 @@ (%$!) :: forall (f :: TyFun a b -> *) (x :: a).         Sing f -> Sing x -> Sing (($!$) @@ f @@ x) f %$! x = applySing f x+infixr 0 %$!
src/Data/Singletons/Prelude/Bool.hs view
@@ -1,9 +1,5 @@ {-# LANGUAGE TemplateHaskell, DataKinds, PolyKinds, TypeFamilies, TypeOperators,-             GADTs, CPP, ScopedTypeVariables, DeriveDataTypeable #-}--#if __GLASGOW_HASKELL__ < 707-{-# OPTIONS_GHC -fno-warn-name-shadowing #-}-#endif+             GADTs, ScopedTypeVariables, DeriveDataTypeable, UndecidableInstances #-}  ----------------------------------------------------------------------------- -- |@@ -61,7 +57,7 @@ import Data.Singletons import Data.Singletons.Prelude.Instances import Data.Singletons.Single-import Data.Singletons.Types+import Data.Type.Bool ( If )  $(singletons [d|   bool_ :: a -> a -> Bool -> a@@ -73,10 +69,12 @@   (&&) :: Bool -> Bool -> Bool   False && _ = False   True  && x = x+  infixr 3 &&    (||) :: Bool -> Bool -> Bool   False || x = x   True  || _ = True+  infixr 2 ||    not :: Bool -> Bool   not False = True
src/Data/Singletons/Prelude/Either.hs view
@@ -1,9 +1,5 @@ {-# LANGUAGE TemplateHaskell, ScopedTypeVariables, TypeFamilies, GADTs,-             DataKinds, PolyKinds, RankNTypes, UndecidableInstances, CPP #-}--#if __GLASGOW_HASKELL__ < 707-{-# OPTIONS_GHC -fno-warn-name-shadowing #-}-#endif+             DataKinds, PolyKinds, RankNTypes, UndecidableInstances #-}  ----------------------------------------------------------------------------- -- |
+ src/Data/Singletons/Prelude/Enum.hs view
@@ -0,0 +1,137 @@+{-# LANGUAGE TemplateHaskell, DataKinds, PolyKinds, ScopedTypeVariables,+             TypeFamilies, TypeOperators, GADTs, UndecidableInstances,+             FlexibleContexts, DefaultSignatures, BangPatterns,+             InstanceSigs #-}++-----------------------------------------------------------------------------+-- |+-- Module      :  Data.Singletons.Prelude.Enum+-- Copyright   :  (C) 2014 Jan Stolarek, Richard Eisenberg+-- License     :  BSD-style (see LICENSE)+-- Maintainer  :  Jan Stolarek (jan.stolarek@p.lodz.pl)+-- Stability   :  experimental+-- Portability :  non-portable+--+-- Defines the promoted and singleton version of Bounded, 'PBounded'+-- and 'SBounded'+--+-----------------------------------------------------------------------------++module Data.Singletons.Prelude.Enum (+  PBounded(..), SBounded(..),+  PEnum(..), SEnum(..),++  -- ** Defunctionalization symbols+  MinBoundSym0,+  MaxBoundSym0,+  SuccSym0, SuccSym1,+  PredSym0, PredSym1,+  ToEnumSym0, ToEnumSym1,+  FromEnumSym0, FromEnumSym1,+  EnumFromToSym0, EnumFromToSym1, EnumFromToSym2,+  EnumFromThenToSym0, EnumFromThenToSym1, EnumFromThenToSym2,+  EnumFromThenToSym3++  ) where++import Data.Singletons.Single+import Data.Singletons.Util+import Data.Singletons.Prelude.Num+import Data.Singletons.Prelude.Base+import Data.Singletons.Prelude.Ord+import Data.Singletons.Prelude.Eq+import Data.Singletons.Prelude.Instances+import Data.Singletons.TypeLits++$(singletonsOnly [d|+  class Bounded a where+    minBound, maxBound :: a+  |])++$(singBoundedInstances boundedBasicTypes)++$(singletonsOnly [d|+  class  Enum a   where+      -- | the successor of a value.  For numeric types, 'succ' adds 1.+      succ                :: a -> a+      -- | the predecessor of a value.  For numeric types, 'pred' subtracts 1.+      pred                :: a -> a+      -- | Convert from a 'Nat'.+      toEnum              :: Nat -> a+      -- | Convert to a 'Nat'.+      fromEnum            :: a -> Nat++      -- The following use infinite lists, and are not promotable:+      -- -- | Used in Haskell's translation of @[n..]@.+      -- enumFrom            :: a -> [a]+      -- -- | Used in Haskell's translation of @[n,n'..]@.+      -- enumFromThen        :: a -> a -> [a]++      -- | Used in Haskell's translation of @[n..m]@.+      enumFromTo          :: a -> a -> [a]+      -- | Used in Haskell's translation of @[n,n'..m]@.+      enumFromThenTo      :: a -> a -> a -> [a]++      succ                   = toEnum . (1 +)  . fromEnum+      pred                   = toEnum . (subtract 1) . fromEnum+      -- enumFrom x             = map toEnum [fromEnum x ..]+      -- enumFromThen x y       = map toEnum [fromEnum x, fromEnum y ..]+      enumFromTo x y         = map toEnum [fromEnum x .. fromEnum y]+      enumFromThenTo x1 x2 y = map toEnum [fromEnum x1, fromEnum x2 .. fromEnum y]++  -- Nat instance for Enum+  eftNat :: Nat -> Nat -> [Nat]+  -- [x1..x2]+  eftNat x0 y | (x0 > y)  = []+              | otherwise = go x0+                 where+                   go x = x : if (x == y) then [] else go (x + 1)++  efdtNat :: Nat -> Nat -> Nat -> [Nat]+  -- [x1,x2..y]+  efdtNat x1 x2 y+   | x2 >= x1  = efdtNatUp x1 x2 y+   | otherwise = efdtNatDn x1 x2 y++  -- Requires x2 >= x1+  efdtNatUp :: Nat -> Nat -> Nat -> [Nat]+  efdtNatUp x1 x2 y    -- Be careful about overflow!+   | y < x2    = if y < x1 then [] else [x1]+   | otherwise = -- Common case: x1 <= x2 <= y+                 let delta = x2 - x1 -- >= 0+                     y' = y - delta  -- x1 <= y' <= y; hence y' is representable++                     -- Invariant: x <= y+                     -- Note that: z <= y' => z + delta won't overflow+                     -- so we are guaranteed not to overflow if/when we recurse+                     go_up x | x > y'    = [x]+                             | otherwise = x : go_up (x + delta)+                 in x1 : go_up x2++  -- Requires x2 <= x1+  efdtNatDn :: Nat -> Nat -> Nat -> [Nat]+  efdtNatDn x1 x2 y    -- Be careful about underflow!+   | y > x2    = if y > x1 then [] else [x1]+   | otherwise = -- Common case: x1 >= x2 >= y+                 let delta = x2 - x1 -- <= 0+                     y' = y - delta  -- y <= y' <= x1; hence y' is representable++                     -- Invariant: x >= y+                     -- Note that: z >= y' => z + delta won't underflow+                     -- so we are guaranteed not to underflow if/when we recurse+                     go_dn x | x < y'    = [x]+                             | otherwise = x : go_dn (x + delta)+     in x1 : go_dn x2++  instance  Enum Nat  where+      succ x = x + 1+      pred x = x - 1++      toEnum   x = x+      fromEnum x = x++      enumFromTo = eftNat+      enumFromThenTo = efdtNat+  |])++$(singEnumInstances enumBasicTypes)
src/Data/Singletons/Prelude/Eq.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE TypeOperators, DataKinds, PolyKinds, TypeFamilies,              RankNTypes, FlexibleContexts, TemplateHaskell,-             UndecidableInstances, GADTs, CPP, DefaultSignatures #-}+             UndecidableInstances, GADTs, DefaultSignatures #-}  ----------------------------------------------------------------------------- -- |@@ -26,24 +26,23 @@ import Data.Singletons.Prelude.Instances import Data.Singletons.Util import Data.Singletons.Promote--#if __GLASGOW_HASKELL__ >= 707 import Data.Type.Equality-#endif --- | The promoted analogue of 'Eq'. If you supply no definition for '(:==)' under--- GHC 7.8+, then it defaults to a use of '(==)', from @Data.Type.Equality@.+-- NB: These must be defined by hand because of the custom handling of the+-- default for (:==) to use Data.Type.Equality.==++-- | The promoted analogue of 'Eq'. If you supply no definition for '(:==)',+-- then it defaults to a use of '(==)', from @Data.Type.Equality@. class kproxy ~ 'KProxy => PEq (kproxy :: KProxy a) where   type (:==) (x :: a) (y :: a) :: Bool   type (:/=) (x :: a) (y :: a) :: Bool -#if __GLASGOW_HASKELL__ < 707-  type (x :: a) :== (y :: a) = Not (x :/= y)-#else   type (x :: a) :== (y :: a) = x == y-#endif   type (x :: a) :/= (y :: a) = Not (x :== y) +infix 4 :==+infix 4 :/=+ $(genDefunSymbols [''(:==), ''(:/=)])  -- | The singleton analogue of 'Eq'. Unlike the definition for 'Eq', it is required@@ -51,6 +50,7 @@ class (kparam ~ 'KProxy) => SEq (kparam :: KProxy k) where   -- | Boolean equality on singletons   (%:==) :: forall (a :: k) (b :: k). Sing a -> Sing b -> Sing (a :== b)+  infix 4 %:==    -- | Boolean disequality on singletons   (%:/=) :: forall (a :: k) (b :: k). Sing a -> Sing b -> Sing (a :/= b)@@ -58,5 +58,6 @@                     ((a :/= b) ~ Not (a :== b))                  => Sing a -> Sing b -> Sing (a :/= b)   a %:/= b = sNot (a %:== b)+  infix 4 %:/=  $(singEqInstances basicTypes)
src/Data/Singletons/Prelude/Instances.hs view
@@ -8,14 +8,9 @@  -} -{-# LANGUAGE CPP, RankNTypes, DataKinds, PolyKinds, GADTs, TypeFamilies,+{-# LANGUAGE RankNTypes, DataKinds, PolyKinds, GADTs, TypeFamilies,              FlexibleContexts, TemplateHaskell, ScopedTypeVariables,              UndecidableInstances, TypeOperators, FlexibleInstances #-}-#if __GLASGOW_HASKELL__ < 707-  -- optimizing instances of SDecide cause GHC to die (#8467)-{-# OPTIONS_GHC -O0 #-}-#endif- {-# OPTIONS_GHC -fno-warn-orphans #-}  module Data.Singletons.Prelude.Instances where@@ -26,3 +21,14 @@ -- some useful singletons $(genSingletons basicTypes) $(singDecideInstances basicTypes)++-- basic definitions we need right away++$(singletonsOnly [d|+  foldl        :: forall a b. (b -> a -> b) -> b -> [a] -> b+  foldl f z0 xs0 = lgo z0 xs0+               where+                 lgo :: b -> [a] -> b+                 lgo z []     =  z+                 lgo z (x:xs) = lgo (f z x) xs+  |])
src/Data/Singletons/Prelude/List.hs view
@@ -1,10 +1,7 @@-{-# LANGUAGE CPP, TypeOperators, DataKinds, PolyKinds, TypeFamilies,+{-# LANGUAGE TypeOperators, DataKinds, PolyKinds, TypeFamilies,              TemplateHaskell, GADTs, UndecidableInstances, RankNTypes,              ScopedTypeVariables, FlexibleContexts #-}--#if __GLASGOW_HASKELL__ < 707-{-# OPTIONS_GHC -fno-warn-name-shadowing #-}-#endif+{-# OPTIONS_GHC -O0 #-} ----------------------------------------------------------------------------- -- | -- Module      :  Data.Singletons.Prelude.List@@ -104,7 +101,7 @@   NilSym0,   (:$), (:$$), (:$$$), -  (:++$$), (:++$), HeadSym0, HeadSym1, LastSym0, LastSym1,+  (:++$$$), (:++$$), (:++$), HeadSym0, HeadSym1, LastSym0, LastSym1,   TailSym0, TailSym1, InitSym0, InitSym1, NullSym0, NullSym1,    MapSym0, MapSym1, MapSym2, ReverseSym0, ReverseSym1,@@ -148,7 +145,7 @@   ZipSym0, ZipSym1, ZipSym2,   Zip3Sym0, Zip3Sym1, Zip3Sym2, Zip3Sym3,   ZipWithSym0, ZipWithSym1, ZipWithSym2, ZipWithSym3,-  ZipWith3Sym0, ZipWith3Sym1, ZipWith3Sym2, ZipWith3Sym3,+  ZipWith3Sym0, ZipWith3Sym1, ZipWith3Sym2, ZipWith3Sym3, ZipWith3Sym4,   UnzipSym0, UnzipSym1,   Unzip3Sym0, Unzip3Sym1,   Unzip4Sym0, Unzip4Sym1,@@ -191,11 +188,9 @@   head []      = error "Data.Singletons.List.head: empty list"    last :: [a] -> a-  last []      =  error "Data.Singletons.List.last: empty list"-  last (x:xs)  =  last' x xs-    where last' :: a -> [a] -> a-          last' y []     = y-          last' _ (y:ys) = last' y ys+  last []       =  error "Data.Singletons.List.last: empty list"+  last [x]      =  x+  last (_:x:xs) =  last (x:xs)    tail :: [a] -> [a]   tail (_ : t) = t@@ -248,13 +243,6 @@               interleave' f (y:ys) r = let (us,zs) = interleave' (f . (y:)) ys r                                        in  (y:us, f (t:y:us) : zs) -  foldl        :: (b -> a -> b) -> b -> [a] -> b-  foldl f z0 xs0 = lgo z0 xs0-               where-                 lgo :: b -> [a] -> b-                 lgo z []     =  z-                 lgo z (x:xs) = lgo (f z x) xs-   foldl'           :: forall a b. (b -> a -> b) -> b -> [a] -> b   foldl' f z0 xs0 = lgo z0 xs0       where lgo :: b -> [a] -> b@@ -458,6 +446,7 @@    (\\)                    :: (Eq a) => [a] -> [a] -> [a]   (\\)                    =  foldl (flip delete)+  infix 5 \\    deleteBy                :: (a -> a -> Bool) -> a -> [a] -> [a]   deleteBy _  _ []        = []@@ -496,4 +485,3 @@                                          LT -> x    |])-
src/Data/Singletons/Prelude/Maybe.hs view
@@ -1,10 +1,6 @@ {-# LANGUAGE TemplateHaskell, ScopedTypeVariables, TypeFamilies,              DataKinds, PolyKinds, UndecidableInstances, GADTs,-             RankNTypes, CPP #-}--#if __GLASGOW_HASKELL__ < 707-{-# OPTIONS_GHC -fno-warn-name-shadowing #-}-#endif+             RankNTypes #-}  ----------------------------------------------------------------------------- -- |
+ src/Data/Singletons/Prelude/Num.hs view
@@ -0,0 +1,130 @@+{-# LANGUAGE TemplateHaskell, PolyKinds, DataKinds, TypeFamilies,+             TypeOperators, GADTs, ScopedTypeVariables, UndecidableInstances,+             DefaultSignatures, FlexibleContexts+  #-}++-----------------------------------------------------------------------------+-- |+-- Module      :  Data.Singletons.Prelude.Num+-- Copyright   :  (C) 2014 Richard Eisenberg+-- License     :  BSD-style (see LICENSE)+-- Maintainer  :  Richard Eisenberg (eir@cis.upenn.edu)+-- Stability   :  experimental+-- Portability :  non-portable+--+-- Defines and exports promoted and singleton versions of definitions from+-- GHC.Num.+--+----------------------------------------------------------------------------++module Data.Singletons.Prelude.Num (+  PNum(..), SNum(..), Subtract, sSubtract,++  -- ** Defunctionalization symbols+  (:+$), (:+$$), (:+$$$),+  (:-$), (:-$$), (:-$$$),+  (:*$), (:*$$), (:*$$$),+  NegateSym0, NegateSym1,+  AbsSym0, AbsSym1,+  SignumSym0, SignumSym1,+  FromIntegerSym0, FromIntegerSym1,+  SubtractSym0, SubtractSym1, SubtractSym2+  ) where++import Data.Singletons.Single+import Data.Singletons+import Data.Singletons.TypeLits.Internal+import Data.Singletons.Decide+import GHC.TypeLits+import Data.Proxy+import Unsafe.Coerce++$(singletonsOnly [d|+  -- | Basic numeric class.+  --+  -- Minimal complete definition: all except 'negate' or @(-)@+  class  Num a  where+      (+), (-), (*)       :: a -> a -> a+      infixl 6 ++      infixl 6 -+      infixl 6 *+      -- | Unary negation.+      negate              :: a -> a+      -- | Absolute value.+      abs                 :: a -> a+      -- | Sign of a number.+      -- The functions 'abs' and 'signum' should satisfy the law:+      --+      -- > abs x * signum x == x+      --+      -- For real numbers, the 'signum' is either @-1@ (negative), @0@ (zero)+      -- or @1@ (positive).+      signum              :: a -> a+      -- | Conversion from a 'Nat'.+      fromInteger         :: Nat -> a++      x - y               = x + negate y++      negate x            = 0 - x+  |])++-- PNum instance+type family SignumNat (a :: Nat) :: Nat where+  SignumNat 0 = 0+  SignumNat x = 1++instance PNum ('KProxy :: KProxy Nat) where+  type a :+ b = a + b+  type a :- b = a - b+  type a :* b = a * b+  type Negate (a :: Nat) = Error "Cannot negate a natural number"+  type Abs (a :: Nat) = a+  type Signum a = SignumNat a+  type FromInteger a = a++-- SNum instance+instance SNum ('KProxy :: KProxy Nat) where+  sa %:+ sb =+    let a = fromSing sa+        b = fromSing sb+        ex = someNatVal (a + b)+    in+    case ex of+      Just (SomeNat (_ :: Proxy ab)) -> unsafeCoerce (SNat :: Sing ab)+      Nothing                        -> error "Two naturals added to a negative?"++  sa %:- sb =+    let a = fromSing sa+        b = fromSing sb+        ex = someNatVal (a - b)+    in+    case ex of+      Just (SomeNat (_ :: Proxy ab)) -> unsafeCoerce (SNat :: Sing ab)+      Nothing                        ->+        error "Negative natural-number singletons are naturally not allowed."++  sa %:* sb =+    let a = fromSing sa+        b = fromSing sb+        ex = someNatVal (a * b)+    in+    case ex of+      Just (SomeNat (_ :: Proxy ab)) -> unsafeCoerce (SNat :: Sing ab)+      Nothing                        ->+        error "Two naturals multiplied to a negative?"++  sNegate _ = error "Cannot call sNegate on a natural number singleton."++  sAbs x = x++  sSignum sx =+    case sx %~ (sing :: Sing 0) of+      Proved Refl -> sing :: Sing 0+      Disproved _ -> unsafeCoerce (sing :: Sing 1)++  sFromInteger x = x++$(singletonsOnly [d|+  subtract :: Num a => a -> a -> a+  subtract x y = y - x+  |])
src/Data/Singletons/Prelude/Ord.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE TemplateHaskell, DataKinds, PolyKinds, ScopedTypeVariables,              TypeFamilies, TypeOperators, GADTs, UndecidableInstances,-             FlexibleContexts, DefaultSignatures #-}+             FlexibleContexts, DefaultSignatures, InstanceSigs #-}  ----------------------------------------------------------------------------- -- |@@ -37,18 +37,20 @@   MinSym0, MinSym1, MinSym2   ) where -import Data.Singletons.Promote import Data.Singletons.Single import Data.Singletons.Prelude.Eq import Data.Singletons.Prelude.Instances import Data.Singletons.Prelude.Bool-import Data.Singletons import Data.Singletons.Util -$(promoteOnly [d|+$(singletonsOnly [d|   class  (Eq a) => Ord a  where     compare              :: a -> a -> Ordering     (<), (<=), (>), (>=) :: a -> a -> Bool+    infix 4 <=+    infix 4 <+    infix 4 >+    infix 4 >=     max, min             :: a -> a -> a      compare x y = if x == y then EQ@@ -58,68 +60,18 @@                   else if x <= y then LT                   else GT -    x <  y = case compare x y of { LT -> True;  _ -> False }-    x <= y = case compare x y of { GT -> False; _ -> True }-    x >  y = case compare x y of { GT -> True;  _ -> False }-    x >= y = case compare x y of { LT -> False; _ -> True }+    x <  y = case compare x y of { LT -> True;  EQ -> False; GT -> False }+    x <= y = case compare x y of { LT -> True;  EQ -> True;  GT -> False }+    x >  y = case compare x y of { LT -> False; EQ -> False; GT -> True }+    x >= y = case compare x y of { LT -> False; EQ -> True;  GT -> True }          -- These two default methods use '<=' rather than 'compare'         -- because the latter is often more expensive     max x y = if x <= y then y else x     min x y = if x <= y then x else y     -- Not handled by TH: {-# MINIMAL compare | (<=) #-}-  |]) -type family CaseOrdering (ord :: Ordering) (lt :: k) (eq :: k) (gt :: k) :: k-type instance CaseOrdering 'LT lt eq gt = lt-type instance CaseOrdering 'EQ lt eq gt = eq-type instance CaseOrdering 'GT lt eq gt = gt--class (kproxy ~ 'KProxy, SEq ('KProxy :: KProxy a))-      => SOrd (kproxy :: KProxy 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)-  (%:>)    :: forall (x :: a) (y :: a). Sing x -> Sing y -> Sing (x :> y)-  (%:>=)   :: forall (x :: a) (y :: a). Sing x -> Sing y -> Sing (x :>= y)-  sMax      :: forall (x :: a) (y :: a). Sing x -> Sing y -> Sing (Max x y)-  sMin      :: forall (x :: a) (y :: a). Sing x -> Sing y -> Sing (Min x y)--  default sCompare :: forall (x :: a) (y :: a).-                      (Compare x y ~ If (x :== y) 'EQ (If (x :<= y) 'LT 'GT))-                   => Sing x -> Sing y -> Sing (Compare x y)-  sCompare x y = sIf (x %:== y) SEQ-                     (sIf (x %:<= y) SLT SGT)--  default (%:<) :: forall (x :: a) (y :: a).-                   ((x :< y) ~ CaseOrdering (Compare x y) 'True 'False 'False)-                => Sing x -> Sing y -> Sing (x :< y)-  x %:< y = case sCompare x y of { SLT -> STrue; SEQ -> SFalse; SGT -> SFalse }--  default (%:<=) :: forall (x :: a) (y :: a).-                    ((x :<= y) ~ CaseOrdering (Compare x y) 'True 'True 'False)-                 => Sing x -> Sing y -> Sing (x :<= y)-  x %:<= y = case sCompare x y of { SLT -> STrue; SEQ -> STrue; SGT -> SFalse }--  default (%:>) :: forall (x :: a) (y :: a).-                   ((x :> y) ~ CaseOrdering (Compare x y) 'False 'False 'True)-                => Sing x -> Sing y -> Sing (x :> y)-  x %:> y = case sCompare x y of { SLT -> SFalse; SEQ -> SFalse; SGT -> STrue }--  default (%:>=) :: forall (x :: a) (y :: a).-                    ((x :>= y) ~ CaseOrdering (Compare x y) 'False 'True 'True)-                 => Sing x -> Sing y -> Sing (x :>= y)-  x %:>= y = case sCompare x y of { SLT -> SFalse; SEQ -> STrue; SGT -> STrue }--  default sMax :: forall (x :: a) (y :: a).-                  (Max x y ~ If (x :<= y) y x)-               => Sing x -> Sing y -> Sing (Max x y)-  sMax x y = sIf (x %:<= y) y x--  default sMin :: forall (x :: a) (y :: a).-                  (Min x y ~ If (x :<= y) x y)-               => Sing x -> Sing y -> Sing (Min x y)-  sMin x y = sIf (x %:<= y) x y+  |])  $(singletons [d|   thenCmp :: Ordering -> Ordering -> Ordering@@ -128,4 +80,4 @@   thenCmp GT _ = GT   |]) -$(promoteOrdInstances basicTypes)+$(singOrdInstances basicTypes)
src/Data/Singletons/Prelude/Tuple.hs view
@@ -1,9 +1,5 @@ {-# LANGUAGE TemplateHaskell, ScopedTypeVariables, DataKinds, PolyKinds,-             RankNTypes, TypeFamilies, GADTs, CPP, UndecidableInstances #-}--#if __GLASGOW_HASKELL__ < 707-{-# OPTIONS_GHC -fno-warn-name-shadowing #-}-#endif+             RankNTypes, TypeFamilies, GADTs, UndecidableInstances #-}  ----------------------------------------------------------------------------- -- |
src/Data/Singletons/Promote.hs view
@@ -7,32 +7,29 @@ type level. It is an internal module to the singletons package. -} -{-# LANGUAGE TemplateHaskell, CPP, MultiWayIf, LambdaCase, TupleSections #-}+{-# LANGUAGE TemplateHaskell, MultiWayIf, LambdaCase, TupleSections, CPP #-}  module Data.Singletons.Promote where  import Language.Haskell.TH hiding ( Q, cxt )-import Language.Haskell.TH.Syntax ( qNewName )+import Language.Haskell.TH.Syntax ( Quasi(..) ) import Language.Haskell.TH.Desugar-import Language.Haskell.TH.Desugar.Lift () import Data.Singletons.Names import Data.Singletons.Promote.Monad import Data.Singletons.Promote.Eq-import Data.Singletons.Promote.Ord-import Data.Singletons.Promote.Bounded import Data.Singletons.Promote.Defun import Data.Singletons.Promote.Type+import Data.Singletons.Deriving.Ord+import Data.Singletons.Deriving.Bounded+import Data.Singletons.Deriving.Enum+import Data.Singletons.Partition import Data.Singletons.Util import Data.Singletons.Syntax import Prelude hiding (exp) import Control.Monad-import Data.Maybe import qualified Data.Map.Strict as Map import Data.Map.Strict ( Map )--#if __GLASGOW_HASKELL__ < 709-import Control.Applicative-#endif+import Data.Maybe  -- | Generate promoted definitions from a type that is already defined. -- This is generally only useful with classes.@@ -52,7 +49,9 @@   promDecls <- promoteM_ decls $ promoteDecs ddecls   return $ decls ++ decsToTH promDecls --- | Promote each declaration, discarding the originals.+-- | 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@@ -72,56 +71,50 @@ promoteEqInstances :: DsMonad q => [Name] -> q [Dec] promoteEqInstances = concatMapM promoteEqInstance --- | Produce instances for 'Compare' from the given types+-- | Produce instances for 'POrd' from the given types promoteOrdInstances :: DsMonad q => [Name] -> q [Dec] promoteOrdInstances = concatMapM promoteOrdInstance --- | Produce instances for 'MinBound' and 'MaxBound' from the given types+-- | Produce an instance for 'POrd' from the given type+promoteOrdInstance :: DsMonad q => Name -> q [Dec]+promoteOrdInstance = promoteInstance mkOrdInstance "Ord"++-- | Produce instances for 'PBounded' from the given types promoteBoundedInstances :: DsMonad q => [Name] -> q [Dec] promoteBoundedInstances = concatMapM promoteBoundedInstance +-- | Produce an instance for 'PBounded' from the given type+promoteBoundedInstance :: DsMonad q => Name -> q [Dec]+promoteBoundedInstance = promoteInstance mkBoundedInstance "Bounded"++-- | Produce instances for 'PEnum' from the given types+promoteEnumInstances :: DsMonad q => [Name] -> q [Dec]+promoteEnumInstances = concatMapM promoteEnumInstance++-- | Produce an instance for 'PEnum' from the given type+promoteEnumInstance :: DsMonad q => Name -> q [Dec]+promoteEnumInstance = promoteInstance mkEnumInstance "Enum"+ -- | Produce an instance for '(:==)' (type-level equality) from the given type promoteEqInstance :: DsMonad q => Name -> q [Dec] promoteEqInstance name = do   (_tvbs, cons) <- getDataD "I cannot make an instance of (:==) for it." name   cons' <- mapM dsCon cons-#if __GLASGOW_HASKELL__ >= 707   vars <- replicateM (length _tvbs) (qNewName "k")   kind <- promoteType (foldType (DConT name) (map DVarT vars))   inst_decs <- mkEqTypeInstance kind cons'   return $ decsToTH inst_decs-#else-  let pairs = [(c1, c2) | c1 <- cons, c2 <- cons]-  mapM (fmap decsToTH . mkEqTypeInstance) pairs-#endif --- | Produce an instance for 'Compare' from the given type-promoteOrdInstance :: DsMonad q => Name -> q [Dec]-promoteOrdInstance name = do-  (_tvbs, cons) <- getDataD "I cannot make an instance of Ord for it." name-  cons' <- mapM dsCon cons-#if __GLASGOW_HASKELL__ >= 707-  vars <- replicateM (length _tvbs) (qNewName "k")-  kind <- promoteType (foldType (DConT name) (map DVarT vars))-  inst_decs <- mkOrdTypeInstance kind cons'-  return $ decsToTH inst_decs-#else-  fail "promoteOrdInstance not implemented for GHC 7.6"-#endif---- | Produce an instance for 'MinBound' and 'MaxBound' from the given type-promoteBoundedInstance :: DsMonad q => Name -> q [Dec]-promoteBoundedInstance name = do-  (_tvbs, cons) <- getDataD "I cannot make an instance of Bounded for it." name+promoteInstance :: DsMonad q => (DType -> [DCon] -> q UInstDecl)+                -> 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   cons' <- mapM dsCon cons-#if __GLASGOW_HASKELL__ >= 707-  vars <- replicateM (length _tvbs) (qNewName "k")-  kind <- promoteType (foldType (DConT name) (map DVarT vars))-  inst_decs <- mkBoundedTypeInstance kind cons'-  return $ decsToTH inst_decs-#else-  fail "promoteBoundedInstance not implemented for GHC 7.6"-#endif+  tvbs' <- mapM dsTvb tvbs+  raw_inst <- mk_inst (foldType (DConT name) (map tvbToType tvbs')) cons'+  decs <- promoteM_ [] $ void $ promoteInstanceDec Map.empty raw_inst+  return $ decsToTH decs  promoteInfo :: DInfo -> PrM () promoteInfo (DTyConI dec _instances) = promoteDecs [dec]@@ -170,9 +163,9 @@  -- Promote a list of top-level declarations. promoteDecs :: [DDec] -> PrM ()-promoteDecs decls = do+promoteDecs raw_decls = do+  decls <- expand raw_decls     -- expand type synonyms   checkForRepInDecls decls-  -- See Note [Promoting declarations in two stages]   PDecs { pd_let_decs              = let_decs         , pd_class_decs            = classes         , pd_instance_decs         = insts@@ -180,8 +173,9 @@      -- promoteLetDecs returns LetBinds, which we don't need at top level   _ <- promoteLetDecs noPrefix let_decs-  (cls_tvb_env, meth_sigs) <- concatMapM promoteClassDec classes-  mapM_ (promoteInstanceDec cls_tvb_env meth_sigs) insts+  mapM_ promoteClassDec classes+  let all_meth_sigs = foldMap (lde_types . cd_lde) classes+  mapM_ (promoteInstanceDec all_meth_sigs) insts   promoteDataDecs datas  promoteDataDecs :: [DataDecl] -> PrM ()@@ -193,13 +187,14 @@     extract_rec_selectors :: DataDecl -> PrM [DLetDec]     extract_rec_selectors (DataDecl _nd data_name tvbs cons _derivings) =       let arg_ty = foldType (DConT data_name)-                            (map (DVarT . extractTvbName) tvbs)+                            (map tvbToType tvbs)       in       concatMapM (getRecordSelectors arg_ty) cons  -- curious about ALetDecEnv? See the LetDecEnv module for an explanation. promoteLetDecs :: (String, String) -- (alpha, symb) prefixes to use                -> [DLetDec] -> PrM ([LetBind], ALetDecEnv)+  -- See Note [Promoting declarations in two stages] promoteLetDecs prefixes decls = do   let_dec_env <- buildLetDecEnv decls   all_locals <- allLocals@@ -226,79 +221,55 @@ --  * for each nullary data constructor we generate a type synonym promoteDataDec :: DataDecl -> PrM () promoteDataDec (DataDecl _nd name tvbs ctors derivings) = do-#if __GLASGOW_HASKELL__ < 707-  when (_nd == Newtype) $-    fail $ "Newtypes don't promote under GHC 7.6. " ++-           "Use <<data>> instead or upgrade GHC."-#endif   -- deriving Eq instance-  _kvs <- replicateM (length tvbs) (qNewName "k")-  _kind <- promoteType (foldType (DConT name) (map DVarT _kvs))+  kvs <- replicateM (length tvbs) (qNewName "k")+  kind <- promoteType (foldType (DConT name) (map DVarT kvs))   when (elem eqName derivings) $ do-#if __GLASGOW_HASKELL__ >= 707-    eq_decs <- mkEqTypeInstance _kind ctors-#else-    let pairs = [ (c1, c2) | c1 <- ctors, c2 <- ctors ]-    eq_decs <- mapM mkEqTypeInstance pairs-#endif+    eq_decs <- mkEqTypeInstance kind ctors     emitDecs eq_decs -  -- deriving Ord instance-  when (elem ordName derivings) $ do-#if __GLASGOW_HASKELL__ >= 707-    ord_decs <- mkOrdTypeInstance _kind ctors-#else-    fail "Ord deriving not yet implemented in GHC 7.6"-#endif-    emitDecs ord_decs--  -- deriving Bounded instance-  when (elem boundedName derivings) $ do-#if __GLASGOW_HASKELL__ >= 707-    bounded_decs <- mkBoundedTypeInstance _kind ctors-#else-    fail "Bounded deriving not yet implemented in GHC 7.6"-#endif-    emitDecs bounded_decs-   ctorSyms <- buildDefunSymsDataD name tvbs ctors   emitDecs ctorSyms -promoteClassDec :: ClassDecl-                -> PrM ( Map Name [Name]    -- from class names to tyvar lists-                       , Map Name DType )   -- returns method signatures-promoteClassDec (ClassDecl cxt cls_name tvbs-                           (LetDecEnv { lde_defns = defaults-                                      , lde_types = meth_sigs-                                      , lde_infix = infix_decls })) = do-  let tvbNames = map extractTvbName tvbs-      pClsName = promoteClassName cls_name-  kproxies <- mapM (const $ qNewName "kproxy") tvbs+promoteClassDec :: UClassDecl+                -> PrM AClassDecl+promoteClassDec decl@(ClassDecl { cd_cxt  = cxt+                                , cd_name = cls_name+                                , cd_tvbs = tvbs+                                , cd_fds  = fundeps+                                , cd_lde  = lde@LetDecEnv+                                    { lde_defns = defaults+                                    , lde_types = meth_sigs+                                    , lde_infix = infix_decls } }) = do+  let pClsName = promoteClassName cls_name+  (ptvbs, proxyCxt) <- mkKProxies (map extractTvbName tvbs)   pCxt <- mapM promote_superclass_pred cxt-  let proxyCxt = map (\kp -> foldl DAppPr (DConPr equalityName)-                                   [DVarT kp, DConT kProxyDataName]) kproxies-      cxt'  = pCxt ++ proxyCxt-      ptvbs = zipWith (\proxy tvbName -> DKindedTV proxy-                                           (DConK kProxyTypeName [DVarK tvbName]))-                      kproxies tvbNames-  sig_decs     <- mapM (uncurry promote_sig) (Map.toList meth_sigs)+  let cxt'  = pCxt ++ proxyCxt+  sig_decs <- mapM (uncurry promote_sig) (Map.toList meth_sigs)      -- the first arg to promoteMethod is a kind subst. We actually don't      -- want to subst for default instances, so we pass Map.empty-  default_decs <- concatMapM (promoteMethod Map.empty meth_sigs)-                             (Map.toList defaults)+  let defaults_list  = Map.toList defaults+      defaults_names = map fst defaults_list+  (default_decs, ann_rhss, prom_rhss)+    <- mapAndUnzip3M (promoteMethod Map.empty meth_sigs) defaults_list+   let infix_decls' = catMaybes $ map (uncurry promoteInfixDecl) infix_decls-  emitDecs [ DClassD cxt' pClsName ptvbs [] (sig_decs ++-                                             default_decs ++-                                             infix_decls') ]-  return ( Map.singleton cls_name tvbNames-         , meth_sigs )++  -- no need to do anything to the fundeps. They work as is!+  emitDecs [DClassD cxt' pClsName ptvbs fundeps+                    (sig_decs ++ default_decs ++ infix_decls')]+  let defaults_list' = zip defaults_names ann_rhss+      proms          = zip defaults_names prom_rhss+  return (decl { cd_lde = lde { lde_defns = Map.fromList defaults_list'+                              , lde_proms = Map.fromList proms } })   where     promote_sig :: Name -> DType -> PrM DDec     promote_sig name ty = do       let proName = promoteValNameLhs name-      (argKs, resK) <- snocView `liftM` (mapM promoteType (snd $ unravel ty))+      (argKs, resK) <- promoteUnraveled ty       args <- mapM (const $ qNewName "arg") argKs       emitDecsM $ defunctionalize proName (map Just argKs) (Just resK)+       return $ DFamilyD TypeFam proName                         (zipWith DKindedTV args argKs)                         (Just resK)@@ -312,122 +283,100 @@                               ++ show name       go (DConPr name)  = return $ DConPr (promoteClassName name) -promoteInstanceDec :: Map Name [Name] -> Map Name DType -> InstDecl -> PrM ()-promoteInstanceDec cls_tvb_env meth_sigs-                   (InstDecl cls_name inst_tys meths) = do+-- returns (unpromoted method name, ALetDecRHS) pairs+promoteInstanceDec :: Map Name DType -> UInstDecl -> PrM AInstDecl+promoteInstanceDec meth_sigs+                   decl@(InstDecl { id_name     = cls_name+                                  , id_arg_tys  = inst_tys+                                  , id_meths    = meths }) = do   cls_tvb_names <- lookup_cls_tvb_names   inst_kis <- mapM promoteType inst_tys   let subst = Map.fromList $ zip cls_tvb_names inst_kis-  meths' <- concatMapM (promoteMethod subst meth_sigs) meths+  (meths', ann_rhss, _) <- mapAndUnzip3M (promoteMethod subst meth_sigs) meths   emitDecs [DInstanceD [] (foldType (DConT pClsName)                                     (map kindParam inst_kis)) meths']+  return (decl { id_meths = zip (map fst meths) ann_rhss })   where     pClsName = promoteClassName cls_name -    lookup_cls_tvb_names :: PrM [String]-    lookup_cls_tvb_names = case Map.lookup cls_name cls_tvb_env of-      Nothing -> do-        m_dinfo <- dsReify pClsName-        case m_dinfo of-          Just (DTyConI (DClassD _cxt _name cls_tvbs _fds _decs) _insts) -> do-            mapM extract_kv_name cls_tvbs-          _ -> fail $ "Cannot find class declaration for " ++ show cls_name-          -- See Note [Bad Names in reification]-      Just tvb_names -> return $ map nameBase tvb_names+    lookup_cls_tvb_names :: PrM [Name]+    lookup_cls_tvb_names = do+      mb_info <- dsReify pClsName+      case mb_info of+        Just (DTyConI (DClassD _ _ tvbs _ _) _) -> return (map extract_kv_name tvbs)+        _ -> do+          mb_info' <- dsReify cls_name+          case mb_info' of+            Just (DTyConI (DClassD _ _ tvbs _ _) _) -> return (map extractTvbName tvbs)+            _ -> fail $ "Cannot find class declaration annotation for " ++ show cls_name -    extract_kv_name :: DTyVarBndr -> PrM String-    extract_kv_name (DKindedTV _kpVar (DConK _kpType [DVarK kv])) =-      -- See Note [Bad Names in reification]-      return $ nameBase kv-    extract_kv_name tvb =-      fail $ "Unexpected parameter to promoted class: " ++ show tvb+    extract_kv_name :: DTyVarBndr -> Name+    extract_kv_name (DKindedTV _ (DConK _kproxy [DVarK kv_name])) = kv_name+    extract_kv_name tvb = error $ "Internal error: extract_kv_name\n" ++ show tvb --- Note [Bad Names in reification]--- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--- For reasons I (RAE) don't understand, reifying a class and reifying an--- associated type family sometimes produce *different* Names for the--- associated type/kind variables. This wreaks havoc with the type subst--- algorithm in promoteMethod. The solution? Ickily compare nameBases--- instead of proper Names. See also GHC#9081.+-- promoteMethod needs to substitute in a method's kind because GHC does not do+-- enough kind checking of associated types. See GHC#9063. When that bug is fixed,+-- the substitution code can be removed.+-- Bug is fixed, but only in HEAD, naturally. When we stop supporting 7.8,+-- this can be rewritten more cleanly, I imagine.+-- UPDATE: GHC 7.10.2 didn't fully solve GHC#9063. Urgh. --- See Note [Bad Names in reification]-promoteMethod :: Map String DKind   -- instantiations for class tyvars+promoteMethod :: Map Name DKind     -- instantiations for class tyvars               -> Map Name DType     -- method types-              -> (Name, ULetDecRHS) -> PrM [DDec]+              -> (Name, ULetDecRHS)+              -> PrM (DDec, ALetDecRHS, DType)+                 -- returns (type instance, ALetDecRHS, promoted RHS) promoteMethod subst sigs_map (meth_name, meth_rhs) = do-  (payload, _defuns, _ann_rhs)+  ((_, _, _, eqns), _defuns, ann_rhs)     <- promoteLetDecRHS sigs_map noPrefix meth_name meth_rhs-  let eqns = payload_to_eqns payload   (arg_kis, res_ki) <- lookup_meth_ty-  let meth_arg_kis' = map subst_ki arg_kis-      meth_res_ki'  = subst_ki res_ki-      eqns'         = map (apply_kis meth_arg_kis' meth_res_ki') eqns-  return $ map (DTySynInstD proName) eqns'+  meth_arg_tvs <- mapM (const $ qNewName "a") arg_kis+  let meth_arg_kis' = map (substKind subst) arg_kis+      meth_res_ki'  = substKind subst res_ki+      helperNameBase = case nameBase proName of+                         first:_ | not (isHsLetter first) -> "TFHelper"+                         alpha                            -> alpha+  helperName <- newUniqueName helperNameBase+  emitDecs [DClosedTypeFamilyD helperName+                               (zipWith DKindedTV meth_arg_tvs meth_arg_kis')+                               (Just meth_res_ki') eqns]+  emitDecsM (defunctionalize helperName (map Just meth_arg_kis') (Just meth_res_ki'))+  return ( DTySynInstD+             proName+             (DTySynEqn (zipWith (DSigT . DVarT) meth_arg_tvs meth_arg_kis')+                        (foldApply (promoteValRhs helperName) (map DVarT meth_arg_tvs)))+         , ann_rhs+         , DConT (promoteTySym helperName 0) )   where     proName = promoteValNameLhs meth_name -    payload_to_eqns (Left (_name, tvbs, rhs)) =-      [DTySynEqn (map tvb_to_ty tvbs) rhs]-    payload_to_eqns (Right (_name, _tvbs, _res_ki, eqns)) = eqns--    tvb_to_ty (DPlainTV n)     = DVarT n-    tvb_to_ty (DKindedTV n ki) = DVarT n `DSigT` ki-     lookup_meth_ty :: PrM ([DKind], DKind)     lookup_meth_ty = case Map.lookup meth_name sigs_map of       Nothing -> do-          -- lookup the promoted name, just in case the term-level one-          -- isn't defined-        m_dinfo <- dsReify proName-        case m_dinfo of-          Just (DTyConI (DFamilyD _flav _name tvbs (Just res)) _insts) -> do-            arg_kis <- mapM (expect_just . extractTvbKind) tvbs-            return (arg_kis, res)-          _ -> fail $ "Cannot find type of " ++ show proName-      Just ty -> do-        let (_, tys) = unravel ty-        kis <- mapM promoteType tys-        return $ snocView kis--    expect_just :: Maybe a -> PrM a-    expect_just (Just x) = return x-    expect_just Nothing =-      fail "Internal error: unknown kind of a promoted class method."--    subst_ki :: DKind -> DKind-    subst_ki (DForallK {}) =-      error "Higher-rank kind encountered in instance method promotion."-    subst_ki (DVarK n) =-      -- See Note [Bad Names in reification]-      case Map.lookup (nameBase n) subst of-        Just ki -> ki-        Nothing -> DVarK n-    subst_ki (DConK con kis) = DConK con (map subst_ki kis)-    subst_ki (DArrowK k1 k2) = DArrowK (subst_ki k1) (subst_ki k2)-    subst_ki DStarK = DStarK--    apply_kis :: [DKind] -> DKind -> DTySynEqn -> DTySynEqn-    apply_kis arg_kis res_ki (DTySynEqn lhs rhs) =-      DTySynEqn (zipWith apply_ki lhs arg_kis) (apply_ki rhs res_ki)--    apply_ki :: DType -> DKind -> DType-    apply_ki = DSigT+        mb_info <- dsReify proName+        case mb_info of+          Just (DTyConI (DFamilyD _ _ tvbs mb_res_ki) _)+            -> return ( map (default_to_star . extractTvbKind) tvbs+                      , default_to_star mb_res_ki )+          _ -> fail $ "Cannot find type annotation for " ++ show proName+      Just ty -> promoteUnraveled ty +    default_to_star Nothing  = DStarK+    default_to_star (Just k) = k  promoteLetDecEnv :: (String, String) -> ULetDecEnv -> PrM ([DDec], ALetDecEnv) promoteLetDecEnv prefixes (LetDecEnv { lde_defns = value_env                                      , lde_types = type_env                                      , lde_infix = infix_decls }) = do-    -- deal with the infix_decls, to get them out of the way   let infix_decls'  = catMaybes $ map (uncurry promoteInfixDecl) infix_decls      -- promote all the declarations, producing annotated declarations-      (names, rhss) = unzip $ Map.toList value_env+  let (names, rhss) = unzip $ Map.toList value_env   (payloads, defun_decss, ann_rhss)     <- fmap unzip3 $ zipWithM (promoteLetDecRHS type_env prefixes) names rhss    emitDecs $ concat defun_decss-  let decs = map payload_to_dec payloads+  let decs = map payload_to_dec payloads ++ infix_decls'      -- build the ALetDecEnv   let let_dec_env' = LetDecEnv { lde_defns = Map.fromList $ zip names ann_rhss@@ -435,45 +384,40 @@                                , lde_infix = infix_decls                                , lde_proms = Map.empty }  -- filled in promoteLetDecs -  return (infix_decls' ++ decs, let_dec_env')+  return (decs, let_dec_env')   where-    payload_to_dec (Left  (name, tvbs, ty)) = DTySynD name tvbs ty-    payload_to_dec (Right (name, tvbs, m_ki, eqns)) =-      DClosedTypeFamilyD name tvbs m_ki eqns+    payload_to_dec (name, tvbs, m_ki, eqns) = DClosedTypeFamilyD name tvbs m_ki eqns  promoteInfixDecl :: Fixity -> Name -> Maybe DDec promoteInfixDecl fixity name-  | isUpcase name = Nothing   -- no need to promote the decl-  | otherwise     = Just $ DLetDec $ DInfixD fixity (promoteValNameLhs name)-+ | isUpcase name = Nothing   -- no need to promote the decl+ | otherwise     = Just $ DLetDec $ DInfixD fixity (promoteValNameLhs name)  -- 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 unwiedly intermediate structure. Perhaps a better design is available.+-- an intermediate structure. Perhaps a better design is available. promoteLetDecRHS :: Map Name DType       -- local type env't                  -> (String, String)     -- let-binding prefixes                  -> Name                 -- name of the thing being promoted                  -> ULetDecRHS           -- body of the thing-                 -> PrM ( Either-                            (Name, [DTyVarBndr], DType) -- "type synonym"-                            (Name, [DTyVarBndr], Maybe DKind, [DTySynEqn])-                                                        -- "type family"+                 -> PrM ( (Name, [DTyVarBndr], Maybe DKind, [DTySynEqn]) -- "type family"                         , [DDec]        -- defunctionalization                         , ALetDecRHS )  -- annotated RHS promoteLetDecRHS type_env prefixes name (UValue exp) = do-  (res_kind, mk_rhs, num_arrows)+  (res_kind, num_arrows)     <- case Map.lookup name type_env of-         Nothing -> return (Nothing, id, 0)+         Nothing -> return (Nothing, 0)          Just ty -> do            ki <- promoteType ty-           return (Just ki, (`DSigT` ki), countArgs ty)+           return (Just ki, countArgs ty)   case num_arrows of     0 -> do       all_locals <- allLocals       (exp', ann_exp) <- promoteExp exp       let proName = promoteValNameLhsPrefix prefixes name       defuns <- defunctionalize proName (map (const Nothing) all_locals) res_kind-      return ( Left (proName, map DPlainTV all_locals, mk_rhs exp')+      return ( ( proName, map DPlainTV all_locals, res_kind+               , [DTySynEqn (map DVarT all_locals) exp'] )              , defuns              , AValue (foldType (DConT proName) (map DVarT all_locals))                       num_arrows ann_exp )@@ -487,21 +431,12 @@ promoteLetDecRHS type_env prefixes name (UFunction clauses) = do   numArgs <- count_args clauses   (m_argKs, m_resK, ty_num_args) <- case Map.lookup name type_env of-#if __GLASGOW_HASKELL__ < 707-      -- we require a type signature here because GHC 7.6.3 doesn't support-      -- kind inference for type families-    Nothing -> fail ("No type signature for function \"" ++-                     (nameBase name) ++ "\". Cannot promote in GHC 7.6.3.\n" ++-                     "Either add a type signature or upgrade GHC.")-#else     Nothing -> return (replicate numArgs Nothing, Nothing, numArgs)-#endif     Just ty -> 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-      kis <- mapM promoteType (snd $ unravel ty)-      let (argKs, resultK) = snocView kis+      (argKs, resultK) <- promoteUnraveled ty       -- invariant: countArgs ty == length argKs       return (map Just argKs, Just resultK, length argKs) @@ -509,15 +444,14 @@   all_locals <- allLocals   defun_decs <- defunctionalize proName                 (map (const Nothing) all_locals ++ m_argKs) m_resK-  local_tvbs <- mapM inferKindTV all_locals+  let local_tvbs = map DPlainTV all_locals   tyvarNames <- mapM (const $ qNewName "a") m_argKs   expClauses <- mapM (etaExpand (ty_num_args - numArgs)) clauses   (eqns, ann_clauses) <- mapAndUnzipM promoteClause expClauses   prom_fun <- lookupVarE name-  args <- zipWithM inferMaybeKindTV tyvarNames m_argKs-  let all_args = local_tvbs ++ args-  resultK <- inferKind m_resK-  return ( Right (proName, all_args, resultK, eqns)+  let args     = zipWith inferMaybeKindTV tyvarNames m_argKs+      all_args = local_tvbs ++ args+  return ( (proName, all_args, m_resK, eqns)          , defun_decs          , AFunction prom_fun ty_num_args ann_clauses ) @@ -536,71 +470,75 @@ promoteClause (DClause pats exp) = do   -- promoting the patterns creates variable bindings. These are passed   -- to the function promoted the RHS-  (types, new_vars) <- evalForPair $ mapM promotePat pats+  ((types, pats'), new_vars) <- evalForPair $ mapAndUnzipM promotePat pats   (ty, ann_exp) <- lambdaBind new_vars $ promoteExp exp   all_locals <- allLocals   -- these are bound *outside* of this clause   return ( DTySynEqn (map DVarT all_locals ++ types) ty-         , ADClause new_vars pats ann_exp )+         , ADClause new_vars pats' ann_exp )  promoteMatch :: DType -> DMatch -> PrM (DTySynEqn, ADMatch) promoteMatch prom_case (DMatch pat exp) = do   -- promoting the patterns creates variable bindings. These are passed   -- to the function promoted the RHS-  (ty, new_vars) <- evalForPair $ promotePat pat+  ((ty, pat'), new_vars) <- evalForPair $ promotePat pat   (rhs, ann_exp) <- lambdaBind new_vars $ promoteExp exp   all_locals <- allLocals   return $ ( DTySynEqn (map DVarT all_locals ++ [ty]) rhs-           , ADMatch new_vars prom_case pat ann_exp)+           , ADMatch new_vars prom_case pat' ann_exp)  -- promotes a term pattern into a type pattern, accumulating bound variable names-promotePat :: DPat -> QWithAux VarPromotions PrM DType-promotePat (DLitPa lit) = promoteLit lit+-- See Note [No wildcards in singletons]+promotePat :: DPat -> QWithAux VarPromotions PrM (DType, DPat)+promotePat (DLitPa lit) = do+  lit' <- promoteLitPat lit+  return (lit', DLitPa lit) promotePat (DVarPa name) = do       -- term vars can be symbols... type vars can't!   tyName <- mkTyName name   addElement (name, tyName)-  return $ DVarT tyName+  return (DVarT tyName, DVarPa name) promotePat (DConPa name pats) = do-  types <- mapM promotePat pats+  (types, pats') <- mapAndUnzipM promotePat pats   let name' = unboxed_tuple_to_tuple name-  return $ foldType (DConT name') types+  return (foldType (DConT name') types, DConPa name pats')   where     unboxed_tuple_to_tuple n       | Just deg <- unboxedTupleNameDegree_maybe n = tupleDataName deg       | otherwise                                  = n promotePat (DTildePa pat) = do   qReportWarning "Lazy pattern converted into regular pattern in promotion"-  promotePat pat+  (ty, pat') <- promotePat pat+  return (ty, DTildePa pat') promotePat (DBangPa pat) = do   qReportWarning "Strict pattern converted into regular pattern in promotion"-  promotePat pat+  (ty, pat') <- promotePat pat+  return (ty, DBangPa pat') promotePat DWildPa = do-  name <- qNewName "z"-  return $ DVarT name+  name <- newUniqueName "_z"+  tyName <- mkTyName name+  addElement (name, tyName)+  return (DVarT tyName, DVarPa name)  promoteExp :: DExp -> PrM (DType, ADExp) promoteExp (DVarE name) = fmap (, ADVarE name) $ lookupVarE name promoteExp (DConE name) = return $ (promoteValRhs name, ADConE name)-promoteExp (DLitE lit)  = fmap (, ADLitE lit) $ promoteLit lit+promoteExp (DLitE lit)  = fmap (, ADLitE lit) $ promoteLitExp lit promoteExp (DAppE exp1 exp2) = do   (exp1', ann_exp1) <- promoteExp exp1   (exp2', ann_exp2) <- promoteExp exp2   return (apply exp1' exp2', ADAppE ann_exp1 ann_exp2) promoteExp (DLamE names exp) = do   lambdaName <- newUniqueName "Lambda"-  resultKVarName  <- qNewName "r"   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-  tvbs <- mapM inferKindTV all_args-  let resultK       = DVarK resultKVarName-      m_resultK     = unknownResult resultK+      tvbs     = map DPlainTV all_args   emitDecs [DClosedTypeFamilyD lambdaName                                tvbs-                               m_resultK+                               Nothing                                [DTySynEqn (map DVarT (all_locals ++ tyNames))                                           rhs]]   emitDecsM $ defunctionalize lambdaName (map (const Nothing) all_args) Nothing@@ -615,11 +553,12 @@   (eqns, ann_matches) <- mapAndUnzipM (promoteMatch prom_case) matches   tyvarName  <- qNewName "t"   let all_args = all_locals ++ [tyvarName]-  tvbs  <- mapM inferKindTV all_args-  resultK    <- fmap DVarK $ qNewName "r"-  emitDecs [DClosedTypeFamilyD caseTFName tvbs (unknownResult resultK) eqns]-  return ( prom_case `DAppT` exp'-         , ADCaseE ann_exp ann_matches )+      tvbs     = map DPlainTV all_args+  emitDecs [DClosedTypeFamilyD caseTFName tvbs Nothing eqns]+    -- See Note [Annotate case return type] in Single+  let applied_case = prom_case `DAppT` exp'+  return ( applied_case+         , ADCaseE ann_exp exp' ann_matches applied_case ) promoteExp (DLetE decs exp) = do   unique <- qNewUnique   let letPrefixes = uniquePrefixes "Let" ":<<<" unique@@ -630,12 +569,23 @@   (exp', ann_exp) <- promoteExp exp   ty' <- promoteType ty   return (DSigT exp' ty', ADSigE ann_exp ty)-promoteExp (DStaticE _) = fail "Promoting static expressions not yet supported"+promoteExp e@(DStaticE _) = fail ("Static expressions cannot be promoted: " ++ show e) -promoteLit :: Monad m => Lit -> m DType-promoteLit (IntegerL n)-  | n >= 0    = return $ DLitT (NumTyLit n)-  | otherwise = fail ("Promoting negative integers not supported: " ++ (show n))-promoteLit (StringL str) = return $ DLitT (StrTyLit str)-promoteLit lit =+promoteLitExp :: Monad m => Lit -> m DType+promoteLitExp (IntegerL n)+  | n >= 0    = return $ (DConT tyFromIntegerName `DAppT` DLitT (NumTyLit n))+  | otherwise = return $ (DConT tyNegateName `DAppT`+                          (DConT tyFromIntegerName `DAppT` DLitT (NumTyLit (-n))))+promoteLitExp (StringL str) = return $ DLitT (StrTyLit str)+promoteLitExp lit =+  fail ("Only string and natural number literals can be promoted: " ++ show lit)++promoteLitPat :: Monad m => Lit -> m DType+promoteLitPat (IntegerL n)+  | n >= 0    = return $ (DLitT (NumTyLit n))+  | otherwise =+    fail $ "Negative literal patterns are not allowed,\n" +++           "because literal patterns are promoted to natural numbers."+promoteLitPat (StringL str) = return $ DLitT (StrTyLit str)+promoteLitPat lit =   fail ("Only string and natural number literals can be promoted: " ++ show lit)
− src/Data/Singletons/Promote/Bounded.hs
@@ -1,53 +0,0 @@-{-# LANGUAGE TemplateHaskell #-}---------------------------------------------------------------------------------- |--- Module      :  Data.Singletons.Promote.Bounded--- Copyright   :  (C) 2014 Jan Stolarek--- License     :  BSD-style (see LICENSE)--- Maintainer  :  Jan Stolarek (jan.stolarek@p.lodz.pl)--- Stability   :  experimental--- Portability :  non-portable------ Implements deriving of promoted Bounded instances----------------------------------------------------------------------------------module Data.Singletons.Promote.Bounded where--import Language.Haskell.TH.Desugar-import Data.Singletons.Names-import Data.Singletons.Util-import Control.Monad--mkBoundedTypeInstance :: DsMonad q => DKind -> [DCon] -> q [DDec]-mkBoundedTypeInstance kind@(DConK name _) cons = do-  -- We can derive instance of Bounded if datatype is an enumeration (all-  -- constructors must be nullary) or has only one constructor. See Section 11-  -- of Haskell 2010 Language Report.-  -- Note that order of conditions below is important.-  when (null cons-       || (any (\(DCon _ _ _ f) -> not . null . tysOfConFields $ f) cons-            && (not . null . tail $ cons))) $-       fail ("Can't derive promoted Bounded instance for " ++ show name-             ++ " datatype.")-  -- at this point we know that either we have a datatype that has only one-  -- constructor or a datatype where each constructor is nullary-  let (DCon _ _ minName fields) = head cons-      (DCon _ _ maxName _)      = last cons-      pbounded_name = promoteClassName boundedName-      fieldsCount   = length $ tysOfConFields fields-      (minRHS, maxRHS) = case fieldsCount of-        0 -> (DConT minName, DConT maxName)-        _ ->-          let minEqnRHS = foldType (DConT minName)-                                   (replicate fieldsCount (DConT tyminBoundName))-              maxEqnRHS = foldType (DConT maxName)-                                   (replicate fieldsCount (DConT tymaxBoundName))-          in (minEqnRHS, maxEqnRHS)-  return $ [ DInstanceD [] (DConT pbounded_name `DAppT` kindParam kind)-             [ DTySynInstD tyminBoundName (DTySynEqn [] minRHS)-             , DTySynInstD tymaxBoundName (DTySynEqn [] maxRHS)-             ]-           ]-mkBoundedTypeInstance _ _ = fail "Error deriving Bounded instance"
src/Data/Singletons/Promote/Defun.hs view
@@ -48,7 +48,7 @@  buildDefunSymsDataD :: Name -> [DTyVarBndr] -> [DCon] -> PrM [DDec] buildDefunSymsDataD tyName tvbs ctors = do-  let res_ty = foldType (DConT tyName) (map (DVarT . extractTvbName) tvbs)+  let res_ty = foldType (DConT tyName) (map tvbToType tvbs)   res_ki <- promoteType res_ty   concatMapM (promoteCtor res_ki) ctors   where@@ -137,14 +137,13 @@           tyfun_param = mk_tvb fst_name m_tyfun           arg_names   = map extractTvbName arg_params           params      = arg_params ++ [tyfun_param]-          con_eq_ct   = foldl DAppPr (DConPr equalityName)-                          [ DConT kindOfName `DAppT`-                              (foldType (DConT data_name) (map DVarT arg_names)-                               `apply`-                               (DVarT extra_name))-                          , DConT kindOfName `DAppT`-                            foldType (DConT next_name) (map DVarT (arg_names ++ [extra_name]))-                          ]+          con_eq_ct   = mkEqPred+                          (DConT kindOfName `DAppT`+                            (foldType (DConT data_name) (map DVarT arg_names)+                             `apply`+                             (DVarT extra_name)))+                          (DConT kindOfName `DAppT`+                           foldType (DConT next_name) (map DVarT (arg_names ++ [extra_name])))           con_decl    = DCon [DPlainTV extra_name]                              [con_eq_ct]                              con_name
src/Data/Singletons/Promote/Eq.hs view
@@ -7,8 +7,6 @@ family instances. -} -{-# LANGUAGE CPP #-}- module Data.Singletons.Promote.Eq where  import Language.Haskell.TH.Syntax@@ -17,19 +15,9 @@ import Data.Singletons.Util import Control.Monad --- Why do we have two different versions of this code? Because GHC 7.6, which--- doesn't allow any overlap among type family equations, needs O(n^2) instances.--- Yuck. But, GHC 7.8 can get away with only O(n) equations in a closed type--- family. The difference is significant enough to make it worth maintaining two--- different generation functions, in RAE's opinion.------ If we wish to change this, delete the 7.8 code -- the 7.6 code should work--- just fine under 7.8.--#if __GLASGOW_HASKELL__ >= 707 -- produce a closed type family helper and the instance -- for (:==) over the given list of ctors-mkEqTypeInstance :: DsMonad q => DKind -> [DCon] -> q [DDec]+mkEqTypeInstance :: Quasi q => DKind -> [DCon] -> q [DDec] mkEqTypeInstance kind cons = do   helperName <- newUniqueName "Equals"   aName <- qNewName "a"@@ -47,10 +35,10 @@                                                        [DVarT aName, DVarT bName]))       inst = DInstanceD [] ((DConT $ promoteClassName eqName) `DAppT`                             kindParam kind) [eqInst]-                                     +   return [closedFam, inst] -  where mk_branch :: DsMonad q => DCon -> q DTySynEqn+  where mk_branch :: Quasi q => DCon -> q DTySynEqn         mk_branch con = do           let (name, numArgs) = extractNameArgs con           lnames <- replicateM numArgs (qNewName "a")@@ -63,7 +51,7 @@               result = tyAll results           return $ DTySynEqn [ltype, rtype] result -        false_case :: DsMonad q => q DTySynEqn+        false_case :: Quasi q => q DTySynEqn         false_case = do           lvar <- qNewName "a"           rvar <- qNewName "b"@@ -75,36 +63,3 @@         tyAll [one] = one         tyAll (h:t) = foldType (DConT $ promoteValNameLhs andName) [h, (tyAll t)]            -- I could use the Apply nonsense here, but there's no reason to--#else---- produce the type instance for (:==) for the given pair of constructors-mkEqTypeInstance :: DsMonad q => (DCon, DCon) -> q DDec-mkEqTypeInstance (c1, c2) =-  if c1 == c2-  then do-    let (name, numArgs) = extractNameArgs c1-    lnames <- replicateM numArgs (qNewName "a")-    rnames <- replicateM numArgs (qNewName "b")-    let lvars = map DVarT lnames-        rvars = map DVarT rnames-    return $ DTySynInstD tyEqName $ DTySynEqn-      [foldType (DConT name) lvars,-       foldType (DConT name) rvars]-      (tyAll (zipWith (\l r -> foldType (DConT tyEqName) [l, r])-                      lvars rvars))-  else do-    let (lname, lNumArgs) = extractNameArgs c1-        (rname, rNumArgs) = extractNameArgs c2-    lnames <- replicateM lNumArgs (qNewName "a")-    rnames <- replicateM rNumArgs (qNewName "b")-    return $ DTySynInstD tyEqName $ DTySynEqn-      [foldType (DConT lname) (map DVarT lnames),-       foldType (DConT rname) (map DVarT rnames)]-      falseTySym-  where tyAll :: [DType] -> DType -- "all" at the type level-        tyAll [] = trueTySym-        tyAll [one] = one-        tyAll (h:t) = foldType (DConT $ promoteValNameLhs andName) [h, (tyAll t)]--#endif
src/Data/Singletons/Promote/Monad.hs view
@@ -9,8 +9,8 @@ of DDec, and is wrapped around a Q. -} -{-# LANGUAGE GeneralizedNewtypeDeriving, StandaloneDeriving, CPP,-             FlexibleContexts, TypeFamilies, KindSignatures #-}+{-# LANGUAGE GeneralizedNewtypeDeriving, StandaloneDeriving,+             FlexibleContexts, TypeFamilies, KindSignatures, CPP #-}  module Data.Singletons.Promote.Monad (   PrM, promoteM, promoteM_, promoteMDecs, VarPromotions,@@ -24,14 +24,9 @@ import Data.Map.Strict ( Map ) import Language.Haskell.TH.Syntax hiding ( lift ) import Language.Haskell.TH.Desugar-import Data.Singletons.Util import Data.Singletons.Names import Data.Singletons.Syntax -#if __GLASGOW_HASKELL__ < 709-import Control.Applicative-#endif- type LetExpansions = Map Name DType  -- from **term-level** name  -- environment during promotion@@ -48,39 +43,9 @@  -- the promotion monad newtype PrM a = PrM (ReaderT PrEnv (WriterT [DDec] Q) a)-  deriving ( Functor, Applicative, Monad+  deriving ( Functor, Applicative, Monad, Quasi            , MonadReader PrEnv, MonadWriter [DDec] ) -liftPrM :: Q a -> PrM a-liftPrM = PrM . lift . lift--instance Quasi PrM where-  qNewName          = liftPrM `comp1` qNewName-  qReport           = liftPrM `comp2` qReport-  qLookupName       = liftPrM `comp2` qLookupName-  qReify            = liftPrM `comp1` qReify-  qReifyInstances   = liftPrM `comp2` qReifyInstances-  qLocation         = liftPrM qLocation-  qRunIO            = liftPrM `comp1` qRunIO-  qAddDependentFile = liftPrM `comp1` qAddDependentFile-#if __GLASGOW_HASKELL__ >= 707-  qReifyRoles       = liftPrM `comp1` qReifyRoles-  qReifyAnnotations = liftPrM `comp1` qReifyAnnotations-  qReifyModule      = liftPrM `comp1` qReifyModule-  qAddTopDecls      = liftPrM `comp1` qAddTopDecls-  qAddModFinalizer  = liftPrM `comp1` qAddModFinalizer-  qGetQ             = liftPrM qGetQ-  qPutQ             = liftPrM `comp1` qPutQ-#endif--  qRecover (PrM handler) (PrM body) = do-    env <- ask-    (result, aux) <- liftPrM $-                     qRecover (runWriterT $ runReaderT handler env)-                              (runWriterT $ runReaderT body env)-    tell aux-    return result- instance DsMonad PrM where   localDeclarations = asks pr_local_decls @@ -144,4 +109,3 @@ promoteMDecs locals thing = do   (decs1, decs2) <- promoteM locals thing   return $ decs1 ++ decs2-
− src/Data/Singletons/Promote/Ord.hs
@@ -1,240 +0,0 @@-{-# LANGUAGE TemplateHaskell #-}---------------------------------------------------------------------------------- |--- Module      :  Data.Singletons.Promote.Ord--- Copyright   :  (C) 2014 Jan Stolarek--- License     :  BSD-style (see LICENSE)--- Maintainer  :  Jan Stolarek (jan.stolarek@p.lodz.pl)--- Stability   :  experimental--- Portability :  non-portable------ Implements deriving of promoted Ord instances----------------------------------------------------------------------------------module Data.Singletons.Promote.Ord where--import Language.Haskell.TH.Syntax-import Language.Haskell.TH.Desugar-import Data.Singletons.Names-import Data.Singletons.Util--mkOrdTypeInstance :: DsMonad q => DKind -> [DCon] -> q [DDec]-mkOrdTypeInstance kind cons = do-  let tagged_cons = zip cons [1..]-      con_pairs   = [ (c1, c2) | c1 <- tagged_cons, c2 <- tagged_cons ]-  eqns <- mapM mkOrdTySynEqn con_pairs-  let tyfam_insts = map (DTySynInstD tyCompareName) eqns-      pord_name   = promoteClassName ordName-      pord_inst   = DInstanceD [] (DConT pord_name `DAppT` kindParam kind)-                               tyfam_insts-  return [pord_inst]--mkOrdTySynEqn :: DsMonad q => ((DCon, Int), (DCon, Int)) -> q DTySynEqn-mkOrdTySynEqn ((c1, n1), (c2, n2)) = do-  let DCon _tvbs1 _cxt1 con_name1 con_fields1 = c1-      DCon _tvbs2 _cxt2 con_name2 con_fields2 = c2-  lhs_names <- mapM (const $ qNewName "lhs") (tysOfConFields con_fields1)-  rhs_names <- mapM (const $ qNewName "rhs") (tysOfConFields con_fields2)-  let lhs_ty = foldType (DConT con_name1) (map DVarT lhs_names)-      rhs_ty = foldType (DConT con_name2) (map DVarT rhs_names)-      result = case n1 `compare` n2 of-        EQ -> let cmps   = zipWith (\lhs rhs ->-                                     foldType (DConT tyCompareName) [ DVarT lhs-                                                                    , DVarT rhs ])-                           lhs_names rhs_names-              in-              foldl (\l r -> foldType (DConT tyThenCmpName) [l, r])-                    (DConT 'EQ) cmps--        LT -> DConT 'LT-        GT -> DConT 'GT-  return $ DTySynEqn [lhs_ty, rhs_ty] result--{---- Note [Deriving Ord]--- ~~~~~~~~~~~~~~~~~~~------ We derive instances of Ord by generating promoted instance of Compare.  Under--- GHC 7.8 this is done by generating a closed type family that does tha--- comparing for given datatype and then making appropriate instance of Compare--- open type family. There are two interesting points in this--- algorithm. Firstly we minimize the number of equations required to compare--- all existing data constructors. To do this we use a catch-all equations. For--- example for this data type:------  data Foo = A | B | C | D | E | F deriving (Eq,Ord)------ We generate equations:------  CompareFoo A A = EQ---  CompareFoo A a = LT -- catch-all case---  CompareFoo B A = GT---  CompareFoo B B = EQ---  CompareFoo B a = LT -- catch-all case------ This however would be very inefficient for the last constructor:------  CompareFoo F A = GT---  CompareFoo F B = GT---  CompareFoo F C = GT---  CompareFoo F D = GT---  CompareFoo F E = GT---  CompareFoo F F = EQ------ So once we get past half of the constructors we reverse the order in which we--- test second constructor passed to Compare:------  CompareFoo F F = EQ---  CompareFoo F a = GT---  CompareFoo E F = LT---  CompareFoo E E = EQ---  CompareFoo E a = GT------ Second interesting point in our algorithm is comparing identical--- constructors. Obviously if they store no data they are equal. But if--- constructor has any fields then they must be compared by calling Compare on--- every field until we get LT or GT result. To do this we generate a helper--- type function that does all the comparing. For example (,,) constructor has--- three fields and we generate this code:------ type family OrderingEqualCase (t1 :: Ordering)---                               (t2 :: Ordering)---                               (t3 :: Ordering) :: Ordering where---   OrderingEqualCase LTSym0 a      b      = LTSym0---   OrderingEqualCase GTSym0 a      b      = GTSym0---   OrderingEqualCase EQSym0 LTSym0 b      = LTSym0---   OrderingEqualCase EQSym0 GTSym0 b      = GTSym0---   OrderingEqualCase EQSym0 EQSym0 LTSym0 = LTSym0---   OrderingEqualCase EQSym0 EQSym0 GTSym0 = GTSym0---   OrderingEqualCase EQSym0 EQSym0 EQSym0 = EQSym0------  type family Compare_helper (a :: (k1,k2,k3)) (b :: (k1,k2,k3) :: Ordering where---    Compare_helper (a1,a2,a3) (b1,b2,b3) =---      OrderingEqualCase (Compare a1 b1) (Compare a2 b2) (Compare a3 b3)-------- Notice that we perform only necessary comparisons. If we can determine----- ordering based on comparing first field we ignore the remaining fields----- (although this implementation requires that we actually compare all fields----- at the call site).--mkOrdTypeInstance :: DsMonad q => DKind -> [DCon] -> q [DDec]-mkOrdTypeInstance kind cons = do-  let taggedCons   = zip cons [1..]-      l            = length cons-      half         = l `div` 2 + l `mod` 2-      combinations = [ (x,y) | x@(_, t1) <- taggedCons-                             , y@(_, t2) <- taggedCons-                             , (t1 <= half && t2 <= t1 + 1) ||-                               (t1 >  half && t2 >= t1 - 1) ]-      groupedCombs = groupBy equalFirstTags combinations-      equalFirstTags ((_,t1),_) ((_,t2),_) = t1 == t2-      reverseOrder [] = []-      reverseOrder xs@(((_,t),_):_) = if t > half-                                      then reverse xs-                                      else xs-      consPairs    = concat (map reverseOrder groupedCombs)-  helperName <- newUniqueName "Compare"-  aName <- qNewName "a"-  bName <- qNewName "b"-  (compareEqns, eqDecs) <- evalForPair $ mapM (mkCompareEqn half) consPairs-  let closedFam = DClosedTypeFamilyD helperName-                                     [ DKindedTV aName kind-                                     , DKindedTV bName kind ]-                                     (Just (DConK orderingName []))-                                     compareEqns-      compareInst = DTySynInstD tyCompareName-                               (DTySynEqn [ DSigT (DVarT aName) kind-                                          , DSigT (DVarT bName) kind ]-                                          (foldType (DConT helperName)-                                                    [DVarT aName, DVarT bName]))-  return (closedFam : compareInst : eqDecs)--  where mkCompareEqn :: DsMonad q => Int -> ((DCon, Int), (DCon, Int))-                                -> QWithAux [DDec] q DTySynEqn-        mkCompareEqn half ((con1, tag1), (con2, tag2))-            | tag1 > tag2 && tag1 <= half =-                mkCompareEqnHelper con1 (Just con2) gtT-            | tag1 < tag2 && tag1 >  half = do-                mkCompareEqnHelper con1 (Just con2) ltT-            | tag1 < tag2 && tag1 <= half =-                mkCompareEqnHelper con1 Nothing ltT-            | tag1 > tag2 && tag1 >  half =-                mkCompareEqnHelper con1 Nothing gtT-            | otherwise =-                mkCompareEqual con1--        eqT = DConT ordEQSymName-        ltT = DConT ordLTSymName-        gtT = DConT ordGTSymName--        mkCompareEqnHelper :: DsMonad q => DCon -> Maybe DCon -> DType -> q DTySynEqn-        mkCompareEqnHelper con1 con2 result = do-            let (name1, numArgs1) = extractNameArgs con1-            (name2, numArgs2) <- case con2 of-                  Just c  -> let (n, numArgs) = extractNameArgs c-                             in  return (DConT n, numArgs)-                  Nothing -> qNewName "z" >>= (\n -> return (DVarT n, 0))-            lnames <- replicateM numArgs1 (qNewName "a")-            rnames <- replicateM numArgs2 (qNewName "b")-            let lvars = map DVarT lnames-                rvars = map DVarT rnames-                ltype = foldType (DConT name1) lvars-                rtype = foldType name2 rvars-            return $ DTySynEqn [ltype, rtype] result--        mkCompareEqual :: DsMonad q => DCon -> QWithAux [DDec] q DTySynEqn-        mkCompareEqual con = do-            let (name, numArgs) = extractNameArgs con-            case numArgs of-              -- If constructor has no fields it is equal to itself-              0 -> return $ DTySynEqn [DConT name, DConT name] eqT-              -- But if it has fields we have to compare them one by one-              _ -> do-                helperName <- newUniqueName "OrderingEqualCase"-                -- Build helper type family that does the comparison-                buildHelperTyFam numArgs helperName--                -- Call the helper function-                lnames <- replicateM numArgs (qNewName "a")-                rnames <- replicateM numArgs (qNewName "b")-                let lvars      = map DVarT lnames-                    rvars      = map DVarT rnames-                    ltype      = foldType (DConT name) lvars-                    rtype      = foldType (DConT name) rvars-                    callParams = zipWith (\l r -> foldType (DConT tyCompareName) [l,r])-                                          lvars rvars-                    call = foldType (DConT helperName) callParams-                return $ DTySynEqn [ltype, rtype] call-            where-                  buildHelperTyFam :: DsMonad q => Int -> Name -> QWithAux [DDec] q ()-                  buildHelperTyFam numArgs helperName = do-                    let orderingKCon = DConK orderingName []-                    (patterns, results) <- buildEqnPats numArgs ([[]], [eqT])-                    tyFamParamNames <- replicateM numArgs (qNewName "a")-                    let eqns = map (uncurry DTySynEqn) (zip patterns results)-                        closedFam = DClosedTypeFamilyD helperName-                                      (zipWith DKindedTV tyFamParamNames-                                              (repeat orderingKCon))-                                      (Just orderingKCon)-                                      eqns-                    addElement closedFam-                    return ()--                  buildEqnPats :: DsMonad q => Int -> ([[DType]], [DType])-                                          -> q ([[DType]], [DType])-                  buildEqnPats 0 acc = return acc-                  buildEqnPats n acc = do-                    let eqns    = fst acc-                        results = snd acc-                        eqnNo   = length (head eqns)-                        newEqs  = map (eqT :) eqns-                    names <- replicateM eqnNo (qNewName "a")-                    let tys   = map DVarT names-                        ltRow = ltT : tys-                        gtRow = gtT : tys-                    buildEqnPats (n-1) ( ltRow : gtRow : newEqs-                                       , ltT : gtT : results )---}
src/Data/Singletons/Promote/Type.hs view
@@ -6,7 +6,7 @@ This file implements promotion of types into kinds. -} -module Data.Singletons.Promote.Type ( promoteType ) where+module Data.Singletons.Promote.Type ( promoteType, promoteUnraveled ) where  import Language.Haskell.TH.Desugar import Data.Singletons.Names@@ -48,3 +48,11 @@     go args     hd = fail $ "Illegal Haskell construct encountered:\n" ++                             "headed by: " ++ show hd ++ "\n" ++                             "applied to: " ++ show args++promoteUnraveled :: Monad m => DType -> m ([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
src/Data/Singletons/Single.hs view
@@ -6,30 +6,33 @@ This file contains functions to refine constructs to work with singleton types. It is an internal module to the singletons package. -}-{-# LANGUAGE TemplateHaskell, CPP, TupleSections, ParallelListComp #-}+{-# LANGUAGE TemplateHaskell, TupleSections, ParallelListComp, CPP #-}  module Data.Singletons.Single where  import Prelude hiding ( exp ) import Language.Haskell.TH hiding ( cxt )-import Language.Haskell.TH.Syntax ( qNewName )+import Language.Haskell.TH.Syntax (Quasi(..))+import Data.Singletons.Deriving.Ord+import Data.Singletons.Deriving.Bounded+import Data.Singletons.Deriving.Enum import Data.Singletons.Util import Data.Singletons.Promote-import Data.Singletons.Promote.Monad ( promoteM, promoteM_ )+import Data.Singletons.Promote.Monad ( promoteM )+import Data.Singletons.Promote.Type import Data.Singletons.Names import Data.Singletons.Single.Monad import Data.Singletons.Single.Type import Data.Singletons.Single.Data import Data.Singletons.Single.Eq import Data.Singletons.Syntax+import Data.Singletons.Partition import Language.Haskell.TH.Desugar import qualified Data.Map.Strict as Map import Data.Map.Strict ( Map )+import Data.Maybe import Control.Monad--#if __GLASGOW_HASKELL__ < 709-import Control.Applicative-#endif+import Data.List  {- How singletons works@@ -45,7 +48,7 @@ use the "SLambda" instance of Sing. To apply singleton functions, we use the applySing function. -That, in an of itself, wouldn't be too hard, but it's really annoying from+That, in and of itself, wouldn't be too hard, but it's really annoying from the user standpoint. After dutifully singling `map`, a user doesn't want to have to use two `applySing`s to actually use it. So, any let-bound identifier is eta-expanded so that the singled type has the same number of arrows as@@ -62,7 +65,7 @@ because SLambda is a *newtype* instance, not a *data* instance.  Note that to maintain the desired invariant, we must also be careful to eta--contract constructors. This is the point of buildLets.+contract constructors. This is the point of buildDataLets. -}  -- | Generate singleton definitions from a type that is already defined.@@ -88,7 +91,9 @@   return (decs ++ singDecs)  -- | Make promoted and singleton versions of all declarations given, discarding--- the original declarations.+-- 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) @@ -114,18 +119,10 @@ singEqInstanceOnly name = singEqualityInstance sEqClassDesc name  -- | Create instances of 'SDecide' for each type in the list.------ Note that, due to a bug in GHC 7.6.3 (and lower) optimizing instances--- for SDecide can make GHC hang. You may want to put--- @{-# OPTIONS_GHC -O0 #-}@ in your file. singDecideInstances :: DsMonad q => [Name] -> q [Dec] singDecideInstances = concatMapM singDecideInstance  -- | Create instance of 'SDecide' for the given type.------ Note that, due to a bug in GHC 7.6.3 (and lower) optimizing instances--- for SDecide can make GHC hang. You may want to put--- @{-# OPTIONS_GHC -O0 #-}@ in your file. singDecideInstance :: DsMonad q => Name -> q [Dec] singDecideInstance name = singEqualityInstance sDecideClassDesc name @@ -144,11 +141,47 @@   eqInstance <- mkEqualityInstance kind scons desc   return $ decToTH eqInstance +-- | Create instances of 'SOrd' for the given types+singOrdInstances :: DsMonad q => [Name] -> q [Dec]+singOrdInstances = concatMapM singOrdInstance++-- | Create instance of 'SOrd' for the given type+singOrdInstance :: DsMonad q => Name -> q [Dec]+singOrdInstance = singInstance mkOrdInstance "Ord"++-- | Create instances of 'SBounded' for the given types+singBoundedInstances :: DsMonad q => [Name] -> q [Dec]+singBoundedInstances = concatMapM singBoundedInstance++-- | Create instance of 'SBounded' for the given type+singBoundedInstance :: DsMonad q => Name -> q [Dec]+singBoundedInstance = singInstance mkBoundedInstance "Bounded"++-- | Create instances of 'SEnum' for the given types+singEnumInstances :: DsMonad q => [Name] -> q [Dec]+singEnumInstances = concatMapM singEnumInstance++-- | Create instance of 'SEnum' for the given type+singEnumInstance :: DsMonad q => Name -> q [Dec]+singEnumInstance = singInstance mkEnumInstance "Enum"++singInstance :: DsMonad q+             => (DType -> [DCon] -> q UInstDecl)+             -> 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+  dtvbs <- mapM dsTvb tvbs+  dcons <- mapM dsCon cons+  raw_inst <- mk_inst (foldType (DConT name) (map tvbToType dtvbs)) dcons+  (a_inst, decs) <- promoteM [] $+                    promoteInstanceDec Map.empty raw_inst+  decs' <- singDecsM [] $ (:[]) <$> singInstD a_inst+  return $ decsToTH (decs ++ decs')+ singInfo :: DsMonad q => DInfo -> q [DDec]-singInfo (DTyConI dec Nothing) = do -- TODO: document this special case+singInfo (DTyConI dec _) =   singTopLevelDecs [] [dec]-singInfo (DTyConI {}) =-  fail "Singling of things with instances not yet supported" -- TODO: fix singInfo (DPrimTyConI _name _numArgs _unlifted) =   fail "Singling of primitive type constructors not supported" singInfo (DVarI _name _ty _mdec _fixity) =@@ -157,25 +190,31 @@   fail "Singling of type variable info not supported"  singTopLevelDecs :: DsMonad q => [Dec] -> [DDec] -> q [DDec]-singTopLevelDecs locals decls = do+singTopLevelDecs locals raw_decls = do+  decls <- withLocalDeclarations locals $ expand raw_decls     -- expand type synonyms   PDecs { pd_let_decs              = letDecls         , pd_class_decs            = classes         , pd_instance_decs         = insts         , pd_data_decs             = datas }    <- partitionDecs decls -  when (not (null classes) || not (null insts)) $-    qReportError "Classes and instances may not yet be made into singletons."+  ((letDecEnv, classes', insts'), promDecls) <- promoteM locals $ do+    promoteDataDecs datas+    (_, letDecEnv) <- promoteLetDecs noPrefix letDecls+    classes' <- mapM promoteClassDec classes+    let meth_sigs = foldMap (lde_types . cd_lde) classes+    insts' <- mapM (promoteInstanceDec meth_sigs) insts+    return (letDecEnv, classes', insts') -  dataDecls' <- promoteM_ locals $ promoteDataDecs datas-  ((_, letDecEnv), letDecls') <- promoteM locals $-                                 promoteLetDecs noPrefix letDecls   singDecsM locals $ do     let letBinds = concatMap buildDataLets datas                 ++ concatMap buildMethLets classes-    (newLetDecls, newDataDecls) <- bindLets letBinds $-                                   singLetDecEnv TopLevel letDecEnv $-                                   concatMapM singDataD datas-    return $ dataDecls' ++ letDecls' ++ (map DLetDec newLetDecls) ++ newDataDecls+    (newLetDecls, newDecls) <- bindLets letBinds $+                               singLetDecEnv letDecEnv $ do+                                 newDataDecls <- concatMapM singDataD datas+                                 newClassDecls <- mapM singClassD classes'+                                 newInstDecls <- mapM singInstD insts'+                                 return (newDataDecls ++ newClassDecls ++ newInstDecls)+    return $ promDecls ++ (map DLetDec newLetDecls) ++ newDecls  -- see comment at top of file buildDataLets :: DataDecl -> [(Name, DExp)]@@ -195,81 +234,192 @@       [ (name, wrapSingFun 1 (promoteValRhs name) (DVarE $ singValName name))       | name <- names ] -buildMethLets :: ClassDecl -> [(Name, DExp)]-buildMethLets = error "Cannot singletonize class definitions yet."-  -- FIXME!+-- see comment at top of file+buildMethLets :: UClassDecl -> [(Name, DExp)]+buildMethLets (ClassDecl { cd_lde = LetDecEnv { lde_types = meth_sigs } }) =+  map mk_bind (Map.toList meth_sigs)+  where+    mk_bind (meth_name, meth_ty) =+      ( meth_name+      , wrapSingFun (countArgs meth_ty) (promoteValRhs meth_name)+                                        (DVarE $ singValName meth_name) ) -singLetDecEnv :: TopLevelFlag -> ALetDecEnv -> SgM a -> SgM ([DLetDec], a)-singLetDecEnv top_level-              (LetDecEnv { lde_defns = defns+singClassD :: AClassDecl -> SgM DDec+singClassD (ClassDecl { cd_cxt  = cls_cxt+                      , cd_name = cls_name+                      , cd_tvbs = cls_tvbs+                      , cd_fds  = cls_fundeps+                      , cd_lde  = LetDecEnv { lde_defns = default_defns+                                            , lde_types = meth_sigs+                                            , lde_infix = fixities+                                            , lde_proms = promoted_defaults } }) = do+  (sing_sigs, _, tyvar_names, res_kis)+    <- unzip4 <$> zipWithM (singTySig no_meth_defns meth_sigs)+                           meth_names (map promoteValRhs meth_names)+  let default_sigs = catMaybes $ zipWith mk_default_sig meth_names sing_sigs+      res_ki_map   = Map.fromList (zip meth_names+                                       (map (fromMaybe always_sig) res_kis))+  sing_meths <- mapM (uncurry (singLetDecRHS (Map.fromList tyvar_names)+                                             res_ki_map))+                     (Map.toList default_defns)+  let fixities' = map (uncurry singInfixDecl) fixities+  cls_cxt' <- mapM singPred cls_cxt+  (kproxies, kproxy_pred) <- mkKProxies (map extractTvbName cls_tvbs)++  return $ DClassD (cls_cxt' ++ kproxy_pred)+                   (singClassName cls_name) kproxies+                   cls_fundeps   -- they are fine without modification+                   (map DLetDec (sing_sigs ++ sing_meths ++ fixities') ++ default_sigs)+  where+    no_meth_defns = error "Internal error: can't find declared method type"+    always_sig    = error "Internal error: no signature for default method"+    meth_names    = Map.keys meth_sigs++    mk_default_sig meth_name (DSigD s_name sty) =+      DDefaultSigD s_name <$> add_constraints meth_name sty+    mk_default_sig _ _ = error "Internal error: a singled signature isn't a signature."++    add_constraints meth_name sty = do  -- Maybe monad+      prom_dflt <- Map.lookup meth_name promoted_defaults+      let default_pred = foldl DAppPr (DConPr equalityName)+                               [ foldApply (promoteValRhs meth_name) tvs+                               , foldApply prom_dflt tvs ]+      return $ DForallT tvbs (default_pred : cxt) (ravel args res)+      where+        (tvbs, cxt, args, res) = unravel sty+        tvs                    = map tvbToType tvbs+++singInstD :: AInstDecl -> SgM DDec+singInstD (InstDecl { id_cxt = cxt, id_name = inst_name+                    , id_arg_tys = inst_tys, id_meths = ann_meths }) = do+  cxt' <- mapM singPred cxt+  inst_kis <- mapM promoteType inst_tys+  meths <- concatMapM (uncurry sing_meth) ann_meths+  return (DInstanceD cxt'+                     (foldl DAppT (DConT s_inst_name) (map kindParam inst_kis))+                     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)+      (s_ty, tyvar_names, m_res_ki) <- case mb_s_info of+        Just (DVarI _ (DForallT cls_kproxy_tvbs _cls_pred s_ty) _ _) -> do+          let class_kvs = map extract_kv cls_kproxy_tvbs+              extract_kv (DKindedTV _kproxyVar (DConK _kproxyTy [DVarK kv])) = kv+              extract_kv _ = error "sing_meth cannot extract a kind variable"++              (sing_tvbs, _pred, _args, res_ty) = unravel s_ty++          inst_kis <- mapM promoteType inst_tys+          let subst    = Map.fromList (zip class_kvs inst_kis)+              m_res_ki = case res_ty of+                _sing `DAppT` (_prom_func `DSigT` res_ki) -> Just (substKind subst res_ki)+                _                                         -> Nothing++          return (substKindInType subst s_ty, map extractTvbName sing_tvbs, m_res_ki)+        _ -> do+          mb_info <- dsReify name+          case mb_info of+            Just (DVarI _ (DForallT cls_tvbs _cls_pred inner_ty) _ _) -> do+              let subst = Map.fromList (zip (map extractTvbName cls_tvbs)+                                            inst_tys)+              (s_ty, _num_args, tyvar_names, res_ki) <- singType (promoteValRhs name)+                                                                 (substType subst inner_ty)+              return (s_ty, tyvar_names, Just res_ki)+            _ -> fail $ "Cannot find type of method " ++ show name++      let kind_map = maybe Map.empty (Map.singleton name) m_res_ki+      meth' <- singLetDecRHS (Map.singleton name tyvar_names)+                             kind_map name rhs+      return $ map DLetDec [DSigD (singValName name) s_ty, meth']++singLetDecEnv :: ALetDecEnv -> SgM a -> SgM ([DLetDec], a)+singLetDecEnv (LetDecEnv { lde_defns = defns                          , lde_types = types                          , lde_infix = infix_decls                          , lde_proms = proms })               thing_inside = do-  (typeSigs, letBinds, tyvarNames)-    <- mapAndUnzip3M (uncurry sing_ty_sig) (Map.toList proms)-  let infix_decls' = map (uncurry sing_infix_decl) infix_decls+  let prom_list = Map.toList proms+  (typeSigs, letBinds, tyvarNames, res_kis)+    <- unzip4 <$> mapM (uncurry (singTySig defns types)) prom_list+  let infix_decls' = map (uncurry singInfixDecl) infix_decls+      res_ki_map   = Map.fromList [ (name, res_ki) | ((name, _), Just res_ki)+                                                       <- zip prom_list res_kis ]   bindLets letBinds $ do-    let_decs <- mapM (uncurry (sing_let_dec (Map.fromList tyvarNames))) (Map.toList defns)+    let_decs <- mapM (uncurry (singLetDecRHS (Map.fromList tyvarNames) res_ki_map))+                     (Map.toList defns)     thing <- thing_inside     return (infix_decls' ++ typeSigs ++ let_decs, thing)-  where-    sing_infix_decl :: Fixity -> Name -> DLetDec-    sing_infix_decl fixity name-      | isUpcase name =-        -- is it a tycon name or a datacon name??-        -- it *must* be a datacon name, because symbolic tycons-        -- can't be promoted. This is terrible.-        DInfixD fixity (singDataConName name)-      | otherwise = DInfixD fixity (singValName name) -    sing_ty_sig :: Name -> DType   -- the type is the promoted type, not the type sig!-                -> SgM ( DLetDec               -- the new type signature-                       , (Name, DExp)          -- the let-bind entry-                       , (Name, [Name])        -- the scoped tyvar names in the tysig-                       )-    sing_ty_sig name prom_ty =-      let sName = singValName name in-      case Map.lookup name types of-        Nothing -> do-          num_args <- guess_num_args name-          (sty, tyvar_names) <- mk_sing_ty num_args prom_ty-          return ( DSigD sName sty-                 , (name, wrapSingFun num_args prom_ty (DVarE sName))-                 , (name, tyvar_names) )-        Just ty -> do-          (sty, num_args, tyvar_names) <- singType top_level prom_ty ty-          return ( DSigD sName sty-                 , (name, wrapSingFun num_args prom_ty (DVarE sName))-                 , (name, tyvar_names) )+singInfixDecl :: Fixity -> Name -> DLetDec+singInfixDecl fixity name+  | isUpcase name =+    -- is it a tycon name or a datacon name??+    -- it *must* be a datacon name, because symbolic tycons+    -- can't be promoted. This is terrible.+    DInfixD fixity (singDataConName name)+  | otherwise = DInfixD fixity (singValName name) -    guess_num_args :: Name -> SgM Int-    guess_num_args name =+singTySig :: Map Name ALetDecRHS  -- definitions+          -> Map Name DType       -- type signatures+          -> Name -> DType   -- the type is the promoted type, not the type sig!+          -> SgM ( DLetDec               -- the new type signature+                 , (Name, DExp)          -- the let-bind entry+                 , (Name, [Name])        -- the scoped tyvar names in the tysig+                 , Maybe DKind           -- the result kind in the tysig+                 )+singTySig defns types name prom_ty =+  let sName = singValName name in+  case Map.lookup name types of+    Nothing -> do+      num_args <- guess_num_args+      (sty, tyvar_names) <- mk_sing_ty num_args+      return ( DSigD sName sty+             , (name, wrapSingFun num_args prom_ty (DVarE sName))+             , (name, tyvar_names)+             , Nothing )+    Just ty -> do+      (sty, num_args, tyvar_names, res_ki) <- singType prom_ty ty+      return ( DSigD sName sty+             , (name, wrapSingFun num_args prom_ty (DVarE sName))+             , (name, tyvar_names)+             , Just res_ki )+  where+    guess_num_args :: SgM Int+    guess_num_args =       case Map.lookup name defns of         Nothing -> fail "Internal error: promotion known for something not let-bound."         Just (AValue _ n _) -> return n         Just (AFunction _ n _) -> return n        -- create a Sing t1 -> Sing t2 -> ... type of a given arity and result type-    mk_sing_ty :: Int -> DType -> SgM (DType, [Name])-    mk_sing_ty n prom_ty = do+    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 (\name -> singFamily `DAppT` DVarT name) arg_names-                                ++ [singFamily `DAppT`-                                    (foldl apply prom_ty (map DVarT arg_names))]))+                        (ravel (map (\nm -> singFamily `DAppT` DVarT nm) arg_names)+                               (singFamily `DAppT`+                                    (foldl apply prom_ty (map DVarT arg_names))))              , arg_names ) -    sing_let_dec :: Map Name [Name] -> Name -> ALetDecRHS -> SgM DLetDec-    sing_let_dec _bound_names name (AValue prom num_arrows exp) =-      DValD (DVarPa (singValName name)) <$>-      (wrapUnSingFun num_arrows prom <$> singExp exp)-    sing_let_dec bound_names name (AFunction prom_fun num_arrows clauses) =-      let tyvar_names = case Map.lookup name bound_names of-                          Nothing -> []-                          Just ns -> ns-      in-      DFunD (singValName name) <$> mapM (singClause prom_fun num_arrows tyvar_names) clauses+singLetDecRHS :: Map Name [Name]+              -> Map Name DKind   -- result kind (might not be known)+              -> Name -> ALetDecRHS -> SgM DLetDec+singLetDecRHS _bound_names _res_kis name (AValue prom num_arrows exp) =+  DValD (DVarPa (singValName name)) <$>+  (wrapUnSingFun num_arrows prom <$> singExp exp)+singLetDecRHS bound_names res_kis name (AFunction prom_fun num_arrows clauses) =+  let tyvar_names = case Map.lookup name bound_names of+                      Nothing -> []+                      Just ns -> ns+      res_ki = Map.lookup name res_kis+  in+  DFunD (singValName name) <$>+        mapM (singClause prom_fun num_arrows tyvar_names res_ki) clauses  singClause :: DType   -- the promoted function            -> Int     -- the number of arrows in the type. If this is more@@ -278,13 +428,19 @@            -> [Name]  -- the names of the forall'd vars in the type sig of this                       -- function. This list should have at least the length as the                       -- number of patterns in the clause+           -> Maybe DKind   -- result kind, if known            -> ADClause -> SgM DClause-singClause prom_fun num_arrows bound_names (ADClause var_proms pats exp) = do-  ((sPats, prom_pats), wilds)-    <- evalForPair $ mapAndUnzipM (singPat (Map.fromList var_proms) Parameter) pats+singClause prom_fun num_arrows bound_names res_ki+           (ADClause var_proms pats exp) = do+  (sPats, prom_pats)+    <- mapAndUnzipM (singPat (Map.fromList var_proms) Parameter) pats   let equalities = zip (map DVarT bound_names) prom_pats-      applied_ty = foldl apply prom_fun prom_pats-  sBody <- bindTyVarsClause var_proms wilds applied_ty equalities $ singExp exp+      -- This res_ki stuff is necessary when we need to propagate result-+      -- based type-inference. It was inspired by toEnum. (If you remove+      -- this, that should fail to compile.)+      applied_ty = maybe id (\ki -> (`DSigT` ki)) res_ki $+                   foldl apply prom_fun prom_pats+  sBody <- bindTyVarsEq var_proms applied_ty equalities $ singExp exp     -- when calling unSingFun, the prom_pats aren't in scope, so we use the     -- bound_names instead   let pattern_bound_names = zipWith const bound_names pats@@ -307,15 +463,25 @@   fail $ "Can't use a singleton pattern outside of a case-statement or\n" ++          "do expression: GHC's brain will explode if you try. (Do try it!)" +-- Note [No wildcards in singletons]+-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+--+-- We forbid patterns with wildcards during singletonization. Why? Because+-- singletonizing a pattern also must produce a type expression equivalent+-- to the pattern, for use in bindTyVars. Wildcards get in the way of this.+-- Thus, we de-wild patterns during promotion, and put the de-wilded patterns+-- in the ADExp AST.+ singPat :: Map Name Name   -- from term-level names to type-level names-        -> PatternContext -> DPat -> QWithAux [Name]  -- these names must be forall-bound-                                     SgM ( DPat-                                         , DType ) -- the type form of the pat+        -> PatternContext+        -> DPat+        -> SgM (DPat, DType) -- the type form of the pat singPat _var_proms _patCxt (DLitPa _lit) =   fail "Singling of literal patterns not yet supported" singPat var_proms _patCxt (DVarPa name) = do   tyname <- case Map.lookup name var_proms of-              Nothing     -> qNewName (nameBase name)+              Nothing     ->+                fail "Internal error: unknown variable when singling pattern"               Just tyname -> return tyname   return (DVarPa (singValName name), DVarT tyname) singPat var_proms patCxt (DConPa name pats) = do@@ -330,37 +496,99 @@ singPat var_proms patCxt (DBangPa pat) = do   (pat', ty) <- singPat var_proms patCxt pat   return (DBangPa pat', ty)-singPat _var_proms _patCxt DWildPa = do-  wild <- qNewName "wild"-  addElement wild-  return (DWildPa, DVarT wild)+singPat _var_proms _patCxt DWildPa =+  -- See Note [No wildcards in singletons]+  fail "Internal error: wildcard seen during singleton generation" +-- Note [Annotate case return type]+-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+--+-- We're straining GHC's type inference here. One particular trouble area+-- is determining the return type of a GADT pattern match. In general, GHC+-- cannot infer return types of GADT pattern matches because the return type+-- becomes "untouchable" in the case matches. See the OutsideIn paper. But,+-- during singletonization, we *know* the return type. So, just add a type+-- annotation. See #54.++-- Note [Why error is so special]+-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+-- Some of the transformations that happen before this point produce impossible+-- case matches. We must be careful when processing these so as not to make+-- an error GHC will complain about. When binding the case-match variables, we+-- normally include an equality constraint saying that the scrutinee is equal+-- to the matched pattern. But, we can't do this in inaccessible matches, because+-- equality is bogus, and GHC (rightly) complains. However, we then have another+-- problem, because GHC doesn't have enough information when type-checking the+-- RHS of the inaccessible match to deem it type-safe. The solution: treat error+-- as super-special, so that GHC doesn't look too hard at singletonized error+-- calls. Specifically, DON'T do the applySing stuff. Just use sError, which+-- has a custom type (Sing x -> a) anyway.+ singExp :: ADExp -> SgM DExp+  -- See Note [Why error is so special]+singExp (ADVarE err `ADAppE` arg)+  | err == errorName = DAppE (DVarE (singValName err)) <$> singExp arg singExp (ADVarE name)  = lookupVarE name singExp (ADConE name)  = lookupConE name singExp (ADLitE lit)   = singLit lit singExp (ADAppE e1 e2) = do   e1' <- singExp e1   e2' <- singExp e2-  return $ (DVarE applySingName) `DAppE` e1' `DAppE` e2'+  -- `applySing undefined x` kills type inference, because GHC can't figure+  -- out the type of `undefined`. So we don't emit that code.+  if isException e1'+  then return e1'+  else return $ (DVarE applySingName) `DAppE` e1' `DAppE` e2' singExp (ADLamE var_proms prom_lam names exp) = do   let sNames = map singValName names-  exp' <- bindTyVars var_proms [] (foldl apply prom_lam (map (DVarT . snd) var_proms)) $+  exp' <- bindTyVars var_proms (foldl apply prom_lam (map (DVarT . snd) var_proms)) $           singExp exp   return $ wrapSingFun (length names) prom_lam $ DLamE sNames exp'-singExp (ADCaseE exp matches) = DCaseE <$> singExp exp <*> mapM singMatch matches+singExp (ADCaseE exp prom_exp matches ret_ty) =+    -- See Note [Annotate case return type]+  DSigE <$> (DCaseE <$> singExp exp <*> mapM (singMatch prom_exp) matches)+        <*> pure (singFamily `DAppT` ret_ty) singExp (ADLetE env exp) =-  uncurry DLetE <$> singLetDecEnv NotTopLevel env (singExp exp)+  uncurry DLetE <$> singLetDecEnv env (singExp exp) singExp (ADSigE {}) =   fail "Singling of explicit type annotations not yet supported." -singMatch :: ADMatch -> SgM DMatch-singMatch (ADMatch var_proms prom_match pat exp) = do-  ((sPat, prom_pat), wilds)-    <- evalForPair $ singPat (Map.fromList var_proms) CaseStatement pat+isException :: DExp -> Bool+isException (DVarE n)             = n == undefinedName+isException (DConE {})            = False+isException (DLitE {})            = False+isException (DAppE (DVarE fun) _) | nameBase fun == "sError" = True+isException (DAppE fun _)         = isException fun+isException (DLamE _ _)           = False+isException (DCaseE e _)          = isException e+isException (DLetE _ e)           = isException e+isException (DSigE e _)           = isException e+isException (DStaticE e)          = isException e++singMatch :: DType  -- ^ the promoted scrutinee+          -> ADMatch -> SgM DMatch+singMatch prom_scrut (ADMatch var_proms prom_match pat exp) = do+  (sPat, prom_pat)+    <- singPat (Map.fromList var_proms) CaseStatement pat         -- why DAppT below? See comment near decl of ADMatch in LetDecEnv.-  sExp <- bindTyVars var_proms wilds (prom_match `DAppT` prom_pat) $ singExp exp+  let equality+        | DVarPa _ <- pat+        , (ADVarE err) `ADAppE` _ <- exp+        , err == errorName   -- See Note [Why error is so special]+        = [] -- no equality from impossible case.+        | otherwise      = [(prom_pat, prom_scrut)]+  sExp <- bindTyVarsEq var_proms (prom_match `DAppT` prom_pat) equality $+          singExp exp   return $ DMatch sPat sExp  singLit :: Lit -> SgM DExp-singLit lit = DSigE (DVarE singMethName) <$> (DAppT singFamily <$> (promoteLit lit))+singLit (IntegerL n)+  | n >= 0    = return $+                DVarE sFromIntegerName `DAppE`+                (DVarE singMethName `DSigE`+                 (singFamily `DAppT` DLitT (NumTyLit n)))+  | otherwise = do sLit <- singLit (IntegerL (-n))+                   return $ DVarE sNegateName `DAppE` sLit+singLit lit = do+  prom_lit <- promoteLitExp lit+  return $ DVarE singMethName `DSigE` (singFamily `DAppT` prom_lit)
src/Data/Singletons/Single/Data.hs view
@@ -50,11 +50,11 @@               then mapM (mkEqualityInstance k ctors') [sEqClassDesc, sDecideClassDesc]               else return [] -  -- e.g. type SNat (a :: Nat) = Sing a+  -- e.g. type SNat = Sing :: Nat -> *   let kindedSynInst =         DTySynD (singTyConName name)-                [DKindedTV aName k]-                (DAppT singFamily a)+                []+                (singFamily `DSigT` (k `DArrowK` DStarK))    return $ (DDataInstD Data [] singFamilyName [DSigT a k] ctors' []) :            kindedSynInst :@@ -125,7 +125,7 @@       kindedIndices = zipWith DSigT indices kinds    -- SingI instance-  emitDecs +  emitDecs     [DInstanceD (map (DAppPr (DConPr singIName)) indices)                 (DAppT (DConT singIName)                        (foldType pCon kindedIndices))@@ -139,10 +139,10 @@                             | (field_name, _, _) <- rec_fields                             | arg <- args ]   return $ DCon tvbs-                [foldl DAppPr (DConPr equalityName) [a, foldType pCon indices]]+                [mkEqPred a (foldType pCon indices)]                 sName                 conFields   where buildArgType :: DType -> DType -> SgM DType         buildArgType ty index = do-          (ty', _, _) <- singType NotTopLevel index ty+          (ty', _, _, _) <- singType index ty           return ty'
src/Data/Singletons/Single/Eq.hs view
@@ -17,12 +17,12 @@ -- making the SEq instance and the SDecide instance are rather similar, -- so we generalize type EqualityClassDesc q = ((DCon, DCon) -> q DClause, Name, Name)-sEqClassDesc, sDecideClassDesc :: DsMonad q => EqualityClassDesc q+sEqClassDesc, sDecideClassDesc :: Quasi q => EqualityClassDesc q sEqClassDesc = (mkEqMethClause, sEqClassName, sEqMethName) sDecideClassDesc = (mkDecideMethClause, sDecideClassName, sDecideMethName)  -- pass the *singleton* constructors, not the originals-mkEqualityInstance :: DsMonad q => DKind -> [DCon]+mkEqualityInstance :: Quasi q => DKind -> [DCon]                    -> EqualityClassDesc q -> q DDec mkEqualityInstance k ctors (mkMeth, className, methName) = do   let ctorPairs = [ (c1, c2) | c1 <- ctors, c2 <- ctors ]@@ -42,12 +42,12 @@         getKindVars other             =           error ("getKindVars sees an unusual kind: " ++ show other) -        mkEmptyMethClauses :: DsMonad q => q [DClause]+        mkEmptyMethClauses :: Quasi q => q [DClause]         mkEmptyMethClauses = do           a <- qNewName "a"           return [DClause [DVarPa a, DWildPa] (DCaseE (DVarE a) emptyMatches)] -mkEqMethClause :: DsMonad q => (DCon, DCon) -> q DClause+mkEqMethClause :: Quasi q => (DCon, DCon) -> q DClause mkEqMethClause (c1, c2)   | lname == rname = do     lnames <- replicateM lNumArgs (qNewName "a")@@ -73,7 +73,7 @@         (lname, lNumArgs) = extractNameArgs c1         (rname, rNumArgs) = extractNameArgs c2 -mkDecideMethClause :: DsMonad q => (DCon, DCon) -> q DClause+mkDecideMethClause :: Quasi q => (DCon, DCon) -> q DClause mkDecideMethClause (c1, c2)   | lname == rname =     if lNumArgs == 0
src/Data/Singletons/Single/Monad.hs view
@@ -12,7 +12,7 @@              TemplateHaskell, CPP #-}  module Data.Singletons.Single.Monad (-  SgM, bindLets, bindTyVars, bindTyVarsClause, lookupVarE, lookupConE,+  SgM, bindLets, bindTyVars, bindTyVarsEq, lookupVarE, lookupConE,   wrapSingFun, wrapUnSingFun,   singM, singDecsM,   emitDecs, emitDecsM@@ -29,10 +29,7 @@ import Language.Haskell.TH.Desugar import Control.Monad.Reader import Control.Monad.Writer--#if __GLASGOW_HASKELL__ < 709 import Control.Applicative-#endif  -- environment during singling data SgEnv =@@ -86,7 +83,7 @@   local (\env@(SgEnv { sg_let_binds = lets2 }) ->                env { sg_let_binds = (Map.fromList lets1) `Map.union` lets2 }) --- bindTyVarsClause+-- bindTyVarsEq -- ~~~~~~~~~~~~~~~~ -- -- This function does some dirty business.@@ -131,25 +128,26 @@ -- available from within the "lambda". -- -- This means, though, that using constraints with case statements and lambdas--- will likely not work. Ugh.+-- will likely not work. Ugh. UPDATE: This actually bit in practice! The+-- Enum class wants to define `succ = toEnum . (+1) . fromEnum`. But that+-- (+1) is a right-section, which desugars to a lambda. The Num constraint+-- couldn't get through. Changing (+1) to (1+) fixed the problem, as+-- left-sections don't need a lambda. -bindTyVarsClause :: VarPromotions   -- the bindings we wish to effect-                 -> [Name]          -- free variables in...-                 -> DType           -- ...this type of the thing_inside-                 -> [(DType, DType)]  -- and asserting these equalities-                 -> SgM DExp -> SgM DExp-bindTyVarsClause var_proms fv_names prom_fun equalities thing_inside = do+bindTyVarsEq :: VarPromotions   -- the bindings we wish to effect+             -> DType           -- the type of the thing_inside+             -> [(DType, DType)]  -- and asserting these equalities+             -> SgM DExp -> SgM DExp+bindTyVarsEq var_proms prom_fun equalities thing_inside = do   lambda <- qNewName "lambda"   let (term_names, tyvar_names) = unzip var_proms-      eq_ct  = [ DConPr equalityName `DAppPr` t1 `DAppPr` t2+      eq_ct  = [ mkEqPred t1 t2                | (t1, t2) <- equalities ]       ty_sig = DSigD lambda $-               DForallT (map DPlainTV tyvar_names)-                        []-                        (DForallT (map DPlainTV fv_names) eq_ct $-                                   ravel (map (\tv_name -> singFamily `DAppT` DVarT tv_name)-                                    tyvar_names-                                ++ [singFamily `DAppT` prom_fun]))+               DForallT (map DPlainTV tyvar_names) eq_ct $+                        ravel (map (\tv_name -> singFamily `DAppT` DVarT tv_name)+                                    tyvar_names)+                              (singFamily `DAppT` prom_fun)   arg_names <- mapM (qNewName . nameBase) term_names   body <- bindLets [ (term_name, DVarE arg_name)                    | term_name <- term_names@@ -158,12 +156,8 @@       let_body = foldExp (DVarE lambda) (map (DVarE . singValName) term_names)   return $ DLetE [ty_sig, fundef] let_body -bindTyVars :: VarPromotions-           -> [Name]-           -> DType-           -> SgM DExp -> SgM DExp-bindTyVars var_proms fv_names prom_fun =-  bindTyVarsClause var_proms fv_names prom_fun []+bindTyVars :: VarPromotions -> DType -> SgM DExp -> SgM DExp+bindTyVars var_proms prom_fun = bindTyVarsEq var_proms prom_fun []  lookupVarE :: Name -> SgM DExp lookupVarE = lookup_var_con singValName (DVarE . singValName)@@ -178,7 +172,8 @@   case Map.lookup name letExpansions of     Nothing -> do       -- try to get it from the global context-      m_dinfo <- dsReify sName+      m_dinfo <- liftM2 (<|>) (dsReify sName) (dsReify name)+        -- try the unrefined name too -- it's needed to bootstrap Enum       case m_dinfo of         Just (DVarI _ ty _ _) ->           let num_args = countArgs ty in
src/Data/Singletons/Single/Type.hs view
@@ -16,37 +16,25 @@ import Data.Singletons.Util import Control.Monad -data TopLevelFlag = TopLevel | NotTopLevel--singType :: TopLevelFlag-         -> DType          -- the promoted version of the thing classified by...+singType :: DType          -- the promoted version of the thing classified by...          -> DType          -- ... this type          -> SgM ( DType    -- the singletonized type                 , Int      -- the number of arguments-                , [Name] ) -- the names of the tyvars used in the sing'd type-singType top_level prom ty = do-  let (cxt, tys) = unravel ty-      args       = init tys-      num_args   = length args+                , [Name]   -- the names of the tyvars used in the sing'd type+                , DKind )  -- the kind of the result type+singType prom ty = do+  let (_, cxt, args, res) = unravel ty+      num_args            = length args   cxt' <- mapM singPred cxt   arg_names <- replicateM num_args (qNewName "t")+  prom_args <- mapM promoteType args+  prom_res  <- promoteType res   let args' = map (\n -> singFamily `DAppT` (DVarT n)) arg_names-      res'  = singFamily `DAppT` (foldl apply prom (map DVarT arg_names))-      tau   = ravel (args' ++ [res'])-  ty' <- case top_level of-           TopLevel -> do-             prom_args <- mapM promoteType args-             return $ DForallT (zipWith DKindedTV arg_names prom_args)-                               cxt' tau-                -- don't annotate kinds. Why? Because the original source-                -- may have used scoped type variables, and we're just-                -- not clever enough to get the scoped kind variables right.-                -- (the business in bindTyVars gets in the way)-                -- If ScopedTypeVariables was actually sane in patterns,-                -- this restriction might be able to be lifted.-           NotTopLevel -> return $ DForallT (map DPlainTV arg_names)-                                            cxt' tau-  return (ty', num_args, arg_names)+      res'  = singFamily `DAppT` (foldl apply prom (map DVarT arg_names) `DSigT` prom_res)+      tau   = ravel args' res'+  let ty' = DForallT (zipWith DKindedTV arg_names prom_args)+                     cxt' tau+  return (ty', num_args, arg_names, prom_res)  singPred :: DPred -> SgM DPred singPred = singPredRec []
src/Data/Singletons/Syntax.hs view
@@ -14,79 +14,32 @@  import Prelude hiding ( exp ) import Data.Monoid-import Data.Singletons.Util import Language.Haskell.TH.Syntax import Language.Haskell.TH.Desugar-import Language.Haskell.TH.Ppr import Data.Map.Strict ( Map ) import qualified Data.Map.Strict as Map-import Data.Maybe-import Control.Monad  type VarPromotions = [(Name, Name)]  -- from term-level name to type-level name    -- the relevant part of declarations-data DataDecl  = DataDecl NewOrData Name [DTyVarBndr] [DCon] [Name]-data ClassDecl = ClassDecl DCxt Name [DTyVarBndr] ULetDecEnv-data InstDecl  = InstDecl Name [DType] [(Name, ULetDecRHS)]--data PartitionedDecs =-  PDecs { pd_let_decs :: [DLetDec]-        , pd_class_decs :: [ClassDecl]-        , pd_instance_decs :: [InstDecl]-        , pd_data_decs :: [DataDecl]-        }--instance Monoid PartitionedDecs where-  mempty = PDecs [] [] [] []-  mappend (PDecs a1 b1 c1 d1) (PDecs a2 b2 c2 d2) =-    PDecs (a1 <> a2) (b1 <> b2) (c1 <> c2) (d1 <> d2)+data DataDecl      = DataDecl NewOrData Name [DTyVarBndr] [DCon] [Name] --- monadic only because of failure-partitionDecs :: Monad m => [DDec] -> m PartitionedDecs-partitionDecs = concatMapM partitionDec+data ClassDecl ann = ClassDecl { cd_cxt  :: DCxt+                               , cd_name :: Name+                               , cd_tvbs :: [DTyVarBndr]+                               , cd_fds  :: [FunDep]+                               , cd_lde  :: LetDecEnv ann } -partitionDec :: Monad m => DDec -> m PartitionedDecs-partitionDec (DLetDec letdec) = return $ mempty { pd_let_decs = [letdec] }-partitionDec (DDataD nd _cxt name tvbs cons derivings) =-  return $ mempty { pd_data_decs = [DataDecl nd name tvbs cons derivings] }-partitionDec (DClassD cxt name tvbs _fds decs) = do-  env <- concatMapM partitionClassDec decs-  return $ mempty { pd_class_decs = [ClassDecl cxt name tvbs env] }-partitionDec (DInstanceD _cxt ty decs) = do-  defns <- liftM catMaybes $ mapM partitionInstanceDec decs-  (name, tys) <- split_app_tys [] ty-  return $ mempty { pd_instance_decs = [InstDecl name tys defns] }-  where-    split_app_tys acc (DAppT t1 t2) = split_app_tys (t2:acc) t1-    split_app_tys acc (DConT name)  = return (name, acc)-    split_app_tys acc (DSigT t _)   = split_app_tys acc t-    split_app_tys _ _ = fail $ "Illegal instance head: " ++ show ty-partitionDec (DRoleAnnotD {}) = return mempty  -- ignore these-partitionDec (DPragmaD {}) = return mempty-partitionDec dec =-  fail $ "Declaration cannot be promoted: " ++ pprint (decToTH dec)+data InstDecl  ann = InstDecl { id_cxt     :: DCxt+                              , id_name    :: Name+                              , id_arg_tys :: [DType]+                              , id_meths   :: [(Name, LetDecRHS ann)] } -partitionClassDec :: Monad m => DDec -> m ULetDecEnv-partitionClassDec (DLetDec (DSigD name ty)) = return $ typeBinding name ty-partitionClassDec (DLetDec (DValD (DVarPa name) exp)) =-  return $ valueBinding name (UValue exp)-partitionClassDec (DLetDec (DFunD name clauses)) =-  return $ valueBinding name (UFunction clauses)-partitionClassDec (DLetDec (DInfixD fixity name)) =-  return $ infixDecl fixity name-partitionClassDec (DPragmaD {}) = return mempty-partitionClassDec _ =-  fail "Only method declarations can be promoted within a class."+type UClassDecl = ClassDecl Unannotated+type UInstDecl  = InstDecl Unannotated -partitionInstanceDec :: Monad m => DDec -> m (Maybe (Name, ULetDecRHS))-partitionInstanceDec (DLetDec (DValD (DVarPa name) exp)) =-  return $ Just (name, UValue exp)-partitionInstanceDec (DLetDec (DFunD name clauses)) =-  return $ Just (name, UFunction clauses)-partitionInstanceDec (DPragmaD {}) = return Nothing-partitionInstanceDec _ =-  fail "Only method bodies can be promoted within an instance."+type AClassDecl = ClassDecl Annotated+type AInstDecl  = InstDecl Annotated  {- We see below several datatypes beginning with "A". These are annotated structures,@@ -104,7 +57,9 @@            | ADLamE VarPromotions  -- bind these type variables to these term vars                     DType          -- the promoted lambda                     [Name] ADExp-           | ADCaseE ADExp [ADMatch]+           | ADCaseE ADExp DType [ADMatch] DType+               -- the first type is the promoted scrutinee;+               -- the second type is the return type            | ADLetE ALetDecEnv ADExp            | ADSigE ADExp DType @@ -116,24 +71,30 @@  data AnnotationFlag = Annotated | Unannotated --- these will be promoted a lot!-type Annotated = 'Annotated+-- These are used at the type-level exclusively+type Annotated   = 'Annotated type Unannotated = 'Unannotated  type family IfAnn (ann :: AnnotationFlag) (yes :: k) (no :: k) :: k type instance IfAnn Annotated   yes no = yes type instance IfAnn Unannotated yes no = no -data ALetDecRHS = AFunction DType  -- promote function (unapplied)-                            Int    -- number of arrows in type-                            [ADClause]-                | AValue DType -- promoted exp-                         Int   -- number of arrows in type-                         ADExp-data ULetDecRHS = UFunction [DClause]-                | UValue DExp+data family LetDecRHS (ann :: AnnotationFlag)+data instance LetDecRHS Annotated+  = AFunction DType  -- promote function (unapplied)+    Int    -- number of arrows in type+    [ADClause]+  | AValue DType -- promoted exp+    Int   -- number of arrows in type+    ADExp+data instance LetDecRHS Unannotated = UFunction [DClause]+                                    | UValue DExp++type ALetDecRHS = LetDecRHS Annotated+type ULetDecRHS = LetDecRHS Unannotated+ data LetDecEnv ann = LetDecEnv-                   { lde_defns :: Map Name (IfAnn ann ALetDecRHS ULetDecRHS)+                   { lde_defns :: Map Name (LetDecRHS ann)                    , lde_types :: Map Name DType   -- type signatures                    , lde_infix :: [(Fixity, Name)] -- infix declarations                    , lde_proms :: IfAnn ann (Map Name DType) () -- possibly, promotions@@ -158,7 +119,7 @@ emptyLetDecEnv :: ULetDecEnv emptyLetDecEnv = mempty -buildLetDecEnv :: DsMonad q => [DLetDec] -> q ULetDecEnv+buildLetDecEnv :: Quasi q => [DLetDec] -> q ULetDecEnv buildLetDecEnv = go emptyLetDecEnv   where     go acc [] = return acc
src/Data/Singletons/TH.hs view
@@ -27,15 +27,21 @@   singEqInstancesOnly, singEqInstanceOnly,   singDecideInstances, singDecideInstance, -  -- ** Functions to generate Ord instances+  -- ** Functions to generate 'Ord' instances   promoteOrdInstances, promoteOrdInstance,+  singOrdInstances, singOrdInstance, -  -- ** Functions to generate Ord instances+  -- ** Functions to generate 'Bounded' instances   promoteBoundedInstances, promoteBoundedInstance,+  singBoundedInstances, singBoundedInstance, -  -- ** Utility function-  cases,+  -- ** Functions to generate 'Enum' instances+  promoteEnumInstances, promoteEnumInstance,+  singEnumInstances, singEnumInstance, +  -- ** Utility functions+  cases, sCases,+   -- * Basic singleton definitions   Sing(SFalse, STrue, STuple0, STuple2, STuple3, STuple4, STuple5, STuple6, STuple7),   module Data.Singletons,@@ -45,7 +51,7 @@   -- so they must be in scope.    PEq(..), If, sIf, (:&&), SEq(..),-  POrd(..),+  POrd(..), SOrd(..), ThenCmp, sThenCmp, Foldl, sFoldl,   Any,   SDecide(..), (:~:)(..), Void, Refuted, Decision(..),   Proxy(..), KProxy(..), SomeSing(..),@@ -60,6 +66,7 @@   Tuple5Sym0, Tuple5Sym1, Tuple5Sym2, Tuple5Sym3, Tuple5Sym4, Tuple5Sym5,   Tuple6Sym0, Tuple6Sym1, Tuple6Sym2, Tuple6Sym3, Tuple6Sym4, Tuple6Sym5, Tuple6Sym6,   Tuple7Sym0, Tuple7Sym1, Tuple7Sym2, Tuple7Sym3, Tuple7Sym4, Tuple7Sym5, Tuple7Sym6, Tuple7Sym7,+  CompareSym0, ThenCmpSym0, FoldlSym0,    SuppressUnusedWarnings(..) @@ -72,20 +79,17 @@ import Data.Singletons.Prelude.Bool import Data.Singletons.Prelude.Eq import Data.Singletons.Prelude.Ord-import Data.Singletons.Types-import Data.Singletons.Void import Data.Singletons.Decide import Data.Singletons.TypeLits import Data.Singletons.SuppressUnusedWarnings+import Data.Singletons.Names import Language.Haskell.TH.Desugar  import GHC.Exts import Language.Haskell.TH import Data.Singletons.Util--#if __GLASGOW_HASKELL__ < 709-import Control.Applicative-#endif+import Data.Proxy ( Proxy(..) )+import Control.Arrow ( first )  -- | The function 'cases' generates a case expression where each right-hand side -- is identical. This may be useful if the type-checker requires knowledge of which@@ -97,16 +101,47 @@       -> q Exp       -- ^ The body, in a Template Haskell quote       -> q Exp cases tyName expq bodyq = do-  info <- reifyWithLocals tyName-  dinfo <- dsInfo info+  dinfo <- dsReify tyName   case dinfo of-    DTyConI (DDataD _ _ _ _ ctors _) _ -> fmap expToTH $ buildCases ctors-    _ -> fail $ "Using <<cases>> with something other than a type constructor: "-                ++ (show tyName)-  where buildCases ctors =-          DCaseE <$> (dsExp =<< expq) <*>-                     mapM (\con -> DMatch (conToPat con) <$> (dsExp =<< bodyq)) ctors+    Just (DTyConI (DDataD _ _ _ _ ctors _) _) ->+      expToTH <$> buildCases (map extractNameArgs ctors) expq bodyq+    Just _ ->+      fail $ "Using <<cases>> with something other than a type constructor: "+              ++ (show tyName)+    _ -> fail $ "Cannot find " ++ show tyName -        conToPat :: DCon -> DPat-        conToPat (DCon _ _ name fields) =-          DConPa name (map (const DWildPa) $ tysOfConFields fields)+-- | The function 'sCases' generates a case expression where each right-hand side+-- is identical. This may be useful if the type-checker requires knowledge of which+-- constructor is used to satisfy equality or type-class constraints, but where+-- 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+       => 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+  dinfo <- dsReify tyName+  case dinfo of+    Just (DTyConI (DDataD _ _ _ _ ctors _) _) ->+      let ctor_stuff = map (first singDataConName . extractNameArgs) ctors in+      expToTH <$> buildCases ctor_stuff expq bodyq+    Just _ ->+      fail $ "Using <<cases>> with something other than a type constructor: "+              ++ (show tyName)+    _ -> fail $ "Cannot find " ++ show tyName++buildCases :: DsMonad m+           => [(Name, Int)]+           -> m Exp  -- scrutinee+           -> m Exp  -- body+           -> m DExp+buildCases ctor_infos expq bodyq =+  DCaseE <$> (dsExp =<< expq) <*>+             mapM (\con -> DMatch (conToPat con) <$> (dsExp =<< bodyq)) ctor_infos+  where+    conToPat :: (Name, Int) -> DPat+    conToPat (name, num_fields) =+      DConPa name (replicate num_fields DWildPa)
src/Data/Singletons/TypeLits.hs view
@@ -8,206 +8,36 @@ -- Portability :  non-portable -- -- Defines and exports singletons useful for the Nat and Symbol kinds.+-- This exports the internal, unsafe constructors. Use Data.Singletons.TypeLits+-- for a safe interface. -- ---------------------------------------------------------------------------- -{-# LANGUAGE CPP, PolyKinds, DataKinds, TypeFamilies, FlexibleInstances,-             UndecidableInstances, ScopedTypeVariables, RankNTypes,-             GADTs, FlexibleContexts, TypeOperators, ConstraintKinds,-             TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -#if __GLASGOW_HASKELL__ < 707-{-# OPTIONS_GHC -O0 #-}   -- don't optimize SDecide instances in 7.6!-#endif- module Data.Singletons.TypeLits (   Nat, Symbol,   SNat, SSymbol, withKnownNat, withKnownSymbol,-  Error, ErrorSym0, sError,+  Error, ErrorSym0, ErrorSym1, sError,   KnownNat, natVal, KnownSymbol, symbolVal, -  (:+), (:-), (:*), (:^),-  (:+$), (:+$$), (:-$), (:-$$),-  (:*$), (:*$$), (:^$), (:^$$)+  (:^), (:^$), (:^$$), (:^$$$)   ) where -import Data.Singletons-import Data.Singletons.Types-import Data.Singletons.Prelude.Eq-import Data.Singletons.Prelude.Ord-import Data.Singletons.Decide-import Data.Singletons.Prelude.Bool-import Data.Singletons.Promote-#if __GLASGOW_HASKELL__ >= 707-import GHC.TypeLits as TL-import Data.Type.Equality-#else-import GHC.TypeLits (Nat, Symbol)-import qualified GHC.TypeLits as TL-#endif-import Unsafe.Coerce----------------------------------------------------------------------------- TypeLits singletons ----------------------------------------------------------------------------------------------------------------------#if __GLASGOW_HASKELL__ >= 707-data instance Sing (n :: Nat) = KnownNat n => SNat--instance KnownNat n => SingI n where-  sing = SNat--instance SingKind ('KProxy :: KProxy Nat) where-  type DemoteRep ('KProxy :: KProxy Nat) = Integer-  fromSing (SNat :: Sing n) = natVal (Proxy :: Proxy n)-  toSing n = case someNatVal n of-               Just (SomeNat (_ :: Proxy n)) -> SomeSing (SNat :: Sing n)-               Nothing -> error "Negative singleton nat"--data instance Sing (n :: Symbol) = KnownSymbol n => SSym--instance KnownSymbol n => SingI n where-  sing = SSym--instance SingKind ('KProxy :: KProxy Symbol) where-  type DemoteRep ('KProxy :: KProxy Symbol) = String-  fromSing (SSym :: Sing n) = symbolVal (Proxy :: Proxy n)-  toSing s = case someSymbolVal s of-               SomeSymbol (_ :: Proxy n) -> SomeSing (SSym :: Sing n)--#else--data TLSingInstance (a :: k) where-  TLSingInstance :: TL.SingI a => TLSingInstance a--newtype DI a = Don'tInstantiate (TL.SingI a => TLSingInstance a)--tlSingInstance :: forall (a :: k). TL.Sing a -> TLSingInstance a-tlSingInstance s = with_sing_i TLSingInstance-  where-    with_sing_i :: (TL.SingI a => TLSingInstance a) -> TLSingInstance a-    with_sing_i si = unsafeCoerce (Don'tInstantiate si) s--withTLSingI :: TL.Sing n -> (TL.SingI n => r) -> r-withTLSingI sn r =-  case tlSingInstance sn of-    TLSingInstance -> r--data instance Sing (n :: Nat) = TL.SingRep n Integer => SNat--instance TL.SingRep n Integer => SingI (n :: Nat) where-  sing = SNat--instance SingKind ('KProxy :: KProxy Nat) where-  type DemoteRep ('KProxy :: KProxy Nat) = Integer-  fromSing (SNat :: Sing n) = TL.fromSing (TL.sing :: TL.Sing n)-  toSing n-    | n >= 0 = case TL.unsafeSingNat n of-                 (tlsing :: TL.Sing n) ->-                   withTLSingI tlsing (SomeSing (SNat :: Sing n))-    | otherwise = error "Negative singleton nat"--data instance Sing (n :: Symbol) = TL.SingRep n String => SSym--instance TL.SingRep n String => SingI (n :: Symbol) where-  sing = SSym--instance SingKind ('KProxy :: KProxy Symbol) where-  type DemoteRep ('KProxy :: KProxy Symbol) = String-  fromSing (SSym :: Sing n) = TL.fromSing (TL.sing :: TL.Sing n)-  toSing n = case TL.unsafeSingSymbol n of-               (tlsing :: TL.Sing n) ->-                 withTLSingI tlsing (SomeSing (SSym :: Sing n))---- create 7.8-style TypeLits definitions:-class KnownNat (n :: Nat) where-  natVal :: proxy n -> Integer--class KnownSymbol (n :: Symbol) where-  symbolVal :: proxy n -> String--instance TL.SingI n => KnownNat n where-  natVal _ = TL.fromSing (TL.sing :: TL.Sing n)--instance TL.SingI n => KnownSymbol n where-  symbolVal _ = TL.fromSing (TL.sing :: TL.Sing n)--#endif---- Synonyms for GHC.TypeLits operations on Nat. These match our naming--- conventions.-type x :+ y = x + y-type x :- y = x - y-type x :* y = x * y-type x :^ y = x ^ y--$(genDefunSymbols [ ''(:+), ''(:-), ''(:*), ''(:^)] )---- SDecide instances:-instance SDecide ('KProxy :: KProxy Nat) where-  (SNat :: Sing n) %~ (SNat :: Sing m)-    | natVal (Proxy :: Proxy n) == natVal (Proxy :: Proxy m)-    = Proved $ unsafeCoerce Refl-    | otherwise-    = Disproved (\_ -> error errStr)-    where errStr = "Broken Nat singletons"--instance SDecide ('KProxy :: KProxy Symbol) where-  (SSym :: Sing n) %~ (SSym :: Sing m)-    | symbolVal (Proxy :: Proxy n) == symbolVal (Proxy :: Proxy m)-    = Proved $ unsafeCoerce Refl-    | otherwise-    = Disproved (\_ -> error errStr)-    where errStr = "Broken Symbol singletons"---- PEq instances-instance PEq ('KProxy :: KProxy Nat) where-  type (a :: Nat) :== (b :: Nat) = a == b-instance PEq ('KProxy :: KProxy Symbol) where-  type (a :: Symbol) :== (b :: Symbol) = a == b---- need SEq instances for TypeLits kinds-instance SEq ('KProxy :: KProxy Nat) where-  a %:== b-    | fromSing a == fromSing b    = unsafeCoerce STrue-    | otherwise                   = unsafeCoerce SFalse--instance SEq ('KProxy :: KProxy Symbol) where-  a %:== b-    | fromSing a == fromSing b    = unsafeCoerce STrue-    | otherwise                   = unsafeCoerce SFalse---- POrd instances-instance POrd ('KProxy :: KProxy Nat) where-  type (a :: Nat) `Compare` (b :: Nat) = a `TL.CmpNat` b--instance POrd ('KProxy :: KProxy Symbol) where-  type (a :: Symbol) `Compare` (b :: Symbol) = a `TL.CmpSymbol` b---- | Kind-restricted synonym for 'Sing' for @Nat@s-type SNat (x :: Nat) = Sing x---- | Kind-restricted synonym for 'Sing' for @Symbol@s-type SSymbol (x :: Symbol) = Sing x---- Convenience functions---- | Given a singleton for @Nat@, call something requiring a--- @KnownNat@ instance.-withKnownNat :: Sing n -> (KnownNat n => r) -> r-withKnownNat SNat f = f---- | Given a singleton for @Symbol@, call something requiring--- a @KnownSymbol@ instance.-withKnownSymbol :: Sing n -> (KnownSymbol n => r) -> r-withKnownSymbol SSym f = f+import Data.Singletons.TypeLits.Internal+import Data.Singletons.Prelude.Num ()   -- for typelits instances --- | The promotion of 'error'-type family Error (str :: Symbol) :: k-data ErrorSym0 (t1 :: TyFun k1 k2)-type instance Apply ErrorSym0 a = Error a+-- This bogus Num instance is helpful for people who want to define+-- functions over Nats that will only be used at the type level or+-- as singletons. A correct SNum instance for Nat singletons exists.+instance Num Nat where+  (+)         = no_term_level_nats+  (-)         = no_term_level_nats+  (*)         = no_term_level_nats+  negate      = no_term_level_nats+  abs         = no_term_level_nats+  signum      = no_term_level_nats+  fromInteger = no_term_level_nats --- | The singleton for 'error'-sError :: Sing (str :: Symbol) -> a-sError sstr = error (fromSing sstr)+no_term_level_nats :: a+no_term_level_nats = error "The kind `Nat` may not be used at the term level."
+ src/Data/Singletons/TypeLits/Internal.hs view
@@ -0,0 +1,155 @@+-----------------------------------------------------------------------------+-- |+-- Module      :  Data.Singletons.TypeLits.Internal+-- Copyright   :  (C) 2014 Richard Eisenberg+-- License     :  BSD-style (see LICENSE)+-- Maintainer  :  Richard Eisenberg (eir@cis.upenn.edu)+-- Stability   :  experimental+-- Portability :  non-portable+--+-- Defines and exports singletons useful for the Nat and Symbol kinds.+-- This exports the internal, unsafe constructors. Use Data.Singletons.TypeLits+-- for a safe interface.+--+----------------------------------------------------------------------------++{-# LANGUAGE PolyKinds, DataKinds, TypeFamilies, FlexibleInstances,+             UndecidableInstances, ScopedTypeVariables, RankNTypes,+             GADTs, FlexibleContexts, TypeOperators, ConstraintKinds,+             TemplateHaskell #-}+{-# OPTIONS_GHC -fno-warn-orphans #-}++module Data.Singletons.TypeLits.Internal (+  Sing(..),++  Nat, Symbol,+  SNat, SSymbol, withKnownNat, withKnownSymbol,+  Error, ErrorSym0, ErrorSym1, sError,+  KnownNat, natVal, KnownSymbol, symbolVal,++  (:^), (:^$), (:^$$), (:^$$$)+  ) where++import Data.Singletons.Promote+import Data.Singletons+import Data.Singletons.Prelude.Eq+import Data.Singletons.Prelude.Ord+import Data.Singletons.Decide+import Data.Singletons.Prelude.Bool+import GHC.TypeLits as TL+import Data.Type.Equality+import Data.Proxy ( Proxy(..) )+import Unsafe.Coerce++----------------------------------------------------------------------+---- TypeLits singletons ---------------------------------------------+----------------------------------------------------------------------++data instance Sing (n :: Nat) = KnownNat n => SNat++instance KnownNat n => SingI n where+  sing = SNat++instance SingKind ('KProxy :: KProxy Nat) where+  type DemoteRep ('KProxy :: KProxy Nat) = Integer+  fromSing (SNat :: Sing n) = natVal (Proxy :: Proxy n)+  toSing n = case someNatVal n of+               Just (SomeNat (_ :: Proxy n)) -> SomeSing (SNat :: Sing n)+               Nothing -> error "Negative singleton nat"++data instance Sing (n :: Symbol) = KnownSymbol n => SSym++instance KnownSymbol n => SingI n where+  sing = SSym++instance SingKind ('KProxy :: KProxy Symbol) where+  type DemoteRep ('KProxy :: KProxy Symbol) = String+  fromSing (SSym :: Sing n) = symbolVal (Proxy :: Proxy n)+  toSing s = case someSymbolVal s of+               SomeSymbol (_ :: Proxy n) -> SomeSing (SSym :: Sing n)++-- SDecide instances:+instance SDecide ('KProxy :: KProxy Nat) where+  (SNat :: Sing n) %~ (SNat :: Sing m)+    | natVal (Proxy :: Proxy n) == natVal (Proxy :: Proxy m)+    = Proved $ unsafeCoerce Refl+    | otherwise+    = Disproved (\_ -> error errStr)+    where errStr = "Broken Nat singletons"++instance SDecide ('KProxy :: KProxy Symbol) where+  (SSym :: Sing n) %~ (SSym :: Sing m)+    | symbolVal (Proxy :: Proxy n) == symbolVal (Proxy :: Proxy m)+    = Proved $ unsafeCoerce Refl+    | otherwise+    = Disproved (\_ -> error errStr)+    where errStr = "Broken Symbol singletons"++-- PEq instances+instance PEq ('KProxy :: KProxy Nat) where+  type (a :: Nat) :== (b :: Nat) = a == b+instance PEq ('KProxy :: KProxy Symbol) where+  type (a :: Symbol) :== (b :: Symbol) = a == b++-- need SEq instances for TypeLits kinds+instance SEq ('KProxy :: KProxy Nat) where+  a %:== b+    | fromSing a == fromSing b    = unsafeCoerce STrue+    | otherwise                   = unsafeCoerce SFalse++instance SEq ('KProxy :: KProxy Symbol) where+  a %:== b+    | fromSing a == fromSing b    = unsafeCoerce STrue+    | otherwise                   = unsafeCoerce SFalse++-- POrd instances+instance POrd ('KProxy :: KProxy Nat) where+  type (a :: Nat) `Compare` (b :: Nat) = a `TL.CmpNat` b++instance POrd ('KProxy :: KProxy Symbol) where+  type (a :: Symbol) `Compare` (b :: Symbol) = a `TL.CmpSymbol` b++-- | Kind-restricted synonym for 'Sing' for @Nat@s+type SNat (x :: Nat) = Sing x++-- | Kind-restricted synonym for 'Sing' for @Symbol@s+type SSymbol (x :: Symbol) = Sing x++-- SOrd instances+instance SOrd ('KProxy :: KProxy Nat) where+  a `sCompare` b = case fromSing a `compare` fromSing b of+                     LT -> unsafeCoerce SLT+                     EQ -> unsafeCoerce SEQ+                     GT -> unsafeCoerce SGT++instance SOrd ('KProxy :: KProxy Symbol) where+  a `sCompare` b = case fromSing a `compare` fromSing b of+                     LT -> unsafeCoerce SLT+                     EQ -> unsafeCoerce SEQ+                     GT -> unsafeCoerce SGT++-- Convenience functions++-- | Given a singleton for @Nat@, call something requiring a+-- @KnownNat@ instance.+withKnownNat :: Sing n -> (KnownNat n => r) -> r+withKnownNat SNat f = f++-- | Given a singleton for @Symbol@, call something requiring+-- a @KnownSymbol@ instance.+withKnownSymbol :: Sing n -> (KnownSymbol n => r) -> r+withKnownSymbol SSym f = f++-- | The promotion of 'error'. This version is more poly-kinded for+-- easier use.+type family Error (str :: k0) :: k+$(genDefunSymbols [''Error])++-- | The singleton for 'error'+sError :: Sing (str :: Symbol) -> a+sError sstr = error (fromSing sstr)++-- TODO: move this to a better home:+type a :^ b = a ^ b+infixr 8 :^+$(genDefunSymbols [''(:^)])
src/Data/Singletons/TypeRepStar.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE RankNTypes, TypeFamilies, KindSignatures, FlexibleInstances,              GADTs, UndecidableInstances, ScopedTypeVariables, DataKinds,-             MagicHash, CPP, TypeOperators #-}+             MagicHash, TypeOperators #-} {-# OPTIONS_GHC -fno-warn-orphans #-}  -----------------------------------------------------------------------------@@ -31,20 +31,14 @@  import Data.Singletons.Prelude.Instances import Data.Singletons-import Data.Singletons.Types import Data.Singletons.Prelude.Eq import Data.Typeable import Unsafe.Coerce import Data.Singletons.Decide -#if __GLASGOW_HASKELL__ >= 707 import GHC.Exts ( Proxy# ) import Data.Type.Coercion import Data.Type.Equality-#else-eqT :: (Typeable a, Typeable b) => Maybe (a :~: b)-eqT = gcast Refl-#endif  data instance Sing (a :: *) where   STypeRep :: Typeable a => Sing a@@ -57,11 +51,7 @@   toSing = dirty_mk_STypeRep  instance PEq ('KProxy :: KProxy *) where-#if __GLASGOW_HASKELL__ < 707-  type (a :: *) :== (a :: *) = True-#else   type (a :: *) :== (b :: *) = a == b-#endif  instance SEq ('KProxy :: KProxy *) where   (STypeRep :: Sing a) %:== (STypeRep :: Sing b) =@@ -77,27 +67,19 @@       Just Refl -> Proved Refl       Nothing   -> Disproved (\Refl -> error "Data.Typeable.eqT failed") -#if __GLASGOW_HASKELL__ >= 707 -- TestEquality instance already defined, but we need this one: instance TestCoercion Sing where   testCoercion (STypeRep :: Sing a) (STypeRep :: Sing b) =     case (eqT :: Maybe (a :~: b)) of       Just Refl -> Just Coercion       Nothing   -> Nothing-#endif  -- everything below here is private and dirty. Don't look!  newtype DI = Don'tInstantiate (forall a. Typeable a => Sing a) dirty_mk_STypeRep :: TypeRep -> SomeSing ('KProxy :: KProxy *) dirty_mk_STypeRep rep =-#if __GLASGOW_HASKELL__ >= 707   let justLikeTypeable :: Proxy# a -> TypeRep       justLikeTypeable _ = rep   in-#else-  let justLikeTypeable :: a -> TypeRep-      justLikeTypeable _ = rep-  in-#endif   unsafeCoerce (Don'tInstantiate STypeRep) justLikeTypeable
− src/Data/Singletons/Types.hs
@@ -1,53 +0,0 @@-{-# LANGUAGE PolyKinds, TypeOperators, GADTs, RankNTypes, TypeFamilies,-             CPP, DataKinds #-}---------------------------------------------------------------------------------- |--- Module      :  Data.Singletons.Types--- Copyright   :  (C) 2013 Richard Eisenberg--- License     :  BSD-style (see LICENSE)--- Maintainer  :  Richard Eisenberg (eir@cis.upenn.edu)--- Stability   :  experimental--- Portability :  non-portable------ Defines and exports types that are useful when working with singletons.--- Some of these are re-exports from @Data.Type.Equality@.-----------------------------------------------------------------------------------module Data.Singletons.Types (-  KProxy(..), Proxy(..),-  (:~:)(..), gcastWith, TestEquality(..),-  If-  ) where--#if __GLASGOW_HASKELL__ < 707---- now in Data.Proxy-data KProxy (a :: *) = KProxy-data Proxy a = Proxy---- now in Data.Type.Equality-data a :~: b where-  Refl :: a :~: a--gcastWith :: (a :~: b) -> ((a ~ b) => r) -> r-gcastWith Refl x = x--class TestEquality (f :: k -> *) where-  testEquality :: f a -> f b -> Maybe (a :~: b)---- now in Data.Type.Bool--- | Type-level "If". @If True a b@ ==> @a@; @If False a b@ ==> @b@-type family If (a :: Bool) (b :: k) (c :: k) :: k-type instance If 'True b c = b-type instance If 'False b c = c--#else--import Data.Proxy-import Data.Type.Equality-import Data.Type.Bool--#endif
src/Data/Singletons/Util.hs view
@@ -7,15 +7,15 @@ Users of the package should not need to consult this file. -} -{-# LANGUAGE CPP, TypeSynonymInstances, FlexibleInstances, RankNTypes,+{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, RankNTypes,              TemplateHaskell, GeneralizedNewtypeDeriving,              MultiParamTypeClasses, StandaloneDeriving,              UndecidableInstances, MagicHash, UnboxedTuples,-             LambdaCase #-}+             LambdaCase, CPP #-}  module Data.Singletons.Util where -import Prelude hiding ( exp, foldl, concat, mapM, any )+import Prelude hiding ( exp, foldl, concat, mapM, any, pred ) import Language.Haskell.TH.Syntax hiding ( lift ) import Language.Haskell.TH.Desugar import Data.Char@@ -23,14 +23,10 @@ import Control.Monad.Writer hiding ( mapM ) import Control.Monad.Reader hiding ( mapM ) import qualified Data.Map as Map+import Data.Map ( Map ) import Data.Foldable import Data.Traversable -#if __GLASGOW_HASKELL__ < 709-import Control.Applicative-import GHC.Exts ( Int(I#) )-#endif- -- The list of types that singletons processes by default basicTypes :: [Name] basicTypes = [ ''Maybe@@ -39,23 +35,24 @@              ] ++ boundedBasicTypes  boundedBasicTypes :: [Name]-boundedBasicTypes = [ ''Bool-             , ''Ordering-             , ''()-             , ''(,)-             , ''(,,)-             , ''(,,,)-             , ''(,,,,)-             , ''(,,,,,)-             , ''(,,,,,,)-            ]+boundedBasicTypes =+            [  ''(,)+            , ''(,,)+            , ''(,,,)+            , ''(,,,,)+            , ''(,,,,,)+            , ''(,,,,,,)+            ] ++ enumBasicTypes --- like reportWarning, but generalized to any DsMonad-qReportWarning :: DsMonad q => String -> q ()+enumBasicTypes :: [Name]+enumBasicTypes = [ ''Bool, ''Ordering, ''() ]++-- like reportWarning, but generalized to any Quasi+qReportWarning :: Quasi q => String -> q () qReportWarning = qReport False --- like reportError, but generalized to any DsMonad-qReportError :: DsMonad q => String -> q ()+-- like reportError, but generalized to any Quasi+qReportError :: Quasi q => String -> q () qReportError = qReport True  -- | Generate a new Unique@@ -63,21 +60,17 @@ qNewUnique = do   Name _ flav <- qNewName "x"   case flav of-#if __GLASGOW_HASKELL__ >= 709     NameU n -> return n-#else-    NameU n -> return (I# n)-#endif     _       -> error "Internal error: `qNewName` didn't return a NameU" -checkForRep :: DsMonad q => [Name] -> q ()+checkForRep :: Quasi q => [Name] -> q () checkForRep names =   when (any ((== "Rep") . nameBase) names)     (fail $ "A data type named <<Rep>> is a special case.\n" ++             "Promoting it will not work as expected.\n" ++             "Please choose another name for your data type.") -checkForRepInDecls :: DsMonad q => [DDec] -> q ()+checkForRepInDecls :: Quasi q => [DDec] -> q () checkForRepInDecls decls =   checkForRep (allNamesIn decls) @@ -93,6 +86,9 @@ extractNameTypes :: DCon -> (Name, [DType]) extractNameTypes (DCon _ _ n fields) = (n, tysOfConFields fields) +extractName :: DCon -> Name+extractName (DCon _ _ n _) = n+ -- is an identifier uppercase? isUpcase :: Name -> Bool isUpcase n = let first = head (nameBase n) in isUpper first || first == ':'@@ -186,7 +182,7 @@                  _   -> error "non-digit in show #"       in d' : convert ds --- extract the kind from a TyVarBndr. Returns '*' by default.+-- extract the kind from a TyVarBndr extractTvbKind :: DTyVarBndr -> Maybe DKind extractTvbKind (DPlainTV _) = Nothing extractTvbKind (DKindedTV _ k) = Just k@@ -196,38 +192,100 @@ extractTvbName (DPlainTV n) = n extractTvbName (DKindedTV n _) = n --- use the kind provided, or make a fresh kind variable-inferKind :: DsMonad q => Maybe DKind -> q (Maybe DKind)-inferKind (Just k) = return $ Just k-#if __GLASGOW_HASKELL__ < 707-inferKind Nothing = do-  newK <- qNewName "k"-  return $ Just $ DVarK newK-#else-inferKind Nothing = return Nothing-#endif+tvbToType :: DTyVarBndr -> DType+tvbToType = DVarT . extractTvbName +inferMaybeKindTV :: Name -> Maybe DKind -> DTyVarBndr+inferMaybeKindTV n Nothing =  DPlainTV n+inferMaybeKindTV n (Just k) = DKindedTV n k+ -- Get argument types from an arrow type. Removing ForallT is an -- important preprocessing step required by promoteType.-unravel :: DType -> ([DPred], [DType])-unravel (DForallT _ cxt ty) =-  let (cxt', tys) = unravel ty in-  (cxt ++ cxt', tys)+unravel :: DType -> ([DTyVarBndr], [DPred], [DType], DType)+unravel (DForallT tvbs cxt ty) =+  let (tvbs', cxt', tys, res) = unravel ty in+  (tvbs ++ tvbs', cxt ++ cxt', tys, res) unravel (DAppT (DAppT DArrowT t1) t2) =-  let (cxt, tys) = unravel t2 in-  (cxt, t1 : tys)-unravel t = ([], [t])+  let (tvbs, cxt, tys, res) = unravel t2 in+  (tvbs, cxt, t1 : tys, res)+unravel t = ([], [], [], t)  -- Reconstruct arrow kind from the list of kinds-ravel :: [DType] -> DType-ravel []    = error "Internal error: raveling nil"-ravel [k]   = k-ravel (h:t) = DAppT (DAppT DArrowT h) (ravel t)+ravel :: [DType] -> DType -> DType+ravel []    res  = res+ravel (h:t) res = DAppT (DAppT DArrowT h) (ravel t res)  -- count the number of arguments in a type countArgs :: DType -> Int-countArgs ty = length (snd $ unravel ty) - 1+countArgs ty = length args+  where (_, _, args, _) = unravel ty +substKind :: Map Name DKind -> DKind -> DKind+substKind _ (DForallK {}) =+  error "Higher-rank kind encountered in instance method promotion."+substKind subst (DVarK n) =+  case Map.lookup n subst of+    Just ki -> ki+    Nothing -> DVarK n+substKind subst (DConK con kis) = DConK con (map (substKind subst) kis)+substKind subst (DArrowK k1 k2) = DArrowK (substKind subst k1) (substKind subst k2)+substKind _ DStarK = DStarK++substType :: Map Name DType -> DType -> DType+substType subst ty | Map.null subst = ty+substType subst (DForallT tvbs cxt inner_ty) =+  let subst'    = foldr Map.delete subst (map extractTvbName tvbs)+      cxt'      = map (substPred subst') cxt+      inner_ty' = substType subst' inner_ty+  in+  DForallT tvbs cxt' inner_ty'+substType subst (DAppT ty1 ty2) = substType subst ty1 `DAppT` substType subst ty2+substType subst (DSigT ty ki) = substType subst ty `DSigT` ki+substType subst (DVarT n) =+  case Map.lookup n subst of+    Just ki -> ki+    Nothing -> DVarT n+substType _ ty@(DConT {}) = ty+substType _ ty@(DArrowT)  = ty+substType _ ty@(DLitT {}) = ty++substPred :: Map Name DType -> DPred -> DPred+substPred subst pred | Map.null subst = pred+substPred subst (DAppPr pred ty) =+  DAppPr (substPred subst pred) (substType subst ty)+substPred subst (DSigPr pred ki) = DSigPr (substPred subst pred) ki+substPred _ pred@(DVarPr {}) = pred+substPred _ pred@(DConPr {}) = pred++substKindInType :: Map Name DKind -> DType -> DType+substKindInType subst ty | Map.null subst = ty+substKindInType subst (DForallT tvbs cxt inner_ty) =+  let tvbs'     = map (substKindInTvb subst) tvbs+      cxt'      = map (substKindInPred subst) cxt+      inner_ty' = substKindInType subst inner_ty+  in+  DForallT tvbs' cxt' inner_ty'+substKindInType subst (DAppT ty1 ty2)+  = substKindInType subst ty1 `DAppT` substKindInType subst ty2+substKindInType subst (DSigT ty ki) = substKindInType subst ty `DSigT` substKind subst ki+substKindInType _ ty@(DVarT {}) = ty+substKindInType _ ty@(DConT {}) = ty+substKindInType _ ty@(DArrowT)  = ty+substKindInType _ ty@(DLitT {}) = ty++substKindInPred :: Map Name DKind -> DPred -> DPred+substKindInPred subst pred | Map.null subst = pred+substKindInPred subst (DAppPr pred ty) =+  DAppPr (substKindInPred subst pred) (substKindInType subst ty)+substKindInPred subst (DSigPr pred ki) = DSigPr (substKindInPred subst pred)+                                                (substKind subst ki)+substKindInPred _ pred@(DVarPr {}) = pred+substKindInPred _ pred@(DConPr {}) = pred++substKindInTvb :: Map Name DKind -> DTyVarBndr -> DTyVarBndr+substKindInTvb _ tvb@(DPlainTV _) = tvb+substKindInTvb subst (DKindedTV n ki) = DKindedTV n (substKind subst ki)+ addStar :: DKind -> DKind addStar t = DArrowK t DStarK @@ -258,7 +316,6 @@ orIfEmpty [] x = x orIfEmpty x  _ = x --- an empty list of matches, compatible with GHC 7.6.3 emptyMatches :: [DMatch] emptyMatches = [DMatch DWildPa (DAppE (DVarE 'error) (DLitE (StringL errStr)))]   where errStr = "Empty case reached -- this should be impossible"@@ -280,7 +337,7 @@   deriving ( Functor, Applicative, Monad, MonadTrans            , MonadWriter m, MonadReader r ) --- make a DsMonad instance for easy lifting+-- 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@@ -290,7 +347,6 @@   qLocation         = lift qLocation   qRunIO            = lift `comp1` qRunIO   qAddDependentFile = lift `comp1` qAddDependentFile-#if __GLASGOW_HASKELL__ >= 707   qReifyRoles       = lift `comp1` qReifyRoles   qReifyAnnotations = lift `comp1` qReifyAnnotations   qReifyModule      = lift `comp1` qReifyModule@@ -298,7 +354,6 @@   qAddModFinalizer  = lift `comp1` qAddModFinalizer   qGetQ             = lift qGetQ   qPutQ             = lift `comp1` qPutQ-#endif    qRecover exp handler = do     (result, aux) <- lift $ qRecover (evalForPair exp) (evalForPair handler)
− src/Data/Singletons/Void.hs
@@ -1,78 +0,0 @@-{- Data/Singletons/Void.hs--   A reimplementation of a Void type, copied shamelessly from Edward Kmett's void-   package, but without inducing a dependency.---}--{-# LANGUAGE CPP, Trustworthy, DeriveDataTypeable, DeriveGeneric, StandaloneDeriving #-}---------------------------------------------------------------------------------- |--- Copyright   :  (C) 2008-2013 Edward Kmett--- License     :  BSD-style (see LICENSE)--- Maintainer  :  Richard Eisenberg (eir@cis.upenn.edu)--- Stability   :  experimental--- Portability :  non-portable------ This module is a reimplementation of Edward Kmett's @void@ package.--- It is included within singletons to avoid depending on @void@ and all the--- packages that depends on (including @text@). If this causes problems for--- you (that singletons has its own 'Void' type), please let me (Richard Eisenberg)--- know at @eir@ at @cis.upenn.edu@.---------------------------------------------------------------------------------module Data.Singletons.Void-  ( Void-  , absurd-  , vacuous-  , vacuousM-  ) where--import Control.Monad (liftM)-import Data.Ix-import Data.Data-import GHC.Generics-import Control.Exception---- | A logically uninhabited data type.-newtype Void = Void Void-  deriving (Data, Typeable, Generic)--instance Eq Void where-  _ == _ = True--instance Ord Void where-  compare _ _ = EQ--instance Show Void where-  showsPrec _ = absurd---- | Reading a 'Void' value is always a parse error, considering 'Void' as--- a data type with no constructors.-instance Read Void where-  readsPrec _ _ = []---- | Since 'Void' values logically don't exist, this witnesses the logical--- reasoning tool of \"ex falso quodlibet\".-absurd :: Void -> a-absurd a = a `seq` spin a where-   spin (Void b) = spin b---- | If 'Void' is uninhabited then any 'Functor' that holds only values of type 'Void'--- is holding no values.-vacuous :: Functor f => f Void -> f a-vacuous = fmap absurd---- | If 'Void' is uninhabited then any 'Monad' that holds values of type 'Void'--- is holding no values.-vacuousM :: Monad m => m Void -> m a-vacuousM = liftM absurd--instance Ix Void where-  range _ = []-  index _ = absurd-  inRange _ = absurd-  rangeSize _ = 0--instance Exception Void
tests/SingletonsTestSuite.hs view
@@ -4,10 +4,14 @@  import Test.Tasty               ( TestTree, defaultMain, testGroup          ) import SingletonsTestSuiteUtils ( compileAndDumpStdTest, compileAndDumpTest-                                , testCompileAndDumpGroup, ghcOpts          )+                                , testCompileAndDumpGroup, ghcOpts+                             --   , cleanFiles+                                )  main :: IO ()-main = defaultMain tests+main = do+--  cleanFiles    We really need to parallelize the testsuite.+  defaultMain tests  tests :: TestTree tests =@@ -25,7 +29,6 @@     , compileAndDumpStdTest "EqInstances"     , compileAndDumpStdTest "CaseExpressions"     , compileAndDumpStdTest "Star"-    , compileAndDumpStdTest "Tuples"     , compileAndDumpStdTest "ReturnFunc"     , compileAndDumpStdTest "Lambdas"     , compileAndDumpStdTest "LambdasComprehensive"@@ -38,17 +41,25 @@     , compileAndDumpStdTest "Records"     , compileAndDumpStdTest "T29"     , compileAndDumpStdTest "T33"+    , compileAndDumpStdTest "T54"+    , compileAndDumpStdTest "Classes"+    , compileAndDumpStdTest "Classes2"+    , compileAndDumpStdTest "FunDeps"+    , compileAndDumpStdTest "T78"+    , compileAndDumpStdTest "OrdDeriving"+    , compileAndDumpStdTest "BoundedDeriving"+    , compileAndDumpStdTest "BadBoundedDeriving"+    , compileAndDumpStdTest "EnumDeriving"+    , compileAndDumpStdTest "BadEnumDeriving"+    , compileAndDumpStdTest "Fixity"+    , compileAndDumpStdTest "Undef"+    , compileAndDumpStdTest "T124"     ],     testCompileAndDumpGroup "Promote"     [ compileAndDumpStdTest "Constructors"     , compileAndDumpStdTest "GenDefunSymbols"     , compileAndDumpStdTest "Newtypes"-    , compileAndDumpStdTest "Classes"-    , compileAndDumpStdTest "TopLevelPatterns"     , compileAndDumpStdTest "Pragmas"-    , compileAndDumpStdTest "OrdDeriving"-    , compileAndDumpStdTest "BoundedDeriving"-    , compileAndDumpStdTest "BadBoundedDeriving"     , compileAndDumpStdTest "Prelude"     ],     testGroup "Database client"
tests/SingletonsTestSuiteUtils.hs view
@@ -4,26 +4,26 @@  , compileAndDumpStdTest  , testCompileAndDumpGroup  , ghcOpts- , singletonsVersion+ , cleanFiles  ) where  import Control.Exception  ( Exception, throw                    )-import Data.List          ( intercalate                         )+import Control.Monad      ( liftM                               )+import Data.List          ( intercalate, find, isPrefixOf       ) import Data.Typeable      ( Typeable                            ) import System.Exit        ( ExitCode(..)                        ) import System.FilePath    ( takeBaseName, pathSeparator         ) import System.IO          ( IOMode(..), hGetContents, openFile  ) import System.Process     ( CreateProcess(..), StdStream(..)-                          , createProcess, proc, waitForProcess )+                          , createProcess, proc, waitForProcess+                          , readProcess, callCommand            )+import System.Directory   ( doesFileExist                       ) import Test.Tasty         ( TestTree, testGroup                 ) import Test.Tasty.Golden  ( goldenVsFileDiff                    ) -import Distribution.PackageDescription.Parse         ( readPackageDescription    )-import Distribution.PackageDescription.Configuration ( flattenPackageDescription )-import Distribution.PackageDescription               ( PackageDescription(..)    )-import Distribution.Verbosity                        ( silent                    ) import Distribution.Package                          ( PackageIdentifier(..)     )-import Data.Version                                  ( showVersion               )+import Distribution.Text                             ( simpleParse               )+import Data.Version                                  ( Version(..)               ) import System.IO.Unsafe                              ( unsafePerformIO           )  #include "../dist/build/autogen/cabal_macros.h"@@ -35,7 +35,6 @@  instance Show ProcessException where     show (ProcessException msg) = msg- -- GHC executable name (if on path) or full path ghcPath :: FilePath ghcPath = "ghc"@@ -50,49 +49,58 @@ includePath = "../../dist/build"  ghcVersion :: String-#if __GLASGOW_HASKELL__ <  706-ghcVersion = error "testsuite requires GHC 7.6 or newer"-#else-#if __GLASGOW_HASKELL__ >= 706 && __GLASGOW_HASKELL__ < 707-ghcVersion = ".ghc76"-#else-ghcVersion = ".ghc78"-#endif-#endif+ghcVersion = ".ghc710" --- the version number of "singletons"-singletonsVersion :: String-singletonsVersion = unsafePerformIO $ do-  gpd <- readPackageDescription silent "singletons.cabal"-  let pd = flattenPackageDescription gpd-  return $ showVersion $ pkgVersion $ package pd+-- The mtl package made an incompatible change between 2.1.3.1 and 2.2.1. Because+-- test files are compiled outside of the cabal infrastructure, we need to check+-- the mtl version and behave accordingly. Argh. The more general solution to this+-- is to use cabal_macros.h and then use the package specifications in dist/setup-config.+-- This also uses a cabal sandbox, if it is around.+extraOpts :: [String]+extraOpts = unsafePerformIO $ do+  (ghcPackageDbOpts, ghcPkgOpts) <- do+     sandboxed <- doesFileExist "cabal.sandbox.config"+     if sandboxed+     then do+       let prefix = "package-db: "+           opts_from_config config =+             case find (prefix `isPrefixOf`) $ lines config of+               Nothing -> ([], [])+               Just db_line -> let package_db = drop (length prefix) db_line in+                               ( [ "-no-user-package-db"+                                 , "-package-db " ++ package_db ]+                               , [ "--no-user-package-db"  -- ghc-pkg is slightly different!+                                 , "--package-db=" ++ package_db ] )+       opts_from_config `liftM` readFile "cabal.sandbox.config"+     else return ([], [])+  mtl_string <- readProcess "ghc-pkg" (ghcPkgOpts ++ ["latest", "mtl"]) ""+  let Just (PackageIdentifier { pkgVersion = ver }) = simpleParse mtl_string+      firstModernVersion = Version [2,2,1] []+      mtlOpt | ver >= firstModernVersion = ["-DMODERN_MTL"]+             | otherwise                 = []+  return $ ghcPackageDbOpts ++ mtlOpt + -- GHC options used when running the tests ghcOpts :: [String]-ghcOpts = [+ghcOpts = extraOpts ++ [     "-v0"   , "-c"-#if __GLASGOW_HASKELL__ < 709-  , "-package-name singletons-" ++ singletonsVersion -- See Note [-package-name hack]-#else-  , "-this-package-key " ++ CURRENT_PACKAGE_KEY-#endif+  , "-this-package-key " ++ CURRENT_PACKAGE_KEY -- See Note [-this-package-key hack]   , "-ddump-splices"   , "-dsuppress-uniques"   , "-fforce-recomp"   , "-fprint-explicit-kinds"-  , "-i" ++ includePath+  , "-O0"+  , "-i" ++ includePath   -- necessary because some tests use these modules+  , "-itests/compile-and-dump"   , "-XTemplateHaskell"   , "-XDataKinds"   , "-XKindSignatures"   , "-XTypeFamilies"-  , "-XTemplateHaskell"   , "-XTypeOperators"-  , "-XKindSignatures"-  , "-XDataKinds"   , "-XMultiParamTypeClasses"   , "-XGADTs"-  , "-XTypeFamilies"   , "-XFlexibleInstances"   , "-XUndecidableInstances"   , "-XRankNTypes"@@ -100,17 +108,18 @@   , "-XPolyKinds"   , "-XFlexibleContexts"   , "-XIncoherentInstances"-  , "-XCPP"   , "-XLambdaCase"   , "-XUnboxedTuples"+  , "-XInstanceSigs"+  , "-XDefaultSignatures"   ] --- Note [-package-name hack]--- ~~~~~~~~~~~~~~~~~~~~~~~~~+-- Note [-this-package-key hack]+-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- -- We want to avoid installing singletons package before running the -- testsuite, because in this way we prevent double compilation of the--- library. To do this we pass -package-name option to GHC to convince+-- library. To do this we pass -this-package-key option to GHC to convince -- it that the test files are actually part of the current -- package. This means that library doesn't have to be installed -- globally and interface files generated during library compilation@@ -240,3 +249,6 @@        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 tests/compile-and-dump/*/*.{hi,o}"
+ tests/compile-and-dump/GradingClient/Database.ghc710.template view
@@ -0,0 +1,4916 @@+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 family Equals_0123456789 (a :: Nat) (b :: Nat) :: Bool where+      Equals_0123456789 Zero Zero = TrueSym0+      Equals_0123456789 (Succ a) (Succ b) = (:==) a b+      Equals_0123456789 (a :: Nat) (b :: Nat) = FalseSym0+    instance PEq (KProxy :: KProxy Nat) where+      type (:==) (a :: Nat) (b :: Nat) = Equals_0123456789 a b+    type ZeroSym0 = Zero+    type SuccSym1 (t :: Nat) = Succ t+    instance SuppressUnusedWarnings SuccSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) SuccSym0KindInference GHC.Tuple.())+    data SuccSym0 (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply SuccSym0 arg) ~ KindOf (SuccSym1 arg) =>+        SuccSym0KindInference+    type instance Apply SuccSym0 l = SuccSym1 l+    type family Compare_0123456789 (a :: Nat)+                                   (a :: Nat) :: Ordering where+      Compare_0123456789 Zero Zero = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) '[]+      Compare_0123456789 (Succ a_0123456789) (Succ b_0123456789) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) '[])+      Compare_0123456789 Zero (Succ _z_0123456789) = LTSym0+      Compare_0123456789 (Succ _z_0123456789) Zero = GTSym0+    type Compare_0123456789Sym2 (t :: Nat) (t :: Nat) =+        Compare_0123456789 t t+    instance SuppressUnusedWarnings Compare_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Compare_0123456789Sym1KindInference GHC.Tuple.())+    data Compare_0123456789Sym1 (l :: Nat) (l :: TyFun Nat Ordering)+      = forall arg. KindOf (Apply (Compare_0123456789Sym1 l) arg) ~ KindOf (Compare_0123456789Sym2 l arg) =>+        Compare_0123456789Sym1KindInference+    type instance Apply (Compare_0123456789Sym1 l) l = Compare_0123456789Sym2 l l+    instance SuppressUnusedWarnings Compare_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Compare_0123456789Sym0KindInference GHC.Tuple.())+    data Compare_0123456789Sym0 (l :: TyFun Nat (TyFun Nat Ordering+                                                 -> *))+      = forall arg. KindOf (Apply Compare_0123456789Sym0 arg) ~ KindOf (Compare_0123456789Sym1 arg) =>+        Compare_0123456789Sym0KindInference+    type instance Apply Compare_0123456789Sym0 l = Compare_0123456789Sym1 l+    instance POrd (KProxy :: KProxy Nat) where+      type Compare (a :: Nat) (a :: Nat) = Apply (Apply Compare_0123456789Sym0 a) a+    data instance Sing (z :: Nat)+      = z ~ Zero => SZero |+        forall (n :: Nat). z ~ Succ n => SSucc (Sing (n :: Nat))+    type SNat = (Sing :: Nat -> *)+    instance SingKind (KProxy :: KProxy Nat) where+      type DemoteRep (KProxy :: KProxy Nat) = Nat+      fromSing SZero = Zero+      fromSing (SSucc b) = Succ (fromSing b)+      toSing Zero = SomeSing SZero+      toSing (Succ b)+        = case toSing b :: SomeSing (KProxy :: KProxy Nat) of {+            SomeSing c -> SomeSing (SSucc c) }+    instance SEq (KProxy :: KProxy Nat) where+      (%:==) SZero SZero = STrue+      (%:==) SZero (SSucc _) = SFalse+      (%:==) (SSucc _) SZero = SFalse+      (%:==) (SSucc a) (SSucc b) = (%:==) a b+    instance SDecide (KProxy :: KProxy Nat) where+      (%~) SZero SZero = Proved Refl+      (%~) SZero (SSucc _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SSucc _) SZero+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SSucc a) (SSucc b)+        = case (%~) a b of {+            Proved Refl -> Proved Refl+            Disproved contra+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl }) }+    instance SOrd (KProxy :: KProxy Nat) =>+             SOrd (KProxy :: KProxy Nat) where+      sCompare ::+        forall (t0 :: Nat) (t1 :: Nat).+        Sing t0+        -> Sing t1+           -> Sing (Apply (Apply (CompareSym0 :: TyFun Nat (TyFun Nat Ordering+                                                            -> *)+                                                 -> *) t0 :: TyFun Nat Ordering+                                                             -> *) t1 :: Ordering)+      sCompare SZero SZero+        = let+            lambda ::+              (t0 ~ ZeroSym0, t1 ~ ZeroSym0) =>+              Sing (Apply (Apply CompareSym0 ZeroSym0) ZeroSym0 :: Ordering)+            lambda+              = applySing+                  (applySing+                     (applySing+                        (singFun3 (Proxy :: Proxy FoldlSym0) sFoldl)+                        (singFun2 (Proxy :: Proxy ThenCmpSym0) sThenCmp))+                     SEQ)+                  SNil+          in lambda+      sCompare (SSucc sA_0123456789) (SSucc sB_0123456789)+        = let+            lambda ::+              forall a_0123456789+                     b_0123456789. (t0 ~ Apply SuccSym0 a_0123456789,+                                    t1 ~ Apply SuccSym0 b_0123456789) =>+              Sing a_0123456789+              -> Sing b_0123456789+                 -> Sing (Apply (Apply CompareSym0 (Apply SuccSym0 a_0123456789)) (Apply SuccSym0 b_0123456789) :: Ordering)+            lambda a_0123456789 b_0123456789+              = applySing+                  (applySing+                     (applySing+                        (singFun3 (Proxy :: Proxy FoldlSym0) sFoldl)+                        (singFun2 (Proxy :: Proxy ThenCmpSym0) sThenCmp))+                     SEQ)+                  (applySing+                     (applySing+                        (singFun2 (Proxy :: Proxy (:$)) SCons)+                        (applySing+                           (applySing+                              (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                           b_0123456789))+                     SNil)+          in lambda sA_0123456789 sB_0123456789+      sCompare SZero (SSucc _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789. (t0 ~ ZeroSym0,+                                     t1 ~ Apply SuccSym0 _z_0123456789) =>+              Sing _z_0123456789+              -> Sing (Apply (Apply CompareSym0 ZeroSym0) (Apply SuccSym0 _z_0123456789) :: Ordering)+            lambda _z_0123456789 = SLT+          in lambda _s_z_0123456789+      sCompare (SSucc _s_z_0123456789) SZero+        = let+            lambda ::+              forall _z_0123456789. (t0 ~ Apply SuccSym0 _z_0123456789,+                                     t1 ~ ZeroSym0) =>+              Sing _z_0123456789+              -> Sing (Apply (Apply CompareSym0 (Apply SuccSym0 _z_0123456789)) ZeroSym0 :: Ordering)+            lambda _z_0123456789 = SGT+          in lambda _s_z_0123456789+    instance SingI Zero where+      sing = SZero+    instance SingI n => SingI (Succ (n :: Nat)) where+      sing = SSucc sing+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 GHC.Types.[]) = True+    attrNotIn (Attr name u) (Sch ((Attr name' _) GHC.Types.: t))+      = ((name /= name') && (attrNotIn (Attr name u) (Sch t)))+    disjoint :: Schema -> Schema -> Bool+    disjoint (Sch GHC.Types.[]) _ = True+    disjoint (Sch (h GHC.Types.: t)) s+      = ((attrNotIn h s) && (disjoint (Sch t) s))+    occurs :: [AChar] -> Schema -> Bool+    occurs _ (Sch GHC.Types.[]) = False+    occurs name (Sch ((Attr name' _) GHC.Types.: attrs))+      = ((name == name') || (occurs name (Sch attrs)))+    lookup :: [AChar] -> Schema -> U+    lookup _ (Sch GHC.Types.[]) = undefined+    lookup name (Sch ((Attr name' u) GHC.Types.: attrs))+      = if (name == name') then u else lookup name (Sch attrs)+    type family Equals_0123456789 (a :: U) (b :: U) :: Bool where+      Equals_0123456789 BOOL BOOL = TrueSym0+      Equals_0123456789 STRING STRING = TrueSym0+      Equals_0123456789 NAT NAT = TrueSym0+      Equals_0123456789 (VEC a a) (VEC b b) = (:&&) ((:==) a b) ((:==) a b)+      Equals_0123456789 (a :: U) (b :: U) = FalseSym0+    instance PEq (KProxy :: KProxy U) where+      type (:==) (a :: U) (b :: U) = Equals_0123456789 a b+    type BOOLSym0 = BOOL+    type STRINGSym0 = STRING+    type NATSym0 = NAT+    type VECSym2 (t :: U) (t :: Nat) = VEC t t+    instance SuppressUnusedWarnings VECSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) VECSym1KindInference GHC.Tuple.())+    data VECSym1 (l :: U) (l :: TyFun Nat U)+      = forall arg. KindOf (Apply (VECSym1 l) arg) ~ KindOf (VECSym2 l arg) =>+        VECSym1KindInference+    type instance Apply (VECSym1 l) l = VECSym2 l l+    instance SuppressUnusedWarnings VECSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) VECSym0KindInference GHC.Tuple.())+    data VECSym0 (l :: TyFun U (TyFun Nat U -> *))+      = forall arg. KindOf (Apply VECSym0 arg) ~ KindOf (VECSym1 arg) =>+        VECSym0KindInference+    type instance Apply VECSym0 l = VECSym1 l+    type family Equals_0123456789 (a :: AChar)+                                  (b :: AChar) :: Bool where+      Equals_0123456789 CA CA = TrueSym0+      Equals_0123456789 CB CB = TrueSym0+      Equals_0123456789 CC CC = TrueSym0+      Equals_0123456789 CD CD = TrueSym0+      Equals_0123456789 CE CE = TrueSym0+      Equals_0123456789 CF CF = TrueSym0+      Equals_0123456789 CG CG = TrueSym0+      Equals_0123456789 CH CH = TrueSym0+      Equals_0123456789 CI CI = TrueSym0+      Equals_0123456789 CJ CJ = TrueSym0+      Equals_0123456789 CK CK = TrueSym0+      Equals_0123456789 CL CL = TrueSym0+      Equals_0123456789 CM CM = TrueSym0+      Equals_0123456789 CN CN = TrueSym0+      Equals_0123456789 CO CO = TrueSym0+      Equals_0123456789 CP CP = TrueSym0+      Equals_0123456789 CQ CQ = TrueSym0+      Equals_0123456789 CR CR = TrueSym0+      Equals_0123456789 CS CS = TrueSym0+      Equals_0123456789 CT CT = TrueSym0+      Equals_0123456789 CU CU = TrueSym0+      Equals_0123456789 CV CV = TrueSym0+      Equals_0123456789 CW CW = TrueSym0+      Equals_0123456789 CX CX = TrueSym0+      Equals_0123456789 CY CY = TrueSym0+      Equals_0123456789 CZ CZ = TrueSym0+      Equals_0123456789 (a :: AChar) (b :: AChar) = FalseSym0+    instance PEq (KProxy :: KProxy AChar) where+      type (:==) (a :: AChar) (b :: AChar) = Equals_0123456789 a b+    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 (t :: [AChar]) (t :: U) = Attr t t+    instance SuppressUnusedWarnings AttrSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) AttrSym1KindInference GHC.Tuple.())+    data AttrSym1 (l :: [AChar]) (l :: TyFun U Attribute)+      = forall arg. KindOf (Apply (AttrSym1 l) arg) ~ KindOf (AttrSym2 l arg) =>+        AttrSym1KindInference+    type instance Apply (AttrSym1 l) l = AttrSym2 l l+    instance SuppressUnusedWarnings AttrSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) AttrSym0KindInference GHC.Tuple.())+    data AttrSym0 (l :: TyFun [AChar] (TyFun U Attribute -> *))+      = forall arg. KindOf (Apply AttrSym0 arg) ~ KindOf (AttrSym1 arg) =>+        AttrSym0KindInference+    type instance Apply AttrSym0 l = AttrSym1 l+    type SchSym1 (t :: [Attribute]) = Sch t+    instance SuppressUnusedWarnings SchSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) SchSym0KindInference GHC.Tuple.())+    data SchSym0 (l :: TyFun [Attribute] Schema)+      = forall arg. KindOf (Apply SchSym0 arg) ~ KindOf (SchSym1 arg) =>+        SchSym0KindInference+    type instance Apply SchSym0 l = SchSym1 l+    type Let0123456789Scrutinee_0123456789Sym4 t t t t =+        Let0123456789Scrutinee_0123456789 t t t t+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym3 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym3KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym3 l l l l+      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym3 l l l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym4 l l l arg) =>+        Let0123456789Scrutinee_0123456789Sym3KindInference+    type instance Apply (Let0123456789Scrutinee_0123456789Sym3 l l l) l = Let0123456789Scrutinee_0123456789Sym4 l l l l+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym2KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym2 l l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym3 l l arg) =>+        Let0123456789Scrutinee_0123456789Sym2KindInference+    type instance Apply (Let0123456789Scrutinee_0123456789Sym2 l l) l = Let0123456789Scrutinee_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym1KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym1 l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym2 l arg) =>+        Let0123456789Scrutinee_0123456789Sym1KindInference+    type instance Apply (Let0123456789Scrutinee_0123456789Sym1 l) l = Let0123456789Scrutinee_0123456789Sym2 l l+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym0 l+      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>+        Let0123456789Scrutinee_0123456789Sym0KindInference+    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l+    type family Let0123456789Scrutinee_0123456789 name+                                                  name'+                                                  u+                                                  attrs where+      Let0123456789Scrutinee_0123456789 name name' u attrs = Apply (Apply (:==$) name) name'+    type family Case_0123456789 name name' u attrs t where+      Case_0123456789 name name' u attrs True = u+      Case_0123456789 name name' u attrs False = Apply (Apply LookupSym0 name) (Apply SchSym0 attrs)+    type LookupSym2 (t :: [AChar]) (t :: Schema) = Lookup t t+    instance SuppressUnusedWarnings LookupSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) LookupSym1KindInference GHC.Tuple.())+    data LookupSym1 (l :: [AChar]) (l :: TyFun Schema U)+      = forall arg. KindOf (Apply (LookupSym1 l) arg) ~ KindOf (LookupSym2 l arg) =>+        LookupSym1KindInference+    type instance Apply (LookupSym1 l) l = LookupSym2 l l+    instance SuppressUnusedWarnings LookupSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) LookupSym0KindInference GHC.Tuple.())+    data LookupSym0 (l :: TyFun [AChar] (TyFun Schema U -> *))+      = forall arg. KindOf (Apply LookupSym0 arg) ~ KindOf (LookupSym1 arg) =>+        LookupSym0KindInference+    type instance Apply LookupSym0 l = LookupSym1 l+    type OccursSym2 (t :: [AChar]) (t :: Schema) = Occurs t t+    instance SuppressUnusedWarnings OccursSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) OccursSym1KindInference GHC.Tuple.())+    data OccursSym1 (l :: [AChar]) (l :: TyFun Schema Bool)+      = forall arg. KindOf (Apply (OccursSym1 l) arg) ~ KindOf (OccursSym2 l arg) =>+        OccursSym1KindInference+    type instance Apply (OccursSym1 l) l = OccursSym2 l l+    instance SuppressUnusedWarnings OccursSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) OccursSym0KindInference GHC.Tuple.())+    data OccursSym0 (l :: TyFun [AChar] (TyFun Schema Bool -> *))+      = forall arg. KindOf (Apply OccursSym0 arg) ~ KindOf (OccursSym1 arg) =>+        OccursSym0KindInference+    type instance Apply OccursSym0 l = OccursSym1 l+    type AttrNotInSym2 (t :: Attribute) (t :: Schema) = AttrNotIn t t+    instance SuppressUnusedWarnings AttrNotInSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) AttrNotInSym1KindInference GHC.Tuple.())+    data AttrNotInSym1 (l :: Attribute) (l :: TyFun Schema Bool)+      = forall arg. KindOf (Apply (AttrNotInSym1 l) arg) ~ KindOf (AttrNotInSym2 l arg) =>+        AttrNotInSym1KindInference+    type instance Apply (AttrNotInSym1 l) l = AttrNotInSym2 l l+    instance SuppressUnusedWarnings AttrNotInSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) AttrNotInSym0KindInference GHC.Tuple.())+    data AttrNotInSym0 (l :: TyFun Attribute (TyFun Schema Bool -> *))+      = forall arg. KindOf (Apply AttrNotInSym0 arg) ~ KindOf (AttrNotInSym1 arg) =>+        AttrNotInSym0KindInference+    type instance Apply AttrNotInSym0 l = AttrNotInSym1 l+    type DisjointSym2 (t :: Schema) (t :: Schema) = Disjoint t t+    instance SuppressUnusedWarnings DisjointSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) DisjointSym1KindInference GHC.Tuple.())+    data DisjointSym1 (l :: Schema) (l :: TyFun Schema Bool)+      = forall arg. KindOf (Apply (DisjointSym1 l) arg) ~ KindOf (DisjointSym2 l arg) =>+        DisjointSym1KindInference+    type instance Apply (DisjointSym1 l) l = DisjointSym2 l l+    instance SuppressUnusedWarnings DisjointSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) DisjointSym0KindInference GHC.Tuple.())+    data DisjointSym0 (l :: TyFun Schema (TyFun Schema Bool -> *))+      = forall arg. KindOf (Apply DisjointSym0 arg) ~ KindOf (DisjointSym1 arg) =>+        DisjointSym0KindInference+    type instance Apply DisjointSym0 l = DisjointSym1 l+    type AppendSym2 (t :: Schema) (t :: Schema) = Append t t+    instance SuppressUnusedWarnings AppendSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) AppendSym1KindInference GHC.Tuple.())+    data AppendSym1 (l :: Schema) (l :: TyFun Schema Schema)+      = forall arg. KindOf (Apply (AppendSym1 l) arg) ~ KindOf (AppendSym2 l arg) =>+        AppendSym1KindInference+    type instance Apply (AppendSym1 l) l = AppendSym2 l l+    instance SuppressUnusedWarnings AppendSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) AppendSym0KindInference GHC.Tuple.())+    data AppendSym0 (l :: TyFun Schema (TyFun Schema Schema -> *))+      = forall arg. KindOf (Apply AppendSym0 arg) ~ KindOf (AppendSym1 arg) =>+        AppendSym0KindInference+    type instance Apply AppendSym0 l = AppendSym1 l+    type family Lookup (a :: [AChar]) (a :: Schema) :: U where+      Lookup _z_0123456789 (Sch '[]) = Any+      Lookup name (Sch ((:) (Attr name' u) attrs)) = Case_0123456789 name name' u attrs (Let0123456789Scrutinee_0123456789Sym4 name name' u attrs)+    type family Occurs (a :: [AChar]) (a :: Schema) :: Bool where+      Occurs _z_0123456789 (Sch '[]) = FalseSym0+      Occurs name (Sch ((:) (Attr name' _z_0123456789) attrs)) = Apply (Apply (:||$) (Apply (Apply (:==$) name) name')) (Apply (Apply OccursSym0 name) (Apply SchSym0 attrs))+    type family AttrNotIn (a :: Attribute) (a :: Schema) :: Bool where+      AttrNotIn _z_0123456789 (Sch '[]) = TrueSym0+      AttrNotIn (Attr name u) (Sch ((:) (Attr name' _z_0123456789) t)) = Apply (Apply (:&&$) (Apply (Apply (:/=$) name) name')) (Apply (Apply AttrNotInSym0 (Apply (Apply AttrSym0 name) u)) (Apply SchSym0 t))+    type family Disjoint (a :: Schema) (a :: Schema) :: Bool where+      Disjoint (Sch '[]) _z_0123456789 = TrueSym0+      Disjoint (Sch ((:) h t)) s = Apply (Apply (:&&$) (Apply (Apply AttrNotInSym0 h) s)) (Apply (Apply DisjointSym0 (Apply SchSym0 t)) s)+    type family Append (a :: Schema) (a :: Schema) :: Schema where+      Append (Sch s1) (Sch s2) = Apply SchSym0 (Apply (Apply (:++$) s1) s2)+    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)+    sAttrNotIn ::+      forall (t :: Attribute) (t :: Schema).+      Sing t -> Sing t -> Sing (Apply (Apply AttrNotInSym0 t) t :: Bool)+    sDisjoint ::+      forall (t :: Schema) (t :: Schema).+      Sing t -> Sing t -> Sing (Apply (Apply DisjointSym0 t) t :: Bool)+    sAppend ::+      forall (t :: Schema) (t :: Schema).+      Sing t -> Sing t -> Sing (Apply (Apply AppendSym0 t) t :: Schema)+    sLookup _s_z_0123456789 (SSch SNil)+      = let+          lambda ::+            forall _z_0123456789. (t ~ _z_0123456789, t ~ Apply SchSym0 '[]) =>+            Sing _z_0123456789+            -> Sing (Apply (Apply LookupSym0 _z_0123456789) (Apply SchSym0 '[]) :: U)+          lambda _z_0123456789 = undefined+        in lambda _s_z_0123456789+    sLookup sName (SSch (SCons (SAttr sName' sU) sAttrs))+      = let+          lambda ::+            forall name name' u attrs. (t ~ name,+                                        t ~ Apply SchSym0 (Apply (Apply (:$) (Apply (Apply AttrSym0 name') u)) attrs)) =>+            Sing name+            -> Sing name'+               -> Sing u+                  -> Sing attrs+                     -> Sing (Apply (Apply LookupSym0 name) (Apply SchSym0 (Apply (Apply (:$) (Apply (Apply AttrSym0 name') u)) attrs)) :: U)+          lambda name name' u attrs+            = let+                sScrutinee_0123456789 ::+                  Sing (Let0123456789Scrutinee_0123456789Sym4 name name' u attrs)+                sScrutinee_0123456789+                  = applySing+                      (applySing (singFun2 (Proxy :: Proxy (:==$)) (%:==)) name) name'+              in  case sScrutinee_0123456789 of {+                    STrue+                      -> let+                           lambda ::+                             TrueSym0 ~ Let0123456789Scrutinee_0123456789Sym4 name name' u attrs =>+                             Sing (Case_0123456789 name name' u attrs TrueSym0)+                           lambda = u+                         in lambda+                    SFalse+                      -> let+                           lambda ::+                             FalseSym0 ~ Let0123456789Scrutinee_0123456789Sym4 name name' u attrs =>+                             Sing (Case_0123456789 name name' u attrs FalseSym0)+                           lambda+                             = applySing+                                 (applySing (singFun2 (Proxy :: Proxy LookupSym0) sLookup) name)+                                 (applySing (singFun1 (Proxy :: Proxy SchSym0) SSch) attrs)+                         in lambda } ::+                    Sing (Case_0123456789 name name' u attrs (Let0123456789Scrutinee_0123456789Sym4 name name' u attrs))+        in lambda sName sName' sU sAttrs+    sOccurs _s_z_0123456789 (SSch SNil)+      = let+          lambda ::+            forall _z_0123456789. (t ~ _z_0123456789, t ~ Apply SchSym0 '[]) =>+            Sing _z_0123456789+            -> Sing (Apply (Apply OccursSym0 _z_0123456789) (Apply SchSym0 '[]) :: Bool)+          lambda _z_0123456789 = SFalse+        in lambda _s_z_0123456789+    sOccurs sName (SSch (SCons (SAttr sName' _s_z_0123456789) sAttrs))+      = let+          lambda ::+            forall name name' _z_0123456789 attrs. (t ~ name,+                                                    t ~ Apply SchSym0 (Apply (Apply (:$) (Apply (Apply AttrSym0 name') _z_0123456789)) attrs)) =>+            Sing name+            -> Sing name'+               -> Sing _z_0123456789+                  -> Sing attrs+                     -> Sing (Apply (Apply OccursSym0 name) (Apply SchSym0 (Apply (Apply (:$) (Apply (Apply AttrSym0 name') _z_0123456789)) attrs)) :: Bool)+          lambda name name' _z_0123456789 attrs+            = applySing+                (applySing+                   (singFun2 (Proxy :: Proxy (:||$)) (%:||))+                   (applySing+                      (applySing (singFun2 (Proxy :: Proxy (:==$)) (%:==)) name) name'))+                (applySing+                   (applySing (singFun2 (Proxy :: Proxy OccursSym0) sOccurs) name)+                   (applySing (singFun1 (Proxy :: Proxy SchSym0) SSch) attrs))+        in lambda sName sName' _s_z_0123456789 sAttrs+    sAttrNotIn _s_z_0123456789 (SSch SNil)+      = let+          lambda ::+            forall _z_0123456789. (t ~ _z_0123456789, t ~ Apply SchSym0 '[]) =>+            Sing _z_0123456789+            -> Sing (Apply (Apply AttrNotInSym0 _z_0123456789) (Apply SchSym0 '[]) :: Bool)+          lambda _z_0123456789 = STrue+        in lambda _s_z_0123456789+    sAttrNotIn+      (SAttr sName sU)+      (SSch (SCons (SAttr sName' _s_z_0123456789) sT))+      = let+          lambda ::+            forall name+                   u+                   name'+                   _z_0123456789+                   t. (t ~ Apply (Apply AttrSym0 name) u,+                       t ~ Apply SchSym0 (Apply (Apply (:$) (Apply (Apply AttrSym0 name') _z_0123456789)) t)) =>+            Sing name+            -> Sing u+               -> Sing name'+                  -> Sing _z_0123456789+                     -> Sing t+                        -> Sing (Apply (Apply AttrNotInSym0 (Apply (Apply AttrSym0 name) u)) (Apply SchSym0 (Apply (Apply (:$) (Apply (Apply AttrSym0 name') _z_0123456789)) t)) :: Bool)+          lambda name u name' _z_0123456789 t+            = applySing+                (applySing+                   (singFun2 (Proxy :: Proxy (:&&$)) (%:&&))+                   (applySing+                      (applySing (singFun2 (Proxy :: Proxy (:/=$)) (%:/=)) name) name'))+                (applySing+                   (applySing+                      (singFun2 (Proxy :: Proxy AttrNotInSym0) sAttrNotIn)+                      (applySing+                         (applySing (singFun2 (Proxy :: Proxy AttrSym0) SAttr) name) u))+                   (applySing (singFun1 (Proxy :: Proxy SchSym0) SSch) t))+        in lambda sName sU sName' _s_z_0123456789 sT+    sDisjoint (SSch SNil) _s_z_0123456789+      = let+          lambda ::+            forall _z_0123456789. (t ~ Apply SchSym0 '[], t ~ _z_0123456789) =>+            Sing _z_0123456789+            -> Sing (Apply (Apply DisjointSym0 (Apply SchSym0 '[])) _z_0123456789 :: Bool)+          lambda _z_0123456789 = STrue+        in lambda _s_z_0123456789+    sDisjoint (SSch (SCons sH sT)) sS+      = let+          lambda ::+            forall h t s. (t ~ Apply SchSym0 (Apply (Apply (:$) h) t),+                           t ~ s) =>+            Sing h+            -> Sing t+               -> Sing s+                  -> Sing (Apply (Apply DisjointSym0 (Apply SchSym0 (Apply (Apply (:$) h) t))) s :: Bool)+          lambda h t s+            = applySing+                (applySing+                   (singFun2 (Proxy :: Proxy (:&&$)) (%:&&))+                   (applySing+                      (applySing (singFun2 (Proxy :: Proxy AttrNotInSym0) sAttrNotIn) h)+                      s))+                (applySing+                   (applySing+                      (singFun2 (Proxy :: Proxy DisjointSym0) sDisjoint)+                      (applySing (singFun1 (Proxy :: Proxy SchSym0) SSch) t))+                   s)+        in lambda sH sT sS+    sAppend (SSch sS1) (SSch sS2)+      = let+          lambda ::+            forall s1 s2. (t ~ Apply SchSym0 s1, t ~ Apply SchSym0 s2) =>+            Sing s1+            -> Sing s2+               -> Sing (Apply (Apply AppendSym0 (Apply SchSym0 s1)) (Apply SchSym0 s2) :: Schema)+          lambda s1 s2+            = applySing+                (singFun1 (Proxy :: Proxy SchSym0) SSch)+                (applySing+                   (applySing (singFun2 (Proxy :: Proxy (:++$)) (%:++)) s1) s2)+        in lambda sS1 sS2+    data instance Sing (z :: U)+      = z ~ BOOL => SBOOL |+        z ~ STRING => SSTRING |+        z ~ NAT => SNAT |+        forall (n :: U) (n :: Nat). z ~ VEC n n =>+        SVEC (Sing (n :: U)) (Sing (n :: Nat))+    type SU = (Sing :: U -> *)+    instance SingKind (KProxy :: KProxy U) where+      type DemoteRep (KProxy :: KProxy 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 b)+        = case+              GHC.Tuple.(,)+                (toSing b :: SomeSing (KProxy :: KProxy U))+                (toSing b :: SomeSing (KProxy :: KProxy Nat))+          of {+            GHC.Tuple.(,) (SomeSing c) (SomeSing c) -> SomeSing (SVEC c c) }+    instance SEq (KProxy :: KProxy 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 (KProxy :: KProxy U) where+      (%~) SBOOL SBOOL = Proved Refl+      (%~) SBOOL SSTRING+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SBOOL SNAT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SBOOL (SVEC _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SSTRING SBOOL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SSTRING SSTRING = Proved Refl+      (%~) SSTRING SNAT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SSTRING (SVEC _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SNAT SBOOL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SNAT SSTRING+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SNAT SNAT = Proved Refl+      (%~) SNAT (SVEC _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SVEC _ _) SBOOL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SVEC _ _) SSTRING+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SVEC _ _) SNAT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SVEC a a) (SVEC b b)+        = case GHC.Tuple.(,) ((%~) a b) ((%~) a b) of {+            GHC.Tuple.(,) (Proved Refl) (Proved Refl) -> Proved Refl+            GHC.Tuple.(,) (Disproved contra) _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,) _ (Disproved contra)+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl }) }+    data instance Sing (z :: AChar)+      = z ~ CA => SCA |+        z ~ CB => SCB |+        z ~ CC => SCC |+        z ~ CD => SCD |+        z ~ CE => SCE |+        z ~ CF => SCF |+        z ~ CG => SCG |+        z ~ CH => SCH |+        z ~ CI => SCI |+        z ~ CJ => SCJ |+        z ~ CK => SCK |+        z ~ CL => SCL |+        z ~ CM => SCM |+        z ~ CN => SCN |+        z ~ CO => SCO |+        z ~ CP => SCP |+        z ~ CQ => SCQ |+        z ~ CR => SCR |+        z ~ CS => SCS |+        z ~ CT => SCT |+        z ~ CU => SCU |+        z ~ CV => SCV |+        z ~ CW => SCW |+        z ~ CX => SCX |+        z ~ CY => SCY |+        z ~ CZ => SCZ+    type SAChar = (Sing :: AChar -> *)+    instance SingKind (KProxy :: KProxy AChar) where+      type DemoteRep (KProxy :: KProxy 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+    instance SEq (KProxy :: KProxy 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 (KProxy :: KProxy AChar) where+      (%~) SCA SCA = Proved Refl+      (%~) SCA SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCA SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCB = Proved Refl+      (%~) SCB SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCB SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCC = Proved Refl+      (%~) SCC SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCC SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCD = Proved Refl+      (%~) SCD SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCD SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCE = Proved Refl+      (%~) SCE SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCE SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCF = Proved Refl+      (%~) SCF SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCF SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCG = Proved Refl+      (%~) SCG SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCG SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCH = Proved Refl+      (%~) SCH SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCH SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCI = Proved Refl+      (%~) SCI SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCI SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCJ = Proved Refl+      (%~) SCJ SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCJ SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCK = Proved Refl+      (%~) SCK SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCK SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCL = Proved Refl+      (%~) SCL SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCL SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCM = Proved Refl+      (%~) SCM SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCM SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCN = Proved Refl+      (%~) SCN SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCN SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCO = Proved Refl+      (%~) SCO SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCO SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCP = Proved Refl+      (%~) SCP SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCP SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCQ = Proved Refl+      (%~) SCQ SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCQ SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCR = Proved Refl+      (%~) SCR SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCR SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCS = Proved Refl+      (%~) SCS SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCS SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCT = Proved Refl+      (%~) SCT SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCT SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCU = Proved Refl+      (%~) SCU SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCU SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCV = Proved Refl+      (%~) SCV SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCV SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCW = Proved Refl+      (%~) SCW SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCW SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCX = Proved Refl+      (%~) SCX SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCX SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCY SCY = Proved Refl+      (%~) SCY SCZ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCA+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCB+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCC+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCD+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCE+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCF+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCG+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCH+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCI+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCJ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCK+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCL+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCM+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCN+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCO+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCP+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCQ+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCR+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCS+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCT+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCU+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCV+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCW+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCX+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCY+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SCZ SCZ = Proved Refl+    data instance Sing (z :: Attribute)+      = forall (n :: [AChar]) (n :: U). z ~ Attr n n =>+        SAttr (Sing (n :: [AChar])) (Sing (n :: U))+    type SAttribute = (Sing :: Attribute -> *)+    instance SingKind (KProxy :: KProxy Attribute) where+      type DemoteRep (KProxy :: KProxy Attribute) = Attribute+      fromSing (SAttr b b) = Attr (fromSing b) (fromSing b)+      toSing (Attr b b)+        = case+              GHC.Tuple.(,)+                (toSing b :: SomeSing (KProxy :: KProxy [AChar]))+                (toSing b :: SomeSing (KProxy :: KProxy U))+          of {+            GHC.Tuple.(,) (SomeSing c) (SomeSing c) -> SomeSing (SAttr c c) }+    data instance Sing (z :: Schema)+      = forall (n :: [Attribute]). z ~ Sch n =>+        SSch (Sing (n :: [Attribute]))+    type SSchema = (Sing :: Schema -> *)+    instance SingKind (KProxy :: KProxy Schema) where+      type DemoteRep (KProxy :: KProxy Schema) = Schema+      fromSing (SSch b) = Sch (fromSing b)+      toSing (Sch b)+        = case toSing b :: SomeSing (KProxy :: KProxy [Attribute]) of {+            SomeSing c -> SomeSing (SSch c) }+    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 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 n => SingI (Sch (n :: [Attribute])) where+      sing = SSch sing+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 }
− tests/compile-and-dump/GradingClient/Database.ghc78.template
@@ -1,4808 +0,0 @@-GradingClient/Database.hs:0:0: Splicing declarations-    singletons-      [d| data Nat-            = Zero | Succ Nat-            deriving (Eq, Ord) |]-  ======>-    GradingClient/Database.hs:(0,0)-(0,0)-    data Nat-      = Zero | Succ Nat-      deriving (Eq, Ord)-    type family Equals_0123456789 (a :: Nat) (b :: Nat) :: Bool where-      Equals_0123456789 Zero Zero = TrueSym0-      Equals_0123456789 (Succ a) (Succ b) = (:==) a b-      Equals_0123456789 (a :: Nat) (b :: Nat) = FalseSym0-    instance PEq (KProxy :: KProxy Nat) where-      type (:==) (a :: Nat) (b :: Nat) = Equals_0123456789 a b-    instance POrd (KProxy :: KProxy Nat) where-      type Compare Zero Zero = EQ-      type Compare Zero (Succ rhs) = LT-      type Compare (Succ lhs) Zero = GT-      type Compare (Succ lhs) (Succ rhs) = ThenCmp EQ (Compare lhs rhs)-    type ZeroSym0 = Zero-    type SuccSym1 (t :: Nat) = Succ t-    instance SuppressUnusedWarnings SuccSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) SuccSym0KindInference GHC.Tuple.())-    data SuccSym0 (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply SuccSym0 arg) ~ KindOf (SuccSym1 arg) =>-        SuccSym0KindInference-    type instance Apply SuccSym0 l = SuccSym1 l-    data instance Sing (z :: Nat)-      = z ~ Zero => SZero |-        forall (n :: Nat). z ~ Succ n => SSucc (Sing n)-    type SNat (z :: Nat) = Sing z-    instance SingKind (KProxy :: KProxy Nat) where-      type DemoteRep (KProxy :: KProxy Nat) = Nat-      fromSing SZero = Zero-      fromSing (SSucc b) = Succ (fromSing b)-      toSing Zero = SomeSing SZero-      toSing (Succ b)-        = case toSing b :: SomeSing (KProxy :: KProxy Nat) of {-            SomeSing c -> SomeSing (SSucc c) }-    instance SEq (KProxy :: KProxy Nat) where-      (%:==) SZero SZero = STrue-      (%:==) SZero (SSucc _) = SFalse-      (%:==) (SSucc _) SZero = SFalse-      (%:==) (SSucc a) (SSucc b) = (%:==) a b-    instance SDecide (KProxy :: KProxy Nat) where-      (%~) SZero SZero = Proved Refl-      (%~) SZero (SSucc _)-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) (SSucc _) SZero-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) (SSucc a) (SSucc b)-        = case (%~) a b of {-            Proved Refl -> Proved Refl-            Disproved contra-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl }) }-    instance SingI Zero where-      sing = SZero-    instance SingI n => SingI (Succ (n :: Nat)) where-      sing = SSucc sing-GradingClient/Database.hs: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] |]-  ======>-    GradingClient/Database.hs:(0,0)-(0,0)-    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 GHC.Types.[]) = True-    attrNotIn (Attr name u) (Sch ((Attr name' _) GHC.Types.: t))-      = ((name /= name') && (attrNotIn (Attr name u) (Sch t)))-    disjoint :: Schema -> Schema -> Bool-    disjoint (Sch GHC.Types.[]) _ = True-    disjoint (Sch (h GHC.Types.: t)) s-      = ((attrNotIn h s) && (disjoint (Sch t) s))-    occurs :: [AChar] -> Schema -> Bool-    occurs _ (Sch GHC.Types.[]) = False-    occurs name (Sch ((Attr name' _) GHC.Types.: attrs))-      = ((name == name') || (occurs name (Sch attrs)))-    lookup :: [AChar] -> Schema -> U-    lookup _ (Sch GHC.Types.[]) = undefined-    lookup name (Sch ((Attr name' u) GHC.Types.: attrs))-      = if (name == name') then u else lookup name (Sch attrs)-    type family Equals_0123456789 (a :: U) (b :: U) :: Bool where-      Equals_0123456789 BOOL BOOL = TrueSym0-      Equals_0123456789 STRING STRING = TrueSym0-      Equals_0123456789 NAT NAT = TrueSym0-      Equals_0123456789 (VEC a a) (VEC b b) = (:&&) ((:==) a b) ((:==) a b)-      Equals_0123456789 (a :: U) (b :: U) = FalseSym0-    instance PEq (KProxy :: KProxy U) where-      type (:==) (a :: U) (b :: U) = Equals_0123456789 a b-    type BOOLSym0 = BOOL-    type STRINGSym0 = STRING-    type NATSym0 = NAT-    type VECSym2 (t :: U) (t :: Nat) = VEC t t-    instance SuppressUnusedWarnings VECSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) VECSym1KindInference GHC.Tuple.())-    data VECSym1 (l :: U) (l :: TyFun Nat U)-      = forall arg. KindOf (Apply (VECSym1 l) arg) ~ KindOf (VECSym2 l arg) =>-        VECSym1KindInference-    type instance Apply (VECSym1 l) l = VECSym2 l l-    instance SuppressUnusedWarnings VECSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) VECSym0KindInference GHC.Tuple.())-    data VECSym0 (l :: TyFun U (TyFun Nat U -> *))-      = forall arg. KindOf (Apply VECSym0 arg) ~ KindOf (VECSym1 arg) =>-        VECSym0KindInference-    type instance Apply VECSym0 l = VECSym1 l-    type family Equals_0123456789 (a :: AChar)-                                  (b :: AChar) :: Bool where-      Equals_0123456789 CA CA = TrueSym0-      Equals_0123456789 CB CB = TrueSym0-      Equals_0123456789 CC CC = TrueSym0-      Equals_0123456789 CD CD = TrueSym0-      Equals_0123456789 CE CE = TrueSym0-      Equals_0123456789 CF CF = TrueSym0-      Equals_0123456789 CG CG = TrueSym0-      Equals_0123456789 CH CH = TrueSym0-      Equals_0123456789 CI CI = TrueSym0-      Equals_0123456789 CJ CJ = TrueSym0-      Equals_0123456789 CK CK = TrueSym0-      Equals_0123456789 CL CL = TrueSym0-      Equals_0123456789 CM CM = TrueSym0-      Equals_0123456789 CN CN = TrueSym0-      Equals_0123456789 CO CO = TrueSym0-      Equals_0123456789 CP CP = TrueSym0-      Equals_0123456789 CQ CQ = TrueSym0-      Equals_0123456789 CR CR = TrueSym0-      Equals_0123456789 CS CS = TrueSym0-      Equals_0123456789 CT CT = TrueSym0-      Equals_0123456789 CU CU = TrueSym0-      Equals_0123456789 CV CV = TrueSym0-      Equals_0123456789 CW CW = TrueSym0-      Equals_0123456789 CX CX = TrueSym0-      Equals_0123456789 CY CY = TrueSym0-      Equals_0123456789 CZ CZ = TrueSym0-      Equals_0123456789 (a :: AChar) (b :: AChar) = FalseSym0-    instance PEq (KProxy :: KProxy AChar) where-      type (:==) (a :: AChar) (b :: AChar) = Equals_0123456789 a b-    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 (t :: [AChar]) (t :: U) = Attr t t-    instance SuppressUnusedWarnings AttrSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) AttrSym1KindInference GHC.Tuple.())-    data AttrSym1 (l :: [AChar]) (l :: TyFun U Attribute)-      = forall arg. KindOf (Apply (AttrSym1 l) arg) ~ KindOf (AttrSym2 l arg) =>-        AttrSym1KindInference-    type instance Apply (AttrSym1 l) l = AttrSym2 l l-    instance SuppressUnusedWarnings AttrSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) AttrSym0KindInference GHC.Tuple.())-    data AttrSym0 (l :: TyFun [AChar] (TyFun U Attribute -> *))-      = forall arg. KindOf (Apply AttrSym0 arg) ~ KindOf (AttrSym1 arg) =>-        AttrSym0KindInference-    type instance Apply AttrSym0 l = AttrSym1 l-    type SchSym1 (t :: [Attribute]) = Sch t-    instance SuppressUnusedWarnings SchSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) SchSym0KindInference GHC.Tuple.())-    data SchSym0 (l :: TyFun [Attribute] Schema)-      = forall arg. KindOf (Apply SchSym0 arg) ~ KindOf (SchSym1 arg) =>-        SchSym0KindInference-    type instance Apply SchSym0 l = SchSym1 l-    type Let0123456789Scrutinee_0123456789Sym4 t t t t =-        Let0123456789Scrutinee_0123456789 t t t t-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym3 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym3KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym3 l l l l-      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym3 l l l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym4 l l l arg) =>-        Let0123456789Scrutinee_0123456789Sym3KindInference-    type instance Apply (Let0123456789Scrutinee_0123456789Sym3 l l l) l = Let0123456789Scrutinee_0123456789Sym4 l l l l-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym2KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym2 l l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym3 l l arg) =>-        Let0123456789Scrutinee_0123456789Sym2KindInference-    type instance Apply (Let0123456789Scrutinee_0123456789Sym2 l l) l = Let0123456789Scrutinee_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym1KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym1 l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym2 l arg) =>-        Let0123456789Scrutinee_0123456789Sym1KindInference-    type instance Apply (Let0123456789Scrutinee_0123456789Sym1 l) l = Let0123456789Scrutinee_0123456789Sym2 l l-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym0 l-      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>-        Let0123456789Scrutinee_0123456789Sym0KindInference-    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l-    type Let0123456789Scrutinee_0123456789 name name' u attrs =-        Apply (Apply (:==$) name) name'-    type family Case_0123456789 name name' u attrs t where-      Case_0123456789 name name' u attrs True = u-      Case_0123456789 name name' u attrs False = Apply (Apply LookupSym0 name) (Apply SchSym0 attrs)-    type LookupSym2 (t :: [AChar]) (t :: Schema) = Lookup t t-    instance SuppressUnusedWarnings LookupSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) LookupSym1KindInference GHC.Tuple.())-    data LookupSym1 (l :: [AChar]) (l :: TyFun Schema U)-      = forall arg. KindOf (Apply (LookupSym1 l) arg) ~ KindOf (LookupSym2 l arg) =>-        LookupSym1KindInference-    type instance Apply (LookupSym1 l) l = LookupSym2 l l-    instance SuppressUnusedWarnings LookupSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) LookupSym0KindInference GHC.Tuple.())-    data LookupSym0 (l :: TyFun [AChar] (TyFun Schema U -> *))-      = forall arg. KindOf (Apply LookupSym0 arg) ~ KindOf (LookupSym1 arg) =>-        LookupSym0KindInference-    type instance Apply LookupSym0 l = LookupSym1 l-    type OccursSym2 (t :: [AChar]) (t :: Schema) = Occurs t t-    instance SuppressUnusedWarnings OccursSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) OccursSym1KindInference GHC.Tuple.())-    data OccursSym1 (l :: [AChar]) (l :: TyFun Schema Bool)-      = forall arg. KindOf (Apply (OccursSym1 l) arg) ~ KindOf (OccursSym2 l arg) =>-        OccursSym1KindInference-    type instance Apply (OccursSym1 l) l = OccursSym2 l l-    instance SuppressUnusedWarnings OccursSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) OccursSym0KindInference GHC.Tuple.())-    data OccursSym0 (l :: TyFun [AChar] (TyFun Schema Bool -> *))-      = forall arg. KindOf (Apply OccursSym0 arg) ~ KindOf (OccursSym1 arg) =>-        OccursSym0KindInference-    type instance Apply OccursSym0 l = OccursSym1 l-    type AttrNotInSym2 (t :: Attribute) (t :: Schema) = AttrNotIn t t-    instance SuppressUnusedWarnings AttrNotInSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) AttrNotInSym1KindInference GHC.Tuple.())-    data AttrNotInSym1 (l :: Attribute) (l :: TyFun Schema Bool)-      = forall arg. KindOf (Apply (AttrNotInSym1 l) arg) ~ KindOf (AttrNotInSym2 l arg) =>-        AttrNotInSym1KindInference-    type instance Apply (AttrNotInSym1 l) l = AttrNotInSym2 l l-    instance SuppressUnusedWarnings AttrNotInSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) AttrNotInSym0KindInference GHC.Tuple.())-    data AttrNotInSym0 (l :: TyFun Attribute (TyFun Schema Bool -> *))-      = forall arg. KindOf (Apply AttrNotInSym0 arg) ~ KindOf (AttrNotInSym1 arg) =>-        AttrNotInSym0KindInference-    type instance Apply AttrNotInSym0 l = AttrNotInSym1 l-    type DisjointSym2 (t :: Schema) (t :: Schema) = Disjoint t t-    instance SuppressUnusedWarnings DisjointSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) DisjointSym1KindInference GHC.Tuple.())-    data DisjointSym1 (l :: Schema) (l :: TyFun Schema Bool)-      = forall arg. KindOf (Apply (DisjointSym1 l) arg) ~ KindOf (DisjointSym2 l arg) =>-        DisjointSym1KindInference-    type instance Apply (DisjointSym1 l) l = DisjointSym2 l l-    instance SuppressUnusedWarnings DisjointSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) DisjointSym0KindInference GHC.Tuple.())-    data DisjointSym0 (l :: TyFun Schema (TyFun Schema Bool -> *))-      = forall arg. KindOf (Apply DisjointSym0 arg) ~ KindOf (DisjointSym1 arg) =>-        DisjointSym0KindInference-    type instance Apply DisjointSym0 l = DisjointSym1 l-    type AppendSym2 (t :: Schema) (t :: Schema) = Append t t-    instance SuppressUnusedWarnings AppendSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) AppendSym1KindInference GHC.Tuple.())-    data AppendSym1 (l :: Schema) (l :: TyFun Schema Schema)-      = forall arg. KindOf (Apply (AppendSym1 l) arg) ~ KindOf (AppendSym2 l arg) =>-        AppendSym1KindInference-    type instance Apply (AppendSym1 l) l = AppendSym2 l l-    instance SuppressUnusedWarnings AppendSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) AppendSym0KindInference GHC.Tuple.())-    data AppendSym0 (l :: TyFun Schema (TyFun Schema Schema -> *))-      = forall arg. KindOf (Apply AppendSym0 arg) ~ KindOf (AppendSym1 arg) =>-        AppendSym0KindInference-    type instance Apply AppendSym0 l = AppendSym1 l-    type family Lookup (a :: [AChar]) (a :: Schema) :: U where-      Lookup z (Sch '[]) = Any-      Lookup name (Sch ((:) (Attr name' u) attrs)) = Case_0123456789 name name' u attrs (Let0123456789Scrutinee_0123456789Sym4 name name' u attrs)-    type family Occurs (a :: [AChar]) (a :: Schema) :: Bool where-      Occurs z (Sch '[]) = FalseSym0-      Occurs name (Sch ((:) (Attr name' z) attrs)) = Apply (Apply (:||$) (Apply (Apply (:==$) name) name')) (Apply (Apply OccursSym0 name) (Apply SchSym0 attrs))-    type family AttrNotIn (a :: Attribute) (a :: Schema) :: Bool where-      AttrNotIn z (Sch '[]) = TrueSym0-      AttrNotIn (Attr name u) (Sch ((:) (Attr name' z) t)) = Apply (Apply (:&&$) (Apply (Apply (:/=$) name) name')) (Apply (Apply AttrNotInSym0 (Apply (Apply AttrSym0 name) u)) (Apply SchSym0 t))-    type family Disjoint (a :: Schema) (a :: Schema) :: Bool where-      Disjoint (Sch '[]) z = TrueSym0-      Disjoint (Sch ((:) h t)) s = Apply (Apply (:&&$) (Apply (Apply AttrNotInSym0 h) s)) (Apply (Apply DisjointSym0 (Apply SchSym0 t)) s)-    type family Append (a :: Schema) (a :: Schema) :: Schema where-      Append (Sch s1) (Sch s2) = Apply SchSym0 (Apply (Apply (:++$) s1) s2)-    sLookup ::-      forall (t :: [AChar]) (t :: Schema).-      Sing t -> Sing t -> Sing (Apply (Apply LookupSym0 t) t)-    sOccurs ::-      forall (t :: [AChar]) (t :: Schema).-      Sing t -> Sing t -> Sing (Apply (Apply OccursSym0 t) t)-    sAttrNotIn ::-      forall (t :: Attribute) (t :: Schema).-      Sing t -> Sing t -> Sing (Apply (Apply AttrNotInSym0 t) t)-    sDisjoint ::-      forall (t :: Schema) (t :: Schema).-      Sing t -> Sing t -> Sing (Apply (Apply DisjointSym0 t) t)-    sAppend ::-      forall (t :: Schema) (t :: Schema).-      Sing t -> Sing t -> Sing (Apply (Apply AppendSym0 t) t)-    sLookup _ (SSch SNil)-      = let-          lambda ::-            forall wild. (t ~ wild, t ~ Apply SchSym0 '[]) =>-            Sing (Apply (Apply LookupSym0 wild) (Apply SchSym0 '[]))-          lambda = undefined-        in lambda-    sLookup sName (SSch (SCons (SAttr sName' sU) sAttrs))-      = let-          lambda ::-            forall name name' u attrs. (t ~ name,-                                        t ~ Apply SchSym0 (Apply (Apply (:$) (Apply (Apply AttrSym0 name') u)) attrs)) =>-            Sing name-            -> Sing name'-               -> Sing u-                  -> Sing attrs-                     -> Sing (Apply (Apply LookupSym0 name) (Apply SchSym0 (Apply (Apply (:$) (Apply (Apply AttrSym0 name') u)) attrs)))-          lambda name name' u attrs-            = let-                sScrutinee_0123456789 ::-                  Sing (Let0123456789Scrutinee_0123456789Sym4 name name' u attrs)-                sScrutinee_0123456789-                  = applySing-                      (applySing (singFun2 (Proxy :: Proxy (:==$)) (%:==)) name) name'-              in-                case sScrutinee_0123456789 of {-                  STrue-                    -> let-                         lambda :: Sing (Case_0123456789 name name' u attrs TrueSym0)-                         lambda = u-                       in lambda-                  SFalse-                    -> let-                         lambda :: Sing (Case_0123456789 name name' u attrs FalseSym0)-                         lambda-                           = applySing-                               (applySing (singFun2 (Proxy :: Proxy LookupSym0) sLookup) name)-                               (applySing (singFun1 (Proxy :: Proxy SchSym0) SSch) attrs)-                       in lambda }-        in lambda sName sName' sU sAttrs-    sOccurs _ (SSch SNil)-      = let-          lambda ::-            forall wild. (t ~ wild, t ~ Apply SchSym0 '[]) =>-            Sing (Apply (Apply OccursSym0 wild) (Apply SchSym0 '[]))-          lambda = SFalse-        in lambda-    sOccurs sName (SSch (SCons (SAttr sName' _) sAttrs))-      = let-          lambda ::-            forall name name' attrs wild. (t ~ name,-                                           t ~ Apply SchSym0 (Apply (Apply (:$) (Apply (Apply AttrSym0 name') wild)) attrs)) =>-            Sing name-            -> Sing name'-               -> Sing attrs-                  -> Sing (Apply (Apply OccursSym0 name) (Apply SchSym0 (Apply (Apply (:$) (Apply (Apply AttrSym0 name') wild)) attrs)))-          lambda name name' attrs-            = applySing-                (applySing-                   (singFun2 (Proxy :: Proxy (:||$)) (%:||))-                   (applySing-                      (applySing (singFun2 (Proxy :: Proxy (:==$)) (%:==)) name) name'))-                (applySing-                   (applySing (singFun2 (Proxy :: Proxy OccursSym0) sOccurs) name)-                   (applySing (singFun1 (Proxy :: Proxy SchSym0) SSch) attrs))-        in lambda sName sName' sAttrs-    sAttrNotIn _ (SSch SNil)-      = let-          lambda ::-            forall wild. (t ~ wild, t ~ Apply SchSym0 '[]) =>-            Sing (Apply (Apply AttrNotInSym0 wild) (Apply SchSym0 '[]))-          lambda = STrue-        in lambda-    sAttrNotIn (SAttr sName sU) (SSch (SCons (SAttr sName' _) sT))-      = let-          lambda ::-            forall name u name' t wild. (t ~ Apply (Apply AttrSym0 name) u,-                                         t ~ Apply SchSym0 (Apply (Apply (:$) (Apply (Apply AttrSym0 name') wild)) t)) =>-            Sing name-            -> Sing u-               -> Sing name'-                  -> Sing t-                     -> Sing (Apply (Apply AttrNotInSym0 (Apply (Apply AttrSym0 name) u)) (Apply SchSym0 (Apply (Apply (:$) (Apply (Apply AttrSym0 name') wild)) t)))-          lambda name u name' t-            = applySing-                (applySing-                   (singFun2 (Proxy :: Proxy (:&&$)) (%:&&))-                   (applySing-                      (applySing (singFun2 (Proxy :: Proxy (:/=$)) (%:/=)) name) name'))-                (applySing-                   (applySing-                      (singFun2 (Proxy :: Proxy AttrNotInSym0) sAttrNotIn)-                      (applySing-                         (applySing (singFun2 (Proxy :: Proxy AttrSym0) SAttr) name) u))-                   (applySing (singFun1 (Proxy :: Proxy SchSym0) SSch) t))-        in lambda sName sU sName' sT-    sDisjoint (SSch SNil) _-      = let-          lambda ::-            forall wild. (t ~ Apply SchSym0 '[], t ~ wild) =>-            Sing (Apply (Apply DisjointSym0 (Apply SchSym0 '[])) wild)-          lambda = STrue-        in lambda-    sDisjoint (SSch (SCons sH sT)) sS-      = let-          lambda ::-            forall h t s. (t ~ Apply SchSym0 (Apply (Apply (:$) h) t),-                           t ~ s) =>-            Sing h-            -> Sing t-               -> Sing s-                  -> Sing (Apply (Apply DisjointSym0 (Apply SchSym0 (Apply (Apply (:$) h) t))) s)-          lambda h t s-            = applySing-                (applySing-                   (singFun2 (Proxy :: Proxy (:&&$)) (%:&&))-                   (applySing-                      (applySing (singFun2 (Proxy :: Proxy AttrNotInSym0) sAttrNotIn) h)-                      s))-                (applySing-                   (applySing-                      (singFun2 (Proxy :: Proxy DisjointSym0) sDisjoint)-                      (applySing (singFun1 (Proxy :: Proxy SchSym0) SSch) t))-                   s)-        in lambda sH sT sS-    sAppend (SSch sS1) (SSch sS2)-      = let-          lambda ::-            forall s1 s2. (t ~ Apply SchSym0 s1, t ~ Apply SchSym0 s2) =>-            Sing s1-            -> Sing s2-               -> Sing (Apply (Apply AppendSym0 (Apply SchSym0 s1)) (Apply SchSym0 s2))-          lambda s1 s2-            = applySing-                (singFun1 (Proxy :: Proxy SchSym0) SSch)-                (applySing-                   (applySing (singFun2 (Proxy :: Proxy (:++$)) (%:++)) s1) s2)-        in lambda sS1 sS2-    data instance Sing (z :: U)-      = z ~ BOOL => SBOOL |-        z ~ STRING => SSTRING |-        z ~ NAT => SNAT |-        forall (n :: U) (n :: Nat). z ~ VEC n n => SVEC (Sing n) (Sing n)-    type SU (z :: U) = Sing z-    instance SingKind (KProxy :: KProxy U) where-      type DemoteRep (KProxy :: KProxy 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 b)-        = case-              GHC.Tuple.(,)-                (toSing b :: SomeSing (KProxy :: KProxy U))-                (toSing b :: SomeSing (KProxy :: KProxy Nat))-          of {-            GHC.Tuple.(,) (SomeSing c) (SomeSing c) -> SomeSing (SVEC c c) }-    instance SEq (KProxy :: KProxy 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 (KProxy :: KProxy U) where-      (%~) SBOOL SBOOL = Proved Refl-      (%~) SBOOL SSTRING-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SBOOL SNAT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SBOOL (SVEC _ _)-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SSTRING SBOOL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SSTRING SSTRING = Proved Refl-      (%~) SSTRING SNAT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SSTRING (SVEC _ _)-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SNAT SBOOL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SNAT SSTRING-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SNAT SNAT = Proved Refl-      (%~) SNAT (SVEC _ _)-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) (SVEC _ _) SBOOL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) (SVEC _ _) SSTRING-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) (SVEC _ _) SNAT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) (SVEC a a) (SVEC b b)-        = case GHC.Tuple.(,) ((%~) a b) ((%~) a b) of {-            GHC.Tuple.(,) (Proved Refl) (Proved Refl) -> Proved Refl-            GHC.Tuple.(,) (Disproved contra) _-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })-            GHC.Tuple.(,) _ (Disproved contra)-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl }) }-    data instance Sing (z :: AChar)-      = z ~ CA => SCA |-        z ~ CB => SCB |-        z ~ CC => SCC |-        z ~ CD => SCD |-        z ~ CE => SCE |-        z ~ CF => SCF |-        z ~ CG => SCG |-        z ~ CH => SCH |-        z ~ CI => SCI |-        z ~ CJ => SCJ |-        z ~ CK => SCK |-        z ~ CL => SCL |-        z ~ CM => SCM |-        z ~ CN => SCN |-        z ~ CO => SCO |-        z ~ CP => SCP |-        z ~ CQ => SCQ |-        z ~ CR => SCR |-        z ~ CS => SCS |-        z ~ CT => SCT |-        z ~ CU => SCU |-        z ~ CV => SCV |-        z ~ CW => SCW |-        z ~ CX => SCX |-        z ~ CY => SCY |-        z ~ CZ => SCZ-    type SAChar (z :: AChar) = Sing z-    instance SingKind (KProxy :: KProxy AChar) where-      type DemoteRep (KProxy :: KProxy 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-    instance SEq (KProxy :: KProxy 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 (KProxy :: KProxy AChar) where-      (%~) SCA SCA = Proved Refl-      (%~) SCA SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCA SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCB = Proved Refl-      (%~) SCB SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCB SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCC = Proved Refl-      (%~) SCC SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCC SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCD = Proved Refl-      (%~) SCD SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCD SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCE = Proved Refl-      (%~) SCE SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCE SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCF = Proved Refl-      (%~) SCF SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCF SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCG = Proved Refl-      (%~) SCG SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCG SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCH = Proved Refl-      (%~) SCH SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCH SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCI = Proved Refl-      (%~) SCI SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCI SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCJ = Proved Refl-      (%~) SCJ SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCJ SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCK = Proved Refl-      (%~) SCK SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCK SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCL = Proved Refl-      (%~) SCL SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCL SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCM = Proved Refl-      (%~) SCM SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCM SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCN = Proved Refl-      (%~) SCN SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCN SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCO = Proved Refl-      (%~) SCO SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCO SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCP = Proved Refl-      (%~) SCP SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCP SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCQ = Proved Refl-      (%~) SCQ SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCQ SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCR = Proved Refl-      (%~) SCR SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCR SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCS = Proved Refl-      (%~) SCS SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCS SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCT = Proved Refl-      (%~) SCT SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCT SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCU = Proved Refl-      (%~) SCU SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCU SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCV = Proved Refl-      (%~) SCV SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCV SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCW = Proved Refl-      (%~) SCW SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCW SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCX = Proved Refl-      (%~) SCX SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCX SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCY SCY = Proved Refl-      (%~) SCY SCZ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCA-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCB-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCC-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCD-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCE-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCF-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCG-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCH-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCI-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCJ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCK-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCL-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCM-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCN-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCO-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCP-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCQ-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCR-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCS-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCT-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCU-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCV-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCW-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCX-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCY-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SCZ SCZ = Proved Refl-    data instance Sing (z :: Attribute)-      = forall (n :: [AChar]) (n :: U). z ~ Attr n n =>-        SAttr (Sing n) (Sing n)-    type SAttribute (z :: Attribute) = Sing z-    instance SingKind (KProxy :: KProxy Attribute) where-      type DemoteRep (KProxy :: KProxy Attribute) = Attribute-      fromSing (SAttr b b) = Attr (fromSing b) (fromSing b)-      toSing (Attr b b)-        = case-              GHC.Tuple.(,)-                (toSing b :: SomeSing (KProxy :: KProxy [AChar]))-                (toSing b :: SomeSing (KProxy :: KProxy U))-          of {-            GHC.Tuple.(,) (SomeSing c) (SomeSing c) -> SomeSing (SAttr c c) }-    data instance Sing (z :: Schema)-      = forall (n :: [Attribute]). z ~ Sch n => SSch (Sing n)-    type SSchema (z :: Schema) = Sing z-    instance SingKind (KProxy :: KProxy Schema) where-      type DemoteRep (KProxy :: KProxy Schema) = Schema-      fromSing (SSch b) = Sch (fromSing b)-      toSing (Sch b)-        = case toSing b :: SomeSing (KProxy :: KProxy [Attribute]) of {-            SomeSing c -> SomeSing (SSch c) }-    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 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 n => SingI (Sch (n :: [Attribute])) where-      sing = SSch sing-GradingClient/Database.hs:0:0: Splicing declarations-    return [] ======> GradingClient/Database.hs:0:0:-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 }
tests/compile-and-dump/GradingClient/Database.hs view
@@ -11,7 +11,7 @@ {-# LANGUAGE PolyKinds, DataKinds, TemplateHaskell, TypeFamilies,     GADTs, TypeOperators, RankNTypes, FlexibleContexts, UndecidableInstances,     FlexibleInstances, ScopedTypeVariables, MultiParamTypeClasses,-    OverlappingInstances, ConstraintKinds, CPP #-}+    ConstraintKinds, CPP #-} {-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}  -- The OverlappingInstances is needed only to allow the InC and SubsetC classes.@@ -28,7 +28,12 @@ import Data.Singletons.TH import Control.Monad import Data.List hiding ( tail )-import Control.Monad.Error++#ifdef MODERN_MTL+import Control.Monad.Except  ( throwError )+#else+import Control.Monad.Error   ( throwError )+#endif  $(singletons [d|   -- Basic Nat type
+ tests/compile-and-dump/GradingClient/Main.ghc710.template view
@@ -0,0 +1,162 @@+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 MajorNameSym0 = MajorName+    type GradeNameSym0 = GradeName+    type YearNameSym0 = YearName+    type FirstNameSym0 = FirstName+    type LastNameSym0 = LastName+    type GradingSchemaSym0 = GradingSchema+    type NamesSym0 = Names+    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) '[])))+    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 Names :: Schema where+      Names = Apply SchSym0 (Apply (Apply (:$) (Apply (Apply AttrSym0 FirstNameSym0) STRINGSym0)) (Apply (Apply (:$) (Apply (Apply AttrSym0 LastNameSym0) STRINGSym0)) '[]))+    sMajorName :: Sing (MajorNameSym0 :: [AChar])+    sGradeName :: Sing (GradeNameSym0 :: [AChar])+    sYearName :: Sing (YearNameSym0 :: [AChar])+    sFirstName :: Sing (FirstNameSym0 :: [AChar])+    sLastName :: Sing (LastNameSym0 :: [AChar])+    sGradingSchema :: Sing (GradingSchemaSym0 :: Schema)+    sNames :: Sing (NamesSym0 :: Schema)+    sMajorName+      = applySing+          (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCM)+          (applySing+             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCA)+             (applySing+                (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCJ)+                (applySing+                   (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCO)+                   (applySing+                      (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCR) SNil))))+    sGradeName+      = applySing+          (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCG)+          (applySing+             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCR)+             (applySing+                (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCA)+                (applySing+                   (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCD)+                   (applySing+                      (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCE) SNil))))+    sYearName+      = applySing+          (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCY)+          (applySing+             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCE)+             (applySing+                (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCA)+                (applySing+                   (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCR) SNil)))+    sFirstName+      = applySing+          (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCF)+          (applySing+             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCI)+             (applySing+                (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCR)+                (applySing+                   (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCS)+                   (applySing+                      (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCT) SNil))))+    sLastName+      = applySing+          (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCL)+          (applySing+             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCA)+             (applySing+                (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCS)+                (applySing+                   (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCT) SNil)))+    sGradingSchema+      = applySing+          (singFun1 (Proxy :: Proxy SchSym0) SSch)+          (applySing+             (applySing+                (singFun2 (Proxy :: Proxy (:$)) SCons)+                (applySing+                   (applySing (singFun2 (Proxy :: Proxy AttrSym0) SAttr) sLastName)+                   SSTRING))+             (applySing+                (applySing+                   (singFun2 (Proxy :: Proxy (:$)) SCons)+                   (applySing+                      (applySing (singFun2 (Proxy :: Proxy AttrSym0) SAttr) sFirstName)+                      SSTRING))+                (applySing+                   (applySing+                      (singFun2 (Proxy :: Proxy (:$)) SCons)+                      (applySing+                         (applySing (singFun2 (Proxy :: Proxy AttrSym0) SAttr) sYearName)+                         SNAT))+                   (applySing+                      (applySing+                         (singFun2 (Proxy :: Proxy (:$)) SCons)+                         (applySing+                            (applySing (singFun2 (Proxy :: Proxy AttrSym0) SAttr) sGradeName)+                            SNAT))+                      (applySing+                         (applySing+                            (singFun2 (Proxy :: Proxy (:$)) SCons)+                            (applySing+                               (applySing (singFun2 (Proxy :: Proxy AttrSym0) SAttr) sMajorName)+                               SBOOL))+                         SNil)))))+    sNames+      = applySing+          (singFun1 (Proxy :: Proxy SchSym0) SSch)+          (applySing+             (applySing+                (singFun2 (Proxy :: Proxy (:$)) SCons)+                (applySing+                   (applySing (singFun2 (Proxy :: Proxy AttrSym0) SAttr) sFirstName)+                   SSTRING))+             (applySing+                (applySing+                   (singFun2 (Proxy :: Proxy (:$)) SCons)+                   (applySing+                      (applySing (singFun2 (Proxy :: Proxy AttrSym0) SAttr) sLastName)+                      SSTRING))+                SNil))
− tests/compile-and-dump/GradingClient/Main.ghc78.template
@@ -1,163 +0,0 @@-GradingClient/Main.hs:0:0: Splicing declarations-    singletons-      [d| lastName, majorName, gradeName, yearName, firstName :: [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] |]-  ======>-    GradingClient/Main.hs:(0,0)-(0,0)-    lastName :: [AChar]-    majorName :: [AChar]-    gradeName :: [AChar]-    yearName :: [AChar]-    firstName :: [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 MajorNameSym0 = MajorName-    type GradeNameSym0 = GradeName-    type YearNameSym0 = YearName-    type FirstNameSym0 = FirstName-    type LastNameSym0 = LastName-    type GradingSchemaSym0 = GradingSchema-    type NamesSym0 = Names-    type MajorName =-        (Apply (Apply (:$) CMSym0) (Apply (Apply (:$) CASym0) (Apply (Apply (:$) CJSym0) (Apply (Apply (:$) COSym0) (Apply (Apply (:$) CRSym0) '[])))) :: [AChar])-    type GradeName =-        (Apply (Apply (:$) CGSym0) (Apply (Apply (:$) CRSym0) (Apply (Apply (:$) CASym0) (Apply (Apply (:$) CDSym0) (Apply (Apply (:$) CESym0) '[])))) :: [AChar])-    type YearName =-        (Apply (Apply (:$) CYSym0) (Apply (Apply (:$) CESym0) (Apply (Apply (:$) CASym0) (Apply (Apply (:$) CRSym0) '[]))) :: [AChar])-    type FirstName =-        (Apply (Apply (:$) CFSym0) (Apply (Apply (:$) CISym0) (Apply (Apply (:$) CRSym0) (Apply (Apply (:$) CSSym0) (Apply (Apply (:$) CTSym0) '[])))) :: [AChar])-    type LastName =-        (Apply (Apply (:$) CLSym0) (Apply (Apply (:$) CASym0) (Apply (Apply (:$) CSSym0) (Apply (Apply (:$) CTSym0) '[]))) :: [AChar])-    type 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)) '[]))))) :: Schema)-    type Names =-        (Apply SchSym0 (Apply (Apply (:$) (Apply (Apply AttrSym0 FirstNameSym0) STRINGSym0)) (Apply (Apply (:$) (Apply (Apply AttrSym0 LastNameSym0) STRINGSym0)) '[])) :: Schema)-    sMajorName :: Sing MajorNameSym0-    sGradeName :: Sing GradeNameSym0-    sYearName :: Sing YearNameSym0-    sFirstName :: Sing FirstNameSym0-    sLastName :: Sing LastNameSym0-    sGradingSchema :: Sing GradingSchemaSym0-    sNames :: Sing NamesSym0-    sMajorName-      = applySing-          (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCM)-          (applySing-             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCA)-             (applySing-                (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCJ)-                (applySing-                   (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCO)-                   (applySing-                      (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCR) SNil))))-    sGradeName-      = applySing-          (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCG)-          (applySing-             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCR)-             (applySing-                (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCA)-                (applySing-                   (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCD)-                   (applySing-                      (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCE) SNil))))-    sYearName-      = applySing-          (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCY)-          (applySing-             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCE)-             (applySing-                (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCA)-                (applySing-                   (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCR) SNil)))-    sFirstName-      = applySing-          (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCF)-          (applySing-             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCI)-             (applySing-                (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCR)-                (applySing-                   (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCS)-                   (applySing-                      (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCT) SNil))))-    sLastName-      = applySing-          (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCL)-          (applySing-             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCA)-             (applySing-                (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCS)-                (applySing-                   (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SCT) SNil)))-    sGradingSchema-      = applySing-          (singFun1 (Proxy :: Proxy SchSym0) SSch)-          (applySing-             (applySing-                (singFun2 (Proxy :: Proxy (:$)) SCons)-                (applySing-                   (applySing (singFun2 (Proxy :: Proxy AttrSym0) SAttr) sLastName)-                   SSTRING))-             (applySing-                (applySing-                   (singFun2 (Proxy :: Proxy (:$)) SCons)-                   (applySing-                      (applySing (singFun2 (Proxy :: Proxy AttrSym0) SAttr) sFirstName)-                      SSTRING))-                (applySing-                   (applySing-                      (singFun2 (Proxy :: Proxy (:$)) SCons)-                      (applySing-                         (applySing (singFun2 (Proxy :: Proxy AttrSym0) SAttr) sYearName)-                         SNAT))-                   (applySing-                      (applySing-                         (singFun2 (Proxy :: Proxy (:$)) SCons)-                         (applySing-                            (applySing (singFun2 (Proxy :: Proxy AttrSym0) SAttr) sGradeName)-                            SNAT))-                      (applySing-                         (applySing-                            (singFun2 (Proxy :: Proxy (:$)) SCons)-                            (applySing-                               (applySing (singFun2 (Proxy :: Proxy AttrSym0) SAttr) sMajorName)-                               SBOOL))-                         SNil)))))-    sNames-      = applySing-          (singFun1 (Proxy :: Proxy SchSym0) SSch)-          (applySing-             (applySing-                (singFun2 (Proxy :: Proxy (:$)) SCons)-                (applySing-                   (applySing (singFun2 (Proxy :: Proxy AttrSym0) SAttr) sFirstName)-                   SSTRING))-             (applySing-                (applySing-                   (singFun2 (Proxy :: Proxy (:$)) SCons)-                   (applySing-                      (applySing (singFun2 (Proxy :: Proxy AttrSym0) SAttr) sLastName)-                      SSTRING))-                SNil))
+ tests/compile-and-dump/InsertionSort/InsertionSortImp.ghc710.template view
@@ -0,0 +1,242 @@+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 (t :: Nat) = Succ t+    instance SuppressUnusedWarnings SuccSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) SuccSym0KindInference GHC.Tuple.())+    data SuccSym0 (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply SuccSym0 arg) ~ KindOf (SuccSym1 arg) =>+        SuccSym0KindInference+    type instance Apply SuccSym0 l = SuccSym1 l+    data instance Sing (z :: Nat)+      = z ~ Zero => SZero |+        forall (n :: Nat). z ~ Succ n => SSucc (Sing (n :: Nat))+    type SNat = (Sing :: Nat -> *)+    instance SingKind (KProxy :: KProxy Nat) where+      type DemoteRep (KProxy :: KProxy Nat) = Nat+      fromSing SZero = Zero+      fromSing (SSucc b) = Succ (fromSing b)+      toSing Zero = SomeSing SZero+      toSing (Succ b)+        = case toSing b :: SomeSing (KProxy :: KProxy Nat) of {+            SomeSing c -> SomeSing (SSucc c) }+    instance SingI Zero where+      sing = SZero+    instance SingI n => SingI (Succ (n :: Nat)) where+      sing = SSucc sing+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 GHC.Types.[] = [n]+    insert n (h GHC.Types.: t)+      = if leq n h then+            (n GHC.Types.: (h GHC.Types.: t))+        else+            (h GHC.Types.: (insert n t))+    insertionSort :: [Nat] -> [Nat]+    insertionSort GHC.Types.[] = []+    insertionSort (h GHC.Types.: t) = insert h (insertionSort t)+    type Let0123456789Scrutinee_0123456789Sym3 t t t =+        Let0123456789Scrutinee_0123456789 t t t+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym2KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym2 l l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym3 l l arg) =>+        Let0123456789Scrutinee_0123456789Sym2KindInference+    type instance Apply (Let0123456789Scrutinee_0123456789Sym2 l l) l = Let0123456789Scrutinee_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym1KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym1 l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym2 l arg) =>+        Let0123456789Scrutinee_0123456789Sym1KindInference+    type instance Apply (Let0123456789Scrutinee_0123456789Sym1 l) l = Let0123456789Scrutinee_0123456789Sym2 l l+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym0 l+      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>+        Let0123456789Scrutinee_0123456789Sym0KindInference+    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l+    type family Let0123456789Scrutinee_0123456789 n h t where+      Let0123456789Scrutinee_0123456789 n h t = Apply (Apply LeqSym0 n) h+    type family Case_0123456789 n h t t where+      Case_0123456789 n h t True = Apply (Apply (:$) n) (Apply (Apply (:$) h) t)+      Case_0123456789 n h t False = Apply (Apply (:$) h) (Apply (Apply InsertSym0 n) t)+    type LeqSym2 (t :: Nat) (t :: Nat) = Leq t t+    instance SuppressUnusedWarnings LeqSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) LeqSym1KindInference GHC.Tuple.())+    data LeqSym1 (l :: Nat) (l :: TyFun Nat Bool)+      = forall arg. KindOf (Apply (LeqSym1 l) arg) ~ KindOf (LeqSym2 l arg) =>+        LeqSym1KindInference+    type instance Apply (LeqSym1 l) l = LeqSym2 l l+    instance SuppressUnusedWarnings LeqSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) LeqSym0KindInference GHC.Tuple.())+    data LeqSym0 (l :: TyFun Nat (TyFun Nat Bool -> *))+      = forall arg. KindOf (Apply LeqSym0 arg) ~ KindOf (LeqSym1 arg) =>+        LeqSym0KindInference+    type instance Apply LeqSym0 l = LeqSym1 l+    type InsertSym2 (t :: Nat) (t :: [Nat]) = Insert t t+    instance SuppressUnusedWarnings InsertSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) InsertSym1KindInference GHC.Tuple.())+    data InsertSym1 (l :: Nat) (l :: TyFun [Nat] [Nat])+      = forall arg. KindOf (Apply (InsertSym1 l) arg) ~ KindOf (InsertSym2 l arg) =>+        InsertSym1KindInference+    type instance Apply (InsertSym1 l) l = InsertSym2 l l+    instance SuppressUnusedWarnings InsertSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) InsertSym0KindInference GHC.Tuple.())+    data InsertSym0 (l :: TyFun Nat (TyFun [Nat] [Nat] -> *))+      = forall arg. KindOf (Apply InsertSym0 arg) ~ KindOf (InsertSym1 arg) =>+        InsertSym0KindInference+    type instance Apply InsertSym0 l = InsertSym1 l+    type InsertionSortSym1 (t :: [Nat]) = InsertionSort t+    instance SuppressUnusedWarnings InsertionSortSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) InsertionSortSym0KindInference GHC.Tuple.())+    data InsertionSortSym0 (l :: TyFun [Nat] [Nat])+      = forall arg. KindOf (Apply InsertionSortSym0 arg) ~ KindOf (InsertionSortSym1 arg) =>+        InsertionSortSym0KindInference+    type instance Apply InsertionSortSym0 l = InsertionSortSym1 l+    type family Leq (a :: Nat) (a :: Nat) :: Bool where+      Leq Zero _z_0123456789 = TrueSym0+      Leq (Succ _z_0123456789) Zero = FalseSym0+      Leq (Succ a) (Succ b) = Apply (Apply LeqSym0 a) b+    type family Insert (a :: Nat) (a :: [Nat]) :: [Nat] where+      Insert n '[] = Apply (Apply (:$) n) '[]+      Insert n ((:) h t) = Case_0123456789 n h t (Let0123456789Scrutinee_0123456789Sym3 n h t)+    type family InsertionSort (a :: [Nat]) :: [Nat] where+      InsertionSort '[] = '[]+      InsertionSort ((:) h t) = Apply (Apply InsertSym0 h) (Apply InsertionSortSym0 t)+    sLeq ::+      forall (t :: Nat) (t :: Nat).+      Sing t -> Sing t -> Sing (Apply (Apply LeqSym0 t) t :: Bool)+    sInsert ::+      forall (t :: Nat) (t :: [Nat]).+      Sing t -> Sing t -> Sing (Apply (Apply InsertSym0 t) t :: [Nat])+    sInsertionSort ::+      forall (t :: [Nat]).+      Sing t -> Sing (Apply InsertionSortSym0 t :: [Nat])+    sLeq SZero _s_z_0123456789+      = let+          lambda ::+            forall _z_0123456789. (t ~ ZeroSym0, t ~ _z_0123456789) =>+            Sing _z_0123456789+            -> Sing (Apply (Apply LeqSym0 ZeroSym0) _z_0123456789 :: Bool)+          lambda _z_0123456789 = STrue+        in lambda _s_z_0123456789+    sLeq (SSucc _s_z_0123456789) SZero+      = let+          lambda ::+            forall _z_0123456789. (t ~ Apply SuccSym0 _z_0123456789,+                                   t ~ ZeroSym0) =>+            Sing _z_0123456789+            -> Sing (Apply (Apply LeqSym0 (Apply SuccSym0 _z_0123456789)) ZeroSym0 :: Bool)+          lambda _z_0123456789 = SFalse+        in lambda _s_z_0123456789+    sLeq (SSucc sA) (SSucc sB)+      = let+          lambda ::+            forall a b. (t ~ Apply SuccSym0 a, t ~ Apply SuccSym0 b) =>+            Sing a+            -> Sing b+               -> Sing (Apply (Apply LeqSym0 (Apply SuccSym0 a)) (Apply SuccSym0 b) :: Bool)+          lambda a b+            = applySing+                (applySing (singFun2 (Proxy :: Proxy LeqSym0) sLeq) a) b+        in lambda sA sB+    sInsert sN SNil+      = let+          lambda ::+            forall n. (t ~ n, t ~ '[]) =>+            Sing n -> Sing (Apply (Apply InsertSym0 n) '[] :: [Nat])+          lambda n+            = applySing+                (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) n) SNil+        in lambda sN+    sInsert sN (SCons sH sT)+      = let+          lambda ::+            forall n h t. (t ~ n, t ~ Apply (Apply (:$) h) t) =>+            Sing n+            -> Sing h+               -> Sing t+                  -> Sing (Apply (Apply InsertSym0 n) (Apply (Apply (:$) h) t) :: [Nat])+          lambda n h t+            = let+                sScrutinee_0123456789 ::+                  Sing (Let0123456789Scrutinee_0123456789Sym3 n h t)+                sScrutinee_0123456789+                  = applySing+                      (applySing (singFun2 (Proxy :: Proxy LeqSym0) sLeq) n) h+              in  case sScrutinee_0123456789 of {+                    STrue+                      -> let+                           lambda ::+                             TrueSym0 ~ Let0123456789Scrutinee_0123456789Sym3 n h t =>+                             Sing (Case_0123456789 n h t TrueSym0)+                           lambda+                             = applySing+                                 (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) n)+                                 (applySing (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) h) t)+                         in lambda+                    SFalse+                      -> let+                           lambda ::+                             FalseSym0 ~ Let0123456789Scrutinee_0123456789Sym3 n h t =>+                             Sing (Case_0123456789 n h t FalseSym0)+                           lambda+                             = applySing+                                 (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) h)+                                 (applySing+                                    (applySing (singFun2 (Proxy :: Proxy InsertSym0) sInsert) n) t)+                         in lambda } ::+                    Sing (Case_0123456789 n h t (Let0123456789Scrutinee_0123456789Sym3 n h t))+        in lambda sN sH sT+    sInsertionSort SNil+      = let+          lambda :: t ~ '[] => Sing (Apply InsertionSortSym0 '[] :: [Nat])+          lambda = SNil+        in lambda+    sInsertionSort (SCons sH sT)+      = let+          lambda ::+            forall h t. t ~ Apply (Apply (:$) h) t =>+            Sing h+            -> Sing t+               -> Sing (Apply InsertionSortSym0 (Apply (Apply (:$) h) t) :: [Nat])+          lambda h t+            = applySing+                (applySing (singFun2 (Proxy :: Proxy InsertSym0) sInsert) h)+                (applySing+                   (singFun1 (Proxy :: Proxy InsertionSortSym0) sInsertionSort) t)+        in lambda sH sT
− tests/compile-and-dump/InsertionSort/InsertionSortImp.ghc78.template
@@ -1,236 +0,0 @@-InsertionSort/InsertionSortImp.hs:0:0: Splicing declarations-    singletons [d| data Nat = Zero | Succ Nat |]-  ======>-    InsertionSort/InsertionSortImp.hs:(0,0)-(0,0)-    data Nat = Zero | Succ Nat-    type ZeroSym0 = Zero-    type SuccSym1 (t :: Nat) = Succ t-    instance SuppressUnusedWarnings SuccSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) SuccSym0KindInference GHC.Tuple.())-    data SuccSym0 (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply SuccSym0 arg) ~ KindOf (SuccSym1 arg) =>-        SuccSym0KindInference-    type instance Apply SuccSym0 l = SuccSym1 l-    data instance Sing (z :: Nat)-      = z ~ Zero => SZero |-        forall (n :: Nat). z ~ Succ n => SSucc (Sing n)-    type SNat (z :: Nat) = Sing z-    instance SingKind (KProxy :: KProxy Nat) where-      type DemoteRep (KProxy :: KProxy Nat) = Nat-      fromSing SZero = Zero-      fromSing (SSucc b) = Succ (fromSing b)-      toSing Zero = SomeSing SZero-      toSing (Succ b)-        = case toSing b :: SomeSing (KProxy :: KProxy Nat) of {-            SomeSing c -> SomeSing (SSucc c) }-    instance SingI Zero where-      sing = SZero-    instance SingI n => SingI (Succ (n :: Nat)) where-      sing = SSucc sing-InsertionSort/InsertionSortImp.hs: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) |]-  ======>-    InsertionSort/InsertionSortImp.hs:(0,0)-(0,0)-    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 GHC.Types.[] = [n]-    insert n (h GHC.Types.: t)-      = if leq n h then-            (n GHC.Types.: (h GHC.Types.: t))-        else-            (h GHC.Types.: (insert n t))-    insertionSort :: [Nat] -> [Nat]-    insertionSort GHC.Types.[] = []-    insertionSort (h GHC.Types.: t) = insert h (insertionSort t)-    type Let0123456789Scrutinee_0123456789Sym3 t t t =-        Let0123456789Scrutinee_0123456789 t t t-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym2KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym2 l l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym3 l l arg) =>-        Let0123456789Scrutinee_0123456789Sym2KindInference-    type instance Apply (Let0123456789Scrutinee_0123456789Sym2 l l) l = Let0123456789Scrutinee_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym1KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym1 l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym2 l arg) =>-        Let0123456789Scrutinee_0123456789Sym1KindInference-    type instance Apply (Let0123456789Scrutinee_0123456789Sym1 l) l = Let0123456789Scrutinee_0123456789Sym2 l l-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym0 l-      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>-        Let0123456789Scrutinee_0123456789Sym0KindInference-    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l-    type Let0123456789Scrutinee_0123456789 n h t =-        Apply (Apply LeqSym0 n) h-    type family Case_0123456789 n h t t where-      Case_0123456789 n h t True = Apply (Apply (:$) n) (Apply (Apply (:$) h) t)-      Case_0123456789 n h t False = Apply (Apply (:$) h) (Apply (Apply InsertSym0 n) t)-    type LeqSym2 (t :: Nat) (t :: Nat) = Leq t t-    instance SuppressUnusedWarnings LeqSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) LeqSym1KindInference GHC.Tuple.())-    data LeqSym1 (l :: Nat) (l :: TyFun Nat Bool)-      = forall arg. KindOf (Apply (LeqSym1 l) arg) ~ KindOf (LeqSym2 l arg) =>-        LeqSym1KindInference-    type instance Apply (LeqSym1 l) l = LeqSym2 l l-    instance SuppressUnusedWarnings LeqSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) LeqSym0KindInference GHC.Tuple.())-    data LeqSym0 (l :: TyFun Nat (TyFun Nat Bool -> *))-      = forall arg. KindOf (Apply LeqSym0 arg) ~ KindOf (LeqSym1 arg) =>-        LeqSym0KindInference-    type instance Apply LeqSym0 l = LeqSym1 l-    type InsertSym2 (t :: Nat) (t :: [Nat]) = Insert t t-    instance SuppressUnusedWarnings InsertSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) InsertSym1KindInference GHC.Tuple.())-    data InsertSym1 (l :: Nat) (l :: TyFun [Nat] [Nat])-      = forall arg. KindOf (Apply (InsertSym1 l) arg) ~ KindOf (InsertSym2 l arg) =>-        InsertSym1KindInference-    type instance Apply (InsertSym1 l) l = InsertSym2 l l-    instance SuppressUnusedWarnings InsertSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) InsertSym0KindInference GHC.Tuple.())-    data InsertSym0 (l :: TyFun Nat (TyFun [Nat] [Nat] -> *))-      = forall arg. KindOf (Apply InsertSym0 arg) ~ KindOf (InsertSym1 arg) =>-        InsertSym0KindInference-    type instance Apply InsertSym0 l = InsertSym1 l-    type InsertionSortSym1 (t :: [Nat]) = InsertionSort t-    instance SuppressUnusedWarnings InsertionSortSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) InsertionSortSym0KindInference GHC.Tuple.())-    data InsertionSortSym0 (l :: TyFun [Nat] [Nat])-      = forall arg. KindOf (Apply InsertionSortSym0 arg) ~ KindOf (InsertionSortSym1 arg) =>-        InsertionSortSym0KindInference-    type instance Apply InsertionSortSym0 l = InsertionSortSym1 l-    type family Leq (a :: Nat) (a :: Nat) :: Bool where-      Leq Zero z = TrueSym0-      Leq (Succ z) Zero = FalseSym0-      Leq (Succ a) (Succ b) = Apply (Apply LeqSym0 a) b-    type family Insert (a :: Nat) (a :: [Nat]) :: [Nat] where-      Insert n '[] = Apply (Apply (:$) n) '[]-      Insert n ((:) h t) = Case_0123456789 n h t (Let0123456789Scrutinee_0123456789Sym3 n h t)-    type family InsertionSort (a :: [Nat]) :: [Nat] where-      InsertionSort '[] = '[]-      InsertionSort ((:) h t) = Apply (Apply InsertSym0 h) (Apply InsertionSortSym0 t)-    sLeq ::-      forall (t :: Nat) (t :: Nat).-      Sing t -> Sing t -> Sing (Apply (Apply LeqSym0 t) t)-    sInsert ::-      forall (t :: Nat) (t :: [Nat]).-      Sing t -> Sing t -> Sing (Apply (Apply InsertSym0 t) t)-    sInsertionSort ::-      forall (t :: [Nat]). Sing t -> Sing (Apply InsertionSortSym0 t)-    sLeq SZero _-      = let-          lambda ::-            forall wild. (t ~ ZeroSym0, t ~ wild) =>-            Sing (Apply (Apply LeqSym0 ZeroSym0) wild)-          lambda = STrue-        in lambda-    sLeq (SSucc _) SZero-      = let-          lambda ::-            forall wild. (t ~ Apply SuccSym0 wild, t ~ ZeroSym0) =>-            Sing (Apply (Apply LeqSym0 (Apply SuccSym0 wild)) ZeroSym0)-          lambda = SFalse-        in lambda-    sLeq (SSucc sA) (SSucc sB)-      = let-          lambda ::-            forall a b. (t ~ Apply SuccSym0 a, t ~ Apply SuccSym0 b) =>-            Sing a-            -> Sing b-               -> Sing (Apply (Apply LeqSym0 (Apply SuccSym0 a)) (Apply SuccSym0 b))-          lambda a b-            = applySing-                (applySing (singFun2 (Proxy :: Proxy LeqSym0) sLeq) a) b-        in lambda sA sB-    sInsert sN SNil-      = let-          lambda ::-            forall n. (t ~ n, t ~ '[]) =>-            Sing n -> Sing (Apply (Apply InsertSym0 n) '[])-          lambda n-            = applySing-                (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) n) SNil-        in lambda sN-    sInsert sN (SCons sH sT)-      = let-          lambda ::-            forall n h t. (t ~ n, t ~ Apply (Apply (:$) h) t) =>-            Sing n-            -> Sing h-               -> Sing t-                  -> Sing (Apply (Apply InsertSym0 n) (Apply (Apply (:$) h) t))-          lambda n h t-            = let-                sScrutinee_0123456789 ::-                  Sing (Let0123456789Scrutinee_0123456789Sym3 n h t)-                sScrutinee_0123456789-                  = applySing-                      (applySing (singFun2 (Proxy :: Proxy LeqSym0) sLeq) n) h-              in-                case sScrutinee_0123456789 of {-                  STrue-                    -> let-                         lambda :: Sing (Case_0123456789 n h t TrueSym0)-                         lambda-                           = applySing-                               (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) n)-                               (applySing (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) h) t)-                       in lambda-                  SFalse-                    -> let-                         lambda :: Sing (Case_0123456789 n h t FalseSym0)-                         lambda-                           = applySing-                               (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) h)-                               (applySing-                                  (applySing (singFun2 (Proxy :: Proxy InsertSym0) sInsert) n) t)-                       in lambda }-        in lambda sN sH sT-    sInsertionSort SNil-      = let-          lambda :: t ~ '[] => Sing (Apply InsertionSortSym0 '[])-          lambda = SNil-        in lambda-    sInsertionSort (SCons sH sT)-      = let-          lambda ::-            forall h t. t ~ Apply (Apply (:$) h) t =>-            Sing h-            -> Sing t-               -> Sing (Apply InsertionSortSym0 (Apply (Apply (:$) h) t))-          lambda h t-            = applySing-                (applySing (singFun2 (Proxy :: Proxy InsertSym0) sInsert) h)-                (applySing-                   (singFun1 (Proxy :: Proxy InsertionSortSym0) sInsertionSort) t)-        in lambda sH sT
tests/compile-and-dump/InsertionSort/InsertionSortImp.hs view
@@ -27,7 +27,7 @@  -} -{-# LANGUAGE IncoherentInstances #-}+{-# LANGUAGE IncoherentInstances, ConstraintKinds #-}  module InsertionSort.InsertionSortImp where @@ -35,9 +35,8 @@ import Data.Singletons.SuppressUnusedWarnings import Data.Singletons.TH --- We use the Dict data type from Edward Kmett's constraints package to be--- able to return dictionaries from functions-import Data.Constraint+data Dict c where+  Dict :: c => Dict c  -- Natural numbers, defined with singleton counterparts $(singletons [d|
− tests/compile-and-dump/Promote/BadBoundedDeriving.ghc78.template
@@ -1,5 +0,0 @@--Promote/BadBoundedDeriving.hs:0:0:-    Can't derive promoted Bounded instance for Foo_0123456789 datatype.--Promote/BadBoundedDeriving.hs:0:0: Q monad failure
− tests/compile-and-dump/Promote/BadBoundedDeriving.hs
@@ -1,8 +0,0 @@-module Promote.BadBoundedDeriving where--import Data.Promotion.Prelude-import Data.Promotion.TH--$(promote [d|-  data Foo a = Foo | Bar a deriving (Bounded)-  |])
− tests/compile-and-dump/Promote/BoundedDeriving.ghc78.template
@@ -1,80 +0,0 @@-Promote/BoundedDeriving.hs:0:0: Splicing declarations-    promote-      [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 :: *) (b :: *)-            = Foo41 | Foo42-            deriving (Bounded)-          data Pair-            = Pair Bool Bool-            deriving (Bounded) |]-  ======>-    Promote/BoundedDeriving.hs:(0,0)-(0,0)-    data Foo1-      = Foo1-      deriving (Bounded)-    data Foo2-      = A | B | C | D | E-      deriving (Bounded)-    data Foo3 a-      = Foo3 a-      deriving (Bounded)-    data Foo4 (a :: *) (b :: *)-      = Foo41 | Foo42-      deriving (Bounded)-    data Pair-      = Pair Bool Bool-      deriving (Bounded)-    instance PBounded (KProxy :: KProxy Foo1) where-      type MinBound = Foo1-      type MaxBound = Foo1-    type Foo1Sym0 = Foo1-    instance PBounded (KProxy :: KProxy Foo2) where-      type MinBound = A-      type MaxBound = E-    type ASym0 = A-    type BSym0 = B-    type CSym0 = C-    type DSym0 = D-    type ESym0 = E-    instance PBounded (KProxy :: KProxy (Foo3 k)) where-      type MinBound = Foo3 MinBound-      type MaxBound = Foo3 MaxBound-    type Foo3Sym1 (t :: a) = Foo3 t-    instance SuppressUnusedWarnings Foo3Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo3Sym0KindInference GHC.Tuple.())-    data Foo3Sym0 (l :: TyFun a (Foo3 a))-      = forall arg. Data.Singletons.KindOf (Apply Foo3Sym0 arg) ~ Data.Singletons.KindOf (Foo3Sym1 arg) =>-        Foo3Sym0KindInference-    type instance Apply Foo3Sym0 l = Foo3Sym1 l-    instance PBounded (KProxy :: KProxy (Foo4 k k)) where-      type MinBound = Foo41-      type MaxBound = Foo42-    type Foo41Sym0 = Foo41-    type Foo42Sym0 = Foo42-    instance PBounded (KProxy :: KProxy Pair) where-      type MinBound = Pair MinBound MinBound-      type MaxBound = Pair MaxBound MaxBound-    type PairSym2 (t :: Bool) (t :: Bool) = Pair t t-    instance SuppressUnusedWarnings PairSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) PairSym1KindInference GHC.Tuple.())-    data PairSym1 (l :: Bool) (l :: TyFun Bool Pair)-      = forall arg. Data.Singletons.KindOf (Apply (PairSym1 l) arg) ~ Data.Singletons.KindOf (PairSym2 l arg) =>-        PairSym1KindInference-    type instance Apply (PairSym1 l) l = PairSym2 l l-    instance SuppressUnusedWarnings PairSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) PairSym0KindInference GHC.Tuple.())-    data PairSym0 (l :: TyFun Bool (TyFun Bool Pair -> *))-      = forall arg. Data.Singletons.KindOf (Apply PairSym0 arg) ~ Data.Singletons.KindOf (PairSym1 arg) =>-        PairSym0KindInference-    type instance Apply PairSym0 l = PairSym1 l
− tests/compile-and-dump/Promote/BoundedDeriving.hs
@@ -1,51 +0,0 @@-module Promote.BoundedDeriving where--import Data.Promotion.Prelude-import Data.Promotion.TH--$(promote [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 :: *) (b :: *) = Foo41 | Foo42 deriving Bounded--  data Pair = Pair Bool Bool-                  deriving Bounded--  |])--foo1a :: Proxy (MinBound :: Foo1)-foo1a = Proxy--foo1b :: Proxy 'Foo1-foo1b = foo1a--foo1c :: Proxy (MaxBound :: Foo1)-foo1c = Proxy--foo1d :: Proxy 'Foo1-foo1d = foo1c--foo2a :: Proxy (MinBound :: Foo2)-foo2a = Proxy--foo2b :: Proxy 'A-foo2b = foo2a--foo2c :: Proxy (MaxBound :: Foo2)-foo2c = Proxy--foo2d :: Proxy 'E-foo2d = foo2c--foo3a :: Proxy (MinBound :: Foo3 Bool)-foo3a = Proxy--foo3b :: Proxy ('Foo3 False)-foo3b = foo3a--foo3c :: Proxy (MaxBound :: Foo3 Bool)-foo3c = Proxy--foo3d :: Proxy ('Foo3 True)-foo3d = foo3c
− tests/compile-and-dump/Promote/Classes.ghc78.template
@@ -1,158 +0,0 @@-Promote/Classes.hs:0:0: Splicing declarations-    promote-      [d| const :: a -> b -> a-          const x _ = x-          fooCompare :: Foo -> Foo -> Ordering-          fooCompare A A = EQ-          fooCompare A _ = LT-          fooCompare _ _ = GT-          -          class MyOrd a where-            mycompare :: a -> a -> Ordering-            (<=>) :: a -> a -> Ordering-            (<=>) = mycompare-          data Foo = A | B-          -          instance MyOrd Foo where-            mycompare = fooCompare-          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 |]-  ======>-    Promote/Classes.hs:(0,0)-(0,0)-    const :: forall a b. a -> b -> a-    const x _ = x-    class MyOrd a where-      mycompare :: a -> a -> Ordering-      (<=>) :: a -> a -> Ordering-      (<=>) = mycompare-    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 _ = LT-    fooCompare _ _ = GT-    instance MyOrd Foo where-      mycompare = fooCompare-    type FooCompareSym2 (t :: Foo) (t :: Foo) = FooCompare t t-    instance SuppressUnusedWarnings FooCompareSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) FooCompareSym1KindInference GHC.Tuple.())-    data FooCompareSym1 (l :: Foo) (l :: TyFun Foo Ordering)-      = forall arg. KindOf (Apply (FooCompareSym1 l) arg) ~ KindOf (FooCompareSym2 l arg) =>-        FooCompareSym1KindInference-    type instance Apply (FooCompareSym1 l) l = FooCompareSym2 l l-    instance SuppressUnusedWarnings FooCompareSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) FooCompareSym0KindInference GHC.Tuple.())-    data FooCompareSym0 (l :: TyFun Foo (TyFun Foo Ordering -> *))-      = forall arg. KindOf (Apply FooCompareSym0 arg) ~ KindOf (FooCompareSym1 arg) =>-        FooCompareSym0KindInference-    type instance Apply FooCompareSym0 l = FooCompareSym1 l-    type ConstSym2 (t :: a) (t :: b) = Const t t-    instance SuppressUnusedWarnings ConstSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) ConstSym1KindInference GHC.Tuple.())-    data ConstSym1 (l :: a) (l :: TyFun b a)-      = forall arg. KindOf (Apply (ConstSym1 l) arg) ~ KindOf (ConstSym2 l arg) =>-        ConstSym1KindInference-    type instance Apply (ConstSym1 l) l = ConstSym2 l l-    instance SuppressUnusedWarnings ConstSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) ConstSym0KindInference GHC.Tuple.())-    data ConstSym0 (l :: TyFun a (TyFun b a -> *))-      = forall arg. KindOf (Apply ConstSym0 arg) ~ KindOf (ConstSym1 arg) =>-        ConstSym0KindInference-    type instance Apply ConstSym0 l = ConstSym1 l-    type family FooCompare (a :: Foo) (a :: Foo) :: Ordering where-      FooCompare A A = EQSym0-      FooCompare A z = LTSym0-      FooCompare z z = GTSym0-    type family Const (a :: a) (a :: b) :: a where-      Const x z = x-    type MycompareSym2 (t :: a) (t :: a) = Mycompare t t-    instance SuppressUnusedWarnings MycompareSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) MycompareSym1KindInference GHC.Tuple.())-    data MycompareSym1 (l :: a) (l :: TyFun a Ordering)-      = forall arg. KindOf (Apply (MycompareSym1 l) arg) ~ KindOf (MycompareSym2 l arg) =>-        MycompareSym1KindInference-    type instance Apply (MycompareSym1 l) l = MycompareSym2 l l-    instance SuppressUnusedWarnings MycompareSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) MycompareSym0KindInference GHC.Tuple.())-    data MycompareSym0 (l :: TyFun a (TyFun a Ordering -> *))-      = forall arg. KindOf (Apply MycompareSym0 arg) ~ KindOf (MycompareSym1 arg) =>-        MycompareSym0KindInference-    type instance Apply MycompareSym0 l = MycompareSym1 l-    type (:<=>$$$) (t :: a) (t :: a) = (:<=>) t t-    instance SuppressUnusedWarnings (:<=>$$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:<=>$$###) GHC.Tuple.())-    data (:<=>$$) (l :: a) (l :: TyFun a Ordering)-      = forall arg. KindOf (Apply ((:<=>$$) l) arg) ~ KindOf ((:<=>$$$) l arg) =>-        (:<=>$$###)-    type instance Apply ((:<=>$$) l) l = (:<=>$$$) l l-    instance SuppressUnusedWarnings (:<=>$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:<=>$###) GHC.Tuple.())-    data (:<=>$) (l :: TyFun a (TyFun a Ordering -> *))-      = forall arg. KindOf (Apply (:<=>$) arg) ~ KindOf ((:<=>$$) arg) =>-        (:<=>$###)-    type instance Apply (:<=>$) l = (:<=>$$) l-    class kproxy ~ KProxy => PMyOrd (kproxy :: KProxy a) where-      type family Mycompare (arg :: a) (arg :: a) :: Ordering-      type family (:<=>) (arg :: a) (arg :: a) :: Ordering-      type instance (:<=>) (a_0123456789 :: a) (a_0123456789 :: a) = (Apply (Apply MycompareSym0 a_0123456789) a_0123456789 :: Ordering)-    instance PMyOrd (KProxy :: KProxy Nat) where-      type Mycompare (Zero :: Nat) (Zero :: Nat) = (EQSym0 :: Ordering)-      type Mycompare (Zero :: Nat) (Succ z :: Nat) = (LTSym0 :: Ordering)-      type Mycompare (Succ z :: Nat) (Zero :: Nat) = (GTSym0 :: Ordering)-      type Mycompare (Succ n :: Nat) (Succ m :: Nat) = (Apply (Apply MycompareSym0 m) n :: Ordering)-    instance PMyOrd (KProxy :: KProxy ()) where-      type Mycompare (z :: ()) (a_0123456789 :: ()) = (Apply (Apply ConstSym0 EQSym0) a_0123456789 :: Ordering)-    instance PMyOrd (KProxy :: KProxy Foo) where-      type Mycompare (a_0123456789 :: Foo) (a_0123456789 :: Foo) = (Apply (Apply FooCompareSym0 a_0123456789) a_0123456789 :: Ordering)-    type ASym0 = A-    type BSym0 = B-Promote/Classes.hs:0:0: Splicing declarations-    promote-      [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 |]-  ======>-    Promote/Classes.hs:(0,0)-(0,0)-    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)-    instance PMyOrd (KProxy :: KProxy Nat') where-      type Mycompare (Zero' :: Nat') (Zero' :: Nat') = (EQSym0 :: Ordering)-      type Mycompare (Zero' :: Nat') (Succ' z :: Nat') = (LTSym0 :: Ordering)-      type Mycompare (Succ' z :: Nat') (Zero' :: Nat') = (GTSym0 :: Ordering)-      type Mycompare (Succ' n :: Nat') (Succ' m :: Nat') = (Apply (Apply MycompareSym0 m) n :: Ordering)-    type Zero'Sym0 = Zero'-    type Succ'Sym1 (t :: Nat') = Succ' t-    instance SuppressUnusedWarnings Succ'Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Succ'Sym0KindInference GHC.Tuple.())-    data Succ'Sym0 (l :: TyFun Nat' Nat')-      = forall arg. KindOf (Apply Succ'Sym0 arg) ~ KindOf (Succ'Sym1 arg) =>-        Succ'Sym0KindInference-    type instance Apply Succ'Sym0 l = Succ'Sym1 l
− tests/compile-and-dump/Promote/Classes.hs
@@ -1,73 +0,0 @@-module Promote.Classes where--import Prelude hiding (Ord(..), const)-import Singletons.Nat-import Data.Singletons-import Data.Singletons.TH-import Data.Singletons.Prelude.Ord (EQSym0, LTSym0, GTSym0)--$(promote [d|-  const :: a -> b -> a-  const x _ = x--  class MyOrd a where-    mycompare :: a -> a -> Ordering-    (<=>) :: a -> a -> Ordering-    (<=>) = mycompare---    infix 4 <=>  infix decls don't work due to #65--  instance MyOrd Nat where-    Zero `mycompare` Zero = EQ-    Zero `mycompare` (Succ _) = LT-    (Succ _) `mycompare` Zero = GT-    (Succ n) `mycompare` (Succ m) = m `mycompare` n--    -- test eta-expansion-  instance MyOrd () where-    mycompare _ = const EQ--  data Foo = A | B--  fooCompare :: Foo -> Foo -> Ordering-  fooCompare A A = EQ-  fooCompare A _ = LT-  fooCompare _ _ = GT--  instance MyOrd Foo where-    -- test that values in instance definitions are eta-expanded-    mycompare = fooCompare- |])---- check promotion across different splices (#55)-$(promote [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- |])--foo1a :: Proxy (Zero `Mycompare` (Succ Zero))-foo1a = Proxy--foo1b :: Proxy LT-foo1b = foo1a--foo2a :: Proxy (A `Mycompare` A)-foo2a = Proxy--foo2b :: Proxy EQ-foo2b = foo2a--foo3a :: Proxy ('() `Mycompare` '())-foo3a = Proxy--foo3b :: Proxy EQ-foo3b = foo3a--foo4a :: Proxy (Succ' Zero' :<=> Zero')-foo4a = Proxy--foo4b :: Proxy GT-foo4b = foo4a
+ tests/compile-and-dump/Promote/Constructors.ghc710.template view
@@ -0,0 +1,79 @@+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 (:+$$$) (t :: Foo) (t :: Foo) = (:+) t t+    instance SuppressUnusedWarnings (:+$$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:+$$###) GHC.Tuple.())+    data (:+$$) (l :: Foo) (l :: TyFun Foo Foo)+      = forall arg. KindOf (Apply ((:+$$) l) arg) ~ KindOf ((:+$$$) l arg) =>+        :+$$###+    type instance Apply ((:+$$) l) l = (:+$$$) l l+    instance SuppressUnusedWarnings (:+$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:+$###) GHC.Tuple.())+    data (:+$) (l :: TyFun Foo (TyFun Foo Foo -> *))+      = forall arg. KindOf (Apply (:+$) arg) ~ KindOf ((:+$$) arg) =>+        :+$###+    type instance Apply (:+$) l = (:+$$) l+    type BarSym5 (t :: Bar)+                 (t :: Bar)+                 (t :: Bar)+                 (t :: Bar)+                 (t :: Foo) =+        Bar t t t t t+    instance SuppressUnusedWarnings BarSym4 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) BarSym4KindInference GHC.Tuple.())+    data BarSym4 (l :: Bar)+                 (l :: Bar)+                 (l :: Bar)+                 (l :: Bar)+                 (l :: TyFun Foo Bar)+      = forall arg. KindOf (Apply (BarSym4 l l l l) arg) ~ KindOf (BarSym5 l l l l arg) =>+        BarSym4KindInference+    type instance Apply (BarSym4 l l l l) l = BarSym5 l l l l l+    instance SuppressUnusedWarnings BarSym3 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) BarSym3KindInference GHC.Tuple.())+    data BarSym3 (l :: Bar)+                 (l :: Bar)+                 (l :: Bar)+                 (l :: TyFun Bar (TyFun Foo Bar -> *))+      = forall arg. KindOf (Apply (BarSym3 l l l) arg) ~ KindOf (BarSym4 l l l arg) =>+        BarSym3KindInference+    type instance Apply (BarSym3 l l l) l = BarSym4 l l l l+    instance SuppressUnusedWarnings BarSym2 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) BarSym2KindInference GHC.Tuple.())+    data BarSym2 (l :: Bar)+                 (l :: Bar)+                 (l :: TyFun Bar (TyFun Bar (TyFun Foo Bar -> *) -> *))+      = forall arg. KindOf (Apply (BarSym2 l l) arg) ~ KindOf (BarSym3 l l arg) =>+        BarSym2KindInference+    type instance Apply (BarSym2 l l) l = BarSym3 l l l+    instance SuppressUnusedWarnings BarSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) BarSym1KindInference GHC.Tuple.())+    data BarSym1 (l :: Bar)+                 (l :: TyFun Bar (TyFun Bar (TyFun Bar (TyFun Foo Bar -> *) -> *)+                                  -> *))+      = forall arg. KindOf (Apply (BarSym1 l) arg) ~ KindOf (BarSym2 l arg) =>+        BarSym1KindInference+    type instance Apply (BarSym1 l) l = BarSym2 l l+    instance SuppressUnusedWarnings BarSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) BarSym0KindInference GHC.Tuple.())+    data BarSym0 (l :: TyFun Bar (TyFun Bar (TyFun Bar (TyFun Bar (TyFun Foo Bar+                                                                   -> *)+                                                        -> *)+                                             -> *)+                                  -> *))+      = forall arg. KindOf (Apply BarSym0 arg) ~ KindOf (BarSym1 arg) =>+        BarSym0KindInference+    type instance Apply BarSym0 l = BarSym1 l
− tests/compile-and-dump/Promote/Constructors.ghc78.template
@@ -1,80 +0,0 @@-Promote/Constructors.hs:0:0: Splicing declarations-    promote-      [d| data Foo = Foo | Foo :+ Foo-          data Bar = Bar Bar Bar Bar Bar Foo |]-  ======>-    Promote/Constructors.hs:(0,0)-(0,0)-    data Foo = Foo | Foo :+ Foo-    data Bar = Bar Bar Bar Bar Bar Foo-    type FooSym0 = Foo-    type (:+$$$) (t :: Foo) (t :: Foo) = (:+) t t-    instance SuppressUnusedWarnings (:+$$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:+$$###) GHC.Tuple.())-    data (:+$$) (l :: Foo) (l :: TyFun Foo Foo)-      = forall arg. KindOf (Apply ((:+$$) l) arg) ~ KindOf ((:+$$$) l arg) =>-        (:+$$###)-    type instance Apply ((:+$$) l) l = (:+$$$) l l-    instance SuppressUnusedWarnings (:+$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:+$###) GHC.Tuple.())-    data (:+$) (l :: TyFun Foo (TyFun Foo Foo -> *))-      = forall arg. KindOf (Apply (:+$) arg) ~ KindOf ((:+$$) arg) =>-        (:+$###)-    type instance Apply (:+$) l = (:+$$) l-    type BarSym5 (t :: Bar)-                 (t :: Bar)-                 (t :: Bar)-                 (t :: Bar)-                 (t :: Foo) =-        Bar t t t t t-    instance SuppressUnusedWarnings BarSym4 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) BarSym4KindInference GHC.Tuple.())-    data BarSym4 (l :: Bar)-                 (l :: Bar)-                 (l :: Bar)-                 (l :: Bar)-                 (l :: TyFun Foo Bar)-      = forall arg. KindOf (Apply (BarSym4 l l l l) arg) ~ KindOf (BarSym5 l l l l arg) =>-        BarSym4KindInference-    type instance Apply (BarSym4 l l l l) l = BarSym5 l l l l l-    instance SuppressUnusedWarnings BarSym3 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) BarSym3KindInference GHC.Tuple.())-    data BarSym3 (l :: Bar)-                 (l :: Bar)-                 (l :: Bar)-                 (l :: TyFun Bar (TyFun Foo Bar -> *))-      = forall arg. KindOf (Apply (BarSym3 l l l) arg) ~ KindOf (BarSym4 l l l arg) =>-        BarSym3KindInference-    type instance Apply (BarSym3 l l l) l = BarSym4 l l l l-    instance SuppressUnusedWarnings BarSym2 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) BarSym2KindInference GHC.Tuple.())-    data BarSym2 (l :: Bar)-                 (l :: Bar)-                 (l :: TyFun Bar (TyFun Bar (TyFun Foo Bar -> *) -> *))-      = forall arg. KindOf (Apply (BarSym2 l l) arg) ~ KindOf (BarSym3 l l arg) =>-        BarSym2KindInference-    type instance Apply (BarSym2 l l) l = BarSym3 l l l-    instance SuppressUnusedWarnings BarSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) BarSym1KindInference GHC.Tuple.())-    data BarSym1 (l :: Bar)-                 (l :: TyFun Bar (TyFun Bar (TyFun Bar (TyFun Foo Bar -> *) -> *)-                                  -> *))-      = forall arg. KindOf (Apply (BarSym1 l) arg) ~ KindOf (BarSym2 l arg) =>-        BarSym1KindInference-    type instance Apply (BarSym1 l) l = BarSym2 l l-    instance SuppressUnusedWarnings BarSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) BarSym0KindInference GHC.Tuple.())-    data BarSym0 (l :: TyFun Bar (TyFun Bar (TyFun Bar (TyFun Bar (TyFun Foo Bar-                                                                   -> *)-                                                        -> *)-                                             -> *)-                                  -> *))-      = forall arg. KindOf (Apply BarSym0 arg) ~ KindOf (BarSym1 arg) =>-        BarSym0KindInference-    type instance Apply BarSym0 l = BarSym1 l
+ tests/compile-and-dump/Promote/GenDefunSymbols.ghc710.template view
@@ -0,0 +1,45 @@+Promote/GenDefunSymbols.hs:0:0:: Splicing declarations+    genDefunSymbols [''LiftMaybe, ''NatT, '':+]+  ======>+    type LiftMaybeSym2 (t :: TyFun a b -> *) (t :: Maybe a) =+        LiftMaybe t t+    instance SuppressUnusedWarnings LiftMaybeSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) LiftMaybeSym1KindInference GHC.Tuple.())+    data LiftMaybeSym1 (l :: TyFun a b -> *)+                       (l :: TyFun (Maybe a) (Maybe b))+      = forall arg. Data.Singletons.KindOf (Apply (LiftMaybeSym1 l) arg) ~ Data.Singletons.KindOf (LiftMaybeSym2 l arg) =>+        LiftMaybeSym1KindInference+    type instance Apply (LiftMaybeSym1 l) l = LiftMaybeSym2 l l+    instance SuppressUnusedWarnings LiftMaybeSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) LiftMaybeSym0KindInference GHC.Tuple.())+    data LiftMaybeSym0 (l :: TyFun (TyFun a b+                                    -> *) (TyFun (Maybe a) (Maybe b) -> *))+      = forall arg. Data.Singletons.KindOf (Apply LiftMaybeSym0 arg) ~ Data.Singletons.KindOf (LiftMaybeSym1 arg) =>+        LiftMaybeSym0KindInference+    type instance Apply LiftMaybeSym0 l = LiftMaybeSym1 l+    type ZeroSym0 = Zero+    type SuccSym1 (t :: NatT) = Succ t+    instance SuppressUnusedWarnings SuccSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) SuccSym0KindInference GHC.Tuple.())+    data SuccSym0 (l :: TyFun NatT NatT)+      = forall arg. Data.Singletons.KindOf (Apply SuccSym0 arg) ~ Data.Singletons.KindOf (SuccSym1 arg) =>+        SuccSym0KindInference+    type instance Apply SuccSym0 l = SuccSym1 l+    type (:+$$$) (t :: Nat) (t :: Nat) = (:+) t t+    instance SuppressUnusedWarnings (:+$$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:+$$###) GHC.Tuple.())+    data (:+$$) (l :: Nat) l+      = forall arg. Data.Singletons.KindOf (Apply ((:+$$) l) arg) ~ Data.Singletons.KindOf ((:+$$$) l arg) =>+        :+$$###+    type instance Apply ((:+$$) l) l = (:+$$$) l l+    instance SuppressUnusedWarnings (:+$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:+$###) GHC.Tuple.())+    data (:+$) l+      = forall arg. Data.Singletons.KindOf (Apply (:+$) arg) ~ Data.Singletons.KindOf ((:+$$) arg) =>+        :+$###+    type instance Apply (:+$) l = (:+$$) l
− tests/compile-and-dump/Promote/GenDefunSymbols.ghc78.template
@@ -1,46 +0,0 @@-Promote/GenDefunSymbols.hs:0:0: Splicing declarations-    genDefunSymbols [''LiftMaybe, ''NatT, '':+]-  ======>-    Promote/GenDefunSymbols.hs:0:0:-    type LiftMaybeSym2 (t :: TyFun a b -> *) (t :: Maybe a) =-        LiftMaybe t t-    instance SuppressUnusedWarnings LiftMaybeSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) LiftMaybeSym1KindInference GHC.Tuple.())-    data LiftMaybeSym1 (l :: TyFun a b -> *)-                       (l :: TyFun (Maybe a) (Maybe b))-      = forall arg. Data.Singletons.KindOf (Apply (LiftMaybeSym1 l) arg) ~ Data.Singletons.KindOf (LiftMaybeSym2 l arg) =>-        LiftMaybeSym1KindInference-    type instance Apply (LiftMaybeSym1 l) l = LiftMaybeSym2 l l-    instance SuppressUnusedWarnings LiftMaybeSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) LiftMaybeSym0KindInference GHC.Tuple.())-    data LiftMaybeSym0 (l :: TyFun (TyFun a b-                                    -> *) (TyFun (Maybe a) (Maybe b) -> *))-      = forall arg. Data.Singletons.KindOf (Apply LiftMaybeSym0 arg) ~ Data.Singletons.KindOf (LiftMaybeSym1 arg) =>-        LiftMaybeSym0KindInference-    type instance Apply LiftMaybeSym0 l = LiftMaybeSym1 l-    type ZeroSym0 = Zero-    type SuccSym1 (t :: NatT) = Succ t-    instance SuppressUnusedWarnings SuccSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) SuccSym0KindInference GHC.Tuple.())-    data SuccSym0 (l :: TyFun NatT NatT)-      = forall arg. Data.Singletons.KindOf (Apply SuccSym0 arg) ~ Data.Singletons.KindOf (SuccSym1 arg) =>-        SuccSym0KindInference-    type instance Apply SuccSym0 l = SuccSym1 l-    type (:+$$$) (t :: Nat) (t :: Nat) = (:+) t t-    instance SuppressUnusedWarnings (:+$$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:+$$###) GHC.Tuple.())-    data (:+$$) (l :: Nat) l-      = forall arg. Data.Singletons.KindOf (Apply ((:+$$) l) arg) ~ Data.Singletons.KindOf ((:+$$$) l arg) =>-        (:+$$###)-    type instance Apply ((:+$$) l) l = (:+$$$) l l-    instance SuppressUnusedWarnings (:+$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:+$###) GHC.Tuple.())-    data (:+$) l-      = forall arg. Data.Singletons.KindOf (Apply (:+$) arg) ~ Data.Singletons.KindOf ((:+$$) arg) =>-        (:+$###)-    type instance Apply (:+$) l = (:+$$) l
tests/compile-and-dump/Promote/GenDefunSymbols.hs view
@@ -7,15 +7,9 @@ import Data.Singletons.SuppressUnusedWarnings import GHC.TypeLits -#if __GLASGOW_HASKELL__ >= 707 type family LiftMaybe (f :: TyFun a b -> *) (x :: Maybe a) :: Maybe b where     LiftMaybe f Nothing = Nothing     LiftMaybe f (Just a) = Just (Apply f a)-#else-type family LiftMaybe (f :: TyFun a b -> *) (x :: Maybe a) :: Maybe b-type instance LiftMaybe f Nothing = Nothing-type instance LiftMaybe f (Just a) = Just (Apply f a)-#endif  data NatT = Zero | Succ NatT 
+ tests/compile-and-dump/Promote/Newtypes.ghc710.template view
@@ -0,0 +1,42 @@+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 UnBarSym1 (t :: Bar) = UnBar t+    instance SuppressUnusedWarnings UnBarSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) UnBarSym0KindInference GHC.Tuple.())+    data UnBarSym0 (l :: TyFun Bar Nat)+      = forall arg. KindOf (Apply UnBarSym0 arg) ~ KindOf (UnBarSym1 arg) =>+        UnBarSym0KindInference+    type instance Apply UnBarSym0 l = UnBarSym1 l+    type family UnBar (a :: Bar) :: Nat where+      UnBar (Bar field) = field+    type family Equals_0123456789 (a :: Foo) (b :: Foo) :: Bool where+      Equals_0123456789 (Foo a) (Foo b) = (:==) a b+      Equals_0123456789 (a :: Foo) (b :: Foo) = FalseSym0+    instance PEq (KProxy :: KProxy Foo) where+      type (:==) (a :: Foo) (b :: Foo) = Equals_0123456789 a b+    type FooSym1 (t :: Nat) = Foo t+    instance SuppressUnusedWarnings FooSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) FooSym0KindInference GHC.Tuple.())+    data FooSym0 (l :: TyFun Nat Foo)+      = forall arg. KindOf (Apply FooSym0 arg) ~ KindOf (FooSym1 arg) =>+        FooSym0KindInference+    type instance Apply FooSym0 l = FooSym1 l+    type BarSym1 (t :: Nat) = Bar t+    instance SuppressUnusedWarnings BarSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) BarSym0KindInference GHC.Tuple.())+    data BarSym0 (l :: TyFun Nat Bar)+      = forall arg. KindOf (Apply BarSym0 arg) ~ KindOf (BarSym1 arg) =>+        BarSym0KindInference+    type instance Apply BarSym0 l = BarSym1 l
− tests/compile-and-dump/Promote/Newtypes.ghc78.template
@@ -1,43 +0,0 @@-Promote/Newtypes.hs:0:0: Splicing declarations-    promote-      [d| newtype Foo-            = Foo Nat-            deriving (Eq)-          newtype Bar = Bar {unBar :: Nat} |]-  ======>-    Promote/Newtypes.hs:(0,0)-(0,0)-    newtype Foo-      = Foo Nat-      deriving (Eq)-    newtype Bar = Bar {unBar :: Nat}-    type UnBarSym1 (t :: Bar) = UnBar t-    instance SuppressUnusedWarnings UnBarSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) UnBarSym0KindInference GHC.Tuple.())-    data UnBarSym0 (l :: TyFun Bar Nat)-      = forall arg. KindOf (Apply UnBarSym0 arg) ~ KindOf (UnBarSym1 arg) =>-        UnBarSym0KindInference-    type instance Apply UnBarSym0 l = UnBarSym1 l-    type family UnBar (a :: Bar) :: Nat where-      UnBar (Bar field) = field-    type family Equals_0123456789 (a :: Foo) (b :: Foo) :: Bool where-      Equals_0123456789 (Foo a) (Foo b) = (:==) a b-      Equals_0123456789 (a :: Foo) (b :: Foo) = FalseSym0-    instance PEq (KProxy :: KProxy Foo) where-      type (:==) (a :: Foo) (b :: Foo) = Equals_0123456789 a b-    type FooSym1 (t :: Nat) = Foo t-    instance SuppressUnusedWarnings FooSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) FooSym0KindInference GHC.Tuple.())-    data FooSym0 (l :: TyFun Nat Foo)-      = forall arg. KindOf (Apply FooSym0 arg) ~ KindOf (FooSym1 arg) =>-        FooSym0KindInference-    type instance Apply FooSym0 l = FooSym1 l-    type BarSym1 (t :: Nat) = Bar t-    instance SuppressUnusedWarnings BarSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) BarSym0KindInference GHC.Tuple.())-    data BarSym0 (l :: TyFun Nat Bar)-      = forall arg. KindOf (Apply BarSym0 arg) ~ KindOf (BarSym1 arg) =>-        BarSym0KindInference-    type instance Apply BarSym0 l = BarSym1 l
− tests/compile-and-dump/Promote/OrdDeriving.ghc78.template
@@ -1,304 +0,0 @@-Promote/OrdDeriving.hs:0:0: Splicing declarations-    promote-      [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) |]-  ======>-    Promote/OrdDeriving.hs:(0,0)-(0,0)-    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 family Equals_0123456789 (a :: Nat) (b :: Nat) :: Bool where-      Equals_0123456789 Zero Zero = TrueSym0-      Equals_0123456789 (Succ a) (Succ b) = (:==) a b-      Equals_0123456789 (a :: Nat) (b :: Nat) = FalseSym0-    instance PEq (KProxy :: KProxy Nat) where-      type (:==) (a :: Nat) (b :: Nat) = Equals_0123456789 a b-    instance POrd (KProxy :: KProxy Nat) where-      type Compare Zero Zero = EQ-      type Compare Zero (Succ rhs) = LT-      type Compare (Succ lhs) Zero = GT-      type Compare (Succ lhs) (Succ rhs) = ThenCmp EQ (Compare lhs rhs)-    type ZeroSym0 = Zero-    type SuccSym1 (t :: Nat) = Succ t-    instance SuppressUnusedWarnings SuccSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) SuccSym0KindInference GHC.Tuple.())-    data SuccSym0 (l :: TyFun Nat Nat)-      = forall arg. Data.Singletons.KindOf (Apply SuccSym0 arg) ~ Data.Singletons.KindOf (SuccSym1 arg) =>-        SuccSym0KindInference-    type instance Apply SuccSym0 l = SuccSym1 l-    type family Equals_0123456789 (a :: Foo k k k k)-                                  (b :: Foo k k k k) :: Bool where-      Equals_0123456789 (A a a a a) (A b b b b) = (:&&) ((:==) a b) ((:&&) ((:==) a b) ((:&&) ((:==) a b) ((:==) a b)))-      Equals_0123456789 (B a a a a) (B b b b b) = (:&&) ((:==) a b) ((:&&) ((:==) a b) ((:&&) ((:==) a b) ((:==) a b)))-      Equals_0123456789 (C a a a a) (C b b b b) = (:&&) ((:==) a b) ((:&&) ((:==) a b) ((:&&) ((:==) a b) ((:==) a b)))-      Equals_0123456789 (D a a a a) (D b b b b) = (:&&) ((:==) a b) ((:&&) ((:==) a b) ((:&&) ((:==) a b) ((:==) a b)))-      Equals_0123456789 (E a a a a) (E b b b b) = (:&&) ((:==) a b) ((:&&) ((:==) a b) ((:&&) ((:==) a b) ((:==) a b)))-      Equals_0123456789 (F a a a a) (F b b b b) = (:&&) ((:==) a b) ((:&&) ((:==) a b) ((:&&) ((:==) a b) ((:==) a b)))-      Equals_0123456789 (a :: Foo k k k k) (b :: Foo k k k k) = FalseSym0-    instance PEq (KProxy :: KProxy (Foo k k k k)) where-      type (:==) (a :: Foo k k k k) (b :: Foo k k k k) = Equals_0123456789 a b-    instance POrd (KProxy :: KProxy (Foo k k k k)) where-      type Compare (A lhs lhs lhs lhs) (A rhs rhs rhs rhs) = ThenCmp (ThenCmp (ThenCmp (ThenCmp EQ (Compare lhs rhs)) (Compare lhs rhs)) (Compare lhs rhs)) (Compare lhs rhs)-      type Compare (A lhs lhs lhs lhs) (B rhs rhs rhs rhs) = LT-      type Compare (A lhs lhs lhs lhs) (C rhs rhs rhs rhs) = LT-      type Compare (A lhs lhs lhs lhs) (D rhs rhs rhs rhs) = LT-      type Compare (A lhs lhs lhs lhs) (E rhs rhs rhs rhs) = LT-      type Compare (A lhs lhs lhs lhs) (F rhs rhs rhs rhs) = LT-      type Compare (B lhs lhs lhs lhs) (A rhs rhs rhs rhs) = GT-      type Compare (B lhs lhs lhs lhs) (B rhs rhs rhs rhs) = ThenCmp (ThenCmp (ThenCmp (ThenCmp EQ (Compare lhs rhs)) (Compare lhs rhs)) (Compare lhs rhs)) (Compare lhs rhs)-      type Compare (B lhs lhs lhs lhs) (C rhs rhs rhs rhs) = LT-      type Compare (B lhs lhs lhs lhs) (D rhs rhs rhs rhs) = LT-      type Compare (B lhs lhs lhs lhs) (E rhs rhs rhs rhs) = LT-      type Compare (B lhs lhs lhs lhs) (F rhs rhs rhs rhs) = LT-      type Compare (C lhs lhs lhs lhs) (A rhs rhs rhs rhs) = GT-      type Compare (C lhs lhs lhs lhs) (B rhs rhs rhs rhs) = GT-      type Compare (C lhs lhs lhs lhs) (C rhs rhs rhs rhs) = ThenCmp (ThenCmp (ThenCmp (ThenCmp EQ (Compare lhs rhs)) (Compare lhs rhs)) (Compare lhs rhs)) (Compare lhs rhs)-      type Compare (C lhs lhs lhs lhs) (D rhs rhs rhs rhs) = LT-      type Compare (C lhs lhs lhs lhs) (E rhs rhs rhs rhs) = LT-      type Compare (C lhs lhs lhs lhs) (F rhs rhs rhs rhs) = LT-      type Compare (D lhs lhs lhs lhs) (A rhs rhs rhs rhs) = GT-      type Compare (D lhs lhs lhs lhs) (B rhs rhs rhs rhs) = GT-      type Compare (D lhs lhs lhs lhs) (C rhs rhs rhs rhs) = GT-      type Compare (D lhs lhs lhs lhs) (D rhs rhs rhs rhs) = ThenCmp (ThenCmp (ThenCmp (ThenCmp EQ (Compare lhs rhs)) (Compare lhs rhs)) (Compare lhs rhs)) (Compare lhs rhs)-      type Compare (D lhs lhs lhs lhs) (E rhs rhs rhs rhs) = LT-      type Compare (D lhs lhs lhs lhs) (F rhs rhs rhs rhs) = LT-      type Compare (E lhs lhs lhs lhs) (A rhs rhs rhs rhs) = GT-      type Compare (E lhs lhs lhs lhs) (B rhs rhs rhs rhs) = GT-      type Compare (E lhs lhs lhs lhs) (C rhs rhs rhs rhs) = GT-      type Compare (E lhs lhs lhs lhs) (D rhs rhs rhs rhs) = GT-      type Compare (E lhs lhs lhs lhs) (E rhs rhs rhs rhs) = ThenCmp (ThenCmp (ThenCmp (ThenCmp EQ (Compare lhs rhs)) (Compare lhs rhs)) (Compare lhs rhs)) (Compare lhs rhs)-      type Compare (E lhs lhs lhs lhs) (F rhs rhs rhs rhs) = LT-      type Compare (F lhs lhs lhs lhs) (A rhs rhs rhs rhs) = GT-      type Compare (F lhs lhs lhs lhs) (B rhs rhs rhs rhs) = GT-      type Compare (F lhs lhs lhs lhs) (C rhs rhs rhs rhs) = GT-      type Compare (F lhs lhs lhs lhs) (D rhs rhs rhs rhs) = GT-      type Compare (F lhs lhs lhs lhs) (E rhs rhs rhs rhs) = GT-      type Compare (F lhs lhs lhs lhs) (F rhs rhs rhs rhs) = ThenCmp (ThenCmp (ThenCmp (ThenCmp EQ (Compare lhs rhs)) (Compare lhs rhs)) (Compare lhs rhs)) (Compare lhs rhs)-    type ASym4 (t :: a) (t :: b) (t :: c) (t :: d) = A t t t t-    instance SuppressUnusedWarnings ASym3 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) ASym3KindInference GHC.Tuple.())-    data ASym3 (l :: a) (l :: b) (l :: c) (l :: TyFun d (Foo a b c d))-      = forall arg. Data.Singletons.KindOf (Apply (ASym3 l l l) arg) ~ Data.Singletons.KindOf (ASym4 l l l arg) =>-        ASym3KindInference-    type instance Apply (ASym3 l l l) l = ASym4 l l l l-    instance SuppressUnusedWarnings ASym2 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) ASym2KindInference GHC.Tuple.())-    data ASym2 (l :: a)-               (l :: b)-               (l :: TyFun c (TyFun d (Foo a b c d) -> *))-      = forall arg. Data.Singletons.KindOf (Apply (ASym2 l l) arg) ~ Data.Singletons.KindOf (ASym3 l l arg) =>-        ASym2KindInference-    type instance Apply (ASym2 l l) l = ASym3 l l l-    instance SuppressUnusedWarnings ASym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) ASym1KindInference GHC.Tuple.())-    data ASym1 (l :: a)-               (l :: TyFun b (TyFun c (TyFun d (Foo a b c d) -> *) -> *))-      = forall arg. Data.Singletons.KindOf (Apply (ASym1 l) arg) ~ Data.Singletons.KindOf (ASym2 l arg) =>-        ASym1KindInference-    type instance Apply (ASym1 l) l = ASym2 l l-    instance SuppressUnusedWarnings ASym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) ASym0KindInference GHC.Tuple.())-    data ASym0 (l :: TyFun a (TyFun b (TyFun c (TyFun d (Foo a b c d)-                                                -> *)-                                       -> *)-                              -> *))-      = forall arg. Data.Singletons.KindOf (Apply ASym0 arg) ~ Data.Singletons.KindOf (ASym1 arg) =>-        ASym0KindInference-    type instance Apply ASym0 l = ASym1 l-    type BSym4 (t :: a) (t :: b) (t :: c) (t :: d) = B t t t t-    instance SuppressUnusedWarnings BSym3 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) BSym3KindInference GHC.Tuple.())-    data BSym3 (l :: a) (l :: b) (l :: c) (l :: TyFun d (Foo a b c d))-      = forall arg. Data.Singletons.KindOf (Apply (BSym3 l l l) arg) ~ Data.Singletons.KindOf (BSym4 l l l arg) =>-        BSym3KindInference-    type instance Apply (BSym3 l l l) l = BSym4 l l l l-    instance SuppressUnusedWarnings BSym2 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) BSym2KindInference GHC.Tuple.())-    data BSym2 (l :: a)-               (l :: b)-               (l :: TyFun c (TyFun d (Foo a b c d) -> *))-      = forall arg. Data.Singletons.KindOf (Apply (BSym2 l l) arg) ~ Data.Singletons.KindOf (BSym3 l l arg) =>-        BSym2KindInference-    type instance Apply (BSym2 l l) l = BSym3 l l l-    instance SuppressUnusedWarnings BSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) BSym1KindInference GHC.Tuple.())-    data BSym1 (l :: a)-               (l :: TyFun b (TyFun c (TyFun d (Foo a b c d) -> *) -> *))-      = forall arg. Data.Singletons.KindOf (Apply (BSym1 l) arg) ~ Data.Singletons.KindOf (BSym2 l arg) =>-        BSym1KindInference-    type instance Apply (BSym1 l) l = BSym2 l l-    instance SuppressUnusedWarnings BSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) BSym0KindInference GHC.Tuple.())-    data BSym0 (l :: TyFun a (TyFun b (TyFun c (TyFun d (Foo a b c d)-                                                -> *)-                                       -> *)-                              -> *))-      = forall arg. Data.Singletons.KindOf (Apply BSym0 arg) ~ Data.Singletons.KindOf (BSym1 arg) =>-        BSym0KindInference-    type instance Apply BSym0 l = BSym1 l-    type CSym4 (t :: a) (t :: b) (t :: c) (t :: d) = C t t t t-    instance SuppressUnusedWarnings CSym3 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) CSym3KindInference GHC.Tuple.())-    data CSym3 (l :: a) (l :: b) (l :: c) (l :: TyFun d (Foo a b c d))-      = forall arg. Data.Singletons.KindOf (Apply (CSym3 l l l) arg) ~ Data.Singletons.KindOf (CSym4 l l l arg) =>-        CSym3KindInference-    type instance Apply (CSym3 l l l) l = CSym4 l l l l-    instance SuppressUnusedWarnings CSym2 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) CSym2KindInference GHC.Tuple.())-    data CSym2 (l :: a)-               (l :: b)-               (l :: TyFun c (TyFun d (Foo a b c d) -> *))-      = forall arg. Data.Singletons.KindOf (Apply (CSym2 l l) arg) ~ Data.Singletons.KindOf (CSym3 l l arg) =>-        CSym2KindInference-    type instance Apply (CSym2 l l) l = CSym3 l l l-    instance SuppressUnusedWarnings CSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) CSym1KindInference GHC.Tuple.())-    data CSym1 (l :: a)-               (l :: TyFun b (TyFun c (TyFun d (Foo a b c d) -> *) -> *))-      = forall arg. Data.Singletons.KindOf (Apply (CSym1 l) arg) ~ Data.Singletons.KindOf (CSym2 l arg) =>-        CSym1KindInference-    type instance Apply (CSym1 l) l = CSym2 l l-    instance SuppressUnusedWarnings CSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) CSym0KindInference GHC.Tuple.())-    data CSym0 (l :: TyFun a (TyFun b (TyFun c (TyFun d (Foo a b c d)-                                                -> *)-                                       -> *)-                              -> *))-      = forall arg. Data.Singletons.KindOf (Apply CSym0 arg) ~ Data.Singletons.KindOf (CSym1 arg) =>-        CSym0KindInference-    type instance Apply CSym0 l = CSym1 l-    type DSym4 (t :: a) (t :: b) (t :: c) (t :: d) = D t t t t-    instance SuppressUnusedWarnings DSym3 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) DSym3KindInference GHC.Tuple.())-    data DSym3 (l :: a) (l :: b) (l :: c) (l :: TyFun d (Foo a b c d))-      = forall arg. Data.Singletons.KindOf (Apply (DSym3 l l l) arg) ~ Data.Singletons.KindOf (DSym4 l l l arg) =>-        DSym3KindInference-    type instance Apply (DSym3 l l l) l = DSym4 l l l l-    instance SuppressUnusedWarnings DSym2 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) DSym2KindInference GHC.Tuple.())-    data DSym2 (l :: a)-               (l :: b)-               (l :: TyFun c (TyFun d (Foo a b c d) -> *))-      = forall arg. Data.Singletons.KindOf (Apply (DSym2 l l) arg) ~ Data.Singletons.KindOf (DSym3 l l arg) =>-        DSym2KindInference-    type instance Apply (DSym2 l l) l = DSym3 l l l-    instance SuppressUnusedWarnings DSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) DSym1KindInference GHC.Tuple.())-    data DSym1 (l :: a)-               (l :: TyFun b (TyFun c (TyFun d (Foo a b c d) -> *) -> *))-      = forall arg. Data.Singletons.KindOf (Apply (DSym1 l) arg) ~ Data.Singletons.KindOf (DSym2 l arg) =>-        DSym1KindInference-    type instance Apply (DSym1 l) l = DSym2 l l-    instance SuppressUnusedWarnings DSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) DSym0KindInference GHC.Tuple.())-    data DSym0 (l :: TyFun a (TyFun b (TyFun c (TyFun d (Foo a b c d)-                                                -> *)-                                       -> *)-                              -> *))-      = forall arg. Data.Singletons.KindOf (Apply DSym0 arg) ~ Data.Singletons.KindOf (DSym1 arg) =>-        DSym0KindInference-    type instance Apply DSym0 l = DSym1 l-    type ESym4 (t :: a) (t :: b) (t :: c) (t :: d) = E t t t t-    instance SuppressUnusedWarnings ESym3 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) ESym3KindInference GHC.Tuple.())-    data ESym3 (l :: a) (l :: b) (l :: c) (l :: TyFun d (Foo a b c d))-      = forall arg. Data.Singletons.KindOf (Apply (ESym3 l l l) arg) ~ Data.Singletons.KindOf (ESym4 l l l arg) =>-        ESym3KindInference-    type instance Apply (ESym3 l l l) l = ESym4 l l l l-    instance SuppressUnusedWarnings ESym2 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) ESym2KindInference GHC.Tuple.())-    data ESym2 (l :: a)-               (l :: b)-               (l :: TyFun c (TyFun d (Foo a b c d) -> *))-      = forall arg. Data.Singletons.KindOf (Apply (ESym2 l l) arg) ~ Data.Singletons.KindOf (ESym3 l l arg) =>-        ESym2KindInference-    type instance Apply (ESym2 l l) l = ESym3 l l l-    instance SuppressUnusedWarnings ESym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) ESym1KindInference GHC.Tuple.())-    data ESym1 (l :: a)-               (l :: TyFun b (TyFun c (TyFun d (Foo a b c d) -> *) -> *))-      = forall arg. Data.Singletons.KindOf (Apply (ESym1 l) arg) ~ Data.Singletons.KindOf (ESym2 l arg) =>-        ESym1KindInference-    type instance Apply (ESym1 l) l = ESym2 l l-    instance SuppressUnusedWarnings ESym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) ESym0KindInference GHC.Tuple.())-    data ESym0 (l :: TyFun a (TyFun b (TyFun c (TyFun d (Foo a b c d)-                                                -> *)-                                       -> *)-                              -> *))-      = forall arg. Data.Singletons.KindOf (Apply ESym0 arg) ~ Data.Singletons.KindOf (ESym1 arg) =>-        ESym0KindInference-    type instance Apply ESym0 l = ESym1 l-    type FSym4 (t :: a) (t :: b) (t :: c) (t :: d) = F t t t t-    instance SuppressUnusedWarnings FSym3 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) FSym3KindInference GHC.Tuple.())-    data FSym3 (l :: a) (l :: b) (l :: c) (l :: TyFun d (Foo a b c d))-      = forall arg. Data.Singletons.KindOf (Apply (FSym3 l l l) arg) ~ Data.Singletons.KindOf (FSym4 l l l arg) =>-        FSym3KindInference-    type instance Apply (FSym3 l l l) l = FSym4 l l l l-    instance SuppressUnusedWarnings FSym2 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) FSym2KindInference GHC.Tuple.())-    data FSym2 (l :: a)-               (l :: b)-               (l :: TyFun c (TyFun d (Foo a b c d) -> *))-      = forall arg. Data.Singletons.KindOf (Apply (FSym2 l l) arg) ~ Data.Singletons.KindOf (FSym3 l l arg) =>-        FSym2KindInference-    type instance Apply (FSym2 l l) l = FSym3 l l l-    instance SuppressUnusedWarnings FSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) FSym1KindInference GHC.Tuple.())-    data FSym1 (l :: a)-               (l :: TyFun b (TyFun c (TyFun d (Foo a b c d) -> *) -> *))-      = forall arg. Data.Singletons.KindOf (Apply (FSym1 l) arg) ~ Data.Singletons.KindOf (FSym2 l arg) =>-        FSym1KindInference-    type instance Apply (FSym1 l) l = FSym2 l l-    instance SuppressUnusedWarnings FSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) FSym0KindInference GHC.Tuple.())-    data FSym0 (l :: TyFun a (TyFun b (TyFun c (TyFun d (Foo a b c d)-                                                -> *)-                                       -> *)-                              -> *))-      = forall arg. Data.Singletons.KindOf (Apply FSym0 arg) ~ Data.Singletons.KindOf (FSym1 arg) =>-        FSym0KindInference-    type instance Apply FSym0 l = FSym1 l
− tests/compile-and-dump/Promote/OrdDeriving.hs
@@ -1,28 +0,0 @@-module Promote.OrdDeriving where--import Data.Promotion.Prelude-import Data.Promotion.TH--$(promote [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)-  |])--foo1a :: Proxy (Zero :< Succ Zero)-foo1a = Proxy--foo1b :: Proxy True-foo1b = foo1a--foo2a :: Proxy (Succ (Succ Zero) `Compare` Zero)-foo2a = Proxy--foo2b :: Proxy GT-foo2b = foo2a
+ tests/compile-and-dump/Promote/Pragmas.ghc710.template view
@@ -0,0 +1,12 @@+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
− tests/compile-and-dump/Promote/Pragmas.ghc78.template
@@ -1,12 +0,0 @@-Promote/Pragmas.hs:0:0: Splicing declarations-    promote-      [d| {-# INLINE foo #-}-          foo :: Bool-          foo = True |]-  ======>-    Promote/Pragmas.hs:(0,0)-(0,0)-    {-# INLINE foo #-}-    foo :: Bool-    foo = True-    type FooSym0 = Foo-    type Foo = (TrueSym0 :: Bool)
+ tests/compile-and-dump/Promote/Prelude.ghc710.template view
@@ -0,0 +1,17 @@+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 (t :: Nat) = Odd t+    instance SuppressUnusedWarnings OddSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) OddSym0KindInference GHC.Tuple.())+    data OddSym0 (l :: TyFun Nat Bool)+      = forall arg. Data.Singletons.KindOf (Apply OddSym0 arg) ~ Data.Singletons.KindOf (OddSym1 arg) =>+        OddSym0KindInference+    type instance Apply OddSym0 l = OddSym1 l+    type family Odd (a :: Nat) :: Bool where+      Odd 0 = FalseSym0+      Odd n = Apply (Apply ($$) (Apply (Apply (:.$) NotSym0) OddSym0)) (Apply (Apply (:-$) n) (FromInteger 1))
− tests/compile-and-dump/Promote/Prelude.ghc78.template
@@ -1,18 +0,0 @@-Promote/Prelude.hs:0:0: Splicing declarations-    promoteOnly-      [d| odd :: Nat -> Bool-          odd 0 = False-          odd n = not . odd $ n - 1 |]-  ======>-    Promote/Prelude.hs:(0,0)-(0,0)-    type OddSym1 (t :: Nat) = Odd t-    instance SuppressUnusedWarnings OddSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) OddSym0KindInference GHC.Tuple.())-    data OddSym0 (l :: TyFun Nat Bool)-      = forall arg. Data.Singletons.KindOf (Apply OddSym0 arg) ~ Data.Singletons.KindOf (OddSym1 arg) =>-        OddSym0KindInference-    type instance Apply OddSym0 l = OddSym1 l-    type family Odd (a :: Nat) :: Bool where-      Odd 0 = FalseSym0-      Odd n = Apply (Apply ($$) (Apply (Apply (:.$) NotSym0) OddSym0)) (Apply (Apply (:-$) n) 1)
tests/compile-and-dump/Promote/Prelude.hs view
@@ -4,6 +4,7 @@ import Data.Promotion.Prelude import Data.Promotion.Prelude.List import Data.Proxy+import GHC.TypeLits  lengthTest1a :: Proxy (Length '[True, True, True, True]) lengthTest1a = Proxy
− tests/compile-and-dump/Promote/TopLevelPatterns.ghc78.template
@@ -1,152 +0,0 @@-Promote/TopLevelPatterns.hs:0:0: Splicing declarations-    promote-      [d| id :: a -> a-          id x = x-          not :: Bool -> Bool-          not True = False-          not False = True-          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]-          -          data Bool = False | True-          data Foo = Bar Bool Bool |]-  ======>-    Promote/TopLevelPatterns.hs:(0,0)-(0,0)-    data Bool = False | True-    data Foo = Bar Bool Bool-    id :: forall a. a -> a-    id x = x-    not :: Bool -> Bool-    not True = False-    not False = True-    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_0123456789 a_0123456789 t where-      Case_0123456789 a_0123456789 '[y_0123456789, z] = y_0123456789-    type family Case_0123456789 a_0123456789 t where-      Case_0123456789 a_0123456789 '[z, y_0123456789] = y_0123456789-    type family Case_0123456789 a_0123456789 t where-      Case_0123456789 a_0123456789 '(y_0123456789, z) = y_0123456789-    type family Case_0123456789 a_0123456789 t where-      Case_0123456789 a_0123456789 '(z, y_0123456789) = y_0123456789-    type family Case_0123456789 t where-      Case_0123456789 (Bar y_0123456789 z) = y_0123456789-    type family Case_0123456789 t where-      Case_0123456789 (Bar z y_0123456789) = y_0123456789-    type family Case_0123456789 t where-      Case_0123456789 '[y_0123456789, z] = y_0123456789-    type family Case_0123456789 t where-      Case_0123456789 '[z, y_0123456789] = y_0123456789-    type NotSym1 (t :: Bool) = Not t-    instance SuppressUnusedWarnings NotSym0 where-      suppressUnusedWarnings _-        = Data.Tuple.snd (GHC.Tuple.(,) NotSym0KindInference GHC.Tuple.())-    data NotSym0 (l :: TyFun Bool Bool)-      = forall arg. KindOf (Apply NotSym0 arg) ~ KindOf (NotSym1 arg) =>-        NotSym0KindInference-    type instance Apply NotSym0 l = NotSym1 l-    type IdSym1 (t :: a) = Id t-    instance SuppressUnusedWarnings IdSym0 where-      suppressUnusedWarnings _-        = Data.Tuple.snd (GHC.Tuple.(,) IdSym0KindInference GHC.Tuple.())-    data IdSym0 (l :: TyFun a a)-      = forall arg. KindOf (Apply IdSym0 arg) ~ KindOf (IdSym1 arg) =>-        IdSym0KindInference-    type instance Apply IdSym0 l = IdSym1 l-    type FSym1 (t :: Bool) = F t-    instance SuppressUnusedWarnings FSym0 where-      suppressUnusedWarnings _-        = Data.Tuple.snd (GHC.Tuple.(,) FSym0KindInference GHC.Tuple.())-    data FSym0 (l :: TyFun Bool Bool)-      = forall arg. KindOf (Apply FSym0 arg) ~ KindOf (FSym1 arg) =>-        FSym0KindInference-    type instance Apply FSym0 l = FSym1 l-    type GSym1 (t :: Bool) = G t-    instance SuppressUnusedWarnings GSym0 where-      suppressUnusedWarnings _-        = Data.Tuple.snd (GHC.Tuple.(,) GSym0KindInference GHC.Tuple.())-    data GSym0 (l :: TyFun Bool Bool)-      = forall arg. KindOf (Apply GSym0 arg) ~ KindOf (GSym1 arg) =>-        GSym0KindInference-    type instance Apply GSym0 l = GSym1 l-    type HSym1 (t :: Bool) = H t-    instance SuppressUnusedWarnings HSym0 where-      suppressUnusedWarnings _-        = Data.Tuple.snd (GHC.Tuple.(,) HSym0KindInference GHC.Tuple.())-    data HSym0 (l :: TyFun Bool Bool)-      = forall arg. KindOf (Apply HSym0 arg) ~ KindOf (HSym1 arg) =>-        HSym0KindInference-    type instance Apply HSym0 l = HSym1 l-    type ISym1 (t :: Bool) = I t-    instance SuppressUnusedWarnings ISym0 where-      suppressUnusedWarnings _-        = Data.Tuple.snd (GHC.Tuple.(,) ISym0KindInference GHC.Tuple.())-    data ISym0 (l :: TyFun Bool Bool)-      = forall arg. KindOf (Apply ISym0 arg) ~ KindOf (ISym1 arg) =>-        ISym0KindInference-    type instance Apply ISym0 l = ISym1 l-    type JSym0 = J-    type KSym0 = K-    type LSym0 = L-    type MSym0 = M-    type X_0123456789Sym0 = X_0123456789-    type X_0123456789Sym0 = X_0123456789-    type X_0123456789Sym0 = X_0123456789-    type X_0123456789Sym0 = X_0123456789-    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 F (a :: Bool) :: Bool where-      F a_0123456789 = Apply (Case_0123456789 a_0123456789 X_0123456789Sym0) a_0123456789-    type family G (a :: Bool) :: Bool where-      G a_0123456789 = Apply (Case_0123456789 a_0123456789 X_0123456789Sym0) a_0123456789-    type family H (a :: Bool) :: Bool where-      H a_0123456789 = Apply (Case_0123456789 a_0123456789 X_0123456789Sym0) a_0123456789-    type family I (a :: Bool) :: Bool where-      I a_0123456789 = Apply (Case_0123456789 a_0123456789 X_0123456789Sym0) a_0123456789-    type J = (Case_0123456789 X_0123456789Sym0 :: Bool)-    type K = (Case_0123456789 X_0123456789Sym0 :: Bool)-    type L = (Case_0123456789 X_0123456789Sym0 :: Bool)-    type M = (Case_0123456789 X_0123456789Sym0 :: Bool)-    type X_0123456789 =-        Apply (Apply (:$) NotSym0) (Apply (Apply (:$) IdSym0) '[])-    type X_0123456789 = Apply (Apply Tuple2Sym0 FSym0) GSym0-    type X_0123456789 =-        Apply (Apply BarSym0 TrueSym0) (Apply HSym0 FalseSym0)-    type X_0123456789 =-        Apply (Apply (:$) (Apply NotSym0 TrueSym0)) (Apply (Apply (:$) (Apply IdSym0 FalseSym0)) '[])-    type FalseSym0 = False-    type TrueSym0 = True-    type BarSym2 (t :: Bool) (t :: Bool) = Bar t t-    instance SuppressUnusedWarnings BarSym1 where-      suppressUnusedWarnings _-        = Data.Tuple.snd (GHC.Tuple.(,) BarSym1KindInference GHC.Tuple.())-    data BarSym1 (l :: Bool) (l :: TyFun Bool Foo)-      = forall arg. KindOf (Apply (BarSym1 l) arg) ~ KindOf (BarSym2 l arg) =>-        BarSym1KindInference-    type instance Apply (BarSym1 l) l = BarSym2 l l-    instance SuppressUnusedWarnings BarSym0 where-      suppressUnusedWarnings _-        = Data.Tuple.snd (GHC.Tuple.(,) BarSym0KindInference GHC.Tuple.())-    data BarSym0 (l :: TyFun Bool (TyFun Bool Foo -> *))-      = forall arg. KindOf (Apply BarSym0 arg) ~ KindOf (BarSym1 arg) =>-        BarSym0KindInference-    type instance Apply BarSym0 l = BarSym1 l
− tests/compile-and-dump/Promote/TopLevelPatterns.hs
@@ -1,34 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-}-{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}--module Promote.TopLevelPatterns where--import Data.Singletons-import Data.Singletons.Prelude.List-import Data.Singletons.SuppressUnusedWarnings-import Data.Singletons.TH hiding (STrue, SFalse, TrueSym0, FalseSym0)---- Remove this test once #54 is fixed-$(promote [d|-  data Bool = False | True-  data Foo = Bar Bool Bool--  id :: a -> a-  id x = x--  not :: Bool -> Bool-  not True  = False-  not False = True--  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]- |])
+ tests/compile-and-dump/Singletons/AsPattern.ghc710.template view
@@ -0,0 +1,393 @@+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@GHC.Types.[] = p+    foo p@[_] = p+    foo p@(_ GHC.Types.: (_ GHC.Types.: _)) = p+    type BazSym3 (t :: Nat) (t :: Nat) (t :: Nat) = Baz t t t+    instance SuppressUnusedWarnings BazSym2 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) BazSym2KindInference GHC.Tuple.())+    data BazSym2 (l :: Nat) (l :: Nat) (l :: TyFun Nat Baz)+      = forall arg. KindOf (Apply (BazSym2 l l) arg) ~ KindOf (BazSym3 l l arg) =>+        BazSym2KindInference+    type instance Apply (BazSym2 l l) l = BazSym3 l l l+    instance SuppressUnusedWarnings BazSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) BazSym1KindInference GHC.Tuple.())+    data BazSym1 (l :: Nat) (l :: TyFun Nat (TyFun Nat Baz -> *))+      = forall arg. KindOf (Apply (BazSym1 l) arg) ~ KindOf (BazSym2 l arg) =>+        BazSym1KindInference+    type instance Apply (BazSym1 l) l = BazSym2 l l+    instance SuppressUnusedWarnings BazSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) BazSym0KindInference GHC.Tuple.())+    data BazSym0 (l :: TyFun Nat (TyFun Nat (TyFun Nat Baz -> *) -> *))+      = forall arg. KindOf (Apply BazSym0 arg) ~ KindOf (BazSym1 arg) =>+        BazSym0KindInference+    type instance Apply BazSym0 l = BazSym1 l+    type Let0123456789PSym0 = Let0123456789P+    type family Let0123456789P where+      Let0123456789P = '[]+    type Let0123456789PSym1 t = Let0123456789P t+    instance SuppressUnusedWarnings Let0123456789PSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789PSym0KindInference GHC.Tuple.())+    data Let0123456789PSym0 l+      = forall arg. KindOf (Apply Let0123456789PSym0 arg) ~ KindOf (Let0123456789PSym1 arg) =>+        Let0123456789PSym0KindInference+    type instance Apply Let0123456789PSym0 l = Let0123456789PSym1 l+    type family Let0123456789P wild_0123456789 where+      Let0123456789P wild_0123456789 = Apply (Apply (:$) wild_0123456789) '[]+    type Let0123456789PSym3 t t t = Let0123456789P t t t+    instance SuppressUnusedWarnings Let0123456789PSym2 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789PSym2KindInference GHC.Tuple.())+    data Let0123456789PSym2 l l l+      = forall arg. KindOf (Apply (Let0123456789PSym2 l l) arg) ~ KindOf (Let0123456789PSym3 l l arg) =>+        Let0123456789PSym2KindInference+    type instance Apply (Let0123456789PSym2 l l) l = Let0123456789PSym3 l l l+    instance SuppressUnusedWarnings Let0123456789PSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789PSym1KindInference GHC.Tuple.())+    data Let0123456789PSym1 l l+      = forall arg. KindOf (Apply (Let0123456789PSym1 l) arg) ~ KindOf (Let0123456789PSym2 l arg) =>+        Let0123456789PSym1KindInference+    type instance Apply (Let0123456789PSym1 l) l = Let0123456789PSym2 l l+    instance SuppressUnusedWarnings Let0123456789PSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789PSym0KindInference GHC.Tuple.())+    data Let0123456789PSym0 l+      = forall arg. KindOf (Apply Let0123456789PSym0 arg) ~ KindOf (Let0123456789PSym1 arg) =>+        Let0123456789PSym0KindInference+    type instance Apply Let0123456789PSym0 l = Let0123456789PSym1 l+    type family Let0123456789P wild_0123456789+                               wild_0123456789+                               wild_0123456789 where+      Let0123456789P wild_0123456789 wild_0123456789 wild_0123456789 = Apply (Apply (:$) wild_0123456789) (Apply (Apply (:$) wild_0123456789) wild_0123456789)+    type Let0123456789PSym2 t t = Let0123456789P t t+    instance SuppressUnusedWarnings Let0123456789PSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789PSym1KindInference GHC.Tuple.())+    data Let0123456789PSym1 l l+      = forall arg. KindOf (Apply (Let0123456789PSym1 l) arg) ~ KindOf (Let0123456789PSym2 l arg) =>+        Let0123456789PSym1KindInference+    type instance Apply (Let0123456789PSym1 l) l = Let0123456789PSym2 l l+    instance SuppressUnusedWarnings Let0123456789PSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789PSym0KindInference GHC.Tuple.())+    data Let0123456789PSym0 l+      = forall arg. KindOf (Apply Let0123456789PSym0 arg) ~ KindOf (Let0123456789PSym1 arg) =>+        Let0123456789PSym0KindInference+    type instance Apply Let0123456789PSym0 l = Let0123456789PSym1 l+    type family Let0123456789P wild_0123456789 wild_0123456789 where+      Let0123456789P wild_0123456789 wild_0123456789 = Apply (Apply Tuple2Sym0 wild_0123456789) wild_0123456789+    type Let0123456789PSym0 = Let0123456789P+    type family Let0123456789P where+      Let0123456789P = NothingSym0+    type Let0123456789PSym3 t t t = Let0123456789P t t t+    instance SuppressUnusedWarnings Let0123456789PSym2 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789PSym2KindInference GHC.Tuple.())+    data Let0123456789PSym2 l l l+      = forall arg. KindOf (Apply (Let0123456789PSym2 l l) arg) ~ KindOf (Let0123456789PSym3 l l arg) =>+        Let0123456789PSym2KindInference+    type instance Apply (Let0123456789PSym2 l l) l = Let0123456789PSym3 l l l+    instance SuppressUnusedWarnings Let0123456789PSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789PSym1KindInference GHC.Tuple.())+    data Let0123456789PSym1 l l+      = forall arg. KindOf (Apply (Let0123456789PSym1 l) arg) ~ KindOf (Let0123456789PSym2 l arg) =>+        Let0123456789PSym1KindInference+    type instance Apply (Let0123456789PSym1 l) l = Let0123456789PSym2 l l+    instance SuppressUnusedWarnings Let0123456789PSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789PSym0KindInference GHC.Tuple.())+    data Let0123456789PSym0 l+      = forall arg. KindOf (Apply Let0123456789PSym0 arg) ~ KindOf (Let0123456789PSym1 arg) =>+        Let0123456789PSym0KindInference+    type instance Apply Let0123456789PSym0 l = Let0123456789PSym1 l+    type family Let0123456789P wild_0123456789+                               wild_0123456789+                               wild_0123456789 where+      Let0123456789P wild_0123456789 wild_0123456789 wild_0123456789 = Apply JustSym0 (Apply (Apply (Apply BazSym0 wild_0123456789) wild_0123456789) wild_0123456789)+    type Let0123456789XSym1 t = Let0123456789X t+    instance SuppressUnusedWarnings Let0123456789XSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789XSym0KindInference GHC.Tuple.())+    data Let0123456789XSym0 l+      = forall arg. KindOf (Apply Let0123456789XSym0 arg) ~ KindOf (Let0123456789XSym1 arg) =>+        Let0123456789XSym0KindInference+    type instance Apply Let0123456789XSym0 l = Let0123456789XSym1 l+    type family Let0123456789X wild_0123456789 where+      Let0123456789X wild_0123456789 = Apply JustSym0 wild_0123456789+    type Let0123456789PSym0 = Let0123456789P+    type family Let0123456789P where+      Let0123456789P = NothingSym0+    type FooSym1 (t :: [Nat]) = Foo t+    instance SuppressUnusedWarnings FooSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) FooSym0KindInference GHC.Tuple.())+    data FooSym0 (l :: TyFun [Nat] [Nat])+      = forall arg. KindOf (Apply FooSym0 arg) ~ KindOf (FooSym1 arg) =>+        FooSym0KindInference+    type instance Apply FooSym0 l = FooSym1 l+    type TupSym1 (t :: (Nat, Nat)) = Tup t+    instance SuppressUnusedWarnings TupSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) TupSym0KindInference GHC.Tuple.())+    data TupSym0 (l :: TyFun (Nat, Nat) (Nat, Nat))+      = forall arg. KindOf (Apply TupSym0 arg) ~ KindOf (TupSym1 arg) =>+        TupSym0KindInference+    type instance Apply TupSym0 l = TupSym1 l+    type Baz_Sym1 (t :: Maybe Baz) = Baz_ t+    instance SuppressUnusedWarnings Baz_Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Baz_Sym0KindInference GHC.Tuple.())+    data Baz_Sym0 (l :: TyFun (Maybe Baz) (Maybe Baz))+      = forall arg. KindOf (Apply Baz_Sym0 arg) ~ KindOf (Baz_Sym1 arg) =>+        Baz_Sym0KindInference+    type instance Apply Baz_Sym0 l = Baz_Sym1 l+    type BarSym1 (t :: Maybe Nat) = Bar t+    instance SuppressUnusedWarnings BarSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) BarSym0KindInference GHC.Tuple.())+    data BarSym0 (l :: TyFun (Maybe Nat) (Maybe Nat))+      = forall arg. KindOf (Apply BarSym0 arg) ~ KindOf (BarSym1 arg) =>+        BarSym0KindInference+    type instance Apply BarSym0 l = BarSym1 l+    type MaybePlusSym1 (t :: Maybe Nat) = MaybePlus t+    instance SuppressUnusedWarnings MaybePlusSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) MaybePlusSym0KindInference GHC.Tuple.())+    data MaybePlusSym0 (l :: TyFun (Maybe Nat) (Maybe Nat))+      = forall arg. KindOf (Apply MaybePlusSym0 arg) ~ KindOf (MaybePlusSym1 arg) =>+        MaybePlusSym0KindInference+    type instance Apply MaybePlusSym0 l = MaybePlusSym1 l+    type family Foo (a :: [Nat]) :: [Nat] where+      Foo '[] = Let0123456789PSym0+      Foo '[wild_0123456789] = Let0123456789PSym1 wild_0123456789+      Foo ((:) wild_0123456789 ((:) wild_0123456789 wild_0123456789)) = Let0123456789PSym3 wild_0123456789 wild_0123456789 wild_0123456789+    type family Tup (a :: (Nat, Nat)) :: (Nat, Nat) where+      Tup '(wild_0123456789,+            wild_0123456789) = Let0123456789PSym2 wild_0123456789 wild_0123456789+    type family Baz_ (a :: Maybe Baz) :: Maybe Baz where+      Baz_ Nothing = Let0123456789PSym0+      Baz_ (Just (Baz wild_0123456789 wild_0123456789 wild_0123456789)) = Let0123456789PSym3 wild_0123456789 wild_0123456789 wild_0123456789+    type family Bar (a :: Maybe Nat) :: Maybe Nat where+      Bar (Just wild_0123456789) = Let0123456789XSym1 wild_0123456789+      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 = Let0123456789PSym0+    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+          lambda :: t ~ '[] => Sing (Apply FooSym0 '[] :: [Nat])+          lambda+            = let+                sP :: Sing Let0123456789PSym0+                sP = SNil+              in sP+        in lambda+    sFoo (SCons sWild_0123456789 SNil)+      = let+          lambda ::+            forall wild_0123456789. t ~ Apply (Apply (:$) wild_0123456789) '[] =>+            Sing wild_0123456789+            -> Sing (Apply FooSym0 (Apply (Apply (:$) wild_0123456789) '[]) :: [Nat])+          lambda wild_0123456789+            = let+                sP :: Sing (Let0123456789PSym1 wild_0123456789)+                sP+                  = applySing+                      (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) wild_0123456789)+                      SNil+              in sP+        in lambda sWild_0123456789+    sFoo+      (SCons sWild_0123456789 (SCons sWild_0123456789 sWild_0123456789))+      = let+          lambda ::+            forall wild_0123456789+                   wild_0123456789+                   wild_0123456789. t ~ Apply (Apply (:$) wild_0123456789) (Apply (Apply (:$) wild_0123456789) wild_0123456789) =>+            Sing wild_0123456789+            -> Sing wild_0123456789+               -> Sing wild_0123456789+                  -> Sing (Apply FooSym0 (Apply (Apply (:$) wild_0123456789) (Apply (Apply (:$) wild_0123456789) wild_0123456789)) :: [Nat])+          lambda wild_0123456789 wild_0123456789 wild_0123456789+            = let+                sP ::+                  Sing (Let0123456789PSym3 wild_0123456789 wild_0123456789 wild_0123456789)+                sP+                  = applySing+                      (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) wild_0123456789)+                      (applySing+                         (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) wild_0123456789)+                         wild_0123456789)+              in sP+        in lambda sWild_0123456789 sWild_0123456789 sWild_0123456789+    sTup (STuple2 sWild_0123456789 sWild_0123456789)+      = let+          lambda ::+            forall wild_0123456789+                   wild_0123456789. t ~ Apply (Apply Tuple2Sym0 wild_0123456789) wild_0123456789 =>+            Sing wild_0123456789+            -> Sing wild_0123456789+               -> Sing (Apply TupSym0 (Apply (Apply Tuple2Sym0 wild_0123456789) wild_0123456789) :: (Nat,+                                                                                                     Nat))+          lambda wild_0123456789 wild_0123456789+            = let+                sP :: Sing (Let0123456789PSym2 wild_0123456789 wild_0123456789)+                sP+                  = applySing+                      (applySing+                         (singFun2 (Proxy :: Proxy Tuple2Sym0) STuple2) wild_0123456789)+                      wild_0123456789+              in sP+        in lambda sWild_0123456789 sWild_0123456789+    sBaz_ SNothing+      = let+          lambda ::+            t ~ NothingSym0 => Sing (Apply Baz_Sym0 NothingSym0 :: Maybe Baz)+          lambda+            = let+                sP :: Sing Let0123456789PSym0+                sP = SNothing+              in sP+        in lambda+    sBaz_+      (SJust (SBaz sWild_0123456789 sWild_0123456789 sWild_0123456789))+      = let+          lambda ::+            forall wild_0123456789+                   wild_0123456789+                   wild_0123456789. t ~ Apply JustSym0 (Apply (Apply (Apply BazSym0 wild_0123456789) wild_0123456789) wild_0123456789) =>+            Sing wild_0123456789+            -> Sing wild_0123456789+               -> Sing wild_0123456789+                  -> Sing (Apply Baz_Sym0 (Apply JustSym0 (Apply (Apply (Apply BazSym0 wild_0123456789) wild_0123456789) wild_0123456789)) :: Maybe Baz)+          lambda wild_0123456789 wild_0123456789 wild_0123456789+            = let+                sP ::+                  Sing (Let0123456789PSym3 wild_0123456789 wild_0123456789 wild_0123456789)+                sP+                  = applySing+                      (singFun1 (Proxy :: Proxy JustSym0) SJust)+                      (applySing+                         (applySing+                            (applySing+                               (singFun3 (Proxy :: Proxy BazSym0) SBaz) wild_0123456789)+                            wild_0123456789)+                         wild_0123456789)+              in sP+        in lambda sWild_0123456789 sWild_0123456789 sWild_0123456789+    sBar (SJust sWild_0123456789)+      = let+          lambda ::+            forall wild_0123456789. t ~ Apply JustSym0 wild_0123456789 =>+            Sing wild_0123456789+            -> Sing (Apply BarSym0 (Apply JustSym0 wild_0123456789) :: Maybe Nat)+          lambda wild_0123456789+            = let+                sX :: Sing (Let0123456789XSym1 wild_0123456789)+                sX+                  = applySing+                      (singFun1 (Proxy :: Proxy JustSym0) SJust) wild_0123456789+              in sX+        in lambda sWild_0123456789+    sBar SNothing+      = let+          lambda ::+            t ~ NothingSym0 => Sing (Apply BarSym0 NothingSym0 :: Maybe Nat)+          lambda = SNothing+        in lambda+    sMaybePlus (SJust sN)+      = let+          lambda ::+            forall n. t ~ Apply JustSym0 n =>+            Sing n+            -> Sing (Apply MaybePlusSym0 (Apply JustSym0 n) :: Maybe Nat)+          lambda n+            = applySing+                (singFun1 (Proxy :: Proxy JustSym0) SJust)+                (applySing+                   (applySing+                      (singFun2 (Proxy :: Proxy PlusSym0) sPlus)+                      (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))+                   n)+        in lambda sN+    sMaybePlus SNothing+      = let+          lambda ::+            t ~ NothingSym0 =>+            Sing (Apply MaybePlusSym0 NothingSym0 :: Maybe Nat)+          lambda+            = let+                sP :: Sing Let0123456789PSym0+                sP = SNothing+              in sP+        in lambda+    data instance Sing (z :: Baz)+      = forall (n :: Nat) (n :: Nat) (n :: Nat). z ~ Baz n n n =>+        SBaz (Sing (n :: Nat)) (Sing (n :: Nat)) (Sing (n :: Nat))+    type SBaz = (Sing :: Baz -> *)+    instance SingKind (KProxy :: KProxy Baz) where+      type DemoteRep (KProxy :: KProxy Baz) = Baz+      fromSing (SBaz b b b) = Baz (fromSing b) (fromSing b) (fromSing b)+      toSing (Baz b b b)+        = case+              GHC.Tuple.(,,)+                (toSing b :: SomeSing (KProxy :: KProxy Nat))+                (toSing b :: SomeSing (KProxy :: KProxy Nat))+                (toSing b :: SomeSing (KProxy :: KProxy Nat))+          of {+            GHC.Tuple.(,,) (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
− tests/compile-and-dump/Singletons/AsPattern.ghc78.template
@@ -1,362 +0,0 @@-Singletons/AsPattern.hs: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 |]-  ======>-    Singletons/AsPattern.hs:(0,0)-(0,0)-    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@GHC.Types.[] = p-    foo p@[_] = p-    foo p@(_ GHC.Types.: _) = p-    type BazSym3 (t :: Nat) (t :: Nat) (t :: Nat) = Baz t t t-    instance SuppressUnusedWarnings BazSym2 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) BazSym2KindInference GHC.Tuple.())-    data BazSym2 (l :: Nat) (l :: Nat) (l :: TyFun Nat Baz)-      = forall arg. KindOf (Apply (BazSym2 l l) arg) ~ KindOf (BazSym3 l l arg) =>-        BazSym2KindInference-    type instance Apply (BazSym2 l l) l = BazSym3 l l l-    instance SuppressUnusedWarnings BazSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) BazSym1KindInference GHC.Tuple.())-    data BazSym1 (l :: Nat) (l :: TyFun Nat (TyFun Nat Baz -> *))-      = forall arg. KindOf (Apply (BazSym1 l) arg) ~ KindOf (BazSym2 l arg) =>-        BazSym1KindInference-    type instance Apply (BazSym1 l) l = BazSym2 l l-    instance SuppressUnusedWarnings BazSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) BazSym0KindInference GHC.Tuple.())-    data BazSym0 (l :: TyFun Nat (TyFun Nat (TyFun Nat Baz -> *) -> *))-      = forall arg. KindOf (Apply BazSym0 arg) ~ KindOf (BazSym1 arg) =>-        BazSym0KindInference-    type instance Apply BazSym0 l = BazSym1 l-    type Let0123456789PSym0 = Let0123456789P-    type Let0123456789P = '[]-    type Let0123456789PSym1 t = Let0123456789P t-    instance SuppressUnusedWarnings Let0123456789PSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789PSym0KindInference GHC.Tuple.())-    data Let0123456789PSym0 l-      = forall arg. KindOf (Apply Let0123456789PSym0 arg) ~ KindOf (Let0123456789PSym1 arg) =>-        Let0123456789PSym0KindInference-    type instance Apply Let0123456789PSym0 l = Let0123456789PSym1 l-    type Let0123456789P wild_0123456789 =-        Apply (Apply (:$) wild_0123456789) '[]-    type Let0123456789PSym2 t t = Let0123456789P t t-    instance SuppressUnusedWarnings Let0123456789PSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789PSym1KindInference GHC.Tuple.())-    data Let0123456789PSym1 l l-      = forall arg. KindOf (Apply (Let0123456789PSym1 l) arg) ~ KindOf (Let0123456789PSym2 l arg) =>-        Let0123456789PSym1KindInference-    type instance Apply (Let0123456789PSym1 l) l = Let0123456789PSym2 l l-    instance SuppressUnusedWarnings Let0123456789PSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789PSym0KindInference GHC.Tuple.())-    data Let0123456789PSym0 l-      = forall arg. KindOf (Apply Let0123456789PSym0 arg) ~ KindOf (Let0123456789PSym1 arg) =>-        Let0123456789PSym0KindInference-    type instance Apply Let0123456789PSym0 l = Let0123456789PSym1 l-    type Let0123456789P wild_0123456789 wild_0123456789 =-        Apply (Apply (:$) wild_0123456789) wild_0123456789-    type Let0123456789PSym2 t t = Let0123456789P t t-    instance SuppressUnusedWarnings Let0123456789PSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789PSym1KindInference GHC.Tuple.())-    data Let0123456789PSym1 l l-      = forall arg. KindOf (Apply (Let0123456789PSym1 l) arg) ~ KindOf (Let0123456789PSym2 l arg) =>-        Let0123456789PSym1KindInference-    type instance Apply (Let0123456789PSym1 l) l = Let0123456789PSym2 l l-    instance SuppressUnusedWarnings Let0123456789PSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789PSym0KindInference GHC.Tuple.())-    data Let0123456789PSym0 l-      = forall arg. KindOf (Apply Let0123456789PSym0 arg) ~ KindOf (Let0123456789PSym1 arg) =>-        Let0123456789PSym0KindInference-    type instance Apply Let0123456789PSym0 l = Let0123456789PSym1 l-    type Let0123456789P wild_0123456789 wild_0123456789 =-        Apply (Apply Tuple2Sym0 wild_0123456789) wild_0123456789-    type Let0123456789PSym0 = Let0123456789P-    type Let0123456789P = NothingSym0-    type Let0123456789PSym3 t t t = Let0123456789P t t t-    instance SuppressUnusedWarnings Let0123456789PSym2 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789PSym2KindInference GHC.Tuple.())-    data Let0123456789PSym2 l l l-      = forall arg. KindOf (Apply (Let0123456789PSym2 l l) arg) ~ KindOf (Let0123456789PSym3 l l arg) =>-        Let0123456789PSym2KindInference-    type instance Apply (Let0123456789PSym2 l l) l = Let0123456789PSym3 l l l-    instance SuppressUnusedWarnings Let0123456789PSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789PSym1KindInference GHC.Tuple.())-    data Let0123456789PSym1 l l-      = forall arg. KindOf (Apply (Let0123456789PSym1 l) arg) ~ KindOf (Let0123456789PSym2 l arg) =>-        Let0123456789PSym1KindInference-    type instance Apply (Let0123456789PSym1 l) l = Let0123456789PSym2 l l-    instance SuppressUnusedWarnings Let0123456789PSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789PSym0KindInference GHC.Tuple.())-    data Let0123456789PSym0 l-      = forall arg. KindOf (Apply Let0123456789PSym0 arg) ~ KindOf (Let0123456789PSym1 arg) =>-        Let0123456789PSym0KindInference-    type instance Apply Let0123456789PSym0 l = Let0123456789PSym1 l-    type Let0123456789P wild_0123456789-                         wild_0123456789-                         wild_0123456789 =-        Apply JustSym0 (Apply (Apply (Apply BazSym0 wild_0123456789) wild_0123456789) wild_0123456789)-    type Let0123456789XSym1 t = Let0123456789X t-    instance SuppressUnusedWarnings Let0123456789XSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789XSym0KindInference GHC.Tuple.())-    data Let0123456789XSym0 l-      = forall arg. KindOf (Apply Let0123456789XSym0 arg) ~ KindOf (Let0123456789XSym1 arg) =>-        Let0123456789XSym0KindInference-    type instance Apply Let0123456789XSym0 l = Let0123456789XSym1 l-    type Let0123456789X wild_0123456789 =-        Apply JustSym0 wild_0123456789-    type Let0123456789PSym0 = Let0123456789P-    type Let0123456789P = NothingSym0-    type FooSym1 (t :: [Nat]) = Foo t-    instance SuppressUnusedWarnings FooSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) FooSym0KindInference GHC.Tuple.())-    data FooSym0 (l :: TyFun [Nat] [Nat])-      = forall arg. KindOf (Apply FooSym0 arg) ~ KindOf (FooSym1 arg) =>-        FooSym0KindInference-    type instance Apply FooSym0 l = FooSym1 l-    type TupSym1 (t :: (Nat, Nat)) = Tup t-    instance SuppressUnusedWarnings TupSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) TupSym0KindInference GHC.Tuple.())-    data TupSym0 (l :: TyFun (Nat, Nat) (Nat, Nat))-      = forall arg. KindOf (Apply TupSym0 arg) ~ KindOf (TupSym1 arg) =>-        TupSym0KindInference-    type instance Apply TupSym0 l = TupSym1 l-    type Baz_Sym1 (t :: Maybe Baz) = Baz_ t-    instance SuppressUnusedWarnings Baz_Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Baz_Sym0KindInference GHC.Tuple.())-    data Baz_Sym0 (l :: TyFun (Maybe Baz) (Maybe Baz))-      = forall arg. KindOf (Apply Baz_Sym0 arg) ~ KindOf (Baz_Sym1 arg) =>-        Baz_Sym0KindInference-    type instance Apply Baz_Sym0 l = Baz_Sym1 l-    type BarSym1 (t :: Maybe Nat) = Bar t-    instance SuppressUnusedWarnings BarSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) BarSym0KindInference GHC.Tuple.())-    data BarSym0 (l :: TyFun (Maybe Nat) (Maybe Nat))-      = forall arg. KindOf (Apply BarSym0 arg) ~ KindOf (BarSym1 arg) =>-        BarSym0KindInference-    type instance Apply BarSym0 l = BarSym1 l-    type MaybePlusSym1 (t :: Maybe Nat) = MaybePlus t-    instance SuppressUnusedWarnings MaybePlusSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) MaybePlusSym0KindInference GHC.Tuple.())-    data MaybePlusSym0 (l :: TyFun (Maybe Nat) (Maybe Nat))-      = forall arg. KindOf (Apply MaybePlusSym0 arg) ~ KindOf (MaybePlusSym1 arg) =>-        MaybePlusSym0KindInference-    type instance Apply MaybePlusSym0 l = MaybePlusSym1 l-    type family Foo (a :: [Nat]) :: [Nat] where-      Foo '[] = Let0123456789PSym0-      Foo '[wild_0123456789] = Let0123456789PSym1 wild_0123456789-      Foo ((:) wild_0123456789 wild_0123456789) = Let0123456789PSym2 wild_0123456789 wild_0123456789-    type family Tup (a :: (Nat, Nat)) :: (Nat, Nat) where-      Tup '(wild_0123456789,-            wild_0123456789) = Let0123456789PSym2 wild_0123456789 wild_0123456789-    type family Baz_ (a :: Maybe Baz) :: Maybe Baz where-      Baz_ Nothing = Let0123456789PSym0-      Baz_ (Just (Baz wild_0123456789 wild_0123456789 wild_0123456789)) = Let0123456789PSym3 wild_0123456789 wild_0123456789 wild_0123456789-    type family Bar (a :: Maybe Nat) :: Maybe Nat where-      Bar (Just wild_0123456789) = Let0123456789XSym1 wild_0123456789-      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 = Let0123456789PSym0-    sFoo :: forall (t :: [Nat]). Sing t -> Sing (Apply FooSym0 t)-    sTup :: forall (t :: (Nat, Nat)). Sing t -> Sing (Apply TupSym0 t)-    sBaz_ :: forall (t :: Maybe Baz). Sing t -> Sing (Apply Baz_Sym0 t)-    sBar :: forall (t :: Maybe Nat). Sing t -> Sing (Apply BarSym0 t)-    sMaybePlus ::-      forall (t :: Maybe Nat). Sing t -> Sing (Apply MaybePlusSym0 t)-    sFoo SNil-      = let-          lambda :: t ~ '[] => Sing (Apply FooSym0 '[])-          lambda-            = let-                sP :: Sing Let0123456789PSym0-                sP = SNil-              in sP-        in lambda-    sFoo (SCons sWild_0123456789 SNil)-      = let-          lambda ::-            forall wild_0123456789. t ~ Apply (Apply (:$) wild_0123456789) '[] =>-            Sing wild_0123456789-            -> Sing (Apply FooSym0 (Apply (Apply (:$) wild_0123456789) '[]))-          lambda wild_0123456789-            = let-                sP :: Sing (Let0123456789PSym1 wild_0123456789)-                sP-                  = applySing-                      (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) wild_0123456789)-                      SNil-              in sP-        in lambda sWild_0123456789-    sFoo (SCons sWild_0123456789 sWild_0123456789)-      = let-          lambda ::-            forall wild_0123456789-                   wild_0123456789. t ~ Apply (Apply (:$) wild_0123456789) wild_0123456789 =>-            Sing wild_0123456789-            -> Sing wild_0123456789-               -> Sing (Apply FooSym0 (Apply (Apply (:$) wild_0123456789) wild_0123456789))-          lambda wild_0123456789 wild_0123456789-            = let-                sP :: Sing (Let0123456789PSym2 wild_0123456789 wild_0123456789)-                sP-                  = applySing-                      (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) wild_0123456789)-                      wild_0123456789-              in sP-        in lambda sWild_0123456789 sWild_0123456789-    sTup (STuple2 sWild_0123456789 sWild_0123456789)-      = let-          lambda ::-            forall wild_0123456789-                   wild_0123456789. t ~ Apply (Apply Tuple2Sym0 wild_0123456789) wild_0123456789 =>-            Sing wild_0123456789-            -> Sing wild_0123456789-               -> Sing (Apply TupSym0 (Apply (Apply Tuple2Sym0 wild_0123456789) wild_0123456789))-          lambda wild_0123456789 wild_0123456789-            = let-                sP :: Sing (Let0123456789PSym2 wild_0123456789 wild_0123456789)-                sP-                  = applySing-                      (applySing-                         (singFun2 (Proxy :: Proxy Tuple2Sym0) STuple2) wild_0123456789)-                      wild_0123456789-              in sP-        in lambda sWild_0123456789 sWild_0123456789-    sBaz_ SNothing-      = let-          lambda :: t ~ NothingSym0 => Sing (Apply Baz_Sym0 NothingSym0)-          lambda-            = let-                sP :: Sing Let0123456789PSym0-                sP = SNothing-              in sP-        in lambda-    sBaz_-      (SJust (SBaz sWild_0123456789 sWild_0123456789 sWild_0123456789))-      = let-          lambda ::-            forall wild_0123456789-                   wild_0123456789-                   wild_0123456789. t ~ Apply JustSym0 (Apply (Apply (Apply BazSym0 wild_0123456789) wild_0123456789) wild_0123456789) =>-            Sing wild_0123456789-            -> Sing wild_0123456789-               -> Sing wild_0123456789-                  -> Sing (Apply Baz_Sym0 (Apply JustSym0 (Apply (Apply (Apply BazSym0 wild_0123456789) wild_0123456789) wild_0123456789)))-          lambda wild_0123456789 wild_0123456789 wild_0123456789-            = let-                sP ::-                  Sing (Let0123456789PSym3 wild_0123456789 wild_0123456789 wild_0123456789)-                sP-                  = applySing-                      (singFun1 (Proxy :: Proxy JustSym0) SJust)-                      (applySing-                         (applySing-                            (applySing-                               (singFun3 (Proxy :: Proxy BazSym0) SBaz) wild_0123456789)-                            wild_0123456789)-                         wild_0123456789)-              in sP-        in lambda sWild_0123456789 sWild_0123456789 sWild_0123456789-    sBar (SJust sWild_0123456789)-      = let-          lambda ::-            forall wild_0123456789. t ~ Apply JustSym0 wild_0123456789 =>-            Sing wild_0123456789-            -> Sing (Apply BarSym0 (Apply JustSym0 wild_0123456789))-          lambda wild_0123456789-            = let-                sX :: Sing (Let0123456789XSym1 wild_0123456789)-                sX-                  = applySing-                      (singFun1 (Proxy :: Proxy JustSym0) SJust) wild_0123456789-              in sX-        in lambda sWild_0123456789-    sBar SNothing-      = let-          lambda :: t ~ NothingSym0 => Sing (Apply BarSym0 NothingSym0)-          lambda = SNothing-        in lambda-    sMaybePlus (SJust sN)-      = let-          lambda ::-            forall n. t ~ Apply JustSym0 n =>-            Sing n -> Sing (Apply MaybePlusSym0 (Apply JustSym0 n))-          lambda n-            = applySing-                (singFun1 (Proxy :: Proxy JustSym0) SJust)-                (applySing-                   (applySing-                      (singFun2 (Proxy :: Proxy PlusSym0) sPlus)-                      (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))-                   n)-        in lambda sN-    sMaybePlus SNothing-      = let-          lambda :: t ~ NothingSym0 => Sing (Apply MaybePlusSym0 NothingSym0)-          lambda-            = let-                sP :: Sing Let0123456789PSym0-                sP = SNothing-              in sP-        in lambda-    data instance Sing (z :: Baz)-      = forall (n :: Nat) (n :: Nat) (n :: Nat). z ~ Baz n n n =>-        SBaz (Sing n) (Sing n) (Sing n)-    type SBaz (z :: Baz) = Sing z-    instance SingKind (KProxy :: KProxy Baz) where-      type DemoteRep (KProxy :: KProxy Baz) = Baz-      fromSing (SBaz b b b) = Baz (fromSing b) (fromSing b) (fromSing b)-      toSing (Baz b b b)-        = case-              GHC.Tuple.(,,)-                (toSing b :: SomeSing (KProxy :: KProxy Nat))-                (toSing b :: SomeSing (KProxy :: KProxy Nat))-                (toSing b :: SomeSing (KProxy :: KProxy Nat))-          of {-            GHC.Tuple.(,,) (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
tests/compile-and-dump/Singletons/AsPattern.hs view
@@ -27,7 +27,7 @@   tup p@(_, _) = p    foo :: [Nat] -> [Nat]-  foo p@[]    = p-  foo p@[_]   = p-  foo p@(_:_) = p+  foo p@[]      = p+  foo p@[_]     = p+  foo p@(_:_:_) = p  |])
+ tests/compile-and-dump/Singletons/BadBoundedDeriving.ghc710.template view
@@ -0,0 +1,3 @@++Singletons/BadBoundedDeriving.hs:0:0:+    Can't derive Bounded instance for Foo_0 a_1.
+ tests/compile-and-dump/Singletons/BadBoundedDeriving.hs view
@@ -0,0 +1,8 @@+module Singletons.BadBoundedDeriving where++import Data.Singletons.Prelude+import Data.Singletons.TH++$(singletons [d|+  data Foo a = Foo | Bar a deriving (Bounded)+  |])
+ tests/compile-and-dump/Singletons/BadEnumDeriving.ghc710.template view
@@ -0,0 +1,3 @@++Singletons/BadEnumDeriving.hs:0:0:+    Can't derive Enum instance for Foo_0 a_1.
+ tests/compile-and-dump/Singletons/BadEnumDeriving.hs view
@@ -0,0 +1,8 @@+module Singletons.BadEnumDeriving where++import Data.Singletons.TH++$(singletons [d|+  data Foo a = Foo a+               deriving Enum+  |])
+ tests/compile-and-dump/Singletons/BoundedDeriving.ghc710.template view
@@ -0,0 +1,265 @@+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 :: *) (b :: *)+            = 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 :: *) (b :: *)+      = 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 (t :: a) = Foo3 t+    instance SuppressUnusedWarnings Foo3Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo3Sym0KindInference GHC.Tuple.())+    data Foo3Sym0 (l :: TyFun a (Foo3 a))+      = forall arg. KindOf (Apply Foo3Sym0 arg) ~ KindOf (Foo3Sym1 arg) =>+        Foo3Sym0KindInference+    type instance Apply Foo3Sym0 l = Foo3Sym1 l+    type Foo41Sym0 = Foo41+    type Foo42Sym0 = Foo42+    type PairSym2 (t :: Bool) (t :: Bool) = Pair t t+    instance SuppressUnusedWarnings PairSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) PairSym1KindInference GHC.Tuple.())+    data PairSym1 (l :: Bool) (l :: TyFun Bool Pair)+      = forall arg. KindOf (Apply (PairSym1 l) arg) ~ KindOf (PairSym2 l arg) =>+        PairSym1KindInference+    type instance Apply (PairSym1 l) l = PairSym2 l l+    instance SuppressUnusedWarnings PairSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) PairSym0KindInference GHC.Tuple.())+    data PairSym0 (l :: TyFun Bool (TyFun Bool Pair -> *))+      = forall arg. KindOf (Apply PairSym0 arg) ~ KindOf (PairSym1 arg) =>+        PairSym0KindInference+    type instance Apply PairSym0 l = PairSym1 l+    type family MinBound_0123456789 :: Foo1 where+      MinBound_0123456789 = Foo1Sym0+    type MinBound_0123456789Sym0 = MinBound_0123456789+    type family MaxBound_0123456789 :: Foo1 where+      MaxBound_0123456789 = Foo1Sym0+    type MaxBound_0123456789Sym0 = MaxBound_0123456789+    instance PBounded (KProxy :: KProxy Foo1) where+      type MinBound = MinBound_0123456789Sym0+      type MaxBound = MaxBound_0123456789Sym0+    type family MinBound_0123456789 :: Foo2 where+      MinBound_0123456789 = ASym0+    type MinBound_0123456789Sym0 = MinBound_0123456789+    type family MaxBound_0123456789 :: Foo2 where+      MaxBound_0123456789 = ESym0+    type MaxBound_0123456789Sym0 = MaxBound_0123456789+    instance PBounded (KProxy :: KProxy Foo2) where+      type MinBound = MinBound_0123456789Sym0+      type MaxBound = MaxBound_0123456789Sym0+    type family MinBound_0123456789 :: Foo3 a where+      MinBound_0123456789 = Apply Foo3Sym0 MinBoundSym0+    type MinBound_0123456789Sym0 = MinBound_0123456789+    type family MaxBound_0123456789 :: Foo3 a where+      MaxBound_0123456789 = Apply Foo3Sym0 MaxBoundSym0+    type MaxBound_0123456789Sym0 = MaxBound_0123456789+    instance PBounded (KProxy :: KProxy (Foo3 a)) where+      type MinBound = MinBound_0123456789Sym0+      type MaxBound = MaxBound_0123456789Sym0+    type family MinBound_0123456789 :: Foo4 a b where+      MinBound_0123456789 = Foo41Sym0+    type MinBound_0123456789Sym0 = MinBound_0123456789+    type family MaxBound_0123456789 :: Foo4 a b where+      MaxBound_0123456789 = Foo42Sym0+    type MaxBound_0123456789Sym0 = MaxBound_0123456789+    instance PBounded (KProxy :: KProxy (Foo4 a b)) where+      type MinBound = MinBound_0123456789Sym0+      type MaxBound = MaxBound_0123456789Sym0+    type family MinBound_0123456789 :: Pair where+      MinBound_0123456789 = Apply (Apply PairSym0 MinBoundSym0) MinBoundSym0+    type MinBound_0123456789Sym0 = MinBound_0123456789+    type family MaxBound_0123456789 :: Pair where+      MaxBound_0123456789 = Apply (Apply PairSym0 MaxBoundSym0) MaxBoundSym0+    type MaxBound_0123456789Sym0 = MaxBound_0123456789+    instance PBounded (KProxy :: KProxy Pair) where+      type MinBound = MinBound_0123456789Sym0+      type MaxBound = MaxBound_0123456789Sym0+    data instance Sing (z :: Foo1) = z ~ Foo1 => SFoo1+    type SFoo1 = (Sing :: Foo1 -> *)+    instance SingKind (KProxy :: KProxy Foo1) where+      type DemoteRep (KProxy :: KProxy Foo1) = Foo1+      fromSing SFoo1 = Foo1+      toSing Foo1 = SomeSing SFoo1+    data instance Sing (z :: Foo2)+      = z ~ A => SA |+        z ~ B => SB |+        z ~ C => SC |+        z ~ D => SD |+        z ~ E => SE+    type SFoo2 = (Sing :: Foo2 -> *)+    instance SingKind (KProxy :: KProxy Foo2) where+      type DemoteRep (KProxy :: KProxy 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 instance Sing (z :: Foo3 a)+      = forall (n :: a). z ~ Foo3 n => SFoo3 (Sing (n :: a))+    type SFoo3 = (Sing :: Foo3 a -> *)+    instance SingKind (KProxy :: KProxy a) =>+             SingKind (KProxy :: KProxy (Foo3 a)) where+      type DemoteRep (KProxy :: KProxy (Foo3 a)) = Foo3 (DemoteRep (KProxy :: KProxy a))+      fromSing (SFoo3 b) = Foo3 (fromSing b)+      toSing (Foo3 b)+        = case toSing b :: SomeSing (KProxy :: KProxy a) of {+            SomeSing c -> SomeSing (SFoo3 c) }+    data instance Sing (z :: Foo4 a b)+      = z ~ Foo41 => SFoo41 | z ~ Foo42 => SFoo42+    type SFoo4 = (Sing :: Foo4 a b -> *)+    instance (SingKind (KProxy :: KProxy a),+              SingKind (KProxy :: KProxy b)) =>+             SingKind (KProxy :: KProxy (Foo4 a b)) where+      type DemoteRep (KProxy :: KProxy (Foo4 a b)) = Foo4 (DemoteRep (KProxy :: KProxy a)) (DemoteRep (KProxy :: KProxy b))+      fromSing SFoo41 = Foo41+      fromSing SFoo42 = Foo42+      toSing Foo41 = SomeSing SFoo41+      toSing Foo42 = SomeSing SFoo42+    data instance Sing (z :: Pair)+      = forall (n :: Bool) (n :: Bool). z ~ Pair n n =>+        SPair (Sing (n :: Bool)) (Sing (n :: Bool))+    type SPair = (Sing :: Pair -> *)+    instance SingKind (KProxy :: KProxy Pair) where+      type DemoteRep (KProxy :: KProxy Pair) = Pair+      fromSing (SPair b b) = Pair (fromSing b) (fromSing b)+      toSing (Pair b b)+        = case+              GHC.Tuple.(,)+                (toSing b :: SomeSing (KProxy :: KProxy Bool))+                (toSing b :: SomeSing (KProxy :: KProxy Bool))+          of {+            GHC.Tuple.(,) (SomeSing c) (SomeSing c) -> SomeSing (SPair c c) }+    instance SBounded (KProxy :: KProxy Foo1) where+      sMinBound :: Sing (MinBoundSym0 :: Foo1)+      sMaxBound :: Sing (MaxBoundSym0 :: Foo1)+      sMinBound+        = let+            lambda :: Sing (MinBoundSym0 :: Foo1)+            lambda = SFoo1+          in lambda+      sMaxBound+        = let+            lambda :: Sing (MaxBoundSym0 :: Foo1)+            lambda = SFoo1+          in lambda+    instance SBounded (KProxy :: KProxy Foo2) where+      sMinBound :: Sing (MinBoundSym0 :: Foo2)+      sMaxBound :: Sing (MaxBoundSym0 :: Foo2)+      sMinBound+        = let+            lambda :: Sing (MinBoundSym0 :: Foo2)+            lambda = SA+          in lambda+      sMaxBound+        = let+            lambda :: Sing (MaxBoundSym0 :: Foo2)+            lambda = SE+          in lambda+    instance SBounded (KProxy :: KProxy a) =>+             SBounded (KProxy :: KProxy (Foo3 a)) where+      sMinBound :: Sing (MinBoundSym0 :: Foo3 a)+      sMaxBound :: Sing (MaxBoundSym0 :: Foo3 a)+      sMinBound+        = let+            lambda :: Sing (MinBoundSym0 :: Foo3 a)+            lambda+              = applySing (singFun1 (Proxy :: Proxy Foo3Sym0) SFoo3) sMinBound+          in lambda+      sMaxBound+        = let+            lambda :: Sing (MaxBoundSym0 :: Foo3 a)+            lambda+              = applySing (singFun1 (Proxy :: Proxy Foo3Sym0) SFoo3) sMaxBound+          in lambda+    instance SBounded (KProxy :: KProxy (Foo4 a b)) where+      sMinBound :: Sing (MinBoundSym0 :: Foo4 a b)+      sMaxBound :: Sing (MaxBoundSym0 :: Foo4 a b)+      sMinBound+        = let+            lambda :: Sing (MinBoundSym0 :: Foo4 a b)+            lambda = SFoo41+          in lambda+      sMaxBound+        = let+            lambda :: Sing (MaxBoundSym0 :: Foo4 a b)+            lambda = SFoo42+          in lambda+    instance SBounded (KProxy :: KProxy Bool) =>+             SBounded (KProxy :: KProxy Pair) where+      sMinBound :: Sing (MinBoundSym0 :: Pair)+      sMaxBound :: Sing (MaxBoundSym0 :: Pair)+      sMinBound+        = let+            lambda :: Sing (MinBoundSym0 :: Pair)+            lambda+              = applySing+                  (applySing (singFun2 (Proxy :: Proxy PairSym0) SPair) sMinBound)+                  sMinBound+          in lambda+      sMaxBound+        = let+            lambda :: Sing (MaxBoundSym0 :: Pair)+            lambda+              = applySing+                  (applySing (singFun2 (Proxy :: Proxy PairSym0) SPair) sMaxBound)+                  sMaxBound+          in lambda+    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 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
+ tests/compile-and-dump/Singletons/BoundedDeriving.hs view
@@ -0,0 +1,51 @@+module Singletons.BoundedDeriving where++import Data.Singletons.Prelude+import Data.Singletons.TH++$(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 :: *) (b :: *) = Foo41 | Foo42 deriving Bounded++  data Pair = Pair Bool Bool+                  deriving Bounded++  |])++foo1a :: Proxy (MinBound :: Foo1)+foo1a = Proxy++foo1b :: Proxy 'Foo1+foo1b = foo1a++foo1c :: Proxy (MaxBound :: Foo1)+foo1c = Proxy++foo1d :: Proxy 'Foo1+foo1d = foo1c++foo2a :: Proxy (MinBound :: Foo2)+foo2a = Proxy++foo2b :: Proxy 'A+foo2b = foo2a++foo2c :: Proxy (MaxBound :: Foo2)+foo2c = Proxy++foo2d :: Proxy 'E+foo2d = foo2c++foo3a :: Proxy (MinBound :: Foo3 Bool)+foo3a = Proxy++foo3b :: Proxy ('Foo3 False)+foo3b = foo3a++foo3c :: Proxy (MaxBound :: Foo3 Bool)+foo3c = Proxy++foo3d :: Proxy ('Foo3 True)+foo3d = foo3c
+ tests/compile-and-dump/Singletons/BoxUnBox.ghc710.template view
@@ -0,0 +1,49 @@+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 :: forall a. Box a -> a+    unBox (FBox a) = a+    type FBoxSym1 (t :: a) = FBox t+    instance SuppressUnusedWarnings FBoxSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) FBoxSym0KindInference GHC.Tuple.())+    data FBoxSym0 (l :: TyFun a (Box a))+      = forall arg. KindOf (Apply FBoxSym0 arg) ~ KindOf (FBoxSym1 arg) =>+        FBoxSym0KindInference+    type instance Apply FBoxSym0 l = FBoxSym1 l+    type UnBoxSym1 (t :: Box a) = UnBox t+    instance SuppressUnusedWarnings UnBoxSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) UnBoxSym0KindInference GHC.Tuple.())+    data UnBoxSym0 (l :: TyFun (Box a) a)+      = forall arg. KindOf (Apply UnBoxSym0 arg) ~ KindOf (UnBoxSym1 arg) =>+        UnBoxSym0KindInference+    type instance Apply UnBoxSym0 l = UnBoxSym1 l+    type family UnBox (a :: Box a) :: a where+      UnBox (FBox a) = a+    sUnBox ::+      forall (t :: Box a). Sing t -> Sing (Apply UnBoxSym0 t :: a)+    sUnBox (SFBox sA)+      = let+          lambda ::+            forall a. t ~ Apply FBoxSym0 a =>+            Sing a -> Sing (Apply UnBoxSym0 (Apply FBoxSym0 a) :: a)+          lambda a = a+        in lambda sA+    data instance Sing (z :: Box a)+      = forall (n :: a). z ~ FBox n => SFBox (Sing (n :: a))+    type SBox = (Sing :: Box a -> *)+    instance SingKind (KProxy :: KProxy a) =>+             SingKind (KProxy :: KProxy (Box a)) where+      type DemoteRep (KProxy :: KProxy (Box a)) = Box (DemoteRep (KProxy :: KProxy a))+      fromSing (SFBox b) = FBox (fromSing b)+      toSing (FBox b)+        = case toSing b :: SomeSing (KProxy :: KProxy a) of {+            SomeSing c -> SomeSing (SFBox c) }+    instance SingI n => SingI (FBox (n :: a)) where+      sing = SFBox sing
− tests/compile-and-dump/Singletons/BoxUnBox.ghc78.template
@@ -1,49 +0,0 @@-Singletons/BoxUnBox.hs:0:0: Splicing declarations-    singletons-      [d| unBox :: Box a -> a-          unBox (FBox a) = a-          -          data Box a = FBox a |]-  ======>-    Singletons/BoxUnBox.hs:(0,0)-(0,0)-    data Box a = FBox a-    unBox :: forall a. Box a -> a-    unBox (FBox a) = a-    type FBoxSym1 (t :: a) = FBox t-    instance SuppressUnusedWarnings FBoxSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) FBoxSym0KindInference GHC.Tuple.())-    data FBoxSym0 (l :: TyFun a (Box a))-      = forall arg. KindOf (Apply FBoxSym0 arg) ~ KindOf (FBoxSym1 arg) =>-        FBoxSym0KindInference-    type instance Apply FBoxSym0 l = FBoxSym1 l-    type UnBoxSym1 (t :: Box a) = UnBox t-    instance SuppressUnusedWarnings UnBoxSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) UnBoxSym0KindInference GHC.Tuple.())-    data UnBoxSym0 (l :: TyFun (Box a) a)-      = forall arg. KindOf (Apply UnBoxSym0 arg) ~ KindOf (UnBoxSym1 arg) =>-        UnBoxSym0KindInference-    type instance Apply UnBoxSym0 l = UnBoxSym1 l-    type family UnBox (a :: Box a) :: a where-      UnBox (FBox a) = a-    sUnBox :: forall (t :: Box a). Sing t -> Sing (Apply UnBoxSym0 t)-    sUnBox (SFBox sA)-      = let-          lambda ::-            forall a. t ~ Apply FBoxSym0 a =>-            Sing a -> Sing (Apply UnBoxSym0 (Apply FBoxSym0 a))-          lambda a = a-        in lambda sA-    data instance Sing (z :: Box a)-      = forall (n :: a). z ~ FBox n => SFBox (Sing n)-    type SBox (z :: Box a) = Sing z-    instance SingKind (KProxy :: KProxy a) =>-             SingKind (KProxy :: KProxy (Box a)) where-      type DemoteRep (KProxy :: KProxy (Box a)) = Box (DemoteRep (KProxy :: KProxy a))-      fromSing (SFBox b) = FBox (fromSing b)-      toSing (FBox b)-        = case toSing b :: SomeSing (KProxy :: KProxy a) of {-            SomeSing c -> SomeSing (SFBox c) }-    instance SingI n => SingI (FBox (n :: a)) where-      sing = SFBox sing
+ tests/compile-and-dump/Singletons/CaseExpressions.ghc710.template view
@@ -0,0 +1,407 @@+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 :: forall a. a -> Maybe a -> a+    foo1 d x+      = case x of {+          Just y -> y+          Nothing -> d }+    foo2 :: forall a. a -> Maybe a -> a+    foo2 d _ = case Just d of { Just y -> y }+    foo3 :: forall a b. 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 :: forall a. a -> a+    foo5 x = case x of { y -> \ _ -> x y }+    type Let0123456789Scrutinee_0123456789Sym1 t =+        Let0123456789Scrutinee_0123456789 t+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym0 l+      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>+        Let0123456789Scrutinee_0123456789Sym0KindInference+    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l+    type family Let0123456789Scrutinee_0123456789 x where+      Let0123456789Scrutinee_0123456789 x = x+    type family Case_0123456789 x y arg_0123456789 t where+      Case_0123456789 x y arg_0123456789 _z_0123456789 = x+    type family Lambda_0123456789 x y t where+      Lambda_0123456789 x y arg_0123456789 = Case_0123456789 x y arg_0123456789 arg_0123456789+    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())+    data Lambda_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>+        Lambda_0123456789Sym2KindInference+    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type family Case_0123456789 x t where+      Case_0123456789 x y = Apply (Apply (Apply Lambda_0123456789Sym0 x) y) y+    type Let0123456789Scrutinee_0123456789Sym1 t =+        Let0123456789Scrutinee_0123456789 t+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym0 l+      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>+        Let0123456789Scrutinee_0123456789Sym0KindInference+    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l+    type family Let0123456789Scrutinee_0123456789 x where+      Let0123456789Scrutinee_0123456789 x = x+    type Let0123456789ZSym2 t t = Let0123456789Z t t+    instance SuppressUnusedWarnings Let0123456789ZSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789ZSym1KindInference GHC.Tuple.())+    data Let0123456789ZSym1 l l+      = forall arg. KindOf (Apply (Let0123456789ZSym1 l) arg) ~ KindOf (Let0123456789ZSym2 l arg) =>+        Let0123456789ZSym1KindInference+    type instance Apply (Let0123456789ZSym1 l) l = Let0123456789ZSym2 l l+    instance SuppressUnusedWarnings Let0123456789ZSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789ZSym0KindInference GHC.Tuple.())+    data Let0123456789ZSym0 l+      = forall arg. KindOf (Apply Let0123456789ZSym0 arg) ~ KindOf (Let0123456789ZSym1 arg) =>+        Let0123456789ZSym0KindInference+    type instance Apply Let0123456789ZSym0 l = Let0123456789ZSym1 l+    type family Let0123456789Z x y :: a where+      Let0123456789Z x y = y+    type family Case_0123456789 x t where+      Case_0123456789 x y = Let0123456789ZSym2 x y+    type Let0123456789Scrutinee_0123456789Sym2 t t =+        Let0123456789Scrutinee_0123456789 t t+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym1KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym1 l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym2 l arg) =>+        Let0123456789Scrutinee_0123456789Sym1KindInference+    type instance Apply (Let0123456789Scrutinee_0123456789Sym1 l) l = Let0123456789Scrutinee_0123456789Sym2 l l+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym0 l+      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>+        Let0123456789Scrutinee_0123456789Sym0KindInference+    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l+    type family Let0123456789Scrutinee_0123456789 a b where+      Let0123456789Scrutinee_0123456789 a b = Apply (Apply Tuple2Sym0 a) b+    type family Case_0123456789 a b t where+      Case_0123456789 a b '(p, _z_0123456789) = p+    type Let0123456789Scrutinee_0123456789Sym2 t t =+        Let0123456789Scrutinee_0123456789 t t+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym1KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym1 l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym2 l arg) =>+        Let0123456789Scrutinee_0123456789Sym1KindInference+    type instance Apply (Let0123456789Scrutinee_0123456789Sym1 l) l = Let0123456789Scrutinee_0123456789Sym2 l l+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym0 l+      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>+        Let0123456789Scrutinee_0123456789Sym0KindInference+    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l+    type family Let0123456789Scrutinee_0123456789 d _z_0123456789 where+      Let0123456789Scrutinee_0123456789 d _z_0123456789 = Apply JustSym0 d+    type family Case_0123456789 d _z_0123456789 t where+      Case_0123456789 d _z_0123456789 (Just y) = y+    type Let0123456789Scrutinee_0123456789Sym2 t t =+        Let0123456789Scrutinee_0123456789 t t+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym1KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym1 l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym2 l arg) =>+        Let0123456789Scrutinee_0123456789Sym1KindInference+    type instance Apply (Let0123456789Scrutinee_0123456789Sym1 l) l = Let0123456789Scrutinee_0123456789Sym2 l l+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym0 l+      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>+        Let0123456789Scrutinee_0123456789Sym0KindInference+    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l+    type family Let0123456789Scrutinee_0123456789 d x where+      Let0123456789Scrutinee_0123456789 d x = x+    type family Case_0123456789 d x t where+      Case_0123456789 d x (Just y) = y+      Case_0123456789 d x Nothing = d+    type Foo5Sym1 (t :: a) = Foo5 t+    instance SuppressUnusedWarnings Foo5Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo5Sym0KindInference GHC.Tuple.())+    data Foo5Sym0 (l :: TyFun a a)+      = forall arg. KindOf (Apply Foo5Sym0 arg) ~ KindOf (Foo5Sym1 arg) =>+        Foo5Sym0KindInference+    type instance Apply Foo5Sym0 l = Foo5Sym1 l+    type Foo4Sym1 (t :: a) = Foo4 t+    instance SuppressUnusedWarnings Foo4Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo4Sym0KindInference GHC.Tuple.())+    data Foo4Sym0 (l :: TyFun a a)+      = forall arg. KindOf (Apply Foo4Sym0 arg) ~ KindOf (Foo4Sym1 arg) =>+        Foo4Sym0KindInference+    type instance Apply Foo4Sym0 l = Foo4Sym1 l+    type Foo3Sym2 (t :: a) (t :: b) = Foo3 t t+    instance SuppressUnusedWarnings Foo3Sym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo3Sym1KindInference GHC.Tuple.())+    data Foo3Sym1 (l :: a) (l :: TyFun b a)+      = forall arg. KindOf (Apply (Foo3Sym1 l) arg) ~ KindOf (Foo3Sym2 l arg) =>+        Foo3Sym1KindInference+    type instance Apply (Foo3Sym1 l) l = Foo3Sym2 l l+    instance SuppressUnusedWarnings Foo3Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo3Sym0KindInference GHC.Tuple.())+    data Foo3Sym0 (l :: TyFun a (TyFun b a -> *))+      = forall arg. KindOf (Apply Foo3Sym0 arg) ~ KindOf (Foo3Sym1 arg) =>+        Foo3Sym0KindInference+    type instance Apply Foo3Sym0 l = Foo3Sym1 l+    type Foo2Sym2 (t :: a) (t :: Maybe a) = Foo2 t t+    instance SuppressUnusedWarnings Foo2Sym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo2Sym1KindInference GHC.Tuple.())+    data Foo2Sym1 (l :: a) (l :: TyFun (Maybe a) a)+      = forall arg. KindOf (Apply (Foo2Sym1 l) arg) ~ KindOf (Foo2Sym2 l arg) =>+        Foo2Sym1KindInference+    type instance Apply (Foo2Sym1 l) l = Foo2Sym2 l l+    instance SuppressUnusedWarnings Foo2Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo2Sym0KindInference GHC.Tuple.())+    data Foo2Sym0 (l :: TyFun a (TyFun (Maybe a) a -> *))+      = forall arg. KindOf (Apply Foo2Sym0 arg) ~ KindOf (Foo2Sym1 arg) =>+        Foo2Sym0KindInference+    type instance Apply Foo2Sym0 l = Foo2Sym1 l+    type Foo1Sym2 (t :: a) (t :: Maybe a) = Foo1 t t+    instance SuppressUnusedWarnings Foo1Sym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo1Sym1KindInference GHC.Tuple.())+    data Foo1Sym1 (l :: a) (l :: TyFun (Maybe a) a)+      = forall arg. KindOf (Apply (Foo1Sym1 l) arg) ~ KindOf (Foo1Sym2 l arg) =>+        Foo1Sym1KindInference+    type instance Apply (Foo1Sym1 l) l = Foo1Sym2 l l+    instance SuppressUnusedWarnings Foo1Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo1Sym0KindInference GHC.Tuple.())+    data Foo1Sym0 (l :: TyFun a (TyFun (Maybe a) a -> *))+      = forall arg. KindOf (Apply Foo1Sym0 arg) ~ KindOf (Foo1Sym1 arg) =>+        Foo1Sym0KindInference+    type instance Apply Foo1Sym0 l = Foo1Sym1 l+    type family Foo5 (a :: a) :: a where+      Foo5 x = Case_0123456789 x (Let0123456789Scrutinee_0123456789Sym1 x)+    type family Foo4 (a :: a) :: a where+      Foo4 x = Case_0123456789 x (Let0123456789Scrutinee_0123456789Sym1 x)+    type family Foo3 (a :: a) (a :: b) :: a where+      Foo3 a b = Case_0123456789 a b (Let0123456789Scrutinee_0123456789Sym2 a b)+    type family Foo2 (a :: a) (a :: Maybe a) :: a where+      Foo2 d _z_0123456789 = Case_0123456789 d _z_0123456789 (Let0123456789Scrutinee_0123456789Sym2 d _z_0123456789)+    type family Foo1 (a :: a) (a :: Maybe a) :: a where+      Foo1 d x = Case_0123456789 d x (Let0123456789Scrutinee_0123456789Sym2 d x)+    sFoo5 :: forall (t :: a). Sing t -> Sing (Apply Foo5Sym0 t :: a)+    sFoo4 :: forall (t :: a). Sing t -> Sing (Apply Foo4Sym0 t :: a)+    sFoo3 ::+      forall (t :: a) (t :: b).+      Sing t -> Sing t -> Sing (Apply (Apply Foo3Sym0 t) t :: a)+    sFoo2 ::+      forall (t :: a) (t :: Maybe a).+      Sing t -> Sing t -> Sing (Apply (Apply Foo2Sym0 t) t :: a)+    sFoo1 ::+      forall (t :: a) (t :: Maybe a).+      Sing t -> Sing t -> Sing (Apply (Apply Foo1Sym0 t) t :: a)+    sFoo5 sX+      = let+          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo5Sym0 x :: a)+          lambda x+            = let+                sScrutinee_0123456789 ::+                  Sing (Let0123456789Scrutinee_0123456789Sym1 x)+                sScrutinee_0123456789 = x+              in  case sScrutinee_0123456789 of {+                    sY+                      -> let+                           lambda ::+                             forall y. y ~ Let0123456789Scrutinee_0123456789Sym1 x =>+                             Sing y -> Sing (Case_0123456789 x y)+                           lambda y+                             = applySing+                                 (singFun1+                                    (Proxy :: Proxy (Apply (Apply Lambda_0123456789Sym0 x) y))+                                    (\ sArg_0123456789+                                       -> let+                                            lambda ::+                                              forall arg_0123456789.+                                              Sing arg_0123456789+                                              -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) arg_0123456789)+                                            lambda arg_0123456789+                                              = case arg_0123456789 of {+                                                  _s_z_0123456789+                                                    -> let+                                                         lambda ::+                                                           forall _z_0123456789. _z_0123456789 ~ arg_0123456789 =>+                                                           Sing _z_0123456789+                                                           -> Sing (Case_0123456789 x y arg_0123456789 _z_0123456789)+                                                         lambda _z_0123456789 = x+                                                       in lambda _s_z_0123456789 } ::+                                                  Sing (Case_0123456789 x y arg_0123456789 arg_0123456789)+                                          in lambda sArg_0123456789))+                                 y+                         in lambda sY } ::+                    Sing (Case_0123456789 x (Let0123456789Scrutinee_0123456789Sym1 x))+        in lambda sX+    sFoo4 sX+      = let+          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo4Sym0 x :: a)+          lambda x+            = let+                sScrutinee_0123456789 ::+                  Sing (Let0123456789Scrutinee_0123456789Sym1 x)+                sScrutinee_0123456789 = x+              in  case sScrutinee_0123456789 of {+                    sY+                      -> let+                           lambda ::+                             forall y. y ~ Let0123456789Scrutinee_0123456789Sym1 x =>+                             Sing y -> Sing (Case_0123456789 x y)+                           lambda y+                             = let+                                 sZ :: Sing (Let0123456789ZSym2 x y :: a)+                                 sZ = y+                               in sZ+                         in lambda sY } ::+                    Sing (Case_0123456789 x (Let0123456789Scrutinee_0123456789Sym1 x))+        in lambda sX+    sFoo3 sA sB+      = let+          lambda ::+            forall a b. (t ~ a, t ~ b) =>+            Sing a -> Sing b -> Sing (Apply (Apply Foo3Sym0 a) b :: a)+          lambda a b+            = let+                sScrutinee_0123456789 ::+                  Sing (Let0123456789Scrutinee_0123456789Sym2 a b)+                sScrutinee_0123456789+                  = applySing+                      (applySing (singFun2 (Proxy :: Proxy Tuple2Sym0) STuple2) a) b+              in  case sScrutinee_0123456789 of {+                    STuple2 sP _s_z_0123456789+                      -> let+                           lambda ::+                             forall p+                                    _z_0123456789. Apply (Apply Tuple2Sym0 p) _z_0123456789 ~ Let0123456789Scrutinee_0123456789Sym2 a b =>+                             Sing p+                             -> Sing _z_0123456789+                                -> Sing (Case_0123456789 a b (Apply (Apply Tuple2Sym0 p) _z_0123456789))+                           lambda p _z_0123456789 = p+                         in lambda sP _s_z_0123456789 } ::+                    Sing (Case_0123456789 a b (Let0123456789Scrutinee_0123456789Sym2 a b))+        in lambda sA sB+    sFoo2 sD _s_z_0123456789+      = let+          lambda ::+            forall d _z_0123456789. (t ~ d, t ~ _z_0123456789) =>+            Sing d+            -> Sing _z_0123456789+               -> Sing (Apply (Apply Foo2Sym0 d) _z_0123456789 :: a)+          lambda d _z_0123456789+            = let+                sScrutinee_0123456789 ::+                  Sing (Let0123456789Scrutinee_0123456789Sym2 d _z_0123456789)+                sScrutinee_0123456789+                  = applySing (singFun1 (Proxy :: Proxy JustSym0) SJust) d+              in  case sScrutinee_0123456789 of {+                    SJust sY+                      -> let+                           lambda ::+                             forall y. Apply JustSym0 y ~ Let0123456789Scrutinee_0123456789Sym2 d _z_0123456789 =>+                             Sing y -> Sing (Case_0123456789 d _z_0123456789 (Apply JustSym0 y))+                           lambda y = y+                         in lambda sY } ::+                    Sing (Case_0123456789 d _z_0123456789 (Let0123456789Scrutinee_0123456789Sym2 d _z_0123456789))+        in lambda sD _s_z_0123456789+    sFoo1 sD sX+      = let+          lambda ::+            forall d x. (t ~ d, t ~ x) =>+            Sing d -> Sing x -> Sing (Apply (Apply Foo1Sym0 d) x :: a)+          lambda d x+            = let+                sScrutinee_0123456789 ::+                  Sing (Let0123456789Scrutinee_0123456789Sym2 d x)+                sScrutinee_0123456789 = x+              in  case sScrutinee_0123456789 of {+                    SJust sY+                      -> let+                           lambda ::+                             forall y. Apply JustSym0 y ~ Let0123456789Scrutinee_0123456789Sym2 d x =>+                             Sing y -> Sing (Case_0123456789 d x (Apply JustSym0 y))+                           lambda y = y+                         in lambda sY+                    SNothing+                      -> let+                           lambda ::+                             NothingSym0 ~ Let0123456789Scrutinee_0123456789Sym2 d x =>+                             Sing (Case_0123456789 d x NothingSym0)+                           lambda = d+                         in lambda } ::+                    Sing (Case_0123456789 d x (Let0123456789Scrutinee_0123456789Sym2 d x))+        in lambda sD sX
− tests/compile-and-dump/Singletons/CaseExpressions.ghc78.template
@@ -1,379 +0,0 @@-Singletons/CaseExpressions.hs: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 } |]-  ======>-    Singletons/CaseExpressions.hs:(0,0)-(0,0)-    foo1 :: forall a. a -> Maybe a -> a-    foo1 d x-      = case x of {-          Just y -> y-          Nothing -> d }-    foo2 :: forall a. a -> Maybe a -> a-    foo2 d _ = case Just d of { Just y -> y }-    foo3 :: forall a b. 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 :: forall a. a -> a-    foo5 x = case x of { y -> \ _ -> x y }-    type Let0123456789Scrutinee_0123456789Sym1 t =-        Let0123456789Scrutinee_0123456789 t-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym0 l-      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>-        Let0123456789Scrutinee_0123456789Sym0KindInference-    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l-    type Let0123456789Scrutinee_0123456789 x = x-    type family Case_0123456789 x y arg_0123456789 t where-      Case_0123456789 x y arg_0123456789 z = x-    type family Lambda_0123456789 x y t where-      Lambda_0123456789 x y arg_0123456789 = Case_0123456789 x y arg_0123456789 arg_0123456789-    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())-    data Lambda_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>-        Lambda_0123456789Sym2KindInference-    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type family Case_0123456789 x t where-      Case_0123456789 x y = Apply (Apply (Apply Lambda_0123456789Sym0 x) y) y-    type Let0123456789Scrutinee_0123456789Sym1 t =-        Let0123456789Scrutinee_0123456789 t-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym0 l-      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>-        Let0123456789Scrutinee_0123456789Sym0KindInference-    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l-    type Let0123456789Scrutinee_0123456789 x = x-    type Let0123456789ZSym2 t t = Let0123456789Z t t-    instance SuppressUnusedWarnings Let0123456789ZSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789ZSym1KindInference GHC.Tuple.())-    data Let0123456789ZSym1 l l-      = forall arg. KindOf (Apply (Let0123456789ZSym1 l) arg) ~ KindOf (Let0123456789ZSym2 l arg) =>-        Let0123456789ZSym1KindInference-    type instance Apply (Let0123456789ZSym1 l) l = Let0123456789ZSym2 l l-    instance SuppressUnusedWarnings Let0123456789ZSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789ZSym0KindInference GHC.Tuple.())-    data Let0123456789ZSym0 l-      = forall arg. KindOf (Apply Let0123456789ZSym0 arg) ~ KindOf (Let0123456789ZSym1 arg) =>-        Let0123456789ZSym0KindInference-    type instance Apply Let0123456789ZSym0 l = Let0123456789ZSym1 l-    type Let0123456789Z x y = (y :: a)-    type family Case_0123456789 x t where-      Case_0123456789 x y = Let0123456789ZSym2 x y-    type Let0123456789Scrutinee_0123456789Sym2 t t =-        Let0123456789Scrutinee_0123456789 t t-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym1KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym1 l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym2 l arg) =>-        Let0123456789Scrutinee_0123456789Sym1KindInference-    type instance Apply (Let0123456789Scrutinee_0123456789Sym1 l) l = Let0123456789Scrutinee_0123456789Sym2 l l-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym0 l-      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>-        Let0123456789Scrutinee_0123456789Sym0KindInference-    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l-    type Let0123456789Scrutinee_0123456789 a b =-        Apply (Apply Tuple2Sym0 a) b-    type family Case_0123456789 a b t where-      Case_0123456789 a b '(p, z) = p-    type Let0123456789Scrutinee_0123456789Sym1 t =-        Let0123456789Scrutinee_0123456789 t-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym0 l-      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>-        Let0123456789Scrutinee_0123456789Sym0KindInference-    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l-    type Let0123456789Scrutinee_0123456789 d = Apply JustSym0 d-    type family Case_0123456789 d t where-      Case_0123456789 d (Just y) = y-    type Let0123456789Scrutinee_0123456789Sym2 t t =-        Let0123456789Scrutinee_0123456789 t t-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym1KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym1 l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym2 l arg) =>-        Let0123456789Scrutinee_0123456789Sym1KindInference-    type instance Apply (Let0123456789Scrutinee_0123456789Sym1 l) l = Let0123456789Scrutinee_0123456789Sym2 l l-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym0 l-      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>-        Let0123456789Scrutinee_0123456789Sym0KindInference-    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l-    type Let0123456789Scrutinee_0123456789 d x = x-    type family Case_0123456789 d x t where-      Case_0123456789 d x (Just y) = y-      Case_0123456789 d x Nothing = d-    type Foo5Sym1 (t :: a) = Foo5 t-    instance SuppressUnusedWarnings Foo5Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo5Sym0KindInference GHC.Tuple.())-    data Foo5Sym0 (l :: TyFun a a)-      = forall arg. KindOf (Apply Foo5Sym0 arg) ~ KindOf (Foo5Sym1 arg) =>-        Foo5Sym0KindInference-    type instance Apply Foo5Sym0 l = Foo5Sym1 l-    type Foo4Sym1 (t :: a) = Foo4 t-    instance SuppressUnusedWarnings Foo4Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo4Sym0KindInference GHC.Tuple.())-    data Foo4Sym0 (l :: TyFun a a)-      = forall arg. KindOf (Apply Foo4Sym0 arg) ~ KindOf (Foo4Sym1 arg) =>-        Foo4Sym0KindInference-    type instance Apply Foo4Sym0 l = Foo4Sym1 l-    type Foo3Sym2 (t :: a) (t :: b) = Foo3 t t-    instance SuppressUnusedWarnings Foo3Sym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo3Sym1KindInference GHC.Tuple.())-    data Foo3Sym1 (l :: a) (l :: TyFun b a)-      = forall arg. KindOf (Apply (Foo3Sym1 l) arg) ~ KindOf (Foo3Sym2 l arg) =>-        Foo3Sym1KindInference-    type instance Apply (Foo3Sym1 l) l = Foo3Sym2 l l-    instance SuppressUnusedWarnings Foo3Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo3Sym0KindInference GHC.Tuple.())-    data Foo3Sym0 (l :: TyFun a (TyFun b a -> *))-      = forall arg. KindOf (Apply Foo3Sym0 arg) ~ KindOf (Foo3Sym1 arg) =>-        Foo3Sym0KindInference-    type instance Apply Foo3Sym0 l = Foo3Sym1 l-    type Foo2Sym2 (t :: a) (t :: Maybe a) = Foo2 t t-    instance SuppressUnusedWarnings Foo2Sym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo2Sym1KindInference GHC.Tuple.())-    data Foo2Sym1 (l :: a) (l :: TyFun (Maybe a) a)-      = forall arg. KindOf (Apply (Foo2Sym1 l) arg) ~ KindOf (Foo2Sym2 l arg) =>-        Foo2Sym1KindInference-    type instance Apply (Foo2Sym1 l) l = Foo2Sym2 l l-    instance SuppressUnusedWarnings Foo2Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo2Sym0KindInference GHC.Tuple.())-    data Foo2Sym0 (l :: TyFun a (TyFun (Maybe a) a -> *))-      = forall arg. KindOf (Apply Foo2Sym0 arg) ~ KindOf (Foo2Sym1 arg) =>-        Foo2Sym0KindInference-    type instance Apply Foo2Sym0 l = Foo2Sym1 l-    type Foo1Sym2 (t :: a) (t :: Maybe a) = Foo1 t t-    instance SuppressUnusedWarnings Foo1Sym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo1Sym1KindInference GHC.Tuple.())-    data Foo1Sym1 (l :: a) (l :: TyFun (Maybe a) a)-      = forall arg. KindOf (Apply (Foo1Sym1 l) arg) ~ KindOf (Foo1Sym2 l arg) =>-        Foo1Sym1KindInference-    type instance Apply (Foo1Sym1 l) l = Foo1Sym2 l l-    instance SuppressUnusedWarnings Foo1Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo1Sym0KindInference GHC.Tuple.())-    data Foo1Sym0 (l :: TyFun a (TyFun (Maybe a) a -> *))-      = forall arg. KindOf (Apply Foo1Sym0 arg) ~ KindOf (Foo1Sym1 arg) =>-        Foo1Sym0KindInference-    type instance Apply Foo1Sym0 l = Foo1Sym1 l-    type family Foo5 (a :: a) :: a where-      Foo5 x = Case_0123456789 x (Let0123456789Scrutinee_0123456789Sym1 x)-    type family Foo4 (a :: a) :: a where-      Foo4 x = Case_0123456789 x (Let0123456789Scrutinee_0123456789Sym1 x)-    type family Foo3 (a :: a) (a :: b) :: a where-      Foo3 a b = Case_0123456789 a b (Let0123456789Scrutinee_0123456789Sym2 a b)-    type family Foo2 (a :: a) (a :: Maybe a) :: a where-      Foo2 d z = Case_0123456789 d (Let0123456789Scrutinee_0123456789Sym1 d)-    type family Foo1 (a :: a) (a :: Maybe a) :: a where-      Foo1 d x = Case_0123456789 d x (Let0123456789Scrutinee_0123456789Sym2 d x)-    sFoo5 :: forall (t :: a). Sing t -> Sing (Apply Foo5Sym0 t)-    sFoo4 :: forall (t :: a). Sing t -> Sing (Apply Foo4Sym0 t)-    sFoo3 ::-      forall (t :: a) (t :: b).-      Sing t -> Sing t -> Sing (Apply (Apply Foo3Sym0 t) t)-    sFoo2 ::-      forall (t :: a) (t :: Maybe a).-      Sing t -> Sing t -> Sing (Apply (Apply Foo2Sym0 t) t)-    sFoo1 ::-      forall (t :: a) (t :: Maybe a).-      Sing t -> Sing t -> Sing (Apply (Apply Foo1Sym0 t) t)-    sFoo5 sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo5Sym0 x)-          lambda x-            = let-                sScrutinee_0123456789 ::-                  Sing (Let0123456789Scrutinee_0123456789Sym1 x)-                sScrutinee_0123456789 = x-              in-                case sScrutinee_0123456789 of {-                  sY-                    -> let-                         lambda :: forall y. Sing y -> Sing (Case_0123456789 x y)-                         lambda y-                           = applySing-                               (singFun1-                                  (Proxy :: Proxy (Apply (Apply Lambda_0123456789Sym0 x) y))-                                  (\ sArg_0123456789-                                     -> let-                                          lambda ::-                                            forall arg_0123456789.-                                            Sing arg_0123456789-                                            -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) arg_0123456789)-                                          lambda arg_0123456789-                                            = case arg_0123456789 of {-                                                _ -> let-                                                       lambda ::-                                                         forall wild.-                                                         Sing (Case_0123456789 x y arg_0123456789 wild)-                                                       lambda = x-                                                     in lambda }-                                        in lambda sArg_0123456789))-                               y-                       in lambda sY }-        in lambda sX-    sFoo4 sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo4Sym0 x)-          lambda x-            = let-                sScrutinee_0123456789 ::-                  Sing (Let0123456789Scrutinee_0123456789Sym1 x)-                sScrutinee_0123456789 = x-              in-                case sScrutinee_0123456789 of {-                  sY-                    -> let-                         lambda :: forall y. Sing y -> Sing (Case_0123456789 x y)-                         lambda y-                           = let-                               sZ :: Sing (Let0123456789ZSym2 x y)-                               sZ = y-                             in sZ-                       in lambda sY }-        in lambda sX-    sFoo3 sA sB-      = let-          lambda ::-            forall a b. (t ~ a, t ~ b) =>-            Sing a -> Sing b -> Sing (Apply (Apply Foo3Sym0 a) b)-          lambda a b-            = let-                sScrutinee_0123456789 ::-                  Sing (Let0123456789Scrutinee_0123456789Sym2 a b)-                sScrutinee_0123456789-                  = applySing-                      (applySing (singFun2 (Proxy :: Proxy Tuple2Sym0) STuple2) a) b-              in-                case sScrutinee_0123456789 of {-                  STuple2 sP _-                    -> let-                         lambda ::-                           forall p wild.-                           Sing p-                           -> Sing (Case_0123456789 a b (Apply (Apply Tuple2Sym0 p) wild))-                         lambda p = p-                       in lambda sP }-        in lambda sA sB-    sFoo2 sD _-      = let-          lambda ::-            forall d wild. (t ~ d, t ~ wild) =>-            Sing d -> Sing (Apply (Apply Foo2Sym0 d) wild)-          lambda d-            = let-                sScrutinee_0123456789 ::-                  Sing (Let0123456789Scrutinee_0123456789Sym1 d)-                sScrutinee_0123456789-                  = applySing (singFun1 (Proxy :: Proxy JustSym0) SJust) d-              in-                case sScrutinee_0123456789 of {-                  SJust sY-                    -> let-                         lambda ::-                           forall y. Sing y -> Sing (Case_0123456789 d (Apply JustSym0 y))-                         lambda y = y-                       in lambda sY }-        in lambda sD-    sFoo1 sD sX-      = let-          lambda ::-            forall d x. (t ~ d, t ~ x) =>-            Sing d -> Sing x -> Sing (Apply (Apply Foo1Sym0 d) x)-          lambda d x-            = let-                sScrutinee_0123456789 ::-                  Sing (Let0123456789Scrutinee_0123456789Sym2 d x)-                sScrutinee_0123456789 = x-              in-                case sScrutinee_0123456789 of {-                  SJust sY-                    -> let-                         lambda ::-                           forall y. Sing y -> Sing (Case_0123456789 d x (Apply JustSym0 y))-                         lambda y = y-                       in lambda sY-                  SNothing-                    -> let-                         lambda :: Sing (Case_0123456789 d x NothingSym0)-                         lambda = d-                       in lambda }-        in lambda sD sX
+ tests/compile-and-dump/Singletons/Classes.ghc710.template view
@@ -0,0 +1,652 @@+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 Eq Foo2 where+            F == F = True+            G == G = True+            F == G = False+            G == F = False+          instance MyOrd Foo where+            mycompare = fooCompare+          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 |]+  ======>+    const :: forall a b. 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 (t :: Foo) (t :: Foo) = FooCompare t t+    instance SuppressUnusedWarnings FooCompareSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) FooCompareSym1KindInference GHC.Tuple.())+    data FooCompareSym1 (l :: Foo) (l :: TyFun Foo Ordering)+      = forall arg. KindOf (Apply (FooCompareSym1 l) arg) ~ KindOf (FooCompareSym2 l arg) =>+        FooCompareSym1KindInference+    type instance Apply (FooCompareSym1 l) l = FooCompareSym2 l l+    instance SuppressUnusedWarnings FooCompareSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) FooCompareSym0KindInference GHC.Tuple.())+    data FooCompareSym0 (l :: TyFun Foo (TyFun Foo Ordering -> *))+      = forall arg. KindOf (Apply FooCompareSym0 arg) ~ KindOf (FooCompareSym1 arg) =>+        FooCompareSym0KindInference+    type instance Apply FooCompareSym0 l = FooCompareSym1 l+    type ConstSym2 (t :: a) (t :: b) = Const t t+    instance SuppressUnusedWarnings ConstSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) ConstSym1KindInference GHC.Tuple.())+    data ConstSym1 (l :: a) (l :: TyFun b a)+      = forall arg. KindOf (Apply (ConstSym1 l) arg) ~ KindOf (ConstSym2 l arg) =>+        ConstSym1KindInference+    type instance Apply (ConstSym1 l) l = ConstSym2 l l+    instance SuppressUnusedWarnings ConstSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) ConstSym0KindInference GHC.Tuple.())+    data ConstSym0 (l :: TyFun a (TyFun b a -> *))+      = forall arg. KindOf (Apply ConstSym0 arg) ~ KindOf (ConstSym1 arg) =>+        ConstSym0KindInference+    type instance Apply ConstSym0 l = ConstSym1 l+    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 _z_0123456789 = x+    infix 4 :<=>+    type MycompareSym2 (t :: a) (t :: a) = Mycompare t t+    instance SuppressUnusedWarnings MycompareSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) MycompareSym1KindInference GHC.Tuple.())+    data MycompareSym1 (l :: a) (l :: TyFun a Ordering)+      = forall arg. KindOf (Apply (MycompareSym1 l) arg) ~ KindOf (MycompareSym2 l arg) =>+        MycompareSym1KindInference+    type instance Apply (MycompareSym1 l) l = MycompareSym2 l l+    instance SuppressUnusedWarnings MycompareSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) MycompareSym0KindInference GHC.Tuple.())+    data MycompareSym0 (l :: TyFun a (TyFun a Ordering -> *))+      = forall arg. KindOf (Apply MycompareSym0 arg) ~ KindOf (MycompareSym1 arg) =>+        MycompareSym0KindInference+    type instance Apply MycompareSym0 l = MycompareSym1 l+    type (:<=>$$$) (t :: a) (t :: a) = (:<=>) t t+    instance SuppressUnusedWarnings (:<=>$$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:<=>$$###) GHC.Tuple.())+    data (:<=>$$) (l :: a) (l :: TyFun a Ordering)+      = forall arg. KindOf (Apply ((:<=>$$) l) arg) ~ KindOf ((:<=>$$$) l arg) =>+        :<=>$$###+    type instance Apply ((:<=>$$) l) l = (:<=>$$$) l l+    instance SuppressUnusedWarnings (:<=>$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:<=>$###) GHC.Tuple.())+    data (:<=>$) (l :: TyFun a (TyFun a Ordering -> *))+      = forall arg. KindOf (Apply (:<=>$) arg) ~ KindOf ((:<=>$$) arg) =>+        :<=>$###+    type instance Apply (:<=>$) l = (:<=>$$) l+    type family TFHelper_0123456789 (a :: a) (a :: a) :: Ordering where+      TFHelper_0123456789 a_0123456789 a_0123456789 = Apply (Apply MycompareSym0 a_0123456789) a_0123456789+    type TFHelper_0123456789Sym2 (t :: a) (t :: a) =+        TFHelper_0123456789 t t+    instance SuppressUnusedWarnings TFHelper_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) TFHelper_0123456789Sym1KindInference GHC.Tuple.())+    data TFHelper_0123456789Sym1 (l :: a) (l :: TyFun a Ordering)+      = forall arg. KindOf (Apply (TFHelper_0123456789Sym1 l) arg) ~ KindOf (TFHelper_0123456789Sym2 l arg) =>+        TFHelper_0123456789Sym1KindInference+    type instance Apply (TFHelper_0123456789Sym1 l) l = TFHelper_0123456789Sym2 l l+    instance SuppressUnusedWarnings TFHelper_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) TFHelper_0123456789Sym0KindInference GHC.Tuple.())+    data TFHelper_0123456789Sym0 (l :: TyFun a (TyFun a Ordering -> *))+      = forall arg. KindOf (Apply TFHelper_0123456789Sym0 arg) ~ KindOf (TFHelper_0123456789Sym1 arg) =>+        TFHelper_0123456789Sym0KindInference+    type instance Apply TFHelper_0123456789Sym0 l = TFHelper_0123456789Sym1 l+    class kproxy ~ KProxy => PMyOrd (kproxy :: KProxy a) where+      type family Mycompare (arg :: a) (arg :: a) :: Ordering+      type family (:<=>) (arg :: a) (arg :: a) :: Ordering+      (:<=>) (a :: a)+             (a :: a) = Apply (Apply TFHelper_0123456789Sym0 a) a+    type family Mycompare_0123456789 (a :: Nat)+                                     (a :: Nat) :: Ordering where+      Mycompare_0123456789 Zero Zero = EQSym0+      Mycompare_0123456789 Zero (Succ _z_0123456789) = LTSym0+      Mycompare_0123456789 (Succ _z_0123456789) Zero = GTSym0+      Mycompare_0123456789 (Succ n) (Succ m) = Apply (Apply MycompareSym0 m) n+    type Mycompare_0123456789Sym2 (t :: Nat) (t :: Nat) =+        Mycompare_0123456789 t t+    instance SuppressUnusedWarnings Mycompare_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Mycompare_0123456789Sym1KindInference GHC.Tuple.())+    data Mycompare_0123456789Sym1 (l :: Nat) (l :: TyFun Nat Ordering)+      = forall arg. KindOf (Apply (Mycompare_0123456789Sym1 l) arg) ~ KindOf (Mycompare_0123456789Sym2 l arg) =>+        Mycompare_0123456789Sym1KindInference+    type instance Apply (Mycompare_0123456789Sym1 l) l = Mycompare_0123456789Sym2 l l+    instance SuppressUnusedWarnings Mycompare_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Mycompare_0123456789Sym0KindInference GHC.Tuple.())+    data Mycompare_0123456789Sym0 (l :: TyFun Nat (TyFun Nat Ordering+                                                   -> *))+      = forall arg. KindOf (Apply Mycompare_0123456789Sym0 arg) ~ KindOf (Mycompare_0123456789Sym1 arg) =>+        Mycompare_0123456789Sym0KindInference+    type instance Apply Mycompare_0123456789Sym0 l = Mycompare_0123456789Sym1 l+    instance PMyOrd (KProxy :: KProxy Nat) where+      type Mycompare (a :: Nat) (a :: Nat) = Apply (Apply Mycompare_0123456789Sym0 a) a+    type family Mycompare_0123456789 (a :: ())+                                     (a :: ()) :: Ordering where+      Mycompare_0123456789 _z_0123456789 a_0123456789 = Apply (Apply ConstSym0 EQSym0) a_0123456789+    type Mycompare_0123456789Sym2 (t :: ()) (t :: ()) =+        Mycompare_0123456789 t t+    instance SuppressUnusedWarnings Mycompare_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Mycompare_0123456789Sym1KindInference GHC.Tuple.())+    data Mycompare_0123456789Sym1 (l :: ()) (l :: TyFun () Ordering)+      = forall arg. KindOf (Apply (Mycompare_0123456789Sym1 l) arg) ~ KindOf (Mycompare_0123456789Sym2 l arg) =>+        Mycompare_0123456789Sym1KindInference+    type instance Apply (Mycompare_0123456789Sym1 l) l = Mycompare_0123456789Sym2 l l+    instance SuppressUnusedWarnings Mycompare_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Mycompare_0123456789Sym0KindInference GHC.Tuple.())+    data Mycompare_0123456789Sym0 (l :: TyFun () (TyFun () Ordering+                                                  -> *))+      = forall arg. KindOf (Apply Mycompare_0123456789Sym0 arg) ~ KindOf (Mycompare_0123456789Sym1 arg) =>+        Mycompare_0123456789Sym0KindInference+    type instance Apply Mycompare_0123456789Sym0 l = Mycompare_0123456789Sym1 l+    instance PMyOrd (KProxy :: KProxy ()) where+      type Mycompare (a :: ()) (a :: ()) = Apply (Apply Mycompare_0123456789Sym0 a) a+    type family Mycompare_0123456789 (a :: Foo)+                                     (a :: Foo) :: Ordering where+      Mycompare_0123456789 a_0123456789 a_0123456789 = Apply (Apply FooCompareSym0 a_0123456789) a_0123456789+    type Mycompare_0123456789Sym2 (t :: Foo) (t :: Foo) =+        Mycompare_0123456789 t t+    instance SuppressUnusedWarnings Mycompare_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Mycompare_0123456789Sym1KindInference GHC.Tuple.())+    data Mycompare_0123456789Sym1 (l :: Foo) (l :: TyFun Foo Ordering)+      = forall arg. KindOf (Apply (Mycompare_0123456789Sym1 l) arg) ~ KindOf (Mycompare_0123456789Sym2 l arg) =>+        Mycompare_0123456789Sym1KindInference+    type instance Apply (Mycompare_0123456789Sym1 l) l = Mycompare_0123456789Sym2 l l+    instance SuppressUnusedWarnings Mycompare_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Mycompare_0123456789Sym0KindInference GHC.Tuple.())+    data Mycompare_0123456789Sym0 (l :: TyFun Foo (TyFun Foo Ordering+                                                   -> *))+      = forall arg. KindOf (Apply Mycompare_0123456789Sym0 arg) ~ KindOf (Mycompare_0123456789Sym1 arg) =>+        Mycompare_0123456789Sym0KindInference+    type instance Apply Mycompare_0123456789Sym0 l = Mycompare_0123456789Sym1 l+    instance PMyOrd (KProxy :: KProxy Foo) where+      type Mycompare (a :: Foo) (a :: Foo) = Apply (Apply Mycompare_0123456789Sym0 a) a+    type family TFHelper_0123456789 (a :: Foo2)+                                    (a :: Foo2) :: Bool where+      TFHelper_0123456789 F F = TrueSym0+      TFHelper_0123456789 G G = TrueSym0+      TFHelper_0123456789 F G = FalseSym0+      TFHelper_0123456789 G F = FalseSym0+    type TFHelper_0123456789Sym2 (t :: Foo2) (t :: Foo2) =+        TFHelper_0123456789 t t+    instance SuppressUnusedWarnings TFHelper_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) TFHelper_0123456789Sym1KindInference GHC.Tuple.())+    data TFHelper_0123456789Sym1 (l :: Foo2) (l :: TyFun Foo2 Bool)+      = forall arg. KindOf (Apply (TFHelper_0123456789Sym1 l) arg) ~ KindOf (TFHelper_0123456789Sym2 l arg) =>+        TFHelper_0123456789Sym1KindInference+    type instance Apply (TFHelper_0123456789Sym1 l) l = TFHelper_0123456789Sym2 l l+    instance SuppressUnusedWarnings TFHelper_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) TFHelper_0123456789Sym0KindInference GHC.Tuple.())+    data TFHelper_0123456789Sym0 (l :: TyFun Foo2 (TyFun Foo2 Bool+                                                   -> *))+      = forall arg. KindOf (Apply TFHelper_0123456789Sym0 arg) ~ KindOf (TFHelper_0123456789Sym1 arg) =>+        TFHelper_0123456789Sym0KindInference+    type instance Apply TFHelper_0123456789Sym0 l = TFHelper_0123456789Sym1 l+    instance PEq (KProxy :: KProxy Foo2) where+      type (:==) (a :: Foo2) (a :: Foo2) = Apply (Apply TFHelper_0123456789Sym0 a) a+    infix 4 %:<=>+    sFooCompare ::+      forall (t :: Foo) (t :: Foo).+      Sing t+      -> Sing t -> Sing (Apply (Apply FooCompareSym0 t) t :: Ordering)+    sConst ::+      forall (t :: a) (t :: b).+      Sing t -> Sing t -> Sing (Apply (Apply ConstSym0 t) t :: a)+    sFooCompare SA SA+      = let+          lambda ::+            (t ~ ASym0, t ~ ASym0) =>+            Sing (Apply (Apply FooCompareSym0 ASym0) ASym0 :: Ordering)+          lambda = SEQ+        in lambda+    sFooCompare SA SB+      = let+          lambda ::+            (t ~ ASym0, t ~ BSym0) =>+            Sing (Apply (Apply FooCompareSym0 ASym0) BSym0 :: Ordering)+          lambda = SLT+        in lambda+    sFooCompare SB SB+      = let+          lambda ::+            (t ~ BSym0, t ~ BSym0) =>+            Sing (Apply (Apply FooCompareSym0 BSym0) BSym0 :: Ordering)+          lambda = SGT+        in lambda+    sFooCompare SB SA+      = let+          lambda ::+            (t ~ BSym0, t ~ ASym0) =>+            Sing (Apply (Apply FooCompareSym0 BSym0) ASym0 :: Ordering)+          lambda = SEQ+        in lambda+    sConst sX _s_z_0123456789+      = let+          lambda ::+            forall x _z_0123456789. (t ~ x, t ~ _z_0123456789) =>+            Sing x+            -> Sing _z_0123456789+               -> Sing (Apply (Apply ConstSym0 x) _z_0123456789 :: a)+          lambda x _z_0123456789 = x+        in lambda sX _s_z_0123456789+    data instance Sing (z :: Foo) = z ~ A => SA | z ~ B => SB+    type SFoo = (Sing :: Foo -> *)+    instance SingKind (KProxy :: KProxy Foo) where+      type DemoteRep (KProxy :: KProxy Foo) = Foo+      fromSing SA = A+      fromSing SB = B+      toSing A = SomeSing SA+      toSing B = SomeSing SB+    data instance Sing (z :: Foo2) = z ~ F => SF | z ~ G => SG+    type SFoo2 = (Sing :: Foo2 -> *)+    instance SingKind (KProxy :: KProxy Foo2) where+      type DemoteRep (KProxy :: KProxy Foo2) = Foo2+      fromSing SF = F+      fromSing SG = G+      toSing F = SomeSing SF+      toSing G = SomeSing SG+    class kproxy ~ KProxy => SMyOrd (kproxy :: KProxy 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 ~ Apply (Apply TFHelper_0123456789Sym0 t) t =>+                Sing t -> Sing t -> Sing (Apply (Apply (:<=>$) t) t :: Ordering)+      (%:<=>) sA_0123456789 sA_0123456789+        = let+            lambda ::+              forall a_0123456789 a_0123456789. (t ~ a_0123456789,+                                                 t ~ a_0123456789) =>+              Sing a_0123456789+              -> Sing a_0123456789+                 -> Sing (Apply (Apply (:<=>$) a_0123456789) a_0123456789 :: Ordering)+            lambda a_0123456789 a_0123456789+              = applySing+                  (applySing+                     (singFun2 (Proxy :: Proxy MycompareSym0) sMycompare) a_0123456789)+                  a_0123456789+          in lambda sA_0123456789 sA_0123456789+    instance SMyOrd (KProxy :: KProxy Nat) where+      sMycompare ::+        forall (t :: Nat) (t :: Nat).+        Sing t+        -> Sing t -> Sing (Apply (Apply MycompareSym0 t) t :: Ordering)+      sMycompare SZero SZero+        = let+            lambda ::+              (t ~ ZeroSym0, t ~ ZeroSym0) =>+              Sing (Apply (Apply MycompareSym0 ZeroSym0) ZeroSym0 :: Ordering)+            lambda = SEQ+          in lambda+      sMycompare SZero (SSucc _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789. (t ~ ZeroSym0,+                                     t ~ Apply SuccSym0 _z_0123456789) =>+              Sing _z_0123456789+              -> Sing (Apply (Apply MycompareSym0 ZeroSym0) (Apply SuccSym0 _z_0123456789) :: Ordering)+            lambda _z_0123456789 = SLT+          in lambda _s_z_0123456789+      sMycompare (SSucc _s_z_0123456789) SZero+        = let+            lambda ::+              forall _z_0123456789. (t ~ Apply SuccSym0 _z_0123456789,+                                     t ~ ZeroSym0) =>+              Sing _z_0123456789+              -> Sing (Apply (Apply MycompareSym0 (Apply SuccSym0 _z_0123456789)) ZeroSym0 :: Ordering)+            lambda _z_0123456789 = SGT+          in lambda _s_z_0123456789+      sMycompare (SSucc sN) (SSucc sM)+        = let+            lambda ::+              forall n m. (t ~ Apply SuccSym0 n, t ~ Apply SuccSym0 m) =>+              Sing n+              -> Sing m+                 -> Sing (Apply (Apply MycompareSym0 (Apply SuccSym0 n)) (Apply SuccSym0 m) :: Ordering)+            lambda n m+              = applySing+                  (applySing (singFun2 (Proxy :: Proxy MycompareSym0) sMycompare) m)+                  n+          in lambda sN sM+    instance SMyOrd (KProxy :: KProxy ()) where+      sMycompare ::+        forall (t :: ()) (t :: ()).+        Sing t+        -> Sing t -> Sing (Apply (Apply MycompareSym0 t) t :: Ordering)+      sMycompare _s_z_0123456789 sA_0123456789+        = let+            lambda ::+              forall _z_0123456789 a_0123456789. (t ~ _z_0123456789,+                                                  t ~ a_0123456789) =>+              Sing _z_0123456789+              -> Sing a_0123456789+                 -> Sing (Apply (Apply MycompareSym0 _z_0123456789) a_0123456789 :: Ordering)+            lambda _z_0123456789 a_0123456789+              = applySing+                  (applySing (singFun2 (Proxy :: Proxy ConstSym0) sConst) SEQ)+                  a_0123456789+          in lambda _s_z_0123456789 sA_0123456789+    instance SMyOrd (KProxy :: KProxy Foo) where+      sMycompare ::+        forall (t :: Foo) (t :: Foo).+        Sing t+        -> Sing t -> Sing (Apply (Apply MycompareSym0 t) t :: Ordering)+      sMycompare sA_0123456789 sA_0123456789+        = let+            lambda ::+              forall a_0123456789 a_0123456789. (t ~ a_0123456789,+                                                 t ~ a_0123456789) =>+              Sing a_0123456789+              -> Sing a_0123456789+                 -> Sing (Apply (Apply MycompareSym0 a_0123456789) a_0123456789 :: Ordering)+            lambda a_0123456789 a_0123456789+              = applySing+                  (applySing+                     (singFun2 (Proxy :: Proxy FooCompareSym0) sFooCompare)+                     a_0123456789)+                  a_0123456789+          in lambda sA_0123456789 sA_0123456789+    instance SEq (KProxy :: KProxy Foo2) where+      (%:==) ::+        forall (a :: Foo2) (b :: Foo2).+        Sing a -> Sing b -> Sing ((:==) a b)+      (%:==) SF SF+        = let+            lambda ::+              (a ~ FSym0, b ~ FSym0) => Sing (Apply (Apply (:==$) FSym0) FSym0)+            lambda = STrue+          in lambda+      (%:==) SG SG+        = let+            lambda ::+              (a ~ GSym0, b ~ GSym0) => Sing (Apply (Apply (:==$) GSym0) GSym0)+            lambda = STrue+          in lambda+      (%:==) SF SG+        = let+            lambda ::+              (a ~ FSym0, b ~ GSym0) => Sing (Apply (Apply (:==$) FSym0) GSym0)+            lambda = SFalse+          in lambda+      (%:==) SG SF+        = let+            lambda ::+              (a ~ GSym0, b ~ FSym0) => Sing (Apply (Apply (:==$) GSym0) FSym0)+            lambda = SFalse+          in lambda+    instance SingI A where+      sing = SA+    instance SingI B where+      sing = SB+    instance SingI F where+      sing = SF+    instance SingI G where+      sing = SG+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_0123456789 (a :: Foo2)+                                     (a :: Foo2) :: Ordering where+      Mycompare_0123456789 F F = EQSym0+      Mycompare_0123456789 F _z_0123456789 = LTSym0+      Mycompare_0123456789 _z_0123456789 _z_0123456789 = GTSym0+    type Mycompare_0123456789Sym2 (t :: Foo2) (t :: Foo2) =+        Mycompare_0123456789 t t+    instance SuppressUnusedWarnings Mycompare_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Mycompare_0123456789Sym1KindInference GHC.Tuple.())+    data Mycompare_0123456789Sym1 (l :: Foo2)+                                  (l :: TyFun Foo2 Ordering)+      = forall arg. KindOf (Apply (Mycompare_0123456789Sym1 l) arg) ~ KindOf (Mycompare_0123456789Sym2 l arg) =>+        Mycompare_0123456789Sym1KindInference+    type instance Apply (Mycompare_0123456789Sym1 l) l = Mycompare_0123456789Sym2 l l+    instance SuppressUnusedWarnings Mycompare_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Mycompare_0123456789Sym0KindInference GHC.Tuple.())+    data Mycompare_0123456789Sym0 (l :: TyFun Foo2 (TyFun Foo2 Ordering+                                                    -> *))+      = forall arg. KindOf (Apply Mycompare_0123456789Sym0 arg) ~ KindOf (Mycompare_0123456789Sym1 arg) =>+        Mycompare_0123456789Sym0KindInference+    type instance Apply Mycompare_0123456789Sym0 l = Mycompare_0123456789Sym1 l+    instance PMyOrd (KProxy :: KProxy Foo2) where+      type Mycompare (a :: Foo2) (a :: Foo2) = Apply (Apply Mycompare_0123456789Sym0 a) a+    type family Compare_0123456789 (a :: Foo2)+                                   (a :: Foo2) :: Ordering where+      Compare_0123456789 F F = EQSym0+      Compare_0123456789 F _z_0123456789 = LTSym0+      Compare_0123456789 _z_0123456789 _z_0123456789 = GTSym0+    type Compare_0123456789Sym2 (t :: Foo2) (t :: Foo2) =+        Compare_0123456789 t t+    instance SuppressUnusedWarnings Compare_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Compare_0123456789Sym1KindInference GHC.Tuple.())+    data Compare_0123456789Sym1 (l :: Foo2) (l :: TyFun Foo2 Ordering)+      = forall arg. KindOf (Apply (Compare_0123456789Sym1 l) arg) ~ KindOf (Compare_0123456789Sym2 l arg) =>+        Compare_0123456789Sym1KindInference+    type instance Apply (Compare_0123456789Sym1 l) l = Compare_0123456789Sym2 l l+    instance SuppressUnusedWarnings Compare_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Compare_0123456789Sym0KindInference GHC.Tuple.())+    data Compare_0123456789Sym0 (l :: TyFun Foo2 (TyFun Foo2 Ordering+                                                  -> *))+      = forall arg. KindOf (Apply Compare_0123456789Sym0 arg) ~ KindOf (Compare_0123456789Sym1 arg) =>+        Compare_0123456789Sym0KindInference+    type instance Apply Compare_0123456789Sym0 l = Compare_0123456789Sym1 l+    instance POrd (KProxy :: KProxy Foo2) where+      type Compare (a :: Foo2) (a :: Foo2) = Apply (Apply Compare_0123456789Sym0 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 (t :: Nat') = Succ' t+    instance SuppressUnusedWarnings Succ'Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Succ'Sym0KindInference GHC.Tuple.())+    data Succ'Sym0 (l :: TyFun Nat' Nat')+      = forall arg. KindOf (Apply Succ'Sym0 arg) ~ KindOf (Succ'Sym1 arg) =>+        Succ'Sym0KindInference+    type instance Apply Succ'Sym0 l = Succ'Sym1 l+    type family Mycompare_0123456789 (a :: Nat')+                                     (a :: Nat') :: Ordering where+      Mycompare_0123456789 Zero' Zero' = EQSym0+      Mycompare_0123456789 Zero' (Succ' _z_0123456789) = LTSym0+      Mycompare_0123456789 (Succ' _z_0123456789) Zero' = GTSym0+      Mycompare_0123456789 (Succ' n) (Succ' m) = Apply (Apply MycompareSym0 m) n+    type Mycompare_0123456789Sym2 (t :: Nat') (t :: Nat') =+        Mycompare_0123456789 t t+    instance SuppressUnusedWarnings Mycompare_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Mycompare_0123456789Sym1KindInference GHC.Tuple.())+    data Mycompare_0123456789Sym1 (l :: Nat')+                                  (l :: TyFun Nat' Ordering)+      = forall arg. KindOf (Apply (Mycompare_0123456789Sym1 l) arg) ~ KindOf (Mycompare_0123456789Sym2 l arg) =>+        Mycompare_0123456789Sym1KindInference+    type instance Apply (Mycompare_0123456789Sym1 l) l = Mycompare_0123456789Sym2 l l+    instance SuppressUnusedWarnings Mycompare_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Mycompare_0123456789Sym0KindInference GHC.Tuple.())+    data Mycompare_0123456789Sym0 (l :: TyFun Nat' (TyFun Nat' Ordering+                                                    -> *))+      = forall arg. KindOf (Apply Mycompare_0123456789Sym0 arg) ~ KindOf (Mycompare_0123456789Sym1 arg) =>+        Mycompare_0123456789Sym0KindInference+    type instance Apply Mycompare_0123456789Sym0 l = Mycompare_0123456789Sym1 l+    instance PMyOrd (KProxy :: KProxy Nat') where+      type Mycompare (a :: Nat') (a :: Nat') = Apply (Apply Mycompare_0123456789Sym0 a) a+    data instance Sing (z :: Nat')+      = z ~ Zero' => SZero' |+        forall (n :: Nat'). z ~ Succ' n => SSucc' (Sing (n :: Nat'))+    type SNat' = (Sing :: Nat' -> *)+    instance SingKind (KProxy :: KProxy Nat') where+      type DemoteRep (KProxy :: KProxy Nat') = Nat'+      fromSing SZero' = Zero'+      fromSing (SSucc' b) = Succ' (fromSing b)+      toSing Zero' = SomeSing SZero'+      toSing (Succ' b)+        = case toSing b :: SomeSing (KProxy :: KProxy Nat') of {+            SomeSing c -> SomeSing (SSucc' c) }+    instance SMyOrd (KProxy :: KProxy Nat') where+      sMycompare ::+        forall (t :: Nat') (t :: Nat').+        Sing t+        -> Sing t+           -> Sing (Apply (Apply (MycompareSym0 :: TyFun Nat' (TyFun Nat' Ordering+                                                               -> *)+                                                   -> *) t :: TyFun Nat' Ordering+                                                              -> *) t :: Ordering)+      sMycompare SZero' SZero'+        = let+            lambda ::+              (t ~ Zero'Sym0, t ~ Zero'Sym0) =>+              Sing (Apply (Apply MycompareSym0 Zero'Sym0) Zero'Sym0 :: Ordering)+            lambda = SEQ+          in lambda+      sMycompare SZero' (SSucc' _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789. (t ~ Zero'Sym0,+                                     t ~ Apply Succ'Sym0 _z_0123456789) =>+              Sing _z_0123456789+              -> Sing (Apply (Apply MycompareSym0 Zero'Sym0) (Apply Succ'Sym0 _z_0123456789) :: Ordering)+            lambda _z_0123456789 = SLT+          in lambda _s_z_0123456789+      sMycompare (SSucc' _s_z_0123456789) SZero'+        = let+            lambda ::+              forall _z_0123456789. (t ~ Apply Succ'Sym0 _z_0123456789,+                                     t ~ Zero'Sym0) =>+              Sing _z_0123456789+              -> Sing (Apply (Apply MycompareSym0 (Apply Succ'Sym0 _z_0123456789)) Zero'Sym0 :: Ordering)+            lambda _z_0123456789 = SGT+          in lambda _s_z_0123456789+      sMycompare (SSucc' sN) (SSucc' sM)+        = let+            lambda ::+              forall n m. (t ~ Apply Succ'Sym0 n, t ~ Apply Succ'Sym0 m) =>+              Sing n+              -> Sing m+                 -> Sing (Apply (Apply MycompareSym0 (Apply Succ'Sym0 n)) (Apply Succ'Sym0 m) :: Ordering)+            lambda n m+              = applySing+                  (applySing (singFun2 (Proxy :: Proxy MycompareSym0) sMycompare) m)+                  n+          in lambda sN sM+    instance SingI Zero' where+      sing = SZero'+    instance SingI n => SingI (Succ' (n :: Nat')) where+      sing = SSucc' sing
+ tests/compile-and-dump/Singletons/Classes.hs view
@@ -0,0 +1,98 @@+module Singletons.Classes where++import Prelude hiding (const)+import Singletons.Nat+import Data.Singletons+import Data.Singletons.TH+import Language.Haskell.TH.Desugar+import Data.Singletons.Prelude.Ord+import Data.Singletons.Prelude.Eq++$(singletons [d|+  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+    Zero `mycompare` Zero = EQ+    Zero `mycompare` (Succ _) = LT+    (Succ _) `mycompare` Zero = GT+    (Succ n) `mycompare` (Succ m) = m `mycompare` n++    -- test eta-expansion+  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+    -- test that values in instance definitions are eta-expanded+    mycompare = fooCompare++  data Foo2 = F | G++  instance Eq Foo2 where+    F == F = True+    G == G = True+    F == G = False+    G == F = False+ |])++$(promote [d|+  -- instance with overlaping equations. Tests #56+  instance MyOrd Foo2 where+      F `mycompare` F = EQ+      F `mycompare` _ = LT+      _ `mycompare` _ = GT++  instance Ord Foo2 where+    F `compare` F = EQ+    F `compare` _ = LT+    _ `compare` _ = GT++  |])++-- check promotion across different splices (#55)+$(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+ |])++foo1a :: Proxy (Zero `Mycompare` (Succ Zero))+foo1a = Proxy++foo1b :: Proxy LT+foo1b = foo1a++foo2a :: Proxy (A `Mycompare` A)+foo2a = Proxy++foo2b :: Proxy EQ+foo2b = foo2a++foo3a :: Proxy ('() `Mycompare` '())+foo3a = Proxy++foo3b :: Proxy EQ+foo3b = foo3a++foo4a :: Proxy (Succ' Zero' :<=> Zero')+foo4a = Proxy++foo4b :: Proxy GT+foo4b = foo4a
+ tests/compile-and-dump/Singletons/Classes2.ghc710.template view
@@ -0,0 +1,116 @@+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 (t :: NatFoo) = SuccFoo t+    instance SuppressUnusedWarnings SuccFooSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) SuccFooSym0KindInference GHC.Tuple.())+    data SuccFooSym0 (l :: TyFun NatFoo NatFoo)+      = forall arg. KindOf (Apply SuccFooSym0 arg) ~ KindOf (SuccFooSym1 arg) =>+        SuccFooSym0KindInference+    type instance Apply SuccFooSym0 l = SuccFooSym1 l+    type family Mycompare_0123456789 (a :: NatFoo)+                                     (a :: NatFoo) :: Ordering where+      Mycompare_0123456789 ZeroFoo ZeroFoo = EQSym0+      Mycompare_0123456789 ZeroFoo (SuccFoo _z_0123456789) = LTSym0+      Mycompare_0123456789 (SuccFoo _z_0123456789) ZeroFoo = GTSym0+      Mycompare_0123456789 (SuccFoo n) (SuccFoo m) = Apply (Apply MycompareSym0 m) n+    type Mycompare_0123456789Sym2 (t :: NatFoo) (t :: NatFoo) =+        Mycompare_0123456789 t t+    instance SuppressUnusedWarnings Mycompare_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Mycompare_0123456789Sym1KindInference GHC.Tuple.())+    data Mycompare_0123456789Sym1 (l :: NatFoo)+                                  (l :: TyFun NatFoo Ordering)+      = forall arg. KindOf (Apply (Mycompare_0123456789Sym1 l) arg) ~ KindOf (Mycompare_0123456789Sym2 l arg) =>+        Mycompare_0123456789Sym1KindInference+    type instance Apply (Mycompare_0123456789Sym1 l) l = Mycompare_0123456789Sym2 l l+    instance SuppressUnusedWarnings Mycompare_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Mycompare_0123456789Sym0KindInference GHC.Tuple.())+    data Mycompare_0123456789Sym0 (l :: TyFun NatFoo (TyFun NatFoo Ordering+                                                      -> *))+      = forall arg. KindOf (Apply Mycompare_0123456789Sym0 arg) ~ KindOf (Mycompare_0123456789Sym1 arg) =>+        Mycompare_0123456789Sym0KindInference+    type instance Apply Mycompare_0123456789Sym0 l = Mycompare_0123456789Sym1 l+    instance PMyOrd (KProxy :: KProxy NatFoo) where+      type Mycompare (a :: NatFoo) (a :: NatFoo) = Apply (Apply Mycompare_0123456789Sym0 a) a+    data instance Sing (z :: NatFoo)+      = z ~ ZeroFoo => SZeroFoo |+        forall (n :: NatFoo). z ~ SuccFoo n =>+        SSuccFoo (Sing (n :: NatFoo))+    type SNatFoo = (Sing :: NatFoo -> *)+    instance SingKind (KProxy :: KProxy NatFoo) where+      type DemoteRep (KProxy :: KProxy NatFoo) = NatFoo+      fromSing SZeroFoo = ZeroFoo+      fromSing (SSuccFoo b) = SuccFoo (fromSing b)+      toSing ZeroFoo = SomeSing SZeroFoo+      toSing (SuccFoo b)+        = case toSing b :: SomeSing (KProxy :: KProxy NatFoo) of {+            SomeSing c -> SomeSing (SSuccFoo c) }+    instance SMyOrd (KProxy :: KProxy NatFoo) where+      sMycompare ::+        forall (t0 :: NatFoo) (t1 :: NatFoo).+        Sing t0+        -> Sing t1+           -> Sing (Apply (Apply (MycompareSym0 :: TyFun NatFoo (TyFun NatFoo Ordering+                                                                 -> *)+                                                   -> *) t0 :: TyFun NatFoo Ordering+                                                               -> *) t1 :: Ordering)+      sMycompare SZeroFoo SZeroFoo+        = let+            lambda ::+              (t0 ~ ZeroFooSym0, t1 ~ ZeroFooSym0) =>+              Sing (Apply (Apply MycompareSym0 ZeroFooSym0) ZeroFooSym0 :: Ordering)+            lambda = SEQ+          in lambda+      sMycompare SZeroFoo (SSuccFoo _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789. (t0 ~ ZeroFooSym0,+                                     t1 ~ Apply SuccFooSym0 _z_0123456789) =>+              Sing _z_0123456789+              -> Sing (Apply (Apply MycompareSym0 ZeroFooSym0) (Apply SuccFooSym0 _z_0123456789) :: Ordering)+            lambda _z_0123456789 = SLT+          in lambda _s_z_0123456789+      sMycompare (SSuccFoo _s_z_0123456789) SZeroFoo+        = let+            lambda ::+              forall _z_0123456789. (t0 ~ Apply SuccFooSym0 _z_0123456789,+                                     t1 ~ ZeroFooSym0) =>+              Sing _z_0123456789+              -> Sing (Apply (Apply MycompareSym0 (Apply SuccFooSym0 _z_0123456789)) ZeroFooSym0 :: Ordering)+            lambda _z_0123456789 = SGT+          in lambda _s_z_0123456789+      sMycompare (SSuccFoo sN) (SSuccFoo sM)+        = let+            lambda ::+              forall n m. (t0 ~ Apply SuccFooSym0 n, t1 ~ Apply SuccFooSym0 m) =>+              Sing n+              -> Sing m+                 -> Sing (Apply (Apply MycompareSym0 (Apply SuccFooSym0 n)) (Apply SuccFooSym0 m) :: Ordering)+            lambda n m+              = applySing+                  (applySing (singFun2 (Proxy :: Proxy MycompareSym0) sMycompare) m)+                  n+          in lambda sN sM+    instance SingI ZeroFoo where+      sing = SZeroFoo+    instance SingI n => SingI (SuccFoo (n :: NatFoo)) where+      sing = SSuccFoo sing
+ tests/compile-and-dump/Singletons/Classes2.hs view
@@ -0,0 +1,22 @@+module Singletons.Classes2 where++import Prelude hiding (const)+import Singletons.Nat+import Singletons.Classes+import Data.Singletons+import Data.Singletons.TH+import Data.Singletons.Prelude.Ord (EQSym0, LTSym0, GTSym0, Sing(..))+import Language.Haskell.TH.Desugar+++$(singletons [d|+  -- tests promotion of class instances when the class was declared+  -- in a different source file than the instance.+  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+ |])
+ tests/compile-and-dump/Singletons/Contains.ghc710.template view
@@ -0,0 +1,56 @@+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 :: forall a. Eq a => a -> [a] -> Bool+    contains _ GHC.Types.[] = False+    contains elt (h GHC.Types.: t) = ((elt == h) || (contains elt t))+    type ContainsSym2 (t :: a) (t :: [a]) = Contains t t+    instance SuppressUnusedWarnings ContainsSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) ContainsSym1KindInference GHC.Tuple.())+    data ContainsSym1 (l :: a) (l :: TyFun [a] Bool)+      = forall arg. KindOf (Apply (ContainsSym1 l) arg) ~ KindOf (ContainsSym2 l arg) =>+        ContainsSym1KindInference+    type instance Apply (ContainsSym1 l) l = ContainsSym2 l l+    instance SuppressUnusedWarnings ContainsSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) ContainsSym0KindInference GHC.Tuple.())+    data ContainsSym0 (l :: TyFun a (TyFun [a] Bool -> *))+      = forall arg. KindOf (Apply ContainsSym0 arg) ~ KindOf (ContainsSym1 arg) =>+        ContainsSym0KindInference+    type instance Apply ContainsSym0 l = ContainsSym1 l+    type family Contains (a :: a) (a :: [a]) :: Bool where+      Contains _z_0123456789 '[] = FalseSym0+      Contains elt ((:) h t) = Apply (Apply (:||$) (Apply (Apply (:==$) elt) h)) (Apply (Apply ContainsSym0 elt) t)+    sContains ::+      forall (t :: a) (t :: [a]). SEq (KProxy :: KProxy a) =>+      Sing t -> Sing t -> Sing (Apply (Apply ContainsSym0 t) t :: Bool)+    sContains _s_z_0123456789 SNil+      = let+          lambda ::+            forall _z_0123456789. (t ~ _z_0123456789, t ~ '[]) =>+            Sing _z_0123456789+            -> Sing (Apply (Apply ContainsSym0 _z_0123456789) '[] :: Bool)+          lambda _z_0123456789 = SFalse+        in lambda _s_z_0123456789+    sContains sElt (SCons sH sT)+      = let+          lambda ::+            forall elt h t. (t ~ elt, t ~ Apply (Apply (:$) h) t) =>+            Sing elt+            -> Sing h+               -> Sing t+                  -> Sing (Apply (Apply ContainsSym0 elt) (Apply (Apply (:$) h) t) :: Bool)+          lambda elt h t+            = applySing+                (applySing+                   (singFun2 (Proxy :: Proxy (:||$)) (%:||))+                   (applySing+                      (applySing (singFun2 (Proxy :: Proxy (:==$)) (%:==)) elt) h))+                (applySing+                   (applySing (singFun2 (Proxy :: Proxy ContainsSym0) sContains) elt)+                   t)+        in lambda sElt sH sT
− tests/compile-and-dump/Singletons/Contains.ghc78.template
@@ -1,56 +0,0 @@-Singletons/Contains.hs:0:0: Splicing declarations-    singletons-      [d| contains :: Eq a => a -> [a] -> Bool-          contains _ [] = False-          contains elt (h : t) = (elt == h) || (contains elt t) |]-  ======>-    Singletons/Contains.hs:(0,0)-(0,0)-    contains :: forall a. Eq a => a -> [a] -> Bool-    contains _ GHC.Types.[] = False-    contains elt (h GHC.Types.: t) = ((elt == h) || (contains elt t))-    type ContainsSym2 (t :: a) (t :: [a]) = Contains t t-    instance SuppressUnusedWarnings ContainsSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) ContainsSym1KindInference GHC.Tuple.())-    data ContainsSym1 (l :: a) (l :: TyFun [a] Bool)-      = forall arg. KindOf (Apply (ContainsSym1 l) arg) ~ KindOf (ContainsSym2 l arg) =>-        ContainsSym1KindInference-    type instance Apply (ContainsSym1 l) l = ContainsSym2 l l-    instance SuppressUnusedWarnings ContainsSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) ContainsSym0KindInference GHC.Tuple.())-    data ContainsSym0 (l :: TyFun a (TyFun [a] Bool -> *))-      = forall arg. KindOf (Apply ContainsSym0 arg) ~ KindOf (ContainsSym1 arg) =>-        ContainsSym0KindInference-    type instance Apply ContainsSym0 l = ContainsSym1 l-    type family Contains (a :: a) (a :: [a]) :: Bool where-      Contains z '[] = FalseSym0-      Contains elt ((:) h t) = Apply (Apply (:||$) (Apply (Apply (:==$) elt) h)) (Apply (Apply ContainsSym0 elt) t)-    sContains ::-      forall (t :: a) (t :: [a]). SEq (KProxy :: KProxy a) =>-      Sing t -> Sing t -> Sing (Apply (Apply ContainsSym0 t) t)-    sContains _ SNil-      = let-          lambda ::-            forall wild. (t ~ wild, t ~ '[]) =>-            Sing (Apply (Apply ContainsSym0 wild) '[])-          lambda = SFalse-        in lambda-    sContains sElt (SCons sH sT)-      = let-          lambda ::-            forall elt h t. (t ~ elt, t ~ Apply (Apply (:$) h) t) =>-            Sing elt-            -> Sing h-               -> Sing t-                  -> Sing (Apply (Apply ContainsSym0 elt) (Apply (Apply (:$) h) t))-          lambda elt h t-            = applySing-                (applySing-                   (singFun2 (Proxy :: Proxy (:||$)) (%:||))-                   (applySing-                      (applySing (singFun2 (Proxy :: Proxy (:==$)) (%:==)) elt) h))-                (applySing-                   (applySing (singFun2 (Proxy :: Proxy ContainsSym0) sContains) elt)-                   t)-        in lambda sElt sH sT
+ tests/compile-and-dump/Singletons/DataValues.ghc710.template view
@@ -0,0 +1,104 @@+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 (t :: a) (t :: b) = Pair t t+    instance SuppressUnusedWarnings PairSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) PairSym1KindInference GHC.Tuple.())+    data PairSym1 (l :: a) (l :: TyFun b (Pair a b))+      = forall arg. KindOf (Apply (PairSym1 l) arg) ~ KindOf (PairSym2 l arg) =>+        PairSym1KindInference+    type instance Apply (PairSym1 l) l = PairSym2 l l+    instance SuppressUnusedWarnings PairSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) PairSym0KindInference GHC.Tuple.())+    data PairSym0 (l :: TyFun a (TyFun b (Pair a b) -> *))+      = forall arg. KindOf (Apply PairSym0 arg) ~ KindOf (PairSym1 arg) =>+        PairSym0KindInference+    type instance Apply PairSym0 l = PairSym1 l+    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) '[])+    sAList :: Sing AListSym0+    sTuple :: Sing TupleSym0+    sComplex :: Sing ComplexSym0+    sPr :: Sing PrSym0+    sAList+      = applySing+          (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SZero)+          (applySing+             (applySing+                (singFun2 (Proxy :: Proxy (:$)) SCons)+                (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))+             (applySing+                (applySing+                   (singFun2 (Proxy :: Proxy (:$)) SCons)+                   (applySing+                      (singFun1 (Proxy :: Proxy SuccSym0) SSucc)+                      (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero)))+                SNil))+    sTuple+      = applySing+          (applySing+             (applySing (singFun3 (Proxy :: Proxy Tuple3Sym0) STuple3) SFalse)+             (applySing (singFun1 (Proxy :: Proxy JustSym0) SJust) SZero))+          STrue+    sComplex+      = applySing+          (applySing+             (singFun2 (Proxy :: Proxy PairSym0) SPair)+             (applySing+                (applySing+                   (singFun2 (Proxy :: Proxy PairSym0) SPair)+                   (applySing (singFun1 (Proxy :: Proxy JustSym0) SJust) SZero))+                SZero))+          SFalse+    sPr+      = applySing+          (applySing+             (singFun2 (Proxy :: Proxy PairSym0) SPair)+             (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))+          (applySing+             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SZero) SNil)+    data instance Sing (z :: Pair a b)+      = forall (n :: a) (n :: b). z ~ Pair n n =>+        SPair (Sing (n :: a)) (Sing (n :: b))+    type SPair = (Sing :: Pair a b -> *)+    instance (SingKind (KProxy :: KProxy a),+              SingKind (KProxy :: KProxy b)) =>+             SingKind (KProxy :: KProxy (Pair a b)) where+      type DemoteRep (KProxy :: KProxy (Pair a b)) = Pair (DemoteRep (KProxy :: KProxy a)) (DemoteRep (KProxy :: KProxy b))+      fromSing (SPair b b) = Pair (fromSing b) (fromSing b)+      toSing (Pair b b)+        = case+              GHC.Tuple.(,)+                (toSing b :: SomeSing (KProxy :: KProxy a))+                (toSing b :: SomeSing (KProxy :: KProxy b))+          of {+            GHC.Tuple.(,) (SomeSing c) (SomeSing c) -> SomeSing (SPair c c) }+    instance (SingI n, SingI n) => SingI (Pair (n :: a) (n :: b)) where+      sing = SPair sing sing
− tests/compile-and-dump/Singletons/DataValues.ghc78.template
@@ -1,104 +0,0 @@-Singletons/DataValues.hs: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) |]-  ======>-    Singletons/DataValues.hs:(0,0)-(0,0)-    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 (t :: a) (t :: b) = Pair t t-    instance SuppressUnusedWarnings PairSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) PairSym1KindInference GHC.Tuple.())-    data PairSym1 (l :: a) (l :: TyFun b (Pair a b))-      = forall arg. KindOf (Apply (PairSym1 l) arg) ~ KindOf (PairSym2 l arg) =>-        PairSym1KindInference-    type instance Apply (PairSym1 l) l = PairSym2 l l-    instance SuppressUnusedWarnings PairSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) PairSym0KindInference GHC.Tuple.())-    data PairSym0 (l :: TyFun a (TyFun b (Pair a b) -> *))-      = forall arg. KindOf (Apply PairSym0 arg) ~ KindOf (PairSym1 arg) =>-        PairSym0KindInference-    type instance Apply PairSym0 l = PairSym1 l-    type AListSym0 = AList-    type TupleSym0 = Tuple-    type ComplexSym0 = Complex-    type PrSym0 = Pr-    type AList =-        Apply (Apply (:$) ZeroSym0) (Apply (Apply (:$) (Apply SuccSym0 ZeroSym0)) (Apply (Apply (:$) (Apply SuccSym0 (Apply SuccSym0 ZeroSym0))) '[]))-    type Tuple =-        Apply (Apply (Apply Tuple3Sym0 FalseSym0) (Apply JustSym0 ZeroSym0)) TrueSym0-    type Complex =-        Apply (Apply PairSym0 (Apply (Apply PairSym0 (Apply JustSym0 ZeroSym0)) ZeroSym0)) FalseSym0-    type Pr =-        Apply (Apply PairSym0 (Apply SuccSym0 ZeroSym0)) (Apply (Apply (:$) ZeroSym0) '[])-    sAList :: Sing AListSym0-    sTuple :: Sing TupleSym0-    sComplex :: Sing ComplexSym0-    sPr :: Sing PrSym0-    sAList-      = applySing-          (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SZero)-          (applySing-             (applySing-                (singFun2 (Proxy :: Proxy (:$)) SCons)-                (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))-             (applySing-                (applySing-                   (singFun2 (Proxy :: Proxy (:$)) SCons)-                   (applySing-                      (singFun1 (Proxy :: Proxy SuccSym0) SSucc)-                      (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero)))-                SNil))-    sTuple-      = applySing-          (applySing-             (applySing (singFun3 (Proxy :: Proxy Tuple3Sym0) STuple3) SFalse)-             (applySing (singFun1 (Proxy :: Proxy JustSym0) SJust) SZero))-          STrue-    sComplex-      = applySing-          (applySing-             (singFun2 (Proxy :: Proxy PairSym0) SPair)-             (applySing-                (applySing-                   (singFun2 (Proxy :: Proxy PairSym0) SPair)-                   (applySing (singFun1 (Proxy :: Proxy JustSym0) SJust) SZero))-                SZero))-          SFalse-    sPr-      = applySing-          (applySing-             (singFun2 (Proxy :: Proxy PairSym0) SPair)-             (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))-          (applySing-             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SZero) SNil)-    data instance Sing (z :: Pair a b)-      = forall (n :: a) (n :: b). z ~ Pair n n => SPair (Sing n) (Sing n)-    type SPair (z :: Pair a b) = Sing z-    instance (SingKind (KProxy :: KProxy a),-              SingKind (KProxy :: KProxy b)) =>-             SingKind (KProxy :: KProxy (Pair a b)) where-      type DemoteRep (KProxy :: KProxy (Pair a b)) = Pair (DemoteRep (KProxy :: KProxy a)) (DemoteRep (KProxy :: KProxy b))-      fromSing (SPair b b) = Pair (fromSing b) (fromSing b)-      toSing (Pair b b)-        = case-              GHC.Tuple.(,)-                (toSing b :: SomeSing (KProxy :: KProxy a))-                (toSing b :: SomeSing (KProxy :: KProxy b))-          of {-            GHC.Tuple.(,) (SomeSing c) (SomeSing c) -> SomeSing (SPair c c) }-    instance (SingI n, SingI n) => SingI (Pair (n :: a) (n :: b)) where-      sing = SPair sing sing
+ tests/compile-and-dump/Singletons/Empty.ghc710.template view
@@ -0,0 +1,14 @@+Singletons/Empty.hs:(0,0)-(0,0): Splicing declarations+    singletons [d| data Empty |]+  ======>+    data Empty+    data instance Sing (z :: Empty)+    type SEmpty = (Sing :: Empty -> *)+    instance SingKind (KProxy :: KProxy Empty) where+      type DemoteRep (KProxy :: KProxy Empty) = Empty+      fromSing z+        = case z of {+            _ -> error "Empty case reached -- this should be impossible" }+      toSing z+        = case z of {+            _ -> error "Empty case reached -- this should be impossible" }
− tests/compile-and-dump/Singletons/Empty.ghc78.template
@@ -1,15 +0,0 @@-Singletons/Empty.hs:0:0: Splicing declarations-    singletons [d| data Empty |]-  ======>-    Singletons/Empty.hs:(0,0)-(0,0)-    data Empty-    data instance Sing (z :: Empty)-    type SEmpty (z :: Empty) = Sing z-    instance SingKind (KProxy :: KProxy Empty) where-      type DemoteRep (KProxy :: KProxy Empty) = Empty-      fromSing z-        = case z of {-            _ -> error "Empty case reached -- this should be impossible" }-      toSing z-        = case z of {-            _ -> error "Empty case reached -- this should be impossible" }
+ tests/compile-and-dump/Singletons/EnumDeriving.ghc710.template view
@@ -0,0 +1,287 @@+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_0123456789 n t where+      Case_0123456789 n True = BumSym0+      Case_0123456789 n False = Apply ErrorSym0 "toEnum: bad argument"+    type family Case_0123456789 n t where+      Case_0123456789 n True = BazSym0+      Case_0123456789 n False = Case_0123456789 n (Apply (Apply (:==$) n) (FromInteger 2))+    type family Case_0123456789 n t where+      Case_0123456789 n True = BarSym0+      Case_0123456789 n False = Case_0123456789 n (Apply (Apply (:==$) n) (FromInteger 1))+    type family ToEnum_0123456789 (a :: GHC.TypeLits.Nat) :: Foo where+      ToEnum_0123456789 n = Case_0123456789 n (Apply (Apply (:==$) n) (FromInteger 0))+    type ToEnum_0123456789Sym1 (t :: GHC.TypeLits.Nat) =+        ToEnum_0123456789 t+    instance SuppressUnusedWarnings ToEnum_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) ToEnum_0123456789Sym0KindInference GHC.Tuple.())+    data ToEnum_0123456789Sym0 (l :: TyFun GHC.TypeLits.Nat Foo)+      = forall arg. KindOf (Apply ToEnum_0123456789Sym0 arg) ~ KindOf (ToEnum_0123456789Sym1 arg) =>+        ToEnum_0123456789Sym0KindInference+    type instance Apply ToEnum_0123456789Sym0 l = ToEnum_0123456789Sym1 l+    type family FromEnum_0123456789 (a :: Foo) :: GHC.TypeLits.Nat where+      FromEnum_0123456789 Bar = FromInteger 0+      FromEnum_0123456789 Baz = FromInteger 1+      FromEnum_0123456789 Bum = FromInteger 2+    type FromEnum_0123456789Sym1 (t :: Foo) = FromEnum_0123456789 t+    instance SuppressUnusedWarnings FromEnum_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) FromEnum_0123456789Sym0KindInference GHC.Tuple.())+    data FromEnum_0123456789Sym0 (l :: TyFun Foo GHC.TypeLits.Nat)+      = forall arg. KindOf (Apply FromEnum_0123456789Sym0 arg) ~ KindOf (FromEnum_0123456789Sym1 arg) =>+        FromEnum_0123456789Sym0KindInference+    type instance Apply FromEnum_0123456789Sym0 l = FromEnum_0123456789Sym1 l+    instance PEnum (KProxy :: KProxy Foo) where+      type ToEnum (a :: GHC.TypeLits.Nat) = Apply ToEnum_0123456789Sym0 a+      type FromEnum (a :: Foo) = Apply FromEnum_0123456789Sym0 a+    data instance Sing (z :: Foo)+      = z ~ Bar => SBar | z ~ Baz => SBaz | z ~ Bum => SBum+    type SFoo = (Sing :: Foo -> *)+    instance SingKind (KProxy :: KProxy Foo) where+      type DemoteRep (KProxy :: KProxy Foo) = Foo+      fromSing SBar = Bar+      fromSing SBaz = Baz+      fromSing SBum = Bum+      toSing Bar = SomeSing SBar+      toSing Baz = SomeSing SBaz+      toSing Bum = SomeSing SBum+    data instance Sing (z :: Quux) = z ~ Q1 => SQ1 | z ~ Q2 => SQ2+    type SQuux = (Sing :: Quux -> *)+    instance SingKind (KProxy :: KProxy Quux) where+      type DemoteRep (KProxy :: KProxy Quux) = Quux+      fromSing SQ1 = Q1+      fromSing SQ2 = Q2+      toSing Q1 = SomeSing SQ1+      toSing Q2 = SomeSing SQ2+    instance SEnum (KProxy :: KProxy Foo) where+      sToEnum ::+        forall (t0 :: GHC.TypeLits.Nat).+        Sing t0+        -> Sing (Apply (ToEnumSym0 :: TyFun GHC.TypeLits.Nat Foo+                                      -> *) t0 :: Foo)+      sFromEnum ::+        forall (t0 :: Foo).+        Sing t0+        -> Sing (Apply (FromEnumSym0 :: TyFun Foo GHC.TypeLits.Nat+                                        -> *) t0 :: GHC.TypeLits.Nat)+      sToEnum sN+        = let+            lambda ::+              forall n. t0 ~ n => Sing n -> Sing (Apply ToEnumSym0 n :: Foo)+            lambda n+              = case+                    applySing+                      (applySing (singFun2 (Proxy :: Proxy (:==$)) (%:==)) n)+                      (sFromInteger (sing :: Sing 0))+                of {+                  STrue+                    -> let+                         lambda ::+                           TrueSym0 ~ Apply (Apply (:==$) n) (FromInteger 0) =>+                           Sing (Case_0123456789 n TrueSym0)+                         lambda = SBar+                       in lambda+                  SFalse+                    -> let+                         lambda ::+                           FalseSym0 ~ Apply (Apply (:==$) n) (FromInteger 0) =>+                           Sing (Case_0123456789 n FalseSym0)+                         lambda+                           = case+                                 applySing+                                   (applySing (singFun2 (Proxy :: Proxy (:==$)) (%:==)) n)+                                   (sFromInteger (sing :: Sing 1))+                             of {+                               STrue+                                 -> let+                                      lambda ::+                                        TrueSym0 ~ Apply (Apply (:==$) n) (FromInteger 1) =>+                                        Sing (Case_0123456789 n TrueSym0)+                                      lambda = SBaz+                                    in lambda+                               SFalse+                                 -> let+                                      lambda ::+                                        FalseSym0 ~ Apply (Apply (:==$) n) (FromInteger 1) =>+                                        Sing (Case_0123456789 n FalseSym0)+                                      lambda+                                        = case+                                              applySing+                                                (applySing+                                                   (singFun2 (Proxy :: Proxy (:==$)) (%:==)) n)+                                                (sFromInteger (sing :: Sing 2))+                                          of {+                                            STrue+                                              -> let+                                                   lambda ::+                                                     TrueSym0 ~ Apply (Apply (:==$) n) (FromInteger 2) =>+                                                     Sing (Case_0123456789 n TrueSym0)+                                                   lambda = SBum+                                                 in lambda+                                            SFalse+                                              -> let+                                                   lambda ::+                                                     FalseSym0 ~ Apply (Apply (:==$) n) (FromInteger 2) =>+                                                     Sing (Case_0123456789 n FalseSym0)+                                                   lambda+                                                     = sError (sing :: Sing "toEnum: bad argument")+                                                 in lambda } ::+                                            Sing (Case_0123456789 n (Apply (Apply (:==$) n) (FromInteger 2)))+                                    in lambda } ::+                               Sing (Case_0123456789 n (Apply (Apply (:==$) n) (FromInteger 1)))+                       in lambda } ::+                  Sing (Case_0123456789 n (Apply (Apply (:==$) n) (FromInteger 0)))+          in lambda sN+      sFromEnum SBar+        = let+            lambda ::+              t0 ~ BarSym0 =>+              Sing (Apply FromEnumSym0 BarSym0 :: GHC.TypeLits.Nat)+            lambda = sFromInteger (sing :: Sing 0)+          in lambda+      sFromEnum SBaz+        = let+            lambda ::+              t0 ~ BazSym0 =>+              Sing (Apply FromEnumSym0 BazSym0 :: GHC.TypeLits.Nat)+            lambda = sFromInteger (sing :: Sing 1)+          in lambda+      sFromEnum SBum+        = let+            lambda ::+              t0 ~ BumSym0 =>+              Sing (Apply FromEnumSym0 BumSym0 :: GHC.TypeLits.Nat)+            lambda = sFromInteger (sing :: Sing 2)+          in lambda+    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_0123456789 n t where+      Case_0123456789 n True = Q2Sym0+      Case_0123456789 n False = Apply ErrorSym0 "toEnum: bad argument"+    type family Case_0123456789 n t where+      Case_0123456789 n True = Q1Sym0+      Case_0123456789 n False = Case_0123456789 n (Apply (Apply (:==$) n) (FromInteger 1))+    type family ToEnum_0123456789 (a :: GHC.TypeLits.Nat) :: Quux where+      ToEnum_0123456789 n = Case_0123456789 n (Apply (Apply (:==$) n) (FromInteger 0))+    type ToEnum_0123456789Sym1 (t :: GHC.TypeLits.Nat) =+        ToEnum_0123456789 t+    instance SuppressUnusedWarnings ToEnum_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) ToEnum_0123456789Sym0KindInference GHC.Tuple.())+    data ToEnum_0123456789Sym0 (l :: TyFun GHC.TypeLits.Nat Quux)+      = forall arg. KindOf (Apply ToEnum_0123456789Sym0 arg) ~ KindOf (ToEnum_0123456789Sym1 arg) =>+        ToEnum_0123456789Sym0KindInference+    type instance Apply ToEnum_0123456789Sym0 l = ToEnum_0123456789Sym1 l+    type family FromEnum_0123456789 (a :: Quux) :: GHC.TypeLits.Nat where+      FromEnum_0123456789 Q1 = FromInteger 0+      FromEnum_0123456789 Q2 = FromInteger 1+    type FromEnum_0123456789Sym1 (t :: Quux) = FromEnum_0123456789 t+    instance SuppressUnusedWarnings FromEnum_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) FromEnum_0123456789Sym0KindInference GHC.Tuple.())+    data FromEnum_0123456789Sym0 (l :: TyFun Quux GHC.TypeLits.Nat)+      = forall arg. KindOf (Apply FromEnum_0123456789Sym0 arg) ~ KindOf (FromEnum_0123456789Sym1 arg) =>+        FromEnum_0123456789Sym0KindInference+    type instance Apply FromEnum_0123456789Sym0 l = FromEnum_0123456789Sym1 l+    instance PEnum (KProxy :: KProxy Quux) where+      type ToEnum (a :: GHC.TypeLits.Nat) = Apply ToEnum_0123456789Sym0 a+      type FromEnum (a :: Quux) = Apply FromEnum_0123456789Sym0 a+    instance SEnum (KProxy :: KProxy Quux) where+      sToEnum ::+        forall (t0 :: GHC.TypeLits.Nat).+        Sing t0+        -> Sing (Apply (ToEnumSym0 :: TyFun GHC.TypeLits.Nat Quux+                                      -> *) t0 :: Quux)+      sFromEnum ::+        forall (t0 :: Quux).+        Sing t0+        -> Sing (Apply (FromEnumSym0 :: TyFun Quux GHC.TypeLits.Nat+                                        -> *) t0 :: GHC.TypeLits.Nat)+      sToEnum sN+        = let+            lambda ::+              forall n. t0 ~ n => Sing n -> Sing (Apply ToEnumSym0 n :: Quux)+            lambda n+              = case+                    applySing+                      (applySing (singFun2 (Proxy :: Proxy (:==$)) (%:==)) n)+                      (sFromInteger (sing :: Sing 0))+                of {+                  STrue+                    -> let+                         lambda ::+                           TrueSym0 ~ Apply (Apply (:==$) n) (FromInteger 0) =>+                           Sing (Case_0123456789 n TrueSym0)+                         lambda = SQ1+                       in lambda+                  SFalse+                    -> let+                         lambda ::+                           FalseSym0 ~ Apply (Apply (:==$) n) (FromInteger 0) =>+                           Sing (Case_0123456789 n FalseSym0)+                         lambda+                           = case+                                 applySing+                                   (applySing (singFun2 (Proxy :: Proxy (:==$)) (%:==)) n)+                                   (sFromInteger (sing :: Sing 1))+                             of {+                               STrue+                                 -> let+                                      lambda ::+                                        TrueSym0 ~ Apply (Apply (:==$) n) (FromInteger 1) =>+                                        Sing (Case_0123456789 n TrueSym0)+                                      lambda = SQ2+                                    in lambda+                               SFalse+                                 -> let+                                      lambda ::+                                        FalseSym0 ~ Apply (Apply (:==$) n) (FromInteger 1) =>+                                        Sing (Case_0123456789 n FalseSym0)+                                      lambda = sError (sing :: Sing "toEnum: bad argument")+                                    in lambda } ::+                               Sing (Case_0123456789 n (Apply (Apply (:==$) n) (FromInteger 1)))+                       in lambda } ::+                  Sing (Case_0123456789 n (Apply (Apply (:==$) n) (FromInteger 0)))+          in lambda sN+      sFromEnum SQ1+        = let+            lambda ::+              t0 ~ Q1Sym0 => Sing (Apply FromEnumSym0 Q1Sym0 :: GHC.TypeLits.Nat)+            lambda = sFromInteger (sing :: Sing 0)+          in lambda+      sFromEnum SQ2+        = let+            lambda ::+              t0 ~ Q2Sym0 => Sing (Apply FromEnumSym0 Q2Sym0 :: GHC.TypeLits.Nat)+            lambda = sFromInteger (sing :: Sing 1)+          in lambda
+ tests/compile-and-dump/Singletons/EnumDeriving.hs view
@@ -0,0 +1,12 @@+module Singletons.EnumDeriving where++import Data.Singletons.Prelude+import Data.Singletons.TH++$(singletons [d|+  data Foo = Bar | Baz | Bum+    deriving Enum+  data Quux = Q1 | Q2+  |])++$(singEnumInstance ''Quux)
+ tests/compile-and-dump/Singletons/EqInstances.ghc710.template view
@@ -0,0 +1,23 @@+Singletons/EqInstances.hs:0:0:: Splicing declarations+    singEqInstances [''Foo, ''Empty]+  ======>+    instance SEq (KProxy :: KProxy Foo) where+      (%:==) SFLeaf SFLeaf = STrue+      (%:==) SFLeaf ((:%+:) _ _) = SFalse+      (%:==) ((:%+:) _ _) SFLeaf = SFalse+      (%:==) ((:%+:) a a) ((:%+:) b b) = (%:&&) ((%:==) a b) ((%:==) a b)+    type family Equals_0123456789 (a :: Foo) (b :: Foo) :: Bool where+      Equals_0123456789 FLeaf FLeaf = TrueSym0+      Equals_0123456789 ((:+:) a a) ((:+:) b b) = (:&&) ((:==) a b) ((:==) a b)+      Equals_0123456789 (a :: Foo) (b :: Foo) = FalseSym0+    instance PEq (KProxy :: KProxy Foo) where+      type (:==) (a :: Foo) (b :: Foo) = Equals_0123456789 a b+    instance SEq (KProxy :: KProxy Empty) where+      (%:==) a _+        = case a of {+            _ -> error "Empty case reached -- this should be impossible" }+    type family Equals_0123456789 (a :: Empty)+                                  (b :: Empty) :: Bool where+      Equals_0123456789 (a :: Empty) (b :: Empty) = FalseSym0+    instance PEq (KProxy :: KProxy Empty) where+      type (:==) (a :: Empty) (b :: Empty) = Equals_0123456789 a b
− tests/compile-and-dump/Singletons/EqInstances.ghc78.template
@@ -1,24 +0,0 @@-Singletons/EqInstances.hs:0:0: Splicing declarations-    singEqInstances [''Foo, ''Empty]-  ======>-    Singletons/EqInstances.hs:0:0:-    instance SEq (KProxy :: KProxy Foo) where-      (%:==) SFLeaf SFLeaf = STrue-      (%:==) SFLeaf ((:%+:) _ _) = SFalse-      (%:==) ((:%+:) _ _) SFLeaf = SFalse-      (%:==) ((:%+:) a a) ((:%+:) b b) = (%:&&) ((%:==) a b) ((%:==) a b)-    type family Equals_0123456789 (a :: Foo) (b :: Foo) :: Bool where-      Equals_0123456789 FLeaf FLeaf = TrueSym0-      Equals_0123456789 ((:+:) a a) ((:+:) b b) = (:&&) ((:==) a b) ((:==) a b)-      Equals_0123456789 (a :: Foo) (b :: Foo) = FalseSym0-    instance PEq (KProxy :: KProxy Foo) where-      type (:==) (a :: Foo) (b :: Foo) = Equals_0123456789 a b-    instance SEq (KProxy :: KProxy Empty) where-      (%:==) a _-        = case a of {-            _ -> error "Empty case reached -- this should be impossible" }-    type family Equals_0123456789 (a :: Empty)-                                  (b :: Empty) :: Bool where-      Equals_0123456789 (a :: Empty) (b :: Empty) = FalseSym0-    instance PEq (KProxy :: KProxy Empty) where-      type (:==) (a :: Empty) (b :: Empty) = Equals_0123456789 a b
+ tests/compile-and-dump/Singletons/Error.ghc710.template view
@@ -0,0 +1,36 @@+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 :: forall a. [a] -> a+    head (a GHC.Types.: _) = a+    head GHC.Types.[] = error "Data.Singletons.List.head: empty list"+    type HeadSym1 (t :: [a]) = Head t+    instance SuppressUnusedWarnings HeadSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) HeadSym0KindInference GHC.Tuple.())+    data HeadSym0 (l :: TyFun [a] a)+      = forall arg. KindOf (Apply HeadSym0 arg) ~ KindOf (HeadSym1 arg) =>+        HeadSym0KindInference+    type instance Apply HeadSym0 l = HeadSym1 l+    type family Head (a :: [a]) :: a where+      Head ((:) a _z_0123456789) = a+      Head '[] = Apply ErrorSym0 "Data.Singletons.List.head: empty list"+    sHead :: forall (t :: [a]). Sing t -> Sing (Apply HeadSym0 t :: a)+    sHead (SCons sA _s_z_0123456789)+      = let+          lambda ::+            forall a _z_0123456789. t ~ Apply (Apply (:$) a) _z_0123456789 =>+            Sing a+            -> Sing _z_0123456789+               -> Sing (Apply HeadSym0 (Apply (Apply (:$) a) _z_0123456789) :: a)+          lambda a _z_0123456789 = a+        in lambda sA _s_z_0123456789+    sHead SNil+      = let+          lambda :: t ~ '[] => Sing (Apply HeadSym0 '[] :: a)+          lambda+            = sError (sing :: Sing "Data.Singletons.List.head: empty list")+        in lambda
− tests/compile-and-dump/Singletons/Error.ghc78.template
@@ -1,37 +0,0 @@-Singletons/Error.hs:0:0: Splicing declarations-    singletons-      [d| head :: [a] -> a-          head (a : _) = a-          head [] = error "Data.Singletons.List.head: empty list" |]-  ======>-    Singletons/Error.hs:(0,0)-(0,0)-    head :: forall a. [a] -> a-    head (a GHC.Types.: _) = a-    head GHC.Types.[] = error "Data.Singletons.List.head: empty list"-    type HeadSym1 (t :: [a]) = Head t-    instance SuppressUnusedWarnings HeadSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) HeadSym0KindInference GHC.Tuple.())-    data HeadSym0 (l :: TyFun [a] a)-      = forall arg. KindOf (Apply HeadSym0 arg) ~ KindOf (HeadSym1 arg) =>-        HeadSym0KindInference-    type instance Apply HeadSym0 l = HeadSym1 l-    type family Head (a :: [a]) :: a where-      Head ((:) a z) = a-      Head '[] = Apply ErrorSym0 "Data.Singletons.List.head: empty list"-    sHead :: forall (t :: [a]). Sing t -> Sing (Apply HeadSym0 t)-    sHead (SCons sA _)-      = let-          lambda ::-            forall a wild. t ~ Apply (Apply (:$) a) wild =>-            Sing a -> Sing (Apply HeadSym0 (Apply (Apply (:$) a) wild))-          lambda a = a-        in lambda sA-    sHead SNil-      = let-          lambda :: t ~ '[] => Sing (Apply HeadSym0 '[])-          lambda-            = applySing-                (singFun1 (Proxy :: Proxy ErrorSym0) sError)-                (sing :: Sing "Data.Singletons.List.head: empty list")-        in lambda
+ tests/compile-and-dump/Singletons/Fixity.ghc710.template view
@@ -0,0 +1,72 @@+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 <=>+    (====) :: forall a. a -> a -> a+    (====) a _ = a+    infix 4 ====+    type (:====$$$) (t :: a) (t :: a) = (:====) t t+    instance SuppressUnusedWarnings (:====$$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:====$$###) GHC.Tuple.())+    data (:====$$) (l :: a) (l :: TyFun a a)+      = forall arg. KindOf (Apply ((:====$$) l) arg) ~ KindOf ((:====$$$) l arg) =>+        :====$$###+    type instance Apply ((:====$$) l) l = (:====$$$) l l+    instance SuppressUnusedWarnings (:====$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:====$###) GHC.Tuple.())+    data (:====$) (l :: TyFun a (TyFun a a -> *))+      = forall arg. KindOf (Apply (:====$) arg) ~ KindOf ((:====$$) arg) =>+        :====$###+    type instance Apply (:====$) l = (:====$$) l+    type family (:====) (a :: a) (a :: a) :: a where+      (:====) a _z_0123456789 = a+    infix 4 :====+    infix 4 :<=>+    type (:<=>$$$) (t :: a) (t :: a) = (:<=>) t t+    instance SuppressUnusedWarnings (:<=>$$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:<=>$$###) GHC.Tuple.())+    data (:<=>$$) (l :: a) (l :: TyFun a Ordering)+      = forall arg. KindOf (Apply ((:<=>$$) l) arg) ~ KindOf ((:<=>$$$) l arg) =>+        :<=>$$###+    type instance Apply ((:<=>$$) l) l = (:<=>$$$) l l+    instance SuppressUnusedWarnings (:<=>$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:<=>$###) GHC.Tuple.())+    data (:<=>$) (l :: TyFun a (TyFun a Ordering -> *))+      = forall arg. KindOf (Apply (:<=>$) arg) ~ KindOf ((:<=>$$) arg) =>+        :<=>$###+    type instance Apply (:<=>$) l = (:<=>$$) l+    class kproxy ~ KProxy => PMyOrd (kproxy :: KProxy a) where+      type family (:<=>) (arg :: a) (arg :: a) :: Ordering+    infix 4 %:====+    infix 4 %:<=>+    (%:====) ::+      forall (t :: a) (t :: a).+      Sing t -> Sing t -> Sing (Apply (Apply (:====$) t) t :: a)+    (%:====) sA _s_z_0123456789+      = let+          lambda ::+            forall a _z_0123456789. (t ~ a, t ~ _z_0123456789) =>+            Sing a+            -> Sing _z_0123456789+               -> Sing (Apply (Apply (:====$) a) _z_0123456789 :: a)+          lambda a _z_0123456789 = a+        in lambda sA _s_z_0123456789+    class kproxy ~ KProxy => SMyOrd (kproxy :: KProxy a) where+      (%:<=>) ::+        forall (t :: a) (t :: a).+        Sing t -> Sing t -> Sing (Apply (Apply (:<=>$) t) t :: Ordering)
+ tests/compile-and-dump/Singletons/Fixity.hs view
@@ -0,0 +1,16 @@+module Singletons.Fixity where++import Data.Singletons+import Data.Singletons.TH+import Data.Singletons.Prelude+import Language.Haskell.TH.Desugar++$(singletons [d|+  class MyOrd a where+    (<=>) :: a -> a -> Ordering+    infix 4 <=>++  (====) :: a -> a -> a+  a ==== _ = a+  infix 4 ====+ |])
+ tests/compile-and-dump/Singletons/FunDeps.ghc710.template view
@@ -0,0 +1,98 @@+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 (t :: a) = Meth t+    instance SuppressUnusedWarnings MethSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) MethSym0KindInference GHC.Tuple.())+    data MethSym0 (l :: TyFun a a)+      = forall arg. KindOf (Apply MethSym0 arg) ~ KindOf (MethSym1 arg) =>+        MethSym0KindInference+    type instance Apply MethSym0 l = MethSym1 l+    type L2rSym1 (t :: a) = L2r t+    instance SuppressUnusedWarnings L2rSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) L2rSym0KindInference GHC.Tuple.())+    data L2rSym0 (l :: TyFun a b)+      = forall arg. KindOf (Apply L2rSym0 arg) ~ KindOf (L2rSym1 arg) =>+        L2rSym0KindInference+    type instance Apply L2rSym0 l = L2rSym1 l+    class (kproxy ~ KProxy,+           kproxy ~ KProxy) => PFD (kproxy :: KProxy a)+                                   (kproxy :: KProxy b) | a -> b where+      type family Meth (arg :: a) :: a+      type family L2r (arg :: a) :: b+    type family Meth_0123456789 (a :: Bool) :: Bool where+      Meth_0123456789 a_0123456789 = Apply NotSym0 a_0123456789+    type Meth_0123456789Sym1 (t :: Bool) = Meth_0123456789 t+    instance SuppressUnusedWarnings Meth_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Meth_0123456789Sym0KindInference GHC.Tuple.())+    data Meth_0123456789Sym0 (l :: TyFun Bool Bool)+      = forall arg. KindOf (Apply Meth_0123456789Sym0 arg) ~ KindOf (Meth_0123456789Sym1 arg) =>+        Meth_0123456789Sym0KindInference+    type instance Apply Meth_0123456789Sym0 l = Meth_0123456789Sym1 l+    type family L2r_0123456789 (a :: Bool) :: Nat where+      L2r_0123456789 False = FromInteger 0+      L2r_0123456789 True = FromInteger 1+    type L2r_0123456789Sym1 (t :: Bool) = L2r_0123456789 t+    instance SuppressUnusedWarnings L2r_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) L2r_0123456789Sym0KindInference GHC.Tuple.())+    data L2r_0123456789Sym0 (l :: TyFun Bool Nat)+      = forall arg. KindOf (Apply L2r_0123456789Sym0 arg) ~ KindOf (L2r_0123456789Sym1 arg) =>+        L2r_0123456789Sym0KindInference+    type instance Apply L2r_0123456789Sym0 l = L2r_0123456789Sym1 l+    instance PFD (KProxy :: KProxy Bool) (KProxy :: KProxy Nat) where+      type Meth (a :: Bool) = Apply Meth_0123456789Sym0 a+      type L2r (a :: Bool) = Apply L2r_0123456789Sym0 a+    sT1 :: Sing T1Sym0+    sT1 = applySing (singFun1 (Proxy :: Proxy MethSym0) sMeth) STrue+    class (kproxy ~ KProxy,+           kproxy ~ KProxy) => SFD (kproxy :: KProxy a)+                                   (kproxy :: KProxy 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 (KProxy :: KProxy Bool) (KProxy :: KProxy 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_0123456789+        = let+            lambda ::+              forall a_0123456789. t ~ a_0123456789 =>+              Sing a_0123456789 -> Sing (Apply MethSym0 a_0123456789 :: Bool)+            lambda a_0123456789+              = applySing (singFun1 (Proxy :: Proxy NotSym0) sNot) a_0123456789+          in lambda sA_0123456789+      sL2r SFalse+        = let+            lambda :: t ~ FalseSym0 => Sing (Apply L2rSym0 FalseSym0 :: Nat)+            lambda = sFromInteger (sing :: Sing 0)+          in lambda+      sL2r STrue+        = let+            lambda :: t ~ TrueSym0 => Sing (Apply L2rSym0 TrueSym0 :: Nat)+            lambda = sFromInteger (sing :: Sing 1)+          in lambda
+ tests/compile-and-dump/Singletons/FunDeps.hs view
@@ -0,0 +1,21 @@+{-# LANGUAGE FunctionalDependencies #-}++module Singletons.FunDeps where++import Data.Singletons.TH+import Data.Singletons.Prelude+import Data.Singletons.TypeLits++$( singletons [d|+  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+--  t2 = l2r False  -- This fails because no FDs in type families+  |])
+ tests/compile-and-dump/Singletons/HigherOrder.ghc710.template view
@@ -0,0 +1,625 @@+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 :: forall a b. (a -> b) -> [a] -> [b]+    map _ GHC.Types.[] = []+    map f (h GHC.Types.: t) = ((f h) GHC.Types.: (map f t))+    liftMaybe :: forall a b. (a -> b) -> Maybe a -> Maybe b+    liftMaybe f (Just x) = Just (f x)+    liftMaybe _ Nothing = Nothing+    zipWith :: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]+    zipWith f (x GHC.Types.: xs) (y GHC.Types.: ys)+      = ((f x y) GHC.Types.: (zipWith f xs ys))+    zipWith _ GHC.Types.[] GHC.Types.[] = []+    zipWith _ (_ GHC.Types.: _) GHC.Types.[] = []+    zipWith _ GHC.Types.[] (_ GHC.Types.: _) = []+    foo :: forall a b. ((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 (t :: a) = Left t+    instance SuppressUnusedWarnings LeftSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) LeftSym0KindInference GHC.Tuple.())+    data LeftSym0 (l :: TyFun a (Either a b))+      = forall arg. KindOf (Apply LeftSym0 arg) ~ KindOf (LeftSym1 arg) =>+        LeftSym0KindInference+    type instance Apply LeftSym0 l = LeftSym1 l+    type RightSym1 (t :: b) = Right t+    instance SuppressUnusedWarnings RightSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) RightSym0KindInference GHC.Tuple.())+    data RightSym0 (l :: TyFun b (Either a b))+      = forall arg. KindOf (Apply RightSym0 arg) ~ KindOf (RightSym1 arg) =>+        RightSym0KindInference+    type instance Apply RightSym0 l = RightSym1 l+    type Let0123456789Scrutinee_0123456789Sym4 t t t t =+        Let0123456789Scrutinee_0123456789 t t t t+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym3 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym3KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym3 l l l l+      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym3 l l l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym4 l l l arg) =>+        Let0123456789Scrutinee_0123456789Sym3KindInference+    type instance Apply (Let0123456789Scrutinee_0123456789Sym3 l l l) l = Let0123456789Scrutinee_0123456789Sym4 l l l l+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym2KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym2 l l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym3 l l arg) =>+        Let0123456789Scrutinee_0123456789Sym2KindInference+    type instance Apply (Let0123456789Scrutinee_0123456789Sym2 l l) l = Let0123456789Scrutinee_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym1KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym1 l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym2 l arg) =>+        Let0123456789Scrutinee_0123456789Sym1KindInference+    type instance Apply (Let0123456789Scrutinee_0123456789Sym1 l) l = Let0123456789Scrutinee_0123456789Sym2 l l+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym0 l+      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>+        Let0123456789Scrutinee_0123456789Sym0KindInference+    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l+    type family Let0123456789Scrutinee_0123456789 ns bs n b where+      Let0123456789Scrutinee_0123456789 ns bs n b = b+    type family Case_0123456789 ns bs n b t where+      Case_0123456789 ns bs n b True = Apply SuccSym0 (Apply SuccSym0 n)+      Case_0123456789 ns bs n b False = n+    type family Lambda_0123456789 ns bs t t where+      Lambda_0123456789 ns bs n b = Case_0123456789 ns bs n b (Let0123456789Scrutinee_0123456789Sym4 ns bs n b)+    type Lambda_0123456789Sym4 t t t t = Lambda_0123456789 t t t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym3 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym3KindInference GHC.Tuple.())+    data Lambda_0123456789Sym3 l l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym3 l l l) arg) ~ KindOf (Lambda_0123456789Sym4 l l l arg) =>+        Lambda_0123456789Sym3KindInference+    type instance Apply (Lambda_0123456789Sym3 l l l) l = Lambda_0123456789Sym4 l l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())+    data Lambda_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>+        Lambda_0123456789Sym2KindInference+    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type Let0123456789Scrutinee_0123456789Sym4 t t t t =+        Let0123456789Scrutinee_0123456789 t t t t+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym3 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym3KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym3 l l l l+      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym3 l l l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym4 l l l arg) =>+        Let0123456789Scrutinee_0123456789Sym3KindInference+    type instance Apply (Let0123456789Scrutinee_0123456789Sym3 l l l) l = Let0123456789Scrutinee_0123456789Sym4 l l l l+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym2KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym2 l l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym3 l l arg) =>+        Let0123456789Scrutinee_0123456789Sym2KindInference+    type instance Apply (Let0123456789Scrutinee_0123456789Sym2 l l) l = Let0123456789Scrutinee_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym1KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym1 l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym2 l arg) =>+        Let0123456789Scrutinee_0123456789Sym1KindInference+    type instance Apply (Let0123456789Scrutinee_0123456789Sym1 l) l = Let0123456789Scrutinee_0123456789Sym2 l l+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym0 l+      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>+        Let0123456789Scrutinee_0123456789Sym0KindInference+    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l+    type family Let0123456789Scrutinee_0123456789 n+                                                  b+                                                  a_0123456789+                                                  a_0123456789 where+      Let0123456789Scrutinee_0123456789 n b a_0123456789 a_0123456789 = b+    type family Case_0123456789 n b a_0123456789 a_0123456789 t where+      Case_0123456789 n b a_0123456789 a_0123456789 True = Apply SuccSym0 (Apply SuccSym0 n)+      Case_0123456789 n b a_0123456789 a_0123456789 False = n+    type family Lambda_0123456789 a_0123456789 a_0123456789 t t where+      Lambda_0123456789 a_0123456789 a_0123456789 n b = Case_0123456789 n b a_0123456789 a_0123456789 (Let0123456789Scrutinee_0123456789Sym4 n b a_0123456789 a_0123456789)+    type Lambda_0123456789Sym4 t t t t = Lambda_0123456789 t t t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym3 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym3KindInference GHC.Tuple.())+    data Lambda_0123456789Sym3 l l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym3 l l l) arg) ~ KindOf (Lambda_0123456789Sym4 l l l arg) =>+        Lambda_0123456789Sym3KindInference+    type instance Apply (Lambda_0123456789Sym3 l l l) l = Lambda_0123456789Sym4 l l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())+    data Lambda_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>+        Lambda_0123456789Sym2KindInference+    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type FooSym3 (t :: TyFun (TyFun a b -> *) (TyFun a b -> *) -> *)+                 (t :: TyFun a b -> *)+                 (t :: a) =+        Foo t t t+    instance SuppressUnusedWarnings FooSym2 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) FooSym2KindInference GHC.Tuple.())+    data FooSym2 (l :: TyFun (TyFun a b -> *) (TyFun a b -> *) -> *)+                 (l :: TyFun a b -> *)+                 (l :: TyFun a b)+      = forall arg. KindOf (Apply (FooSym2 l l) arg) ~ KindOf (FooSym3 l l arg) =>+        FooSym2KindInference+    type instance Apply (FooSym2 l l) l = FooSym3 l l l+    instance SuppressUnusedWarnings FooSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) FooSym1KindInference GHC.Tuple.())+    data FooSym1 (l :: TyFun (TyFun a b -> *) (TyFun a b -> *) -> *)+                 (l :: TyFun (TyFun a b -> *) (TyFun a b -> *))+      = forall arg. KindOf (Apply (FooSym1 l) arg) ~ KindOf (FooSym2 l arg) =>+        FooSym1KindInference+    type instance Apply (FooSym1 l) l = FooSym2 l l+    instance SuppressUnusedWarnings FooSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) FooSym0KindInference GHC.Tuple.())+    data FooSym0 (l :: TyFun (TyFun (TyFun a b -> *) (TyFun a b -> *)+                              -> *) (TyFun (TyFun a b -> *) (TyFun a b -> *) -> *))+      = forall arg. KindOf (Apply FooSym0 arg) ~ KindOf (FooSym1 arg) =>+        FooSym0KindInference+    type instance Apply FooSym0 l = FooSym1 l+    type ZipWithSym3 (t :: TyFun a (TyFun b c -> *) -> *)+                     (t :: [a])+                     (t :: [b]) =+        ZipWith t t t+    instance SuppressUnusedWarnings ZipWithSym2 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) ZipWithSym2KindInference GHC.Tuple.())+    data ZipWithSym2 (l :: TyFun a (TyFun b c -> *) -> *)+                     (l :: [a])+                     (l :: TyFun [b] [c])+      = forall arg. KindOf (Apply (ZipWithSym2 l l) arg) ~ KindOf (ZipWithSym3 l l arg) =>+        ZipWithSym2KindInference+    type instance Apply (ZipWithSym2 l l) l = ZipWithSym3 l l l+    instance SuppressUnusedWarnings ZipWithSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) ZipWithSym1KindInference GHC.Tuple.())+    data ZipWithSym1 (l :: TyFun a (TyFun b c -> *) -> *)+                     (l :: TyFun [a] (TyFun [b] [c] -> *))+      = forall arg. KindOf (Apply (ZipWithSym1 l) arg) ~ KindOf (ZipWithSym2 l arg) =>+        ZipWithSym1KindInference+    type instance Apply (ZipWithSym1 l) l = ZipWithSym2 l l+    instance SuppressUnusedWarnings ZipWithSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) ZipWithSym0KindInference GHC.Tuple.())+    data ZipWithSym0 (l :: TyFun (TyFun a (TyFun b c -> *)+                                  -> *) (TyFun [a] (TyFun [b] [c] -> *) -> *))+      = forall arg. KindOf (Apply ZipWithSym0 arg) ~ KindOf (ZipWithSym1 arg) =>+        ZipWithSym0KindInference+    type instance Apply ZipWithSym0 l = ZipWithSym1 l+    type SplungeSym2 (t :: [Nat]) (t :: [Bool]) = Splunge t t+    instance SuppressUnusedWarnings SplungeSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) SplungeSym1KindInference GHC.Tuple.())+    data SplungeSym1 (l :: [Nat]) (l :: TyFun [Bool] [Nat])+      = forall arg. KindOf (Apply (SplungeSym1 l) arg) ~ KindOf (SplungeSym2 l arg) =>+        SplungeSym1KindInference+    type instance Apply (SplungeSym1 l) l = SplungeSym2 l l+    instance SuppressUnusedWarnings SplungeSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) SplungeSym0KindInference GHC.Tuple.())+    data SplungeSym0 (l :: TyFun [Nat] (TyFun [Bool] [Nat] -> *))+      = forall arg. KindOf (Apply SplungeSym0 arg) ~ KindOf (SplungeSym1 arg) =>+        SplungeSym0KindInference+    type instance Apply SplungeSym0 l = SplungeSym1 l+    type EtadSym2 (t :: [Nat]) (t :: [Bool]) = Etad t t+    instance SuppressUnusedWarnings EtadSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) EtadSym1KindInference GHC.Tuple.())+    data EtadSym1 (l :: [Nat]) (l :: TyFun [Bool] [Nat])+      = forall arg. KindOf (Apply (EtadSym1 l) arg) ~ KindOf (EtadSym2 l arg) =>+        EtadSym1KindInference+    type instance Apply (EtadSym1 l) l = EtadSym2 l l+    instance SuppressUnusedWarnings EtadSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) EtadSym0KindInference GHC.Tuple.())+    data EtadSym0 (l :: TyFun [Nat] (TyFun [Bool] [Nat] -> *))+      = forall arg. KindOf (Apply EtadSym0 arg) ~ KindOf (EtadSym1 arg) =>+        EtadSym0KindInference+    type instance Apply EtadSym0 l = EtadSym1 l+    type LiftMaybeSym2 (t :: TyFun a b -> *) (t :: Maybe a) =+        LiftMaybe t t+    instance SuppressUnusedWarnings LiftMaybeSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) LiftMaybeSym1KindInference GHC.Tuple.())+    data LiftMaybeSym1 (l :: TyFun a b -> *)+                       (l :: TyFun (Maybe a) (Maybe b))+      = forall arg. KindOf (Apply (LiftMaybeSym1 l) arg) ~ KindOf (LiftMaybeSym2 l arg) =>+        LiftMaybeSym1KindInference+    type instance Apply (LiftMaybeSym1 l) l = LiftMaybeSym2 l l+    instance SuppressUnusedWarnings LiftMaybeSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) LiftMaybeSym0KindInference GHC.Tuple.())+    data LiftMaybeSym0 (l :: TyFun (TyFun a b+                                    -> *) (TyFun (Maybe a) (Maybe b) -> *))+      = forall arg. KindOf (Apply LiftMaybeSym0 arg) ~ KindOf (LiftMaybeSym1 arg) =>+        LiftMaybeSym0KindInference+    type instance Apply LiftMaybeSym0 l = LiftMaybeSym1 l+    type MapSym2 (t :: TyFun a b -> *) (t :: [a]) = Map t t+    instance SuppressUnusedWarnings MapSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) MapSym1KindInference GHC.Tuple.())+    data MapSym1 (l :: TyFun a b -> *) (l :: TyFun [a] [b])+      = forall arg. KindOf (Apply (MapSym1 l) arg) ~ KindOf (MapSym2 l arg) =>+        MapSym1KindInference+    type instance Apply (MapSym1 l) l = MapSym2 l l+    instance SuppressUnusedWarnings MapSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) MapSym0KindInference GHC.Tuple.())+    data MapSym0 (l :: TyFun (TyFun a b -> *) (TyFun [a] [b] -> *))+      = forall arg. KindOf (Apply MapSym0 arg) ~ KindOf (MapSym1 arg) =>+        MapSym0KindInference+    type instance Apply MapSym0 l = MapSym1 l+    type family Foo (a :: TyFun (TyFun a b -> *) (TyFun a b -> *) -> *)+                    (a :: TyFun a b -> *)+                    (a :: a) :: b where+      Foo f g a = Apply (Apply f g) a+    type family ZipWith (a :: TyFun a (TyFun 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 _z_0123456789 '[] '[] = '[]+      ZipWith _z_0123456789 ((:) _z_0123456789 _z_0123456789) '[] = '[]+      ZipWith _z_0123456789 '[] ((:) _z_0123456789 _z_0123456789) = '[]+    type family Splunge (a :: [Nat]) (a :: [Bool]) :: [Nat] where+      Splunge ns bs = Apply (Apply (Apply ZipWithSym0 (Apply (Apply Lambda_0123456789Sym0 ns) bs)) ns) bs+    type family Etad (a :: [Nat]) (a :: [Bool]) :: [Nat] where+      Etad a_0123456789 a_0123456789 = Apply (Apply (Apply ZipWithSym0 (Apply (Apply Lambda_0123456789Sym0 a_0123456789) a_0123456789)) a_0123456789) a_0123456789+    type family LiftMaybe (a :: TyFun a b -> *)+                          (a :: Maybe a) :: Maybe b where+      LiftMaybe f (Just x) = Apply JustSym0 (Apply f x)+      LiftMaybe _z_0123456789 Nothing = NothingSym0+    type family Map (a :: TyFun a b -> *) (a :: [a]) :: [b] where+      Map _z_0123456789 '[] = '[]+      Map f ((:) h t) = Apply (Apply (:$) (Apply f h)) (Apply (Apply MapSym0 f) t)+    sFoo ::+      forall (t :: TyFun (TyFun a b -> *) (TyFun a b -> *) -> *)+             (t :: TyFun a b -> *)+             (t :: a).+      Sing t+      -> Sing t+         -> Sing t -> Sing (Apply (Apply (Apply FooSym0 t) t) t :: b)+    sZipWith ::+      forall (t :: TyFun a (TyFun b c -> *) -> *) (t :: [a]) (t :: [b]).+      Sing t+      -> Sing t+         -> Sing t -> Sing (Apply (Apply (Apply ZipWithSym0 t) t) t :: [c])+    sSplunge ::+      forall (t :: [Nat]) (t :: [Bool]).+      Sing t -> Sing t -> Sing (Apply (Apply SplungeSym0 t) t :: [Nat])+    sEtad ::+      forall (t :: [Nat]) (t :: [Bool]).+      Sing t -> Sing t -> Sing (Apply (Apply EtadSym0 t) t :: [Nat])+    sLiftMaybe ::+      forall (t :: TyFun a b -> *) (t :: Maybe a).+      Sing t+      -> Sing t -> Sing (Apply (Apply LiftMaybeSym0 t) t :: Maybe b)+    sMap ::+      forall (t :: TyFun a b -> *) (t :: [a]).+      Sing t -> Sing t -> Sing (Apply (Apply MapSym0 t) t :: [b])+    sFoo sF sG sA+      = let+          lambda ::+            forall f g a. (t ~ f, t ~ g, t ~ a) =>+            Sing f+            -> Sing g+               -> Sing a -> Sing (Apply (Apply (Apply FooSym0 f) g) a :: b)+          lambda f g a = applySing (applySing f g) a+        in lambda sF sG sA+    sZipWith sF (SCons sX sXs) (SCons sY sYs)+      = let+          lambda ::+            forall f x xs y ys. (t ~ f,+                                 t ~ Apply (Apply (:$) x) xs,+                                 t ~ Apply (Apply (:$) y) ys) =>+            Sing f+            -> Sing x+               -> Sing xs+                  -> Sing y+                     -> Sing ys+                        -> Sing (Apply (Apply (Apply ZipWithSym0 f) (Apply (Apply (:$) x) xs)) (Apply (Apply (:$) y) ys) :: [c])+          lambda f x xs y ys+            = applySing+                (applySing+                   (singFun2 (Proxy :: Proxy (:$)) SCons)+                   (applySing (applySing f x) y))+                (applySing+                   (applySing+                      (applySing (singFun3 (Proxy :: Proxy ZipWithSym0) sZipWith) f) xs)+                   ys)+        in lambda sF sX sXs sY sYs+    sZipWith _s_z_0123456789 SNil SNil+      = let+          lambda ::+            forall _z_0123456789. (t ~ _z_0123456789, t ~ '[], t ~ '[]) =>+            Sing _z_0123456789+            -> Sing (Apply (Apply (Apply ZipWithSym0 _z_0123456789) '[]) '[] :: [c])+          lambda _z_0123456789 = SNil+        in lambda _s_z_0123456789+    sZipWith+      _s_z_0123456789+      (SCons _s_z_0123456789 _s_z_0123456789)+      SNil+      = let+          lambda ::+            forall _z_0123456789+                   _z_0123456789+                   _z_0123456789. (t ~ _z_0123456789,+                                   t ~ Apply (Apply (:$) _z_0123456789) _z_0123456789,+                                   t ~ '[]) =>+            Sing _z_0123456789+            -> Sing _z_0123456789+               -> Sing _z_0123456789+                  -> Sing (Apply (Apply (Apply ZipWithSym0 _z_0123456789) (Apply (Apply (:$) _z_0123456789) _z_0123456789)) '[] :: [c])+          lambda _z_0123456789 _z_0123456789 _z_0123456789 = SNil+        in lambda _s_z_0123456789 _s_z_0123456789 _s_z_0123456789+    sZipWith+      _s_z_0123456789+      SNil+      (SCons _s_z_0123456789 _s_z_0123456789)+      = let+          lambda ::+            forall _z_0123456789+                   _z_0123456789+                   _z_0123456789. (t ~ _z_0123456789,+                                   t ~ '[],+                                   t ~ Apply (Apply (:$) _z_0123456789) _z_0123456789) =>+            Sing _z_0123456789+            -> Sing _z_0123456789+               -> Sing _z_0123456789+                  -> Sing (Apply (Apply (Apply ZipWithSym0 _z_0123456789) '[]) (Apply (Apply (:$) _z_0123456789) _z_0123456789) :: [c])+          lambda _z_0123456789 _z_0123456789 _z_0123456789 = SNil+        in lambda _s_z_0123456789 _s_z_0123456789 _s_z_0123456789+    sSplunge sNs sBs+      = let+          lambda ::+            forall ns bs. (t ~ ns, t ~ bs) =>+            Sing ns+            -> Sing bs -> Sing (Apply (Apply SplungeSym0 ns) bs :: [Nat])+          lambda ns bs+            = applySing+                (applySing+                   (applySing+                      (singFun3 (Proxy :: Proxy ZipWithSym0) sZipWith)+                      (singFun2+                         (Proxy :: Proxy (Apply (Apply Lambda_0123456789Sym0 ns) bs))+                         (\ sN sB+                            -> let+                                 lambda ::+                                   forall n b.+                                   Sing n+                                   -> Sing b+                                      -> Sing (Apply (Apply (Apply (Apply Lambda_0123456789Sym0 ns) bs) n) b)+                                 lambda n b+                                   = let+                                       sScrutinee_0123456789 ::+                                         Sing (Let0123456789Scrutinee_0123456789Sym4 ns bs n b)+                                       sScrutinee_0123456789 = b+                                     in  case sScrutinee_0123456789 of {+                                           STrue+                                             -> let+                                                  lambda ::+                                                    TrueSym0 ~ Let0123456789Scrutinee_0123456789Sym4 ns bs n b =>+                                                    Sing (Case_0123456789 ns bs n b TrueSym0)+                                                  lambda+                                                    = applySing+                                                        (singFun1 (Proxy :: Proxy SuccSym0) SSucc)+                                                        (applySing+                                                           (singFun1+                                                              (Proxy :: Proxy SuccSym0) SSucc)+                                                           n)+                                                in lambda+                                           SFalse+                                             -> let+                                                  lambda ::+                                                    FalseSym0 ~ Let0123456789Scrutinee_0123456789Sym4 ns bs n b =>+                                                    Sing (Case_0123456789 ns bs n b FalseSym0)+                                                  lambda = n+                                                in lambda } ::+                                           Sing (Case_0123456789 ns bs n b (Let0123456789Scrutinee_0123456789Sym4 ns bs n b))+                               in lambda sN sB)))+                   ns)+                bs+        in lambda sNs sBs+    sEtad sA_0123456789 sA_0123456789+      = let+          lambda ::+            forall a_0123456789 a_0123456789. (t ~ a_0123456789,+                                               t ~ a_0123456789) =>+            Sing a_0123456789+            -> Sing a_0123456789+               -> Sing (Apply (Apply EtadSym0 a_0123456789) a_0123456789 :: [Nat])+          lambda a_0123456789 a_0123456789+            = applySing+                (applySing+                   (applySing+                      (singFun3 (Proxy :: Proxy ZipWithSym0) sZipWith)+                      (singFun2+                         (Proxy ::+                            Proxy (Apply (Apply Lambda_0123456789Sym0 a_0123456789) a_0123456789))+                         (\ sN sB+                            -> let+                                 lambda ::+                                   forall n b.+                                   Sing n+                                   -> Sing b+                                      -> Sing (Apply (Apply (Apply (Apply Lambda_0123456789Sym0 a_0123456789) a_0123456789) n) b)+                                 lambda n b+                                   = let+                                       sScrutinee_0123456789 ::+                                         Sing (Let0123456789Scrutinee_0123456789Sym4 n b a_0123456789 a_0123456789)+                                       sScrutinee_0123456789 = b+                                     in  case sScrutinee_0123456789 of {+                                           STrue+                                             -> let+                                                  lambda ::+                                                    TrueSym0 ~ Let0123456789Scrutinee_0123456789Sym4 n b a_0123456789 a_0123456789 =>+                                                    Sing (Case_0123456789 n b a_0123456789 a_0123456789 TrueSym0)+                                                  lambda+                                                    = applySing+                                                        (singFun1 (Proxy :: Proxy SuccSym0) SSucc)+                                                        (applySing+                                                           (singFun1+                                                              (Proxy :: Proxy SuccSym0) SSucc)+                                                           n)+                                                in lambda+                                           SFalse+                                             -> let+                                                  lambda ::+                                                    FalseSym0 ~ Let0123456789Scrutinee_0123456789Sym4 n b a_0123456789 a_0123456789 =>+                                                    Sing (Case_0123456789 n b a_0123456789 a_0123456789 FalseSym0)+                                                  lambda = n+                                                in lambda } ::+                                           Sing (Case_0123456789 n b a_0123456789 a_0123456789 (Let0123456789Scrutinee_0123456789Sym4 n b a_0123456789 a_0123456789))+                               in lambda sN sB)))+                   a_0123456789)+                a_0123456789+        in lambda sA_0123456789 sA_0123456789+    sLiftMaybe sF (SJust sX)+      = let+          lambda ::+            forall f x. (t ~ f, t ~ Apply JustSym0 x) =>+            Sing f+            -> Sing x+               -> Sing (Apply (Apply LiftMaybeSym0 f) (Apply JustSym0 x) :: Maybe b)+          lambda f x+            = applySing+                (singFun1 (Proxy :: Proxy JustSym0) SJust) (applySing f x)+        in lambda sF sX+    sLiftMaybe _s_z_0123456789 SNothing+      = let+          lambda ::+            forall _z_0123456789. (t ~ _z_0123456789, t ~ NothingSym0) =>+            Sing _z_0123456789+            -> Sing (Apply (Apply LiftMaybeSym0 _z_0123456789) NothingSym0 :: Maybe b)+          lambda _z_0123456789 = SNothing+        in lambda _s_z_0123456789+    sMap _s_z_0123456789 SNil+      = let+          lambda ::+            forall _z_0123456789. (t ~ _z_0123456789, t ~ '[]) =>+            Sing _z_0123456789+            -> Sing (Apply (Apply MapSym0 _z_0123456789) '[] :: [b])+          lambda _z_0123456789 = SNil+        in lambda _s_z_0123456789+    sMap sF (SCons sH sT)+      = let+          lambda ::+            forall f h t. (t ~ f, t ~ Apply (Apply (:$) h) t) =>+            Sing f+            -> Sing h+               -> Sing t+                  -> Sing (Apply (Apply MapSym0 f) (Apply (Apply (:$) h) t) :: [b])+          lambda f h t+            = applySing+                (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) (applySing f h))+                (applySing+                   (applySing (singFun2 (Proxy :: Proxy MapSym0) sMap) f) t)+        in lambda sF sH sT+    data instance Sing (z :: Either a b)+      = forall (n :: a). z ~ Left n => SLeft (Sing (n :: a)) |+        forall (n :: b). z ~ Right n => SRight (Sing (n :: b))+    type SEither = (Sing :: Either a b -> *)+    instance (SingKind (KProxy :: KProxy a),+              SingKind (KProxy :: KProxy b)) =>+             SingKind (KProxy :: KProxy (Either a b)) where+      type DemoteRep (KProxy :: KProxy (Either a b)) = Either (DemoteRep (KProxy :: KProxy a)) (DemoteRep (KProxy :: KProxy b))+      fromSing (SLeft b) = Left (fromSing b)+      fromSing (SRight b) = Right (fromSing b)+      toSing (Left b)+        = case toSing b :: SomeSing (KProxy :: KProxy a) of {+            SomeSing c -> SomeSing (SLeft c) }+      toSing (Right b)+        = case toSing b :: SomeSing (KProxy :: KProxy b) of {+            SomeSing c -> SomeSing (SRight c) }+    instance SingI n => SingI (Left (n :: a)) where+      sing = SLeft sing+    instance SingI n => SingI (Right (n :: b)) where+      sing = SRight sing
− tests/compile-and-dump/Singletons/HigherOrder.ghc78.template
@@ -1,594 +0,0 @@-Singletons/HigherOrder.hs: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 |]-  ======>-    Singletons/HigherOrder.hs:(0,0)-(0,0)-    data Either a b = Left a | Right b-    map :: forall a b. (a -> b) -> [a] -> [b]-    map _ GHC.Types.[] = []-    map f (h GHC.Types.: t) = ((f h) GHC.Types.: (map f t))-    liftMaybe :: forall a b. (a -> b) -> Maybe a -> Maybe b-    liftMaybe f (Just x) = Just (f x)-    liftMaybe _ Nothing = Nothing-    zipWith :: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]-    zipWith f (x GHC.Types.: xs) (y GHC.Types.: ys)-      = ((f x y) GHC.Types.: (zipWith f xs ys))-    zipWith _ GHC.Types.[] GHC.Types.[] = []-    zipWith _ (_ GHC.Types.: _) GHC.Types.[] = []-    zipWith _ GHC.Types.[] (_ GHC.Types.: _) = []-    foo :: forall a b. ((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 (t :: a) = Left t-    instance SuppressUnusedWarnings LeftSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) LeftSym0KindInference GHC.Tuple.())-    data LeftSym0 (l :: TyFun a (Either a b))-      = forall arg. KindOf (Apply LeftSym0 arg) ~ KindOf (LeftSym1 arg) =>-        LeftSym0KindInference-    type instance Apply LeftSym0 l = LeftSym1 l-    type RightSym1 (t :: b) = Right t-    instance SuppressUnusedWarnings RightSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) RightSym0KindInference GHC.Tuple.())-    data RightSym0 (l :: TyFun b (Either a b))-      = forall arg. KindOf (Apply RightSym0 arg) ~ KindOf (RightSym1 arg) =>-        RightSym0KindInference-    type instance Apply RightSym0 l = RightSym1 l-    type Let0123456789Scrutinee_0123456789Sym4 t t t t =-        Let0123456789Scrutinee_0123456789 t t t t-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym3 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym3KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym3 l l l l-      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym3 l l l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym4 l l l arg) =>-        Let0123456789Scrutinee_0123456789Sym3KindInference-    type instance Apply (Let0123456789Scrutinee_0123456789Sym3 l l l) l = Let0123456789Scrutinee_0123456789Sym4 l l l l-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym2KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym2 l l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym3 l l arg) =>-        Let0123456789Scrutinee_0123456789Sym2KindInference-    type instance Apply (Let0123456789Scrutinee_0123456789Sym2 l l) l = Let0123456789Scrutinee_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym1KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym1 l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym2 l arg) =>-        Let0123456789Scrutinee_0123456789Sym1KindInference-    type instance Apply (Let0123456789Scrutinee_0123456789Sym1 l) l = Let0123456789Scrutinee_0123456789Sym2 l l-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym0 l-      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>-        Let0123456789Scrutinee_0123456789Sym0KindInference-    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l-    type Let0123456789Scrutinee_0123456789 ns bs n b = b-    type family Case_0123456789 ns bs n b t where-      Case_0123456789 ns bs n b True = Apply SuccSym0 (Apply SuccSym0 n)-      Case_0123456789 ns bs n b False = n-    type family Lambda_0123456789 ns bs t t where-      Lambda_0123456789 ns bs n b = Case_0123456789 ns bs n b (Let0123456789Scrutinee_0123456789Sym4 ns bs n b)-    type Lambda_0123456789Sym4 t t t t = Lambda_0123456789 t t t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym3 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym3KindInference GHC.Tuple.())-    data Lambda_0123456789Sym3 l l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym3 l l l) arg) ~ KindOf (Lambda_0123456789Sym4 l l l arg) =>-        Lambda_0123456789Sym3KindInference-    type instance Apply (Lambda_0123456789Sym3 l l l) l = Lambda_0123456789Sym4 l l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())-    data Lambda_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>-        Lambda_0123456789Sym2KindInference-    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type Let0123456789Scrutinee_0123456789Sym4 t t t t =-        Let0123456789Scrutinee_0123456789 t t t t-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym3 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym3KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym3 l l l l-      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym3 l l l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym4 l l l arg) =>-        Let0123456789Scrutinee_0123456789Sym3KindInference-    type instance Apply (Let0123456789Scrutinee_0123456789Sym3 l l l) l = Let0123456789Scrutinee_0123456789Sym4 l l l l-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym2KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym2 l l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym3 l l arg) =>-        Let0123456789Scrutinee_0123456789Sym2KindInference-    type instance Apply (Let0123456789Scrutinee_0123456789Sym2 l l) l = Let0123456789Scrutinee_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym1KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym1 l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym2 l arg) =>-        Let0123456789Scrutinee_0123456789Sym1KindInference-    type instance Apply (Let0123456789Scrutinee_0123456789Sym1 l) l = Let0123456789Scrutinee_0123456789Sym2 l l-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym0 l-      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>-        Let0123456789Scrutinee_0123456789Sym0KindInference-    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l-    type Let0123456789Scrutinee_0123456789 n-                                            b-                                            a_0123456789-                                            a_0123456789 =-        b-    type family Case_0123456789 n b a_0123456789 a_0123456789 t where-      Case_0123456789 n b a_0123456789 a_0123456789 True = Apply SuccSym0 (Apply SuccSym0 n)-      Case_0123456789 n b a_0123456789 a_0123456789 False = n-    type family Lambda_0123456789 a_0123456789 a_0123456789 t t where-      Lambda_0123456789 a_0123456789 a_0123456789 n b = Case_0123456789 n b a_0123456789 a_0123456789 (Let0123456789Scrutinee_0123456789Sym4 n b a_0123456789 a_0123456789)-    type Lambda_0123456789Sym4 t t t t = Lambda_0123456789 t t t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym3 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym3KindInference GHC.Tuple.())-    data Lambda_0123456789Sym3 l l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym3 l l l) arg) ~ KindOf (Lambda_0123456789Sym4 l l l arg) =>-        Lambda_0123456789Sym3KindInference-    type instance Apply (Lambda_0123456789Sym3 l l l) l = Lambda_0123456789Sym4 l l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())-    data Lambda_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>-        Lambda_0123456789Sym2KindInference-    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type FooSym3 (t :: TyFun (TyFun a b -> *) (TyFun a b -> *) -> *)-                 (t :: TyFun a b -> *)-                 (t :: a) =-        Foo t t t-    instance SuppressUnusedWarnings FooSym2 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) FooSym2KindInference GHC.Tuple.())-    data FooSym2 (l :: TyFun (TyFun a b -> *) (TyFun a b -> *) -> *)-                 (l :: TyFun a b -> *)-                 (l :: TyFun a b)-      = forall arg. KindOf (Apply (FooSym2 l l) arg) ~ KindOf (FooSym3 l l arg) =>-        FooSym2KindInference-    type instance Apply (FooSym2 l l) l = FooSym3 l l l-    instance SuppressUnusedWarnings FooSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) FooSym1KindInference GHC.Tuple.())-    data FooSym1 (l :: TyFun (TyFun a b -> *) (TyFun a b -> *) -> *)-                 (l :: TyFun (TyFun a b -> *) (TyFun a b -> *))-      = forall arg. KindOf (Apply (FooSym1 l) arg) ~ KindOf (FooSym2 l arg) =>-        FooSym1KindInference-    type instance Apply (FooSym1 l) l = FooSym2 l l-    instance SuppressUnusedWarnings FooSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) FooSym0KindInference GHC.Tuple.())-    data FooSym0 (l :: TyFun (TyFun (TyFun a b -> *) (TyFun a b -> *)-                              -> *) (TyFun (TyFun a b -> *) (TyFun a b -> *) -> *))-      = forall arg. KindOf (Apply FooSym0 arg) ~ KindOf (FooSym1 arg) =>-        FooSym0KindInference-    type instance Apply FooSym0 l = FooSym1 l-    type ZipWithSym3 (t :: TyFun a (TyFun b c -> *) -> *)-                     (t :: [a])-                     (t :: [b]) =-        ZipWith t t t-    instance SuppressUnusedWarnings ZipWithSym2 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) ZipWithSym2KindInference GHC.Tuple.())-    data ZipWithSym2 (l :: TyFun a (TyFun b c -> *) -> *)-                     (l :: [a])-                     (l :: TyFun [b] [c])-      = forall arg. KindOf (Apply (ZipWithSym2 l l) arg) ~ KindOf (ZipWithSym3 l l arg) =>-        ZipWithSym2KindInference-    type instance Apply (ZipWithSym2 l l) l = ZipWithSym3 l l l-    instance SuppressUnusedWarnings ZipWithSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) ZipWithSym1KindInference GHC.Tuple.())-    data ZipWithSym1 (l :: TyFun a (TyFun b c -> *) -> *)-                     (l :: TyFun [a] (TyFun [b] [c] -> *))-      = forall arg. KindOf (Apply (ZipWithSym1 l) arg) ~ KindOf (ZipWithSym2 l arg) =>-        ZipWithSym1KindInference-    type instance Apply (ZipWithSym1 l) l = ZipWithSym2 l l-    instance SuppressUnusedWarnings ZipWithSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) ZipWithSym0KindInference GHC.Tuple.())-    data ZipWithSym0 (l :: TyFun (TyFun a (TyFun b c -> *)-                                  -> *) (TyFun [a] (TyFun [b] [c] -> *) -> *))-      = forall arg. KindOf (Apply ZipWithSym0 arg) ~ KindOf (ZipWithSym1 arg) =>-        ZipWithSym0KindInference-    type instance Apply ZipWithSym0 l = ZipWithSym1 l-    type SplungeSym2 (t :: [Nat]) (t :: [Bool]) = Splunge t t-    instance SuppressUnusedWarnings SplungeSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) SplungeSym1KindInference GHC.Tuple.())-    data SplungeSym1 (l :: [Nat]) (l :: TyFun [Bool] [Nat])-      = forall arg. KindOf (Apply (SplungeSym1 l) arg) ~ KindOf (SplungeSym2 l arg) =>-        SplungeSym1KindInference-    type instance Apply (SplungeSym1 l) l = SplungeSym2 l l-    instance SuppressUnusedWarnings SplungeSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) SplungeSym0KindInference GHC.Tuple.())-    data SplungeSym0 (l :: TyFun [Nat] (TyFun [Bool] [Nat] -> *))-      = forall arg. KindOf (Apply SplungeSym0 arg) ~ KindOf (SplungeSym1 arg) =>-        SplungeSym0KindInference-    type instance Apply SplungeSym0 l = SplungeSym1 l-    type EtadSym2 (t :: [Nat]) (t :: [Bool]) = Etad t t-    instance SuppressUnusedWarnings EtadSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) EtadSym1KindInference GHC.Tuple.())-    data EtadSym1 (l :: [Nat]) (l :: TyFun [Bool] [Nat])-      = forall arg. KindOf (Apply (EtadSym1 l) arg) ~ KindOf (EtadSym2 l arg) =>-        EtadSym1KindInference-    type instance Apply (EtadSym1 l) l = EtadSym2 l l-    instance SuppressUnusedWarnings EtadSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) EtadSym0KindInference GHC.Tuple.())-    data EtadSym0 (l :: TyFun [Nat] (TyFun [Bool] [Nat] -> *))-      = forall arg. KindOf (Apply EtadSym0 arg) ~ KindOf (EtadSym1 arg) =>-        EtadSym0KindInference-    type instance Apply EtadSym0 l = EtadSym1 l-    type LiftMaybeSym2 (t :: TyFun a b -> *) (t :: Maybe a) =-        LiftMaybe t t-    instance SuppressUnusedWarnings LiftMaybeSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) LiftMaybeSym1KindInference GHC.Tuple.())-    data LiftMaybeSym1 (l :: TyFun a b -> *)-                       (l :: TyFun (Maybe a) (Maybe b))-      = forall arg. KindOf (Apply (LiftMaybeSym1 l) arg) ~ KindOf (LiftMaybeSym2 l arg) =>-        LiftMaybeSym1KindInference-    type instance Apply (LiftMaybeSym1 l) l = LiftMaybeSym2 l l-    instance SuppressUnusedWarnings LiftMaybeSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) LiftMaybeSym0KindInference GHC.Tuple.())-    data LiftMaybeSym0 (l :: TyFun (TyFun a b-                                    -> *) (TyFun (Maybe a) (Maybe b) -> *))-      = forall arg. KindOf (Apply LiftMaybeSym0 arg) ~ KindOf (LiftMaybeSym1 arg) =>-        LiftMaybeSym0KindInference-    type instance Apply LiftMaybeSym0 l = LiftMaybeSym1 l-    type MapSym2 (t :: TyFun a b -> *) (t :: [a]) = Map t t-    instance SuppressUnusedWarnings MapSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) MapSym1KindInference GHC.Tuple.())-    data MapSym1 (l :: TyFun a b -> *) (l :: TyFun [a] [b])-      = forall arg. KindOf (Apply (MapSym1 l) arg) ~ KindOf (MapSym2 l arg) =>-        MapSym1KindInference-    type instance Apply (MapSym1 l) l = MapSym2 l l-    instance SuppressUnusedWarnings MapSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) MapSym0KindInference GHC.Tuple.())-    data MapSym0 (l :: TyFun (TyFun a b -> *) (TyFun [a] [b] -> *))-      = forall arg. KindOf (Apply MapSym0 arg) ~ KindOf (MapSym1 arg) =>-        MapSym0KindInference-    type instance Apply MapSym0 l = MapSym1 l-    type family Foo (a :: TyFun (TyFun a b -> *) (TyFun a b -> *) -> *)-                    (a :: TyFun a b -> *)-                    (a :: a) :: b where-      Foo f g a = Apply (Apply f g) a-    type family ZipWith (a :: TyFun a (TyFun 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 z '[] '[] = '[]-      ZipWith z ((:) z z) '[] = '[]-      ZipWith z '[] ((:) z z) = '[]-    type family Splunge (a :: [Nat]) (a :: [Bool]) :: [Nat] where-      Splunge ns bs = Apply (Apply (Apply ZipWithSym0 (Apply (Apply Lambda_0123456789Sym0 ns) bs)) ns) bs-    type family Etad (a :: [Nat]) (a :: [Bool]) :: [Nat] where-      Etad a_0123456789 a_0123456789 = Apply (Apply (Apply ZipWithSym0 (Apply (Apply Lambda_0123456789Sym0 a_0123456789) a_0123456789)) a_0123456789) a_0123456789-    type family LiftMaybe (a :: TyFun a b -> *)-                          (a :: Maybe a) :: Maybe b where-      LiftMaybe f (Just x) = Apply JustSym0 (Apply f x)-      LiftMaybe z Nothing = NothingSym0-    type family Map (a :: TyFun a b -> *) (a :: [a]) :: [b] where-      Map z '[] = '[]-      Map f ((:) h t) = Apply (Apply (:$) (Apply f h)) (Apply (Apply MapSym0 f) t)-    sFoo ::-      forall (t :: TyFun (TyFun a b -> *) (TyFun a b -> *) -> *)-             (t :: TyFun a b -> *)-             (t :: a).-      Sing t-      -> Sing t -> Sing t -> Sing (Apply (Apply (Apply FooSym0 t) t) t)-    sZipWith ::-      forall (t :: TyFun a (TyFun b c -> *) -> *) (t :: [a]) (t :: [b]).-      Sing t-      -> Sing t-         -> Sing t -> Sing (Apply (Apply (Apply ZipWithSym0 t) t) t)-    sSplunge ::-      forall (t :: [Nat]) (t :: [Bool]).-      Sing t -> Sing t -> Sing (Apply (Apply SplungeSym0 t) t)-    sEtad ::-      forall (t :: [Nat]) (t :: [Bool]).-      Sing t -> Sing t -> Sing (Apply (Apply EtadSym0 t) t)-    sLiftMaybe ::-      forall (t :: TyFun a b -> *) (t :: Maybe a).-      Sing t -> Sing t -> Sing (Apply (Apply LiftMaybeSym0 t) t)-    sMap ::-      forall (t :: TyFun a b -> *) (t :: [a]).-      Sing t -> Sing t -> Sing (Apply (Apply MapSym0 t) t)-    sFoo sF sG sA-      = let-          lambda ::-            forall f g a. (t ~ f, t ~ g, t ~ a) =>-            Sing f-            -> Sing g -> Sing a -> Sing (Apply (Apply (Apply FooSym0 f) g) a)-          lambda f g a = applySing (applySing f g) a-        in lambda sF sG sA-    sZipWith sF (SCons sX sXs) (SCons sY sYs)-      = let-          lambda ::-            forall f x xs y ys. (t ~ f,-                                 t ~ Apply (Apply (:$) x) xs,-                                 t ~ Apply (Apply (:$) y) ys) =>-            Sing f-            -> Sing x-               -> Sing xs-                  -> Sing y-                     -> Sing ys-                        -> Sing (Apply (Apply (Apply ZipWithSym0 f) (Apply (Apply (:$) x) xs)) (Apply (Apply (:$) y) ys))-          lambda f x xs y ys-            = applySing-                (applySing-                   (singFun2 (Proxy :: Proxy (:$)) SCons)-                   (applySing (applySing f x) y))-                (applySing-                   (applySing-                      (applySing (singFun3 (Proxy :: Proxy ZipWithSym0) sZipWith) f) xs)-                   ys)-        in lambda sF sX sXs sY sYs-    sZipWith _ SNil SNil-      = let-          lambda ::-            forall wild. (t ~ wild, t ~ '[], t ~ '[]) =>-            Sing (Apply (Apply (Apply ZipWithSym0 wild) '[]) '[])-          lambda = SNil-        in lambda-    sZipWith _ (SCons _ _) SNil-      = let-          lambda ::-            forall wild wild wild. (t ~ wild,-                                    t ~ Apply (Apply (:$) wild) wild,-                                    t ~ '[]) =>-            Sing (Apply (Apply (Apply ZipWithSym0 wild) (Apply (Apply (:$) wild) wild)) '[])-          lambda = SNil-        in lambda-    sZipWith _ SNil (SCons _ _)-      = let-          lambda ::-            forall wild wild wild. (t ~ wild,-                                    t ~ '[],-                                    t ~ Apply (Apply (:$) wild) wild) =>-            Sing (Apply (Apply (Apply ZipWithSym0 wild) '[]) (Apply (Apply (:$) wild) wild))-          lambda = SNil-        in lambda-    sSplunge sNs sBs-      = let-          lambda ::-            forall ns bs. (t ~ ns, t ~ bs) =>-            Sing ns -> Sing bs -> Sing (Apply (Apply SplungeSym0 ns) bs)-          lambda ns bs-            = applySing-                (applySing-                   (applySing-                      (singFun3 (Proxy :: Proxy ZipWithSym0) sZipWith)-                      (singFun2-                         (Proxy :: Proxy (Apply (Apply Lambda_0123456789Sym0 ns) bs))-                         (\ sN sB-                            -> let-                                 lambda ::-                                   forall n b.-                                   Sing n-                                   -> Sing b-                                      -> Sing (Apply (Apply (Apply (Apply Lambda_0123456789Sym0 ns) bs) n) b)-                                 lambda n b-                                   = let-                                       sScrutinee_0123456789 ::-                                         Sing (Let0123456789Scrutinee_0123456789Sym4 ns bs n b)-                                       sScrutinee_0123456789 = b-                                     in-                                       case sScrutinee_0123456789 of {-                                         STrue-                                           -> let-                                                lambda :: Sing (Case_0123456789 ns bs n b TrueSym0)-                                                lambda-                                                  = applySing-                                                      (singFun1 (Proxy :: Proxy SuccSym0) SSucc)-                                                      (applySing-                                                         (singFun1 (Proxy :: Proxy SuccSym0) SSucc)-                                                         n)-                                              in lambda-                                         SFalse-                                           -> let-                                                lambda :: Sing (Case_0123456789 ns bs n b FalseSym0)-                                                lambda = n-                                              in lambda }-                               in lambda sN sB)))-                   ns)-                bs-        in lambda sNs sBs-    sEtad sA_0123456789 sA_0123456789-      = let-          lambda ::-            forall a_0123456789 a_0123456789. (t ~ a_0123456789,-                                               t ~ a_0123456789) =>-            Sing a_0123456789-            -> Sing a_0123456789-               -> Sing (Apply (Apply EtadSym0 a_0123456789) a_0123456789)-          lambda a_0123456789 a_0123456789-            = applySing-                (applySing-                   (applySing-                      (singFun3 (Proxy :: Proxy ZipWithSym0) sZipWith)-                      (singFun2-                         (Proxy ::-                            Proxy (Apply (Apply Lambda_0123456789Sym0 a_0123456789) a_0123456789))-                         (\ sN sB-                            -> let-                                 lambda ::-                                   forall n b.-                                   Sing n-                                   -> Sing b-                                      -> Sing (Apply (Apply (Apply (Apply Lambda_0123456789Sym0 a_0123456789) a_0123456789) n) b)-                                 lambda n b-                                   = let-                                       sScrutinee_0123456789 ::-                                         Sing (Let0123456789Scrutinee_0123456789Sym4 n b a_0123456789 a_0123456789)-                                       sScrutinee_0123456789 = b-                                     in-                                       case sScrutinee_0123456789 of {-                                         STrue-                                           -> let-                                                lambda ::-                                                  Sing (Case_0123456789 n b a_0123456789 a_0123456789 TrueSym0)-                                                lambda-                                                  = applySing-                                                      (singFun1 (Proxy :: Proxy SuccSym0) SSucc)-                                                      (applySing-                                                         (singFun1 (Proxy :: Proxy SuccSym0) SSucc)-                                                         n)-                                              in lambda-                                         SFalse-                                           -> let-                                                lambda ::-                                                  Sing (Case_0123456789 n b a_0123456789 a_0123456789 FalseSym0)-                                                lambda = n-                                              in lambda }-                               in lambda sN sB)))-                   a_0123456789)-                a_0123456789-        in lambda sA_0123456789 sA_0123456789-    sLiftMaybe sF (SJust sX)-      = let-          lambda ::-            forall f x. (t ~ f, t ~ Apply JustSym0 x) =>-            Sing f-            -> Sing x-               -> Sing (Apply (Apply LiftMaybeSym0 f) (Apply JustSym0 x))-          lambda f x-            = applySing-                (singFun1 (Proxy :: Proxy JustSym0) SJust) (applySing f x)-        in lambda sF sX-    sLiftMaybe _ SNothing-      = let-          lambda ::-            forall wild. (t ~ wild, t ~ NothingSym0) =>-            Sing (Apply (Apply LiftMaybeSym0 wild) NothingSym0)-          lambda = SNothing-        in lambda-    sMap _ SNil-      = let-          lambda ::-            forall wild. (t ~ wild, t ~ '[]) =>-            Sing (Apply (Apply MapSym0 wild) '[])-          lambda = SNil-        in lambda-    sMap sF (SCons sH sT)-      = let-          lambda ::-            forall f h t. (t ~ f, t ~ Apply (Apply (:$) h) t) =>-            Sing f-            -> Sing h-               -> Sing t-                  -> Sing (Apply (Apply MapSym0 f) (Apply (Apply (:$) h) t))-          lambda f h t-            = applySing-                (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) (applySing f h))-                (applySing-                   (applySing (singFun2 (Proxy :: Proxy MapSym0) sMap) f) t)-        in lambda sF sH sT-    data instance Sing (z :: Either a b)-      = forall (n :: a). z ~ Left n => SLeft (Sing n) |-        forall (n :: b). z ~ Right n => SRight (Sing n)-    type SEither (z :: Either a b) = Sing z-    instance (SingKind (KProxy :: KProxy a),-              SingKind (KProxy :: KProxy b)) =>-             SingKind (KProxy :: KProxy (Either a b)) where-      type DemoteRep (KProxy :: KProxy (Either a b)) = Either (DemoteRep (KProxy :: KProxy a)) (DemoteRep (KProxy :: KProxy b))-      fromSing (SLeft b) = Left (fromSing b)-      fromSing (SRight b) = Right (fromSing b)-      toSing (Left b)-        = case toSing b :: SomeSing (KProxy :: KProxy a) of {-            SomeSing c -> SomeSing (SLeft c) }-      toSing (Right b)-        = case toSing b :: SomeSing (KProxy :: KProxy b) of {-            SomeSing c -> SomeSing (SRight c) }-    instance SingI n => SingI (Left (n :: a)) where-      sing = SLeft sing-    instance SingI n => SingI (Right (n :: b)) where-      sing = SRight sing
+ tests/compile-and-dump/Singletons/LambdaCase.ghc710.template view
@@ -0,0 +1,287 @@+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 :: forall a. a -> Maybe a -> a+    foo1 d x+      = \case {+          Just y -> y+          Nothing -> d }+          x+    foo2 :: forall a. a -> Maybe a -> a+    foo2 d _+      = \case {+          Just y -> y+          Nothing -> d }+          (Just d)+    foo3 :: forall a b. a -> b -> a+    foo3 a b = \case { (p, _) -> p } (a, b)+    type family Case_0123456789 a b x_0123456789 t where+      Case_0123456789 a b x_0123456789 '(p, _z_0123456789) = p+    type family Lambda_0123456789 a b t where+      Lambda_0123456789 a b x_0123456789 = Case_0123456789 a b x_0123456789 x_0123456789+    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())+    data Lambda_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>+        Lambda_0123456789Sym2KindInference+    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type family Case_0123456789 d x_0123456789 _z_0123456789 t where+      Case_0123456789 d x_0123456789 _z_0123456789 (Just y) = y+      Case_0123456789 d x_0123456789 _z_0123456789 Nothing = d+    type family Lambda_0123456789 d _z_0123456789 t where+      Lambda_0123456789 d _z_0123456789 x_0123456789 = Case_0123456789 d x_0123456789 _z_0123456789 x_0123456789+    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())+    data Lambda_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>+        Lambda_0123456789Sym2KindInference+    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type family Case_0123456789 d x x_0123456789 t where+      Case_0123456789 d x x_0123456789 (Just y) = y+      Case_0123456789 d x x_0123456789 Nothing = d+    type family Lambda_0123456789 d x t where+      Lambda_0123456789 d x x_0123456789 = Case_0123456789 d x x_0123456789 x_0123456789+    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())+    data Lambda_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>+        Lambda_0123456789Sym2KindInference+    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type Foo3Sym2 (t :: a) (t :: b) = Foo3 t t+    instance SuppressUnusedWarnings Foo3Sym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo3Sym1KindInference GHC.Tuple.())+    data Foo3Sym1 (l :: a) (l :: TyFun b a)+      = forall arg. KindOf (Apply (Foo3Sym1 l) arg) ~ KindOf (Foo3Sym2 l arg) =>+        Foo3Sym1KindInference+    type instance Apply (Foo3Sym1 l) l = Foo3Sym2 l l+    instance SuppressUnusedWarnings Foo3Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo3Sym0KindInference GHC.Tuple.())+    data Foo3Sym0 (l :: TyFun a (TyFun b a -> *))+      = forall arg. KindOf (Apply Foo3Sym0 arg) ~ KindOf (Foo3Sym1 arg) =>+        Foo3Sym0KindInference+    type instance Apply Foo3Sym0 l = Foo3Sym1 l+    type Foo2Sym2 (t :: a) (t :: Maybe a) = Foo2 t t+    instance SuppressUnusedWarnings Foo2Sym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo2Sym1KindInference GHC.Tuple.())+    data Foo2Sym1 (l :: a) (l :: TyFun (Maybe a) a)+      = forall arg. KindOf (Apply (Foo2Sym1 l) arg) ~ KindOf (Foo2Sym2 l arg) =>+        Foo2Sym1KindInference+    type instance Apply (Foo2Sym1 l) l = Foo2Sym2 l l+    instance SuppressUnusedWarnings Foo2Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo2Sym0KindInference GHC.Tuple.())+    data Foo2Sym0 (l :: TyFun a (TyFun (Maybe a) a -> *))+      = forall arg. KindOf (Apply Foo2Sym0 arg) ~ KindOf (Foo2Sym1 arg) =>+        Foo2Sym0KindInference+    type instance Apply Foo2Sym0 l = Foo2Sym1 l+    type Foo1Sym2 (t :: a) (t :: Maybe a) = Foo1 t t+    instance SuppressUnusedWarnings Foo1Sym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo1Sym1KindInference GHC.Tuple.())+    data Foo1Sym1 (l :: a) (l :: TyFun (Maybe a) a)+      = forall arg. KindOf (Apply (Foo1Sym1 l) arg) ~ KindOf (Foo1Sym2 l arg) =>+        Foo1Sym1KindInference+    type instance Apply (Foo1Sym1 l) l = Foo1Sym2 l l+    instance SuppressUnusedWarnings Foo1Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo1Sym0KindInference GHC.Tuple.())+    data Foo1Sym0 (l :: TyFun a (TyFun (Maybe a) a -> *))+      = forall arg. KindOf (Apply Foo1Sym0 arg) ~ KindOf (Foo1Sym1 arg) =>+        Foo1Sym0KindInference+    type instance Apply Foo1Sym0 l = Foo1Sym1 l+    type family Foo3 (a :: a) (a :: b) :: a where+      Foo3 a b = Apply (Apply (Apply Lambda_0123456789Sym0 a) b) (Apply (Apply Tuple2Sym0 a) b)+    type family Foo2 (a :: a) (a :: Maybe a) :: a where+      Foo2 d _z_0123456789 = Apply (Apply (Apply Lambda_0123456789Sym0 d) _z_0123456789) (Apply JustSym0 d)+    type family Foo1 (a :: a) (a :: Maybe a) :: a where+      Foo1 d x = Apply (Apply (Apply Lambda_0123456789Sym0 d) x) x+    sFoo3 ::+      forall (t :: a) (t :: b).+      Sing t -> Sing t -> Sing (Apply (Apply Foo3Sym0 t) t :: a)+    sFoo2 ::+      forall (t :: a) (t :: Maybe a).+      Sing t -> Sing t -> Sing (Apply (Apply Foo2Sym0 t) t :: a)+    sFoo1 ::+      forall (t :: a) (t :: Maybe a).+      Sing t -> Sing t -> Sing (Apply (Apply Foo1Sym0 t) t :: a)+    sFoo3 sA sB+      = let+          lambda ::+            forall a b. (t ~ a, t ~ b) =>+            Sing a -> Sing b -> Sing (Apply (Apply Foo3Sym0 a) b :: a)+          lambda a b+            = applySing+                (singFun1+                   (Proxy :: Proxy (Apply (Apply Lambda_0123456789Sym0 a) b))+                   (\ sX_0123456789+                      -> let+                           lambda ::+                             forall x_0123456789.+                             Sing x_0123456789+                             -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 a) b) x_0123456789)+                           lambda x_0123456789+                             = case x_0123456789 of {+                                 STuple2 sP _s_z_0123456789+                                   -> let+                                        lambda ::+                                          forall p+                                                 _z_0123456789. Apply (Apply Tuple2Sym0 p) _z_0123456789 ~ x_0123456789 =>+                                          Sing p+                                          -> Sing _z_0123456789+                                             -> Sing (Case_0123456789 a b x_0123456789 (Apply (Apply Tuple2Sym0 p) _z_0123456789))+                                        lambda p _z_0123456789 = p+                                      in lambda sP _s_z_0123456789 } ::+                                 Sing (Case_0123456789 a b x_0123456789 x_0123456789)+                         in lambda sX_0123456789))+                (applySing+                   (applySing (singFun2 (Proxy :: Proxy Tuple2Sym0) STuple2) a) b)+        in lambda sA sB+    sFoo2 sD _s_z_0123456789+      = let+          lambda ::+            forall d _z_0123456789. (t ~ d, t ~ _z_0123456789) =>+            Sing d+            -> Sing _z_0123456789+               -> Sing (Apply (Apply Foo2Sym0 d) _z_0123456789 :: a)+          lambda d _z_0123456789+            = applySing+                (singFun1+                   (Proxy ::+                      Proxy (Apply (Apply Lambda_0123456789Sym0 d) _z_0123456789))+                   (\ sX_0123456789+                      -> let+                           lambda ::+                             forall x_0123456789.+                             Sing x_0123456789+                             -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 d) _z_0123456789) x_0123456789)+                           lambda x_0123456789+                             = case x_0123456789 of {+                                 SJust sY+                                   -> let+                                        lambda ::+                                          forall y. Apply JustSym0 y ~ x_0123456789 =>+                                          Sing y+                                          -> Sing (Case_0123456789 d x_0123456789 _z_0123456789 (Apply JustSym0 y))+                                        lambda y = y+                                      in lambda sY+                                 SNothing+                                   -> let+                                        lambda ::+                                          NothingSym0 ~ x_0123456789 =>+                                          Sing (Case_0123456789 d x_0123456789 _z_0123456789 NothingSym0)+                                        lambda = d+                                      in lambda } ::+                                 Sing (Case_0123456789 d x_0123456789 _z_0123456789 x_0123456789)+                         in lambda sX_0123456789))+                (applySing (singFun1 (Proxy :: Proxy JustSym0) SJust) d)+        in lambda sD _s_z_0123456789+    sFoo1 sD sX+      = let+          lambda ::+            forall d x. (t ~ d, t ~ x) =>+            Sing d -> Sing x -> Sing (Apply (Apply Foo1Sym0 d) x :: a)+          lambda d x+            = applySing+                (singFun1+                   (Proxy :: Proxy (Apply (Apply Lambda_0123456789Sym0 d) x))+                   (\ sX_0123456789+                      -> let+                           lambda ::+                             forall x_0123456789.+                             Sing x_0123456789+                             -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 d) x) x_0123456789)+                           lambda x_0123456789+                             = case x_0123456789 of {+                                 SJust sY+                                   -> let+                                        lambda ::+                                          forall y. Apply JustSym0 y ~ x_0123456789 =>+                                          Sing y+                                          -> Sing (Case_0123456789 d x x_0123456789 (Apply JustSym0 y))+                                        lambda y = y+                                      in lambda sY+                                 SNothing+                                   -> let+                                        lambda ::+                                          NothingSym0 ~ x_0123456789 =>+                                          Sing (Case_0123456789 d x x_0123456789 NothingSym0)+                                        lambda = d+                                      in lambda } ::+                                 Sing (Case_0123456789 d x x_0123456789 x_0123456789)+                         in lambda sX_0123456789))+                x+        in lambda sD sX
− tests/compile-and-dump/Singletons/LambdaCase.ghc78.template
@@ -1,269 +0,0 @@-Singletons/LambdaCase.hs: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) |]-  ======>-    Singletons/LambdaCase.hs:(0,0)-(0,0)-    foo1 :: forall a. a -> Maybe a -> a-    foo1 d x-      = \case {-          Just y -> y-          Nothing -> d }-          x-    foo2 :: forall a. a -> Maybe a -> a-    foo2 d _-      = \case {-          Just y -> y-          Nothing -> d }-          (Just d)-    foo3 :: forall a b. a -> b -> a-    foo3 a b = \case { (p, _) -> p } (a, b)-    type family Case_0123456789 a b x_0123456789 t where-      Case_0123456789 a b x_0123456789 '(p, z) = p-    type family Lambda_0123456789 a b t where-      Lambda_0123456789 a b x_0123456789 = Case_0123456789 a b x_0123456789 x_0123456789-    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())-    data Lambda_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>-        Lambda_0123456789Sym2KindInference-    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type family Case_0123456789 d x_0123456789 t where-      Case_0123456789 d x_0123456789 (Just y) = y-      Case_0123456789 d x_0123456789 Nothing = d-    type family Lambda_0123456789 d t where-      Lambda_0123456789 d x_0123456789 = Case_0123456789 d x_0123456789 x_0123456789-    type Lambda_0123456789Sym2 t t = Lambda_0123456789 t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type family Case_0123456789 d x x_0123456789 t where-      Case_0123456789 d x x_0123456789 (Just y) = y-      Case_0123456789 d x x_0123456789 Nothing = d-    type family Lambda_0123456789 d x t where-      Lambda_0123456789 d x x_0123456789 = Case_0123456789 d x x_0123456789 x_0123456789-    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())-    data Lambda_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>-        Lambda_0123456789Sym2KindInference-    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type Foo3Sym2 (t :: a) (t :: b) = Foo3 t t-    instance SuppressUnusedWarnings Foo3Sym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo3Sym1KindInference GHC.Tuple.())-    data Foo3Sym1 (l :: a) (l :: TyFun b a)-      = forall arg. KindOf (Apply (Foo3Sym1 l) arg) ~ KindOf (Foo3Sym2 l arg) =>-        Foo3Sym1KindInference-    type instance Apply (Foo3Sym1 l) l = Foo3Sym2 l l-    instance SuppressUnusedWarnings Foo3Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo3Sym0KindInference GHC.Tuple.())-    data Foo3Sym0 (l :: TyFun a (TyFun b a -> *))-      = forall arg. KindOf (Apply Foo3Sym0 arg) ~ KindOf (Foo3Sym1 arg) =>-        Foo3Sym0KindInference-    type instance Apply Foo3Sym0 l = Foo3Sym1 l-    type Foo2Sym2 (t :: a) (t :: Maybe a) = Foo2 t t-    instance SuppressUnusedWarnings Foo2Sym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo2Sym1KindInference GHC.Tuple.())-    data Foo2Sym1 (l :: a) (l :: TyFun (Maybe a) a)-      = forall arg. KindOf (Apply (Foo2Sym1 l) arg) ~ KindOf (Foo2Sym2 l arg) =>-        Foo2Sym1KindInference-    type instance Apply (Foo2Sym1 l) l = Foo2Sym2 l l-    instance SuppressUnusedWarnings Foo2Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo2Sym0KindInference GHC.Tuple.())-    data Foo2Sym0 (l :: TyFun a (TyFun (Maybe a) a -> *))-      = forall arg. KindOf (Apply Foo2Sym0 arg) ~ KindOf (Foo2Sym1 arg) =>-        Foo2Sym0KindInference-    type instance Apply Foo2Sym0 l = Foo2Sym1 l-    type Foo1Sym2 (t :: a) (t :: Maybe a) = Foo1 t t-    instance SuppressUnusedWarnings Foo1Sym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo1Sym1KindInference GHC.Tuple.())-    data Foo1Sym1 (l :: a) (l :: TyFun (Maybe a) a)-      = forall arg. KindOf (Apply (Foo1Sym1 l) arg) ~ KindOf (Foo1Sym2 l arg) =>-        Foo1Sym1KindInference-    type instance Apply (Foo1Sym1 l) l = Foo1Sym2 l l-    instance SuppressUnusedWarnings Foo1Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo1Sym0KindInference GHC.Tuple.())-    data Foo1Sym0 (l :: TyFun a (TyFun (Maybe a) a -> *))-      = forall arg. KindOf (Apply Foo1Sym0 arg) ~ KindOf (Foo1Sym1 arg) =>-        Foo1Sym0KindInference-    type instance Apply Foo1Sym0 l = Foo1Sym1 l-    type family Foo3 (a :: a) (a :: b) :: a where-      Foo3 a b = Apply (Apply (Apply Lambda_0123456789Sym0 a) b) (Apply (Apply Tuple2Sym0 a) b)-    type family Foo2 (a :: a) (a :: Maybe a) :: a where-      Foo2 d z = Apply (Apply Lambda_0123456789Sym0 d) (Apply JustSym0 d)-    type family Foo1 (a :: a) (a :: Maybe a) :: a where-      Foo1 d x = Apply (Apply (Apply Lambda_0123456789Sym0 d) x) x-    sFoo3 ::-      forall (t :: a) (t :: b).-      Sing t -> Sing t -> Sing (Apply (Apply Foo3Sym0 t) t)-    sFoo2 ::-      forall (t :: a) (t :: Maybe a).-      Sing t -> Sing t -> Sing (Apply (Apply Foo2Sym0 t) t)-    sFoo1 ::-      forall (t :: a) (t :: Maybe a).-      Sing t -> Sing t -> Sing (Apply (Apply Foo1Sym0 t) t)-    sFoo3 sA sB-      = let-          lambda ::-            forall a b. (t ~ a, t ~ b) =>-            Sing a -> Sing b -> Sing (Apply (Apply Foo3Sym0 a) b)-          lambda a b-            = applySing-                (singFun1-                   (Proxy :: Proxy (Apply (Apply Lambda_0123456789Sym0 a) b))-                   (\ sX_0123456789-                      -> let-                           lambda ::-                             forall x_0123456789.-                             Sing x_0123456789-                             -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 a) b) x_0123456789)-                           lambda x_0123456789-                             = case x_0123456789 of {-                                 STuple2 sP _-                                   -> let-                                        lambda ::-                                          forall p wild.-                                          Sing p-                                          -> Sing (Case_0123456789 a b x_0123456789 (Apply (Apply Tuple2Sym0 p) wild))-                                        lambda p = p-                                      in lambda sP }-                         in lambda sX_0123456789))-                (applySing-                   (applySing (singFun2 (Proxy :: Proxy Tuple2Sym0) STuple2) a) b)-        in lambda sA sB-    sFoo2 sD _-      = let-          lambda ::-            forall d wild. (t ~ d, t ~ wild) =>-            Sing d -> Sing (Apply (Apply Foo2Sym0 d) wild)-          lambda d-            = applySing-                (singFun1-                   (Proxy :: Proxy (Apply Lambda_0123456789Sym0 d))-                   (\ sX_0123456789-                      -> let-                           lambda ::-                             forall x_0123456789.-                             Sing x_0123456789-                             -> Sing (Apply (Apply Lambda_0123456789Sym0 d) x_0123456789)-                           lambda x_0123456789-                             = case x_0123456789 of {-                                 SJust sY-                                   -> let-                                        lambda ::-                                          forall y.-                                          Sing y-                                          -> Sing (Case_0123456789 d x_0123456789 (Apply JustSym0 y))-                                        lambda y = y-                                      in lambda sY-                                 SNothing-                                   -> let-                                        lambda :: Sing (Case_0123456789 d x_0123456789 NothingSym0)-                                        lambda = d-                                      in lambda }-                         in lambda sX_0123456789))-                (applySing (singFun1 (Proxy :: Proxy JustSym0) SJust) d)-        in lambda sD-    sFoo1 sD sX-      = let-          lambda ::-            forall d x. (t ~ d, t ~ x) =>-            Sing d -> Sing x -> Sing (Apply (Apply Foo1Sym0 d) x)-          lambda d x-            = applySing-                (singFun1-                   (Proxy :: Proxy (Apply (Apply Lambda_0123456789Sym0 d) x))-                   (\ sX_0123456789-                      -> let-                           lambda ::-                             forall x_0123456789.-                             Sing x_0123456789-                             -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 d) x) x_0123456789)-                           lambda x_0123456789-                             = case x_0123456789 of {-                                 SJust sY-                                   -> let-                                        lambda ::-                                          forall y.-                                          Sing y-                                          -> Sing (Case_0123456789 d x x_0123456789 (Apply JustSym0 y))-                                        lambda y = y-                                      in lambda sY-                                 SNothing-                                   -> let-                                        lambda ::-                                          Sing (Case_0123456789 d x x_0123456789 NothingSym0)-                                        lambda = d-                                      in lambda }-                         in lambda sX_0123456789))-                x-        in lambda sD sX
+ tests/compile-and-dump/Singletons/Lambdas.ghc710.template view
@@ -0,0 +1,816 @@+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 :: forall a b. a -> b -> a+    foo0 = \ x y -> x+    foo1 :: forall a b. a -> b -> a+    foo1 x = \ _ -> x+    foo2 :: forall a b. a -> b -> a+    foo2 x y = \ _ -> x y+    foo3 :: forall a. a -> a+    foo3 x = \ y -> y x+    foo4 :: forall a b c. a -> b -> c -> a+    foo4 x y z = \ _ _ -> x y z+    foo5 :: forall a b. a -> b -> b+    foo5 x y = \ x -> x y+    foo6 :: forall a b. a -> b -> a+    foo6 a b = \ x -> \ _ -> x a b+    foo7 :: forall a b. a -> b -> b+    foo7 x y = \ (_, b) -> b (x, y)+    data Foo a b = Foo a b+    foo8 :: forall a b. Foo a b -> a+    foo8 x = \ (Foo a _) -> a x+    type FooSym2 (t :: a) (t :: b) = Foo t t+    instance SuppressUnusedWarnings FooSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) FooSym1KindInference GHC.Tuple.())+    data FooSym1 (l :: a) (l :: TyFun b (Foo a b))+      = forall arg. KindOf (Apply (FooSym1 l) arg) ~ KindOf (FooSym2 l arg) =>+        FooSym1KindInference+    type instance Apply (FooSym1 l) l = FooSym2 l l+    instance SuppressUnusedWarnings FooSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) FooSym0KindInference GHC.Tuple.())+    data FooSym0 (l :: TyFun a (TyFun b (Foo a b) -> *))+      = forall arg. KindOf (Apply FooSym0 arg) ~ KindOf (FooSym1 arg) =>+        FooSym0KindInference+    type instance Apply FooSym0 l = FooSym1 l+    type family Case_0123456789 x arg_0123456789 t where+      Case_0123456789 x arg_0123456789 (Foo a _z_0123456789) = a+    type family Lambda_0123456789 x t where+      Lambda_0123456789 x arg_0123456789 = Case_0123456789 x arg_0123456789 arg_0123456789+    type Lambda_0123456789Sym2 t t = Lambda_0123456789 t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type family Case_0123456789 x y arg_0123456789 t where+      Case_0123456789 x y arg_0123456789 '(_z_0123456789, b) = b+    type family Lambda_0123456789 x y t where+      Lambda_0123456789 x y arg_0123456789 = Case_0123456789 x y arg_0123456789 arg_0123456789+    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())+    data Lambda_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>+        Lambda_0123456789Sym2KindInference+    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type family Case_0123456789 a b x arg_0123456789 t where+      Case_0123456789 a b x arg_0123456789 _z_0123456789 = x+    type family Lambda_0123456789 a b x t where+      Lambda_0123456789 a b x arg_0123456789 = Case_0123456789 a b x arg_0123456789 arg_0123456789+    type Lambda_0123456789Sym4 t t t t = Lambda_0123456789 t t t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym3 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym3KindInference GHC.Tuple.())+    data Lambda_0123456789Sym3 l l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym3 l l l) arg) ~ KindOf (Lambda_0123456789Sym4 l l l arg) =>+        Lambda_0123456789Sym3KindInference+    type instance Apply (Lambda_0123456789Sym3 l l l) l = Lambda_0123456789Sym4 l l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())+    data Lambda_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>+        Lambda_0123456789Sym2KindInference+    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type family Lambda_0123456789 a b t where+      Lambda_0123456789 a b x = Apply (Apply (Apply Lambda_0123456789Sym0 a) b) x+    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())+    data Lambda_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>+        Lambda_0123456789Sym2KindInference+    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type family Lambda_0123456789 x y t where+      Lambda_0123456789 x y x = x+    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())+    data Lambda_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>+        Lambda_0123456789Sym2KindInference+    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type family Case_0123456789 x+                                y+                                z+                                arg_0123456789+                                arg_0123456789+                                t where+      Case_0123456789 x y z arg_0123456789 arg_0123456789 '(_z_0123456789,+                                                            _z_0123456789) = x+    type family Lambda_0123456789 x y z t t where+      Lambda_0123456789 x y z arg_0123456789 arg_0123456789 = Case_0123456789 x y z arg_0123456789 arg_0123456789 (Apply (Apply Tuple2Sym0 arg_0123456789) arg_0123456789)+    type Lambda_0123456789Sym5 t t t t t = Lambda_0123456789 t t t t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym4 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym4KindInference GHC.Tuple.())+    data Lambda_0123456789Sym4 l l l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym4 l l l l) arg) ~ KindOf (Lambda_0123456789Sym5 l l l l arg) =>+        Lambda_0123456789Sym4KindInference+    type instance Apply (Lambda_0123456789Sym4 l l l l) l = Lambda_0123456789Sym5 l l l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym3 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym3KindInference GHC.Tuple.())+    data Lambda_0123456789Sym3 l l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym3 l l l) arg) ~ KindOf (Lambda_0123456789Sym4 l l l arg) =>+        Lambda_0123456789Sym3KindInference+    type instance Apply (Lambda_0123456789Sym3 l l l) l = Lambda_0123456789Sym4 l l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())+    data Lambda_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>+        Lambda_0123456789Sym2KindInference+    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type family Lambda_0123456789 x t where+      Lambda_0123456789 x y = y+    type Lambda_0123456789Sym2 t t = Lambda_0123456789 t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type family Case_0123456789 x y arg_0123456789 t where+      Case_0123456789 x y arg_0123456789 _z_0123456789 = x+    type family Lambda_0123456789 x y t where+      Lambda_0123456789 x y arg_0123456789 = Case_0123456789 x y arg_0123456789 arg_0123456789+    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())+    data Lambda_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>+        Lambda_0123456789Sym2KindInference+    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type family Case_0123456789 x arg_0123456789 a_0123456789 t where+      Case_0123456789 x arg_0123456789 a_0123456789 _z_0123456789 = x+    type family Lambda_0123456789 x a_0123456789 t where+      Lambda_0123456789 x a_0123456789 arg_0123456789 = Case_0123456789 x arg_0123456789 a_0123456789 arg_0123456789+    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())+    data Lambda_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>+        Lambda_0123456789Sym2KindInference+    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type family Lambda_0123456789 a_0123456789 a_0123456789 t t where+      Lambda_0123456789 a_0123456789 a_0123456789 x y = x+    type Lambda_0123456789Sym4 t t t t = Lambda_0123456789 t t t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym3 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym3KindInference GHC.Tuple.())+    data Lambda_0123456789Sym3 l l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym3 l l l) arg) ~ KindOf (Lambda_0123456789Sym4 l l l arg) =>+        Lambda_0123456789Sym3KindInference+    type instance Apply (Lambda_0123456789Sym3 l l l) l = Lambda_0123456789Sym4 l l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())+    data Lambda_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>+        Lambda_0123456789Sym2KindInference+    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type Foo8Sym1 (t :: Foo a b) = Foo8 t+    instance SuppressUnusedWarnings Foo8Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo8Sym0KindInference GHC.Tuple.())+    data Foo8Sym0 (l :: TyFun (Foo a b) a)+      = forall arg. KindOf (Apply Foo8Sym0 arg) ~ KindOf (Foo8Sym1 arg) =>+        Foo8Sym0KindInference+    type instance Apply Foo8Sym0 l = Foo8Sym1 l+    type Foo7Sym2 (t :: a) (t :: b) = Foo7 t t+    instance SuppressUnusedWarnings Foo7Sym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo7Sym1KindInference GHC.Tuple.())+    data Foo7Sym1 (l :: a) (l :: TyFun b b)+      = forall arg. KindOf (Apply (Foo7Sym1 l) arg) ~ KindOf (Foo7Sym2 l arg) =>+        Foo7Sym1KindInference+    type instance Apply (Foo7Sym1 l) l = Foo7Sym2 l l+    instance SuppressUnusedWarnings Foo7Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo7Sym0KindInference GHC.Tuple.())+    data Foo7Sym0 (l :: TyFun a (TyFun b b -> *))+      = forall arg. KindOf (Apply Foo7Sym0 arg) ~ KindOf (Foo7Sym1 arg) =>+        Foo7Sym0KindInference+    type instance Apply Foo7Sym0 l = Foo7Sym1 l+    type Foo6Sym2 (t :: a) (t :: b) = Foo6 t t+    instance SuppressUnusedWarnings Foo6Sym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo6Sym1KindInference GHC.Tuple.())+    data Foo6Sym1 (l :: a) (l :: TyFun b a)+      = forall arg. KindOf (Apply (Foo6Sym1 l) arg) ~ KindOf (Foo6Sym2 l arg) =>+        Foo6Sym1KindInference+    type instance Apply (Foo6Sym1 l) l = Foo6Sym2 l l+    instance SuppressUnusedWarnings Foo6Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo6Sym0KindInference GHC.Tuple.())+    data Foo6Sym0 (l :: TyFun a (TyFun b a -> *))+      = forall arg. KindOf (Apply Foo6Sym0 arg) ~ KindOf (Foo6Sym1 arg) =>+        Foo6Sym0KindInference+    type instance Apply Foo6Sym0 l = Foo6Sym1 l+    type Foo5Sym2 (t :: a) (t :: b) = Foo5 t t+    instance SuppressUnusedWarnings Foo5Sym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo5Sym1KindInference GHC.Tuple.())+    data Foo5Sym1 (l :: a) (l :: TyFun b b)+      = forall arg. KindOf (Apply (Foo5Sym1 l) arg) ~ KindOf (Foo5Sym2 l arg) =>+        Foo5Sym1KindInference+    type instance Apply (Foo5Sym1 l) l = Foo5Sym2 l l+    instance SuppressUnusedWarnings Foo5Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo5Sym0KindInference GHC.Tuple.())+    data Foo5Sym0 (l :: TyFun a (TyFun b b -> *))+      = forall arg. KindOf (Apply Foo5Sym0 arg) ~ KindOf (Foo5Sym1 arg) =>+        Foo5Sym0KindInference+    type instance Apply Foo5Sym0 l = Foo5Sym1 l+    type Foo4Sym3 (t :: a) (t :: b) (t :: c) = Foo4 t t t+    instance SuppressUnusedWarnings Foo4Sym2 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo4Sym2KindInference GHC.Tuple.())+    data Foo4Sym2 (l :: a) (l :: b) (l :: TyFun c a)+      = forall arg. KindOf (Apply (Foo4Sym2 l l) arg) ~ KindOf (Foo4Sym3 l l arg) =>+        Foo4Sym2KindInference+    type instance Apply (Foo4Sym2 l l) l = Foo4Sym3 l l l+    instance SuppressUnusedWarnings Foo4Sym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo4Sym1KindInference GHC.Tuple.())+    data Foo4Sym1 (l :: a) (l :: TyFun b (TyFun c a -> *))+      = forall arg. KindOf (Apply (Foo4Sym1 l) arg) ~ KindOf (Foo4Sym2 l arg) =>+        Foo4Sym1KindInference+    type instance Apply (Foo4Sym1 l) l = Foo4Sym2 l l+    instance SuppressUnusedWarnings Foo4Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo4Sym0KindInference GHC.Tuple.())+    data Foo4Sym0 (l :: TyFun a (TyFun b (TyFun c a -> *) -> *))+      = forall arg. KindOf (Apply Foo4Sym0 arg) ~ KindOf (Foo4Sym1 arg) =>+        Foo4Sym0KindInference+    type instance Apply Foo4Sym0 l = Foo4Sym1 l+    type Foo3Sym1 (t :: a) = Foo3 t+    instance SuppressUnusedWarnings Foo3Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo3Sym0KindInference GHC.Tuple.())+    data Foo3Sym0 (l :: TyFun a a)+      = forall arg. KindOf (Apply Foo3Sym0 arg) ~ KindOf (Foo3Sym1 arg) =>+        Foo3Sym0KindInference+    type instance Apply Foo3Sym0 l = Foo3Sym1 l+    type Foo2Sym2 (t :: a) (t :: b) = Foo2 t t+    instance SuppressUnusedWarnings Foo2Sym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo2Sym1KindInference GHC.Tuple.())+    data Foo2Sym1 (l :: a) (l :: TyFun b a)+      = forall arg. KindOf (Apply (Foo2Sym1 l) arg) ~ KindOf (Foo2Sym2 l arg) =>+        Foo2Sym1KindInference+    type instance Apply (Foo2Sym1 l) l = Foo2Sym2 l l+    instance SuppressUnusedWarnings Foo2Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo2Sym0KindInference GHC.Tuple.())+    data Foo2Sym0 (l :: TyFun a (TyFun b a -> *))+      = forall arg. KindOf (Apply Foo2Sym0 arg) ~ KindOf (Foo2Sym1 arg) =>+        Foo2Sym0KindInference+    type instance Apply Foo2Sym0 l = Foo2Sym1 l+    type Foo1Sym2 (t :: a) (t :: b) = Foo1 t t+    instance SuppressUnusedWarnings Foo1Sym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo1Sym1KindInference GHC.Tuple.())+    data Foo1Sym1 (l :: a) (l :: TyFun b a)+      = forall arg. KindOf (Apply (Foo1Sym1 l) arg) ~ KindOf (Foo1Sym2 l arg) =>+        Foo1Sym1KindInference+    type instance Apply (Foo1Sym1 l) l = Foo1Sym2 l l+    instance SuppressUnusedWarnings Foo1Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo1Sym0KindInference GHC.Tuple.())+    data Foo1Sym0 (l :: TyFun a (TyFun b a -> *))+      = forall arg. KindOf (Apply Foo1Sym0 arg) ~ KindOf (Foo1Sym1 arg) =>+        Foo1Sym0KindInference+    type instance Apply Foo1Sym0 l = Foo1Sym1 l+    type Foo0Sym2 (t :: a) (t :: b) = Foo0 t t+    instance SuppressUnusedWarnings Foo0Sym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo0Sym1KindInference GHC.Tuple.())+    data Foo0Sym1 (l :: a) (l :: TyFun b a)+      = forall arg. KindOf (Apply (Foo0Sym1 l) arg) ~ KindOf (Foo0Sym2 l arg) =>+        Foo0Sym1KindInference+    type instance Apply (Foo0Sym1 l) l = Foo0Sym2 l l+    instance SuppressUnusedWarnings Foo0Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo0Sym0KindInference GHC.Tuple.())+    data Foo0Sym0 (l :: TyFun a (TyFun b a -> *))+      = forall arg. KindOf (Apply Foo0Sym0 arg) ~ KindOf (Foo0Sym1 arg) =>+        Foo0Sym0KindInference+    type instance Apply Foo0Sym0 l = Foo0Sym1 l+    type family Foo8 (a :: Foo a b) :: a where+      Foo8 x = Apply (Apply Lambda_0123456789Sym0 x) x+    type family Foo7 (a :: a) (a :: b) :: b where+      Foo7 x y = Apply (Apply (Apply Lambda_0123456789Sym0 x) y) (Apply (Apply Tuple2Sym0 x) y)+    type family Foo6 (a :: a) (a :: b) :: a where+      Foo6 a b = Apply (Apply (Apply (Apply Lambda_0123456789Sym0 a) b) a) b+    type family Foo5 (a :: a) (a :: b) :: b where+      Foo5 x y = Apply (Apply (Apply Lambda_0123456789Sym0 x) y) y+    type family Foo4 (a :: a) (a :: b) (a :: c) :: a where+      Foo4 x y z = Apply (Apply (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) z) y) z+    type family Foo3 (a :: a) :: a where+      Foo3 x = Apply (Apply Lambda_0123456789Sym0 x) x+    type family Foo2 (a :: a) (a :: b) :: a where+      Foo2 x y = Apply (Apply (Apply Lambda_0123456789Sym0 x) y) y+    type family Foo1 (a :: a) (a :: b) :: a where+      Foo1 x a_0123456789 = Apply (Apply (Apply Lambda_0123456789Sym0 x) a_0123456789) a_0123456789+    type family Foo0 (a :: a) (a :: b) :: a where+      Foo0 a_0123456789 a_0123456789 = Apply (Apply (Apply (Apply Lambda_0123456789Sym0 a_0123456789) a_0123456789) a_0123456789) a_0123456789+    sFoo8 ::+      forall (t :: Foo a b). Sing t -> Sing (Apply Foo8Sym0 t :: a)+    sFoo7 ::+      forall (t :: a) (t :: b).+      Sing t -> Sing t -> Sing (Apply (Apply Foo7Sym0 t) t :: b)+    sFoo6 ::+      forall (t :: a) (t :: b).+      Sing t -> Sing t -> Sing (Apply (Apply Foo6Sym0 t) t :: a)+    sFoo5 ::+      forall (t :: a) (t :: b).+      Sing t -> Sing t -> Sing (Apply (Apply Foo5Sym0 t) t :: b)+    sFoo4 ::+      forall (t :: a) (t :: b) (t :: c).+      Sing t+      -> Sing t+         -> Sing t -> Sing (Apply (Apply (Apply Foo4Sym0 t) t) t :: a)+    sFoo3 :: forall (t :: a). Sing t -> Sing (Apply Foo3Sym0 t :: a)+    sFoo2 ::+      forall (t :: a) (t :: b).+      Sing t -> Sing t -> Sing (Apply (Apply Foo2Sym0 t) t :: a)+    sFoo1 ::+      forall (t :: a) (t :: b).+      Sing t -> Sing t -> Sing (Apply (Apply Foo1Sym0 t) t :: a)+    sFoo0 ::+      forall (t :: a) (t :: b).+      Sing t -> Sing t -> Sing (Apply (Apply Foo0Sym0 t) t :: a)+    sFoo8 sX+      = let+          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo8Sym0 x :: a)+          lambda x+            = applySing+                (singFun1+                   (Proxy :: Proxy (Apply Lambda_0123456789Sym0 x))+                   (\ sArg_0123456789+                      -> let+                           lambda ::+                             forall arg_0123456789.+                             Sing arg_0123456789+                             -> Sing (Apply (Apply Lambda_0123456789Sym0 x) arg_0123456789)+                           lambda arg_0123456789+                             = case arg_0123456789 of {+                                 SFoo sA _s_z_0123456789+                                   -> let+                                        lambda ::+                                          forall a+                                                 _z_0123456789. Apply (Apply FooSym0 a) _z_0123456789 ~ arg_0123456789 =>+                                          Sing a+                                          -> Sing _z_0123456789+                                             -> Sing (Case_0123456789 x arg_0123456789 (Apply (Apply FooSym0 a) _z_0123456789))+                                        lambda a _z_0123456789 = a+                                      in lambda sA _s_z_0123456789 } ::+                                 Sing (Case_0123456789 x arg_0123456789 arg_0123456789)+                         in lambda sArg_0123456789))+                x+        in lambda sX+    sFoo7 sX sY+      = let+          lambda ::+            forall x y. (t ~ x, t ~ y) =>+            Sing x -> Sing y -> Sing (Apply (Apply Foo7Sym0 x) y :: b)+          lambda x y+            = applySing+                (singFun1+                   (Proxy :: Proxy (Apply (Apply Lambda_0123456789Sym0 x) y))+                   (\ sArg_0123456789+                      -> let+                           lambda ::+                             forall arg_0123456789.+                             Sing arg_0123456789+                             -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) arg_0123456789)+                           lambda arg_0123456789+                             = case arg_0123456789 of {+                                 STuple2 _s_z_0123456789 sB+                                   -> let+                                        lambda ::+                                          forall _z_0123456789+                                                 b. Apply (Apply Tuple2Sym0 _z_0123456789) b ~ arg_0123456789 =>+                                          Sing _z_0123456789+                                          -> Sing b+                                             -> Sing (Case_0123456789 x y arg_0123456789 (Apply (Apply Tuple2Sym0 _z_0123456789) b))+                                        lambda _z_0123456789 b = b+                                      in lambda _s_z_0123456789 sB } ::+                                 Sing (Case_0123456789 x y arg_0123456789 arg_0123456789)+                         in lambda sArg_0123456789))+                (applySing+                   (applySing (singFun2 (Proxy :: Proxy Tuple2Sym0) STuple2) x) y)+        in lambda sX sY+    sFoo6 sA sB+      = let+          lambda ::+            forall a b. (t ~ a, t ~ b) =>+            Sing a -> Sing b -> Sing (Apply (Apply Foo6Sym0 a) b :: a)+          lambda a b+            = applySing+                (applySing+                   (singFun1+                      (Proxy :: Proxy (Apply (Apply Lambda_0123456789Sym0 a) b))+                      (\ sX+                         -> let+                              lambda ::+                                forall x.+                                Sing x -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 a) b) x)+                              lambda x+                                = singFun1+                                    (Proxy ::+                                       Proxy (Apply (Apply (Apply Lambda_0123456789Sym0 a) b) x))+                                    (\ sArg_0123456789+                                       -> let+                                            lambda ::+                                              forall arg_0123456789.+                                              Sing arg_0123456789+                                              -> Sing (Apply (Apply (Apply (Apply Lambda_0123456789Sym0 a) b) x) arg_0123456789)+                                            lambda arg_0123456789+                                              = case arg_0123456789 of {+                                                  _s_z_0123456789+                                                    -> let+                                                         lambda ::+                                                           forall _z_0123456789. _z_0123456789 ~ arg_0123456789 =>+                                                           Sing _z_0123456789+                                                           -> Sing (Case_0123456789 a b x arg_0123456789 _z_0123456789)+                                                         lambda _z_0123456789 = x+                                                       in lambda _s_z_0123456789 } ::+                                                  Sing (Case_0123456789 a b x arg_0123456789 arg_0123456789)+                                          in lambda sArg_0123456789)+                            in lambda sX))+                   a)+                b+        in lambda sA sB+    sFoo5 sX sY+      = let+          lambda ::+            forall x y. (t ~ x, t ~ y) =>+            Sing x -> Sing y -> Sing (Apply (Apply Foo5Sym0 x) y :: b)+          lambda x y+            = applySing+                (singFun1+                   (Proxy :: Proxy (Apply (Apply Lambda_0123456789Sym0 x) y))+                   (\ sX+                      -> let+                           lambda ::+                             forall x.+                             Sing x -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) x)+                           lambda x = x+                         in lambda sX))+                y+        in lambda sX sY+    sFoo4 sX sY sZ+      = let+          lambda ::+            forall x y z. (t ~ x, t ~ y, t ~ z) =>+            Sing x+            -> Sing y+               -> Sing z -> Sing (Apply (Apply (Apply Foo4Sym0 x) y) z :: a)+          lambda x y z+            = applySing+                (applySing+                   (singFun2+                      (Proxy ::+                         Proxy (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) z))+                      (\ sArg_0123456789 sArg_0123456789+                         -> let+                              lambda ::+                                forall arg_0123456789 arg_0123456789.+                                Sing arg_0123456789+                                -> Sing arg_0123456789+                                   -> Sing (Apply (Apply (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) z) arg_0123456789) arg_0123456789)+                              lambda arg_0123456789 arg_0123456789+                                = case+                                      applySing+                                        (applySing+                                           (singFun2 (Proxy :: Proxy Tuple2Sym0) STuple2)+                                           arg_0123456789)+                                        arg_0123456789+                                  of {+                                    STuple2 _s_z_0123456789 _s_z_0123456789+                                      -> let+                                           lambda ::+                                             forall _z_0123456789+                                                    _z_0123456789. Apply (Apply Tuple2Sym0 _z_0123456789) _z_0123456789 ~ Apply (Apply Tuple2Sym0 arg_0123456789) arg_0123456789 =>+                                             Sing _z_0123456789+                                             -> Sing _z_0123456789+                                                -> Sing (Case_0123456789 x y z arg_0123456789 arg_0123456789 (Apply (Apply Tuple2Sym0 _z_0123456789) _z_0123456789))+                                           lambda _z_0123456789 _z_0123456789 = x+                                         in lambda _s_z_0123456789 _s_z_0123456789 } ::+                                    Sing (Case_0123456789 x y z arg_0123456789 arg_0123456789 (Apply (Apply Tuple2Sym0 arg_0123456789) arg_0123456789))+                            in lambda sArg_0123456789 sArg_0123456789))+                   y)+                z+        in lambda sX sY sZ+    sFoo3 sX+      = let+          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo3Sym0 x :: a)+          lambda x+            = applySing+                (singFun1+                   (Proxy :: Proxy (Apply Lambda_0123456789Sym0 x))+                   (\ sY+                      -> let+                           lambda ::+                             forall y. Sing y -> Sing (Apply (Apply Lambda_0123456789Sym0 x) y)+                           lambda y = y+                         in lambda sY))+                x+        in lambda sX+    sFoo2 sX sY+      = let+          lambda ::+            forall x y. (t ~ x, t ~ y) =>+            Sing x -> Sing y -> Sing (Apply (Apply Foo2Sym0 x) y :: a)+          lambda x y+            = applySing+                (singFun1+                   (Proxy :: Proxy (Apply (Apply Lambda_0123456789Sym0 x) y))+                   (\ sArg_0123456789+                      -> let+                           lambda ::+                             forall arg_0123456789.+                             Sing arg_0123456789+                             -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) arg_0123456789)+                           lambda arg_0123456789+                             = case arg_0123456789 of {+                                 _s_z_0123456789+                                   -> let+                                        lambda ::+                                          forall _z_0123456789. _z_0123456789 ~ arg_0123456789 =>+                                          Sing _z_0123456789+                                          -> Sing (Case_0123456789 x y arg_0123456789 _z_0123456789)+                                        lambda _z_0123456789 = x+                                      in lambda _s_z_0123456789 } ::+                                 Sing (Case_0123456789 x y arg_0123456789 arg_0123456789)+                         in lambda sArg_0123456789))+                y+        in lambda sX sY+    sFoo1 sX sA_0123456789+      = let+          lambda ::+            forall x a_0123456789. (t ~ x, t ~ a_0123456789) =>+            Sing x+            -> Sing a_0123456789+               -> Sing (Apply (Apply Foo1Sym0 x) a_0123456789 :: a)+          lambda x a_0123456789+            = applySing+                (singFun1+                   (Proxy ::+                      Proxy (Apply (Apply Lambda_0123456789Sym0 x) a_0123456789))+                   (\ sArg_0123456789+                      -> let+                           lambda ::+                             forall arg_0123456789.+                             Sing arg_0123456789+                             -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 x) a_0123456789) arg_0123456789)+                           lambda arg_0123456789+                             = case arg_0123456789 of {+                                 _s_z_0123456789+                                   -> let+                                        lambda ::+                                          forall _z_0123456789. _z_0123456789 ~ arg_0123456789 =>+                                          Sing _z_0123456789+                                          -> Sing (Case_0123456789 x arg_0123456789 a_0123456789 _z_0123456789)+                                        lambda _z_0123456789 = x+                                      in lambda _s_z_0123456789 } ::+                                 Sing (Case_0123456789 x arg_0123456789 a_0123456789 arg_0123456789)+                         in lambda sArg_0123456789))+                a_0123456789+        in lambda sX sA_0123456789+    sFoo0 sA_0123456789 sA_0123456789+      = let+          lambda ::+            forall a_0123456789 a_0123456789. (t ~ a_0123456789,+                                               t ~ a_0123456789) =>+            Sing a_0123456789+            -> Sing a_0123456789+               -> Sing (Apply (Apply Foo0Sym0 a_0123456789) a_0123456789 :: a)+          lambda a_0123456789 a_0123456789+            = applySing+                (applySing+                   (singFun2+                      (Proxy ::+                         Proxy (Apply (Apply Lambda_0123456789Sym0 a_0123456789) a_0123456789))+                      (\ sX sY+                         -> let+                              lambda ::+                                forall x y.+                                Sing x+                                -> Sing y+                                   -> Sing (Apply (Apply (Apply (Apply Lambda_0123456789Sym0 a_0123456789) a_0123456789) x) y)+                              lambda x y = x+                            in lambda sX sY))+                   a_0123456789)+                a_0123456789+        in lambda sA_0123456789 sA_0123456789+    data instance Sing (z :: Foo a b)+      = forall (n :: a) (n :: b). z ~ Foo n n =>+        SFoo (Sing (n :: a)) (Sing (n :: b))+    type SFoo = (Sing :: Foo a b -> *)+    instance (SingKind (KProxy :: KProxy a),+              SingKind (KProxy :: KProxy b)) =>+             SingKind (KProxy :: KProxy (Foo a b)) where+      type DemoteRep (KProxy :: KProxy (Foo a b)) = Foo (DemoteRep (KProxy :: KProxy a)) (DemoteRep (KProxy :: KProxy b))+      fromSing (SFoo b b) = Foo (fromSing b) (fromSing b)+      toSing (Foo b b)+        = case+              GHC.Tuple.(,)+                (toSing b :: SomeSing (KProxy :: KProxy a))+                (toSing b :: SomeSing (KProxy :: KProxy b))+          of {+            GHC.Tuple.(,) (SomeSing c) (SomeSing c) -> SomeSing (SFoo c c) }+    instance (SingI n, SingI n) => SingI (Foo (n :: a) (n :: b)) where+      sing = SFoo sing sing
− tests/compile-and-dump/Singletons/Lambdas.ghc78.template
@@ -1,793 +0,0 @@-Singletons/Lambdas.hs: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 |]-  ======>-    Singletons/Lambdas.hs:(0,0)-(0,0)-    foo0 :: forall a b. a -> b -> a-    foo0 = \ x y -> x-    foo1 :: forall a b. a -> b -> a-    foo1 x = \ _ -> x-    foo2 :: forall a b. a -> b -> a-    foo2 x y = \ _ -> x y-    foo3 :: forall a. a -> a-    foo3 x = \ y -> y x-    foo4 :: forall a b c. a -> b -> c -> a-    foo4 x y z = \ _ _ -> x y z-    foo5 :: forall a b. a -> b -> b-    foo5 x y = \ x -> x y-    foo6 :: forall a b. a -> b -> a-    foo6 a b = \ x -> \ _ -> x a b-    foo7 :: forall a b. a -> b -> b-    foo7 x y = \ (_, b) -> b (x, y)-    data Foo a b = Foo a b-    foo8 :: forall a b. Foo a b -> a-    foo8 x = \ (Foo a _) -> a x-    type FooSym2 (t :: a) (t :: b) = Foo t t-    instance SuppressUnusedWarnings FooSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) FooSym1KindInference GHC.Tuple.())-    data FooSym1 (l :: a) (l :: TyFun b (Foo a b))-      = forall arg. KindOf (Apply (FooSym1 l) arg) ~ KindOf (FooSym2 l arg) =>-        FooSym1KindInference-    type instance Apply (FooSym1 l) l = FooSym2 l l-    instance SuppressUnusedWarnings FooSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) FooSym0KindInference GHC.Tuple.())-    data FooSym0 (l :: TyFun a (TyFun b (Foo a b) -> *))-      = forall arg. KindOf (Apply FooSym0 arg) ~ KindOf (FooSym1 arg) =>-        FooSym0KindInference-    type instance Apply FooSym0 l = FooSym1 l-    type family Case_0123456789 x arg_0123456789 t where-      Case_0123456789 x arg_0123456789 (Foo a z) = a-    type family Lambda_0123456789 x t where-      Lambda_0123456789 x arg_0123456789 = Case_0123456789 x arg_0123456789 arg_0123456789-    type Lambda_0123456789Sym2 t t = Lambda_0123456789 t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type family Case_0123456789 x y arg_0123456789 t where-      Case_0123456789 x y arg_0123456789 '(z, b) = b-    type family Lambda_0123456789 x y t where-      Lambda_0123456789 x y arg_0123456789 = Case_0123456789 x y arg_0123456789 arg_0123456789-    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())-    data Lambda_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>-        Lambda_0123456789Sym2KindInference-    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type family Case_0123456789 a b x arg_0123456789 t where-      Case_0123456789 a b x arg_0123456789 z = x-    type family Lambda_0123456789 a b x t where-      Lambda_0123456789 a b x arg_0123456789 = Case_0123456789 a b x arg_0123456789 arg_0123456789-    type Lambda_0123456789Sym4 t t t t = Lambda_0123456789 t t t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym3 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym3KindInference GHC.Tuple.())-    data Lambda_0123456789Sym3 l l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym3 l l l) arg) ~ KindOf (Lambda_0123456789Sym4 l l l arg) =>-        Lambda_0123456789Sym3KindInference-    type instance Apply (Lambda_0123456789Sym3 l l l) l = Lambda_0123456789Sym4 l l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())-    data Lambda_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>-        Lambda_0123456789Sym2KindInference-    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type family Lambda_0123456789 a b t where-      Lambda_0123456789 a b x = Apply (Apply (Apply Lambda_0123456789Sym0 a) b) x-    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())-    data Lambda_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>-        Lambda_0123456789Sym2KindInference-    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type family Lambda_0123456789 x y t where-      Lambda_0123456789 x y x = x-    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())-    data Lambda_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>-        Lambda_0123456789Sym2KindInference-    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type family Case_0123456789 x-                                y-                                z-                                arg_0123456789-                                arg_0123456789-                                t where-      Case_0123456789 x y z arg_0123456789 arg_0123456789 '(z, z) = x-    type family Lambda_0123456789 x y z t t where-      Lambda_0123456789 x y z arg_0123456789 arg_0123456789 = Case_0123456789 x y z arg_0123456789 arg_0123456789 (Apply (Apply Tuple2Sym0 arg_0123456789) arg_0123456789)-    type Lambda_0123456789Sym5 t t t t t = Lambda_0123456789 t t t t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym4 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym4KindInference GHC.Tuple.())-    data Lambda_0123456789Sym4 l l l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym4 l l l l) arg) ~ KindOf (Lambda_0123456789Sym5 l l l l arg) =>-        Lambda_0123456789Sym4KindInference-    type instance Apply (Lambda_0123456789Sym4 l l l l) l = Lambda_0123456789Sym5 l l l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym3 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym3KindInference GHC.Tuple.())-    data Lambda_0123456789Sym3 l l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym3 l l l) arg) ~ KindOf (Lambda_0123456789Sym4 l l l arg) =>-        Lambda_0123456789Sym3KindInference-    type instance Apply (Lambda_0123456789Sym3 l l l) l = Lambda_0123456789Sym4 l l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())-    data Lambda_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>-        Lambda_0123456789Sym2KindInference-    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type family Lambda_0123456789 x t where-      Lambda_0123456789 x y = y-    type Lambda_0123456789Sym2 t t = Lambda_0123456789 t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type family Case_0123456789 x y arg_0123456789 t where-      Case_0123456789 x y arg_0123456789 z = x-    type family Lambda_0123456789 x y t where-      Lambda_0123456789 x y arg_0123456789 = Case_0123456789 x y arg_0123456789 arg_0123456789-    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())-    data Lambda_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>-        Lambda_0123456789Sym2KindInference-    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type family Case_0123456789 x arg_0123456789 a_0123456789 t where-      Case_0123456789 x arg_0123456789 a_0123456789 z = x-    type family Lambda_0123456789 x a_0123456789 t where-      Lambda_0123456789 x a_0123456789 arg_0123456789 = Case_0123456789 x arg_0123456789 a_0123456789 arg_0123456789-    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())-    data Lambda_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>-        Lambda_0123456789Sym2KindInference-    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type family Lambda_0123456789 a_0123456789 a_0123456789 t t where-      Lambda_0123456789 a_0123456789 a_0123456789 x y = x-    type Lambda_0123456789Sym4 t t t t = Lambda_0123456789 t t t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym3 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym3KindInference GHC.Tuple.())-    data Lambda_0123456789Sym3 l l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym3 l l l) arg) ~ KindOf (Lambda_0123456789Sym4 l l l arg) =>-        Lambda_0123456789Sym3KindInference-    type instance Apply (Lambda_0123456789Sym3 l l l) l = Lambda_0123456789Sym4 l l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())-    data Lambda_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>-        Lambda_0123456789Sym2KindInference-    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type Foo8Sym1 (t :: Foo a b) = Foo8 t-    instance SuppressUnusedWarnings Foo8Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo8Sym0KindInference GHC.Tuple.())-    data Foo8Sym0 (l :: TyFun (Foo a b) a)-      = forall arg. KindOf (Apply Foo8Sym0 arg) ~ KindOf (Foo8Sym1 arg) =>-        Foo8Sym0KindInference-    type instance Apply Foo8Sym0 l = Foo8Sym1 l-    type Foo7Sym2 (t :: a) (t :: b) = Foo7 t t-    instance SuppressUnusedWarnings Foo7Sym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo7Sym1KindInference GHC.Tuple.())-    data Foo7Sym1 (l :: a) (l :: TyFun b b)-      = forall arg. KindOf (Apply (Foo7Sym1 l) arg) ~ KindOf (Foo7Sym2 l arg) =>-        Foo7Sym1KindInference-    type instance Apply (Foo7Sym1 l) l = Foo7Sym2 l l-    instance SuppressUnusedWarnings Foo7Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo7Sym0KindInference GHC.Tuple.())-    data Foo7Sym0 (l :: TyFun a (TyFun b b -> *))-      = forall arg. KindOf (Apply Foo7Sym0 arg) ~ KindOf (Foo7Sym1 arg) =>-        Foo7Sym0KindInference-    type instance Apply Foo7Sym0 l = Foo7Sym1 l-    type Foo6Sym2 (t :: a) (t :: b) = Foo6 t t-    instance SuppressUnusedWarnings Foo6Sym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo6Sym1KindInference GHC.Tuple.())-    data Foo6Sym1 (l :: a) (l :: TyFun b a)-      = forall arg. KindOf (Apply (Foo6Sym1 l) arg) ~ KindOf (Foo6Sym2 l arg) =>-        Foo6Sym1KindInference-    type instance Apply (Foo6Sym1 l) l = Foo6Sym2 l l-    instance SuppressUnusedWarnings Foo6Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo6Sym0KindInference GHC.Tuple.())-    data Foo6Sym0 (l :: TyFun a (TyFun b a -> *))-      = forall arg. KindOf (Apply Foo6Sym0 arg) ~ KindOf (Foo6Sym1 arg) =>-        Foo6Sym0KindInference-    type instance Apply Foo6Sym0 l = Foo6Sym1 l-    type Foo5Sym2 (t :: a) (t :: b) = Foo5 t t-    instance SuppressUnusedWarnings Foo5Sym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo5Sym1KindInference GHC.Tuple.())-    data Foo5Sym1 (l :: a) (l :: TyFun b b)-      = forall arg. KindOf (Apply (Foo5Sym1 l) arg) ~ KindOf (Foo5Sym2 l arg) =>-        Foo5Sym1KindInference-    type instance Apply (Foo5Sym1 l) l = Foo5Sym2 l l-    instance SuppressUnusedWarnings Foo5Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo5Sym0KindInference GHC.Tuple.())-    data Foo5Sym0 (l :: TyFun a (TyFun b b -> *))-      = forall arg. KindOf (Apply Foo5Sym0 arg) ~ KindOf (Foo5Sym1 arg) =>-        Foo5Sym0KindInference-    type instance Apply Foo5Sym0 l = Foo5Sym1 l-    type Foo4Sym3 (t :: a) (t :: b) (t :: c) = Foo4 t t t-    instance SuppressUnusedWarnings Foo4Sym2 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo4Sym2KindInference GHC.Tuple.())-    data Foo4Sym2 (l :: a) (l :: b) (l :: TyFun c a)-      = forall arg. KindOf (Apply (Foo4Sym2 l l) arg) ~ KindOf (Foo4Sym3 l l arg) =>-        Foo4Sym2KindInference-    type instance Apply (Foo4Sym2 l l) l = Foo4Sym3 l l l-    instance SuppressUnusedWarnings Foo4Sym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo4Sym1KindInference GHC.Tuple.())-    data Foo4Sym1 (l :: a) (l :: TyFun b (TyFun c a -> *))-      = forall arg. KindOf (Apply (Foo4Sym1 l) arg) ~ KindOf (Foo4Sym2 l arg) =>-        Foo4Sym1KindInference-    type instance Apply (Foo4Sym1 l) l = Foo4Sym2 l l-    instance SuppressUnusedWarnings Foo4Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo4Sym0KindInference GHC.Tuple.())-    data Foo4Sym0 (l :: TyFun a (TyFun b (TyFun c a -> *) -> *))-      = forall arg. KindOf (Apply Foo4Sym0 arg) ~ KindOf (Foo4Sym1 arg) =>-        Foo4Sym0KindInference-    type instance Apply Foo4Sym0 l = Foo4Sym1 l-    type Foo3Sym1 (t :: a) = Foo3 t-    instance SuppressUnusedWarnings Foo3Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo3Sym0KindInference GHC.Tuple.())-    data Foo3Sym0 (l :: TyFun a a)-      = forall arg. KindOf (Apply Foo3Sym0 arg) ~ KindOf (Foo3Sym1 arg) =>-        Foo3Sym0KindInference-    type instance Apply Foo3Sym0 l = Foo3Sym1 l-    type Foo2Sym2 (t :: a) (t :: b) = Foo2 t t-    instance SuppressUnusedWarnings Foo2Sym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo2Sym1KindInference GHC.Tuple.())-    data Foo2Sym1 (l :: a) (l :: TyFun b a)-      = forall arg. KindOf (Apply (Foo2Sym1 l) arg) ~ KindOf (Foo2Sym2 l arg) =>-        Foo2Sym1KindInference-    type instance Apply (Foo2Sym1 l) l = Foo2Sym2 l l-    instance SuppressUnusedWarnings Foo2Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo2Sym0KindInference GHC.Tuple.())-    data Foo2Sym0 (l :: TyFun a (TyFun b a -> *))-      = forall arg. KindOf (Apply Foo2Sym0 arg) ~ KindOf (Foo2Sym1 arg) =>-        Foo2Sym0KindInference-    type instance Apply Foo2Sym0 l = Foo2Sym1 l-    type Foo1Sym2 (t :: a) (t :: b) = Foo1 t t-    instance SuppressUnusedWarnings Foo1Sym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo1Sym1KindInference GHC.Tuple.())-    data Foo1Sym1 (l :: a) (l :: TyFun b a)-      = forall arg. KindOf (Apply (Foo1Sym1 l) arg) ~ KindOf (Foo1Sym2 l arg) =>-        Foo1Sym1KindInference-    type instance Apply (Foo1Sym1 l) l = Foo1Sym2 l l-    instance SuppressUnusedWarnings Foo1Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo1Sym0KindInference GHC.Tuple.())-    data Foo1Sym0 (l :: TyFun a (TyFun b a -> *))-      = forall arg. KindOf (Apply Foo1Sym0 arg) ~ KindOf (Foo1Sym1 arg) =>-        Foo1Sym0KindInference-    type instance Apply Foo1Sym0 l = Foo1Sym1 l-    type Foo0Sym2 (t :: a) (t :: b) = Foo0 t t-    instance SuppressUnusedWarnings Foo0Sym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo0Sym1KindInference GHC.Tuple.())-    data Foo0Sym1 (l :: a) (l :: TyFun b a)-      = forall arg. KindOf (Apply (Foo0Sym1 l) arg) ~ KindOf (Foo0Sym2 l arg) =>-        Foo0Sym1KindInference-    type instance Apply (Foo0Sym1 l) l = Foo0Sym2 l l-    instance SuppressUnusedWarnings Foo0Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo0Sym0KindInference GHC.Tuple.())-    data Foo0Sym0 (l :: TyFun a (TyFun b a -> *))-      = forall arg. KindOf (Apply Foo0Sym0 arg) ~ KindOf (Foo0Sym1 arg) =>-        Foo0Sym0KindInference-    type instance Apply Foo0Sym0 l = Foo0Sym1 l-    type family Foo8 (a :: Foo a b) :: a where-      Foo8 x = Apply (Apply Lambda_0123456789Sym0 x) x-    type family Foo7 (a :: a) (a :: b) :: b where-      Foo7 x y = Apply (Apply (Apply Lambda_0123456789Sym0 x) y) (Apply (Apply Tuple2Sym0 x) y)-    type family Foo6 (a :: a) (a :: b) :: a where-      Foo6 a b = Apply (Apply (Apply (Apply Lambda_0123456789Sym0 a) b) a) b-    type family Foo5 (a :: a) (a :: b) :: b where-      Foo5 x y = Apply (Apply (Apply Lambda_0123456789Sym0 x) y) y-    type family Foo4 (a :: a) (a :: b) (a :: c) :: a where-      Foo4 x y z = Apply (Apply (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) z) y) z-    type family Foo3 (a :: a) :: a where-      Foo3 x = Apply (Apply Lambda_0123456789Sym0 x) x-    type family Foo2 (a :: a) (a :: b) :: a where-      Foo2 x y = Apply (Apply (Apply Lambda_0123456789Sym0 x) y) y-    type family Foo1 (a :: a) (a :: b) :: a where-      Foo1 x a_0123456789 = Apply (Apply (Apply Lambda_0123456789Sym0 x) a_0123456789) a_0123456789-    type family Foo0 (a :: a) (a :: b) :: a where-      Foo0 a_0123456789 a_0123456789 = Apply (Apply (Apply (Apply Lambda_0123456789Sym0 a_0123456789) a_0123456789) a_0123456789) a_0123456789-    sFoo8 :: forall (t :: Foo a b). Sing t -> Sing (Apply Foo8Sym0 t)-    sFoo7 ::-      forall (t :: a) (t :: b).-      Sing t -> Sing t -> Sing (Apply (Apply Foo7Sym0 t) t)-    sFoo6 ::-      forall (t :: a) (t :: b).-      Sing t -> Sing t -> Sing (Apply (Apply Foo6Sym0 t) t)-    sFoo5 ::-      forall (t :: a) (t :: b).-      Sing t -> Sing t -> Sing (Apply (Apply Foo5Sym0 t) t)-    sFoo4 ::-      forall (t :: a) (t :: b) (t :: c).-      Sing t-      -> Sing t -> Sing t -> Sing (Apply (Apply (Apply Foo4Sym0 t) t) t)-    sFoo3 :: forall (t :: a). Sing t -> Sing (Apply Foo3Sym0 t)-    sFoo2 ::-      forall (t :: a) (t :: b).-      Sing t -> Sing t -> Sing (Apply (Apply Foo2Sym0 t) t)-    sFoo1 ::-      forall (t :: a) (t :: b).-      Sing t -> Sing t -> Sing (Apply (Apply Foo1Sym0 t) t)-    sFoo0 ::-      forall (t :: a) (t :: b).-      Sing t -> Sing t -> Sing (Apply (Apply Foo0Sym0 t) t)-    sFoo8 sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo8Sym0 x)-          lambda x-            = applySing-                (singFun1-                   (Proxy :: Proxy (Apply Lambda_0123456789Sym0 x))-                   (\ sArg_0123456789-                      -> let-                           lambda ::-                             forall arg_0123456789.-                             Sing arg_0123456789-                             -> Sing (Apply (Apply Lambda_0123456789Sym0 x) arg_0123456789)-                           lambda arg_0123456789-                             = case arg_0123456789 of {-                                 SFoo sA _-                                   -> let-                                        lambda ::-                                          forall a wild.-                                          Sing a-                                          -> Sing (Case_0123456789 x arg_0123456789 (Apply (Apply FooSym0 a) wild))-                                        lambda a = a-                                      in lambda sA }-                         in lambda sArg_0123456789))-                x-        in lambda sX-    sFoo7 sX sY-      = let-          lambda ::-            forall x y. (t ~ x, t ~ y) =>-            Sing x -> Sing y -> Sing (Apply (Apply Foo7Sym0 x) y)-          lambda x y-            = applySing-                (singFun1-                   (Proxy :: Proxy (Apply (Apply Lambda_0123456789Sym0 x) y))-                   (\ sArg_0123456789-                      -> let-                           lambda ::-                             forall arg_0123456789.-                             Sing arg_0123456789-                             -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) arg_0123456789)-                           lambda arg_0123456789-                             = case arg_0123456789 of {-                                 STuple2 _ sB-                                   -> let-                                        lambda ::-                                          forall b wild.-                                          Sing b-                                          -> Sing (Case_0123456789 x y arg_0123456789 (Apply (Apply Tuple2Sym0 wild) b))-                                        lambda b = b-                                      in lambda sB }-                         in lambda sArg_0123456789))-                (applySing-                   (applySing (singFun2 (Proxy :: Proxy Tuple2Sym0) STuple2) x) y)-        in lambda sX sY-    sFoo6 sA sB-      = let-          lambda ::-            forall a b. (t ~ a, t ~ b) =>-            Sing a -> Sing b -> Sing (Apply (Apply Foo6Sym0 a) b)-          lambda a b-            = applySing-                (applySing-                   (singFun1-                      (Proxy :: Proxy (Apply (Apply Lambda_0123456789Sym0 a) b))-                      (\ sX-                         -> let-                              lambda ::-                                forall x.-                                Sing x -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 a) b) x)-                              lambda x-                                = singFun1-                                    (Proxy ::-                                       Proxy (Apply (Apply (Apply Lambda_0123456789Sym0 a) b) x))-                                    (\ sArg_0123456789-                                       -> let-                                            lambda ::-                                              forall arg_0123456789.-                                              Sing arg_0123456789-                                              -> Sing (Apply (Apply (Apply (Apply Lambda_0123456789Sym0 a) b) x) arg_0123456789)-                                            lambda arg_0123456789-                                              = case arg_0123456789 of {-                                                  _ -> let-                                                         lambda ::-                                                           forall wild.-                                                           Sing (Case_0123456789 a b x arg_0123456789 wild)-                                                         lambda = x-                                                       in lambda }-                                          in lambda sArg_0123456789)-                            in lambda sX))-                   a)-                b-        in lambda sA sB-    sFoo5 sX sY-      = let-          lambda ::-            forall x y. (t ~ x, t ~ y) =>-            Sing x -> Sing y -> Sing (Apply (Apply Foo5Sym0 x) y)-          lambda x y-            = applySing-                (singFun1-                   (Proxy :: Proxy (Apply (Apply Lambda_0123456789Sym0 x) y))-                   (\ sX-                      -> let-                           lambda ::-                             forall x.-                             Sing x -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) x)-                           lambda x = x-                         in lambda sX))-                y-        in lambda sX sY-    sFoo4 sX sY sZ-      = let-          lambda ::-            forall x y z. (t ~ x, t ~ y, t ~ z) =>-            Sing x-            -> Sing y -> Sing z -> Sing (Apply (Apply (Apply Foo4Sym0 x) y) z)-          lambda x y z-            = applySing-                (applySing-                   (singFun2-                      (Proxy ::-                         Proxy (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) z))-                      (\ sArg_0123456789 sArg_0123456789-                         -> let-                              lambda ::-                                forall arg_0123456789 arg_0123456789.-                                Sing arg_0123456789-                                -> Sing arg_0123456789-                                   -> Sing (Apply (Apply (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) z) arg_0123456789) arg_0123456789)-                              lambda arg_0123456789 arg_0123456789-                                = case-                                      applySing-                                        (applySing-                                           (singFun2 (Proxy :: Proxy Tuple2Sym0) STuple2)-                                           arg_0123456789)-                                        arg_0123456789-                                  of {-                                    STuple2 _ _-                                      -> let-                                           lambda ::-                                             forall wild wild.-                                             Sing (Case_0123456789 x y z arg_0123456789 arg_0123456789 (Apply (Apply Tuple2Sym0 wild) wild))-                                           lambda = x-                                         in lambda }-                            in lambda sArg_0123456789 sArg_0123456789))-                   y)-                z-        in lambda sX sY sZ-    sFoo3 sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo3Sym0 x)-          lambda x-            = applySing-                (singFun1-                   (Proxy :: Proxy (Apply Lambda_0123456789Sym0 x))-                   (\ sY-                      -> let-                           lambda ::-                             forall y. Sing y -> Sing (Apply (Apply Lambda_0123456789Sym0 x) y)-                           lambda y = y-                         in lambda sY))-                x-        in lambda sX-    sFoo2 sX sY-      = let-          lambda ::-            forall x y. (t ~ x, t ~ y) =>-            Sing x -> Sing y -> Sing (Apply (Apply Foo2Sym0 x) y)-          lambda x y-            = applySing-                (singFun1-                   (Proxy :: Proxy (Apply (Apply Lambda_0123456789Sym0 x) y))-                   (\ sArg_0123456789-                      -> let-                           lambda ::-                             forall arg_0123456789.-                             Sing arg_0123456789-                             -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) arg_0123456789)-                           lambda arg_0123456789-                             = case arg_0123456789 of {-                                 _ -> let-                                        lambda ::-                                          forall wild.-                                          Sing (Case_0123456789 x y arg_0123456789 wild)-                                        lambda = x-                                      in lambda }-                         in lambda sArg_0123456789))-                y-        in lambda sX sY-    sFoo1 sX sA_0123456789-      = let-          lambda ::-            forall x a_0123456789. (t ~ x, t ~ a_0123456789) =>-            Sing x-            -> Sing a_0123456789-               -> Sing (Apply (Apply Foo1Sym0 x) a_0123456789)-          lambda x a_0123456789-            = applySing-                (singFun1-                   (Proxy ::-                      Proxy (Apply (Apply Lambda_0123456789Sym0 x) a_0123456789))-                   (\ sArg_0123456789-                      -> let-                           lambda ::-                             forall arg_0123456789.-                             Sing arg_0123456789-                             -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 x) a_0123456789) arg_0123456789)-                           lambda arg_0123456789-                             = case arg_0123456789 of {-                                 _ -> let-                                        lambda ::-                                          forall wild.-                                          Sing (Case_0123456789 x arg_0123456789 a_0123456789 wild)-                                        lambda = x-                                      in lambda }-                         in lambda sArg_0123456789))-                a_0123456789-        in lambda sX sA_0123456789-    sFoo0 sA_0123456789 sA_0123456789-      = let-          lambda ::-            forall a_0123456789 a_0123456789. (t ~ a_0123456789,-                                               t ~ a_0123456789) =>-            Sing a_0123456789-            -> Sing a_0123456789-               -> Sing (Apply (Apply Foo0Sym0 a_0123456789) a_0123456789)-          lambda a_0123456789 a_0123456789-            = applySing-                (applySing-                   (singFun2-                      (Proxy ::-                         Proxy (Apply (Apply Lambda_0123456789Sym0 a_0123456789) a_0123456789))-                      (\ sX sY-                         -> let-                              lambda ::-                                forall x y.-                                Sing x-                                -> Sing y-                                   -> Sing (Apply (Apply (Apply (Apply Lambda_0123456789Sym0 a_0123456789) a_0123456789) x) y)-                              lambda x y = x-                            in lambda sX sY))-                   a_0123456789)-                a_0123456789-        in lambda sA_0123456789 sA_0123456789-    data instance Sing (z :: Foo a b)-      = forall (n :: a) (n :: b). z ~ Foo n n => SFoo (Sing n) (Sing n)-    type SFoo (z :: Foo a b) = Sing z-    instance (SingKind (KProxy :: KProxy a),-              SingKind (KProxy :: KProxy b)) =>-             SingKind (KProxy :: KProxy (Foo a b)) where-      type DemoteRep (KProxy :: KProxy (Foo a b)) = Foo (DemoteRep (KProxy :: KProxy a)) (DemoteRep (KProxy :: KProxy b))-      fromSing (SFoo b b) = Foo (fromSing b) (fromSing b)-      toSing (Foo b b)-        = case-              GHC.Tuple.(,)-                (toSing b :: SomeSing (KProxy :: KProxy a))-                (toSing b :: SomeSing (KProxy :: KProxy b))-          of {-            GHC.Tuple.(,) (SomeSing c) (SomeSing c) -> SomeSing (SFoo c c) }-    instance (SingI n, SingI n) => SingI (Foo (n :: a) (n :: b)) where-      sing = SFoo sing sing
+ tests/compile-and-dump/Singletons/LambdasComprehensive.ghc710.template view
@@ -0,0 +1,81 @@+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_0123456789 t where+      Lambda_0123456789 x = Apply (Apply (Apply Either_Sym0 PredSym0) SuccSym0) x+    type Lambda_0123456789Sym1 t = Lambda_0123456789 t+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    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_0123456789Sym0) (Apply (Apply (:$) (Apply LeftSym0 ZeroSym0)) (Apply (Apply (:$) (Apply RightSym0 (Apply SuccSym0 ZeroSym0))) '[]))+    sBar :: Sing (BarSym0 :: [Nat])+    sFoo :: Sing (FooSym0 :: [Nat])+    sBar+      = applySing+          (applySing+             (singFun2 (Proxy :: Proxy MapSym0) sMap)+             (applySing+                (applySing+                   (singFun3 (Proxy :: Proxy Either_Sym0) sEither_)+                   (singFun1 (Proxy :: Proxy PredSym0) sPred))+                (singFun1 (Proxy :: Proxy SuccSym0) SSucc)))+          (applySing+             (applySing+                (singFun2 (Proxy :: Proxy (:$)) SCons)+                (applySing (singFun1 (Proxy :: Proxy LeftSym0) SLeft) SZero))+             (applySing+                (applySing+                   (singFun2 (Proxy :: Proxy (:$)) SCons)+                   (applySing+                      (singFun1 (Proxy :: Proxy RightSym0) SRight)+                      (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero)))+                SNil))+    sFoo+      = applySing+          (applySing+             (singFun2 (Proxy :: Proxy MapSym0) sMap)+             (singFun1+                (Proxy :: Proxy Lambda_0123456789Sym0)+                (\ sX+                   -> let+                        lambda :: forall x. Sing x -> Sing (Apply Lambda_0123456789Sym0 x)+                        lambda x+                          = applySing+                              (applySing+                                 (applySing+                                    (singFun3 (Proxy :: Proxy Either_Sym0) sEither_)+                                    (singFun1 (Proxy :: Proxy PredSym0) sPred))+                                 (singFun1 (Proxy :: Proxy SuccSym0) SSucc))+                              x+                      in lambda sX)))+          (applySing+             (applySing+                (singFun2 (Proxy :: Proxy (:$)) SCons)+                (applySing (singFun1 (Proxy :: Proxy LeftSym0) SLeft) SZero))+             (applySing+                (applySing+                   (singFun2 (Proxy :: Proxy (:$)) SCons)+                   (applySing+                      (singFun1 (Proxy :: Proxy RightSym0) SRight)+                      (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero)))+                SNil))
− tests/compile-and-dump/Singletons/LambdasComprehensive.ghc78.template
@@ -1,82 +0,0 @@-Singletons/LambdasComprehensive.hs: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)] |]-  ======>-    Singletons/LambdasComprehensive.hs:(0,0)-(0,0)-    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_0123456789 t where-      Lambda_0123456789 x = Apply (Apply (Apply Either_Sym0 PredSym0) SuccSym0) x-    type Lambda_0123456789Sym1 t = Lambda_0123456789 t-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type BarSym0 = Bar-    type FooSym0 = Foo-    type Bar =-        (Apply (Apply MapSym0 (Apply (Apply Either_Sym0 PredSym0) SuccSym0)) (Apply (Apply (:$) (Apply LeftSym0 ZeroSym0)) (Apply (Apply (:$) (Apply RightSym0 (Apply SuccSym0 ZeroSym0))) '[])) :: [Nat])-    type Foo =-        (Apply (Apply MapSym0 Lambda_0123456789Sym0) (Apply (Apply (:$) (Apply LeftSym0 ZeroSym0)) (Apply (Apply (:$) (Apply RightSym0 (Apply SuccSym0 ZeroSym0))) '[])) :: [Nat])-    sBar :: Sing BarSym0-    sFoo :: Sing FooSym0-    sBar-      = applySing-          (applySing-             (singFun2 (Proxy :: Proxy MapSym0) sMap)-             (applySing-                (applySing-                   (singFun3 (Proxy :: Proxy Either_Sym0) sEither_)-                   (singFun1 (Proxy :: Proxy PredSym0) sPred))-                (singFun1 (Proxy :: Proxy SuccSym0) SSucc)))-          (applySing-             (applySing-                (singFun2 (Proxy :: Proxy (:$)) SCons)-                (applySing (singFun1 (Proxy :: Proxy LeftSym0) SLeft) SZero))-             (applySing-                (applySing-                   (singFun2 (Proxy :: Proxy (:$)) SCons)-                   (applySing-                      (singFun1 (Proxy :: Proxy RightSym0) SRight)-                      (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero)))-                SNil))-    sFoo-      = applySing-          (applySing-             (singFun2 (Proxy :: Proxy MapSym0) sMap)-             (singFun1-                (Proxy :: Proxy Lambda_0123456789Sym0)-                (\ sX-                   -> let-                        lambda :: forall x. Sing x -> Sing (Apply Lambda_0123456789Sym0 x)-                        lambda x-                          = applySing-                              (applySing-                                 (applySing-                                    (singFun3 (Proxy :: Proxy Either_Sym0) sEither_)-                                    (singFun1 (Proxy :: Proxy PredSym0) sPred))-                                 (singFun1 (Proxy :: Proxy SuccSym0) SSucc))-                              x-                      in lambda sX)))-          (applySing-             (applySing-                (singFun2 (Proxy :: Proxy (:$)) SCons)-                (applySing (singFun1 (Proxy :: Proxy LeftSym0) SLeft) SZero))-             (applySing-                (applySing-                   (singFun2 (Proxy :: Proxy (:$)) SCons)-                   (applySing-                      (singFun1 (Proxy :: Proxy RightSym0) SRight)-                      (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero)))-                SNil))
+ tests/compile-and-dump/Singletons/LetStatements.ghc710.template view
@@ -0,0 +1,1026 @@+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_ :: forall a. a -> a+    foo13_ y = y+    foo14 :: Nat -> (Nat, Nat)+    foo14 x = let (y, z) = (Succ x, x) in (z, y)+    type family Case_0123456789 x t where+      Case_0123456789 x '(y_0123456789, _z_0123456789) = y_0123456789+    type family Case_0123456789 x t where+      Case_0123456789 x '(_z_0123456789, y_0123456789) = y_0123456789+    type Let0123456789YSym1 t = Let0123456789Y t+    instance SuppressUnusedWarnings Let0123456789YSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789YSym0KindInference GHC.Tuple.())+    data Let0123456789YSym0 l+      = forall arg. KindOf (Apply Let0123456789YSym0 arg) ~ KindOf (Let0123456789YSym1 arg) =>+        Let0123456789YSym0KindInference+    type instance Apply Let0123456789YSym0 l = Let0123456789YSym1 l+    type Let0123456789ZSym1 t = Let0123456789Z t+    instance SuppressUnusedWarnings Let0123456789ZSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789ZSym0KindInference GHC.Tuple.())+    data Let0123456789ZSym0 l+      = forall arg. KindOf (Apply Let0123456789ZSym0 arg) ~ KindOf (Let0123456789ZSym1 arg) =>+        Let0123456789ZSym0KindInference+    type instance Apply Let0123456789ZSym0 l = Let0123456789ZSym1 l+    type Let0123456789X_0123456789Sym1 t = Let0123456789X_0123456789 t+    instance SuppressUnusedWarnings Let0123456789X_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789X_0123456789Sym0KindInference GHC.Tuple.())+    data Let0123456789X_0123456789Sym0 l+      = forall arg. KindOf (Apply Let0123456789X_0123456789Sym0 arg) ~ KindOf (Let0123456789X_0123456789Sym1 arg) =>+        Let0123456789X_0123456789Sym0KindInference+    type instance Apply Let0123456789X_0123456789Sym0 l = Let0123456789X_0123456789Sym1 l+    type family Let0123456789Y x where+      Let0123456789Y x = Case_0123456789 x (Let0123456789X_0123456789Sym1 x)+    type family Let0123456789Z x where+      Let0123456789Z x = Case_0123456789 x (Let0123456789X_0123456789Sym1 x)+    type family Let0123456789X_0123456789 x where+      Let0123456789X_0123456789 x = Apply (Apply Tuple2Sym0 (Apply SuccSym0 x)) x+    type Let0123456789BarSym1 t = Let0123456789Bar t+    instance SuppressUnusedWarnings Let0123456789BarSym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Let0123456789BarSym0KindInference GHC.Tuple.())+    data Let0123456789BarSym0 l+      = forall arg. KindOf (Apply Let0123456789BarSym0 arg) ~ KindOf (Let0123456789BarSym1 arg) =>+        Let0123456789BarSym0KindInference+    type instance Apply Let0123456789BarSym0 l = Let0123456789BarSym1 l+    type family Let0123456789Bar x :: a where+      Let0123456789Bar x = x+    type (:<<<%%%%%%%%%%:+$$$$) t (t :: Nat) (t :: Nat) =+        (:<<<%%%%%%%%%%:+) t t t+    instance SuppressUnusedWarnings (:<<<%%%%%%%%%%:+$$$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:<<<%%%%%%%%%%:+$$$###) GHC.Tuple.())+    data (:<<<%%%%%%%%%%:+$$$) l (l :: Nat) (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply ((:<<<%%%%%%%%%%:+$$$) l l) arg) ~ KindOf ((:<<<%%%%%%%%%%:+$$$$) l l arg) =>+        :<<<%%%%%%%%%%:+$$$###+    type instance Apply ((:<<<%%%%%%%%%%:+$$$) l l) l = (:<<<%%%%%%%%%%:+$$$$) l l l+    instance SuppressUnusedWarnings (:<<<%%%%%%%%%%:+$$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:<<<%%%%%%%%%%:+$$###) GHC.Tuple.())+    data (:<<<%%%%%%%%%%:+$$) l (l :: TyFun Nat (TyFun Nat Nat -> *))+      = forall arg. KindOf (Apply ((:<<<%%%%%%%%%%:+$$) l) arg) ~ KindOf ((:<<<%%%%%%%%%%:+$$$) l arg) =>+        :<<<%%%%%%%%%%:+$$###+    type instance Apply ((:<<<%%%%%%%%%%:+$$) l) l = (:<<<%%%%%%%%%%:+$$$) l l+    instance SuppressUnusedWarnings (:<<<%%%%%%%%%%:+$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:<<<%%%%%%%%%%:+$###) GHC.Tuple.())+    data (:<<<%%%%%%%%%%:+$) l+      = forall arg. KindOf (Apply (:<<<%%%%%%%%%%:+$) arg) ~ KindOf ((:<<<%%%%%%%%%%:+$$) arg) =>+        :<<<%%%%%%%%%%:+$###+    type instance Apply (:<<<%%%%%%%%%%:+$) l = (:<<<%%%%%%%%%%:+$$) l+    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 Let0123456789ZSym1 t = Let0123456789Z t+    instance SuppressUnusedWarnings Let0123456789ZSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789ZSym0KindInference GHC.Tuple.())+    data Let0123456789ZSym0 l+      = forall arg. KindOf (Apply Let0123456789ZSym0 arg) ~ KindOf (Let0123456789ZSym1 arg) =>+        Let0123456789ZSym0KindInference+    type instance Apply Let0123456789ZSym0 l = Let0123456789ZSym1 l+    type (:<<<%%%%%%%%%%:+$$$$) t (t :: Nat) (t :: Nat) =+        (:<<<%%%%%%%%%%:+) t t t+    instance SuppressUnusedWarnings (:<<<%%%%%%%%%%:+$$$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:<<<%%%%%%%%%%:+$$$###) GHC.Tuple.())+    data (:<<<%%%%%%%%%%:+$$$) l (l :: Nat) (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply ((:<<<%%%%%%%%%%:+$$$) l l) arg) ~ KindOf ((:<<<%%%%%%%%%%:+$$$$) l l arg) =>+        :<<<%%%%%%%%%%:+$$$###+    type instance Apply ((:<<<%%%%%%%%%%:+$$$) l l) l = (:<<<%%%%%%%%%%:+$$$$) l l l+    instance SuppressUnusedWarnings (:<<<%%%%%%%%%%:+$$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:<<<%%%%%%%%%%:+$$###) GHC.Tuple.())+    data (:<<<%%%%%%%%%%:+$$) l (l :: TyFun Nat (TyFun Nat Nat -> *))+      = forall arg. KindOf (Apply ((:<<<%%%%%%%%%%:+$$) l) arg) ~ KindOf ((:<<<%%%%%%%%%%:+$$$) l arg) =>+        :<<<%%%%%%%%%%:+$$###+    type instance Apply ((:<<<%%%%%%%%%%:+$$) l) l = (:<<<%%%%%%%%%%:+$$$) l l+    instance SuppressUnusedWarnings (:<<<%%%%%%%%%%:+$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:<<<%%%%%%%%%%:+$###) GHC.Tuple.())+    data (:<<<%%%%%%%%%%:+$) l+      = forall arg. KindOf (Apply (:<<<%%%%%%%%%%:+$) arg) ~ KindOf ((:<<<%%%%%%%%%%:+$$) arg) =>+        :<<<%%%%%%%%%%:+$###+    type instance Apply (:<<<%%%%%%%%%%:+$) l = (:<<<%%%%%%%%%%:+$$) l+    type family Let0123456789Z x :: Nat where+      Let0123456789Z 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 (:<<<%%%%%%%%%%:+$$$$) t (t :: Nat) (t :: Nat) =+        (:<<<%%%%%%%%%%:+) t t t+    instance SuppressUnusedWarnings (:<<<%%%%%%%%%%:+$$$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:<<<%%%%%%%%%%:+$$$###) GHC.Tuple.())+    data (:<<<%%%%%%%%%%:+$$$) l (l :: Nat) (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply ((:<<<%%%%%%%%%%:+$$$) l l) arg) ~ KindOf ((:<<<%%%%%%%%%%:+$$$$) l l arg) =>+        :<<<%%%%%%%%%%:+$$$###+    type instance Apply ((:<<<%%%%%%%%%%:+$$$) l l) l = (:<<<%%%%%%%%%%:+$$$$) l l l+    instance SuppressUnusedWarnings (:<<<%%%%%%%%%%:+$$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:<<<%%%%%%%%%%:+$$###) GHC.Tuple.())+    data (:<<<%%%%%%%%%%:+$$) l (l :: TyFun Nat (TyFun Nat Nat -> *))+      = forall arg. KindOf (Apply ((:<<<%%%%%%%%%%:+$$) l) arg) ~ KindOf ((:<<<%%%%%%%%%%:+$$$) l arg) =>+        :<<<%%%%%%%%%%:+$$###+    type instance Apply ((:<<<%%%%%%%%%%:+$$) l) l = (:<<<%%%%%%%%%%:+$$$) l l+    instance SuppressUnusedWarnings (:<<<%%%%%%%%%%:+$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:<<<%%%%%%%%%%:+$###) GHC.Tuple.())+    data (:<<<%%%%%%%%%%:+$) l+      = forall arg. KindOf (Apply (:<<<%%%%%%%%%%:+$) arg) ~ KindOf ((:<<<%%%%%%%%%%:+$$) arg) =>+        :<<<%%%%%%%%%%:+$###+    type instance Apply (:<<<%%%%%%%%%%:+$) l = (:<<<%%%%%%%%%%:+$$) l+    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_0123456789 x a_0123456789 t where+      Lambda_0123456789 x a_0123456789 x = x+    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())+    data Lambda_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>+        Lambda_0123456789Sym2KindInference+    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type Let0123456789ZSym2 t (t :: Nat) = Let0123456789Z t t+    instance SuppressUnusedWarnings Let0123456789ZSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789ZSym1KindInference GHC.Tuple.())+    data Let0123456789ZSym1 l (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply (Let0123456789ZSym1 l) arg) ~ KindOf (Let0123456789ZSym2 l arg) =>+        Let0123456789ZSym1KindInference+    type instance Apply (Let0123456789ZSym1 l) l = Let0123456789ZSym2 l l+    instance SuppressUnusedWarnings Let0123456789ZSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789ZSym0KindInference GHC.Tuple.())+    data Let0123456789ZSym0 l+      = forall arg. KindOf (Apply Let0123456789ZSym0 arg) ~ KindOf (Let0123456789ZSym1 arg) =>+        Let0123456789ZSym0KindInference+    type instance Apply Let0123456789ZSym0 l = Let0123456789ZSym1 l+    type family Let0123456789Z x (a :: Nat) :: Nat where+      Let0123456789Z x a_0123456789 = Apply (Apply (Apply Lambda_0123456789Sym0 x) a_0123456789) a_0123456789+    type family Lambda_0123456789 x t where+      Lambda_0123456789 x x = x+    type Lambda_0123456789Sym2 t t = Lambda_0123456789 t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type Let0123456789ZSym1 t = Let0123456789Z t+    instance SuppressUnusedWarnings Let0123456789ZSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789ZSym0KindInference GHC.Tuple.())+    data Let0123456789ZSym0 l+      = forall arg. KindOf (Apply Let0123456789ZSym0 arg) ~ KindOf (Let0123456789ZSym1 arg) =>+        Let0123456789ZSym0KindInference+    type instance Apply Let0123456789ZSym0 l = Let0123456789ZSym1 l+    type family Let0123456789Z x :: Nat where+      Let0123456789Z x = Apply (Apply Lambda_0123456789Sym0 x) ZeroSym0+    type Let0123456789XSym1 t = Let0123456789X t+    instance SuppressUnusedWarnings Let0123456789XSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789XSym0KindInference GHC.Tuple.())+    data Let0123456789XSym0 l+      = forall arg. KindOf (Apply Let0123456789XSym0 arg) ~ KindOf (Let0123456789XSym1 arg) =>+        Let0123456789XSym0KindInference+    type instance Apply Let0123456789XSym0 l = Let0123456789XSym1 l+    type family Let0123456789X x :: Nat where+      Let0123456789X x = ZeroSym0+    type Let0123456789FSym2 t (t :: Nat) = Let0123456789F t t+    instance SuppressUnusedWarnings Let0123456789FSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789FSym1KindInference GHC.Tuple.())+    data Let0123456789FSym1 l (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply (Let0123456789FSym1 l) arg) ~ KindOf (Let0123456789FSym2 l arg) =>+        Let0123456789FSym1KindInference+    type instance Apply (Let0123456789FSym1 l) l = Let0123456789FSym2 l l+    instance SuppressUnusedWarnings Let0123456789FSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789FSym0KindInference GHC.Tuple.())+    data Let0123456789FSym0 l+      = forall arg. KindOf (Apply Let0123456789FSym0 arg) ~ KindOf (Let0123456789FSym1 arg) =>+        Let0123456789FSym0KindInference+    type instance Apply Let0123456789FSym0 l = Let0123456789FSym1 l+    type family Let0123456789F x (a :: Nat) :: Nat where+      Let0123456789F x y = Apply SuccSym0 y+    type Let0123456789ZSym1 t = Let0123456789Z t+    instance SuppressUnusedWarnings Let0123456789ZSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789ZSym0KindInference GHC.Tuple.())+    data Let0123456789ZSym0 l+      = forall arg. KindOf (Apply Let0123456789ZSym0 arg) ~ KindOf (Let0123456789ZSym1 arg) =>+        Let0123456789ZSym0KindInference+    type instance Apply Let0123456789ZSym0 l = Let0123456789ZSym1 l+    type family Let0123456789Z x :: Nat where+      Let0123456789Z x = Apply (Let0123456789FSym1 x) x+    type Let0123456789ZSym2 t t = Let0123456789Z t t+    instance SuppressUnusedWarnings Let0123456789ZSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789ZSym1KindInference GHC.Tuple.())+    data Let0123456789ZSym1 l l+      = forall arg. KindOf (Apply (Let0123456789ZSym1 l) arg) ~ KindOf (Let0123456789ZSym2 l arg) =>+        Let0123456789ZSym1KindInference+    type instance Apply (Let0123456789ZSym1 l) l = Let0123456789ZSym2 l l+    instance SuppressUnusedWarnings Let0123456789ZSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789ZSym0KindInference GHC.Tuple.())+    data Let0123456789ZSym0 l+      = forall arg. KindOf (Apply Let0123456789ZSym0 arg) ~ KindOf (Let0123456789ZSym1 arg) =>+        Let0123456789ZSym0KindInference+    type instance Apply Let0123456789ZSym0 l = Let0123456789ZSym1 l+    type family Let0123456789Z x y :: Nat where+      Let0123456789Z x y = Apply SuccSym0 y+    type Let0123456789FSym2 t (t :: Nat) = Let0123456789F t t+    instance SuppressUnusedWarnings Let0123456789FSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789FSym1KindInference GHC.Tuple.())+    data Let0123456789FSym1 l (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply (Let0123456789FSym1 l) arg) ~ KindOf (Let0123456789FSym2 l arg) =>+        Let0123456789FSym1KindInference+    type instance Apply (Let0123456789FSym1 l) l = Let0123456789FSym2 l l+    instance SuppressUnusedWarnings Let0123456789FSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789FSym0KindInference GHC.Tuple.())+    data Let0123456789FSym0 l+      = forall arg. KindOf (Apply Let0123456789FSym0 arg) ~ KindOf (Let0123456789FSym1 arg) =>+        Let0123456789FSym0KindInference+    type instance Apply Let0123456789FSym0 l = Let0123456789FSym1 l+    type family Let0123456789F x (a :: Nat) :: Nat where+      Let0123456789F x y = Apply SuccSym0 (Let0123456789ZSym2 x y)+    type Let0123456789FSym2 t (t :: Nat) = Let0123456789F t t+    instance SuppressUnusedWarnings Let0123456789FSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789FSym1KindInference GHC.Tuple.())+    data Let0123456789FSym1 l (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply (Let0123456789FSym1 l) arg) ~ KindOf (Let0123456789FSym2 l arg) =>+        Let0123456789FSym1KindInference+    type instance Apply (Let0123456789FSym1 l) l = Let0123456789FSym2 l l+    instance SuppressUnusedWarnings Let0123456789FSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789FSym0KindInference GHC.Tuple.())+    data Let0123456789FSym0 l+      = forall arg. KindOf (Apply Let0123456789FSym0 arg) ~ KindOf (Let0123456789FSym1 arg) =>+        Let0123456789FSym0KindInference+    type instance Apply Let0123456789FSym0 l = Let0123456789FSym1 l+    type family Let0123456789F x (a :: Nat) :: Nat where+      Let0123456789F x y = Apply SuccSym0 y+    type Let0123456789YSym1 t = Let0123456789Y t+    instance SuppressUnusedWarnings Let0123456789YSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789YSym0KindInference GHC.Tuple.())+    data Let0123456789YSym0 l+      = forall arg. KindOf (Apply Let0123456789YSym0 arg) ~ KindOf (Let0123456789YSym1 arg) =>+        Let0123456789YSym0KindInference+    type instance Apply Let0123456789YSym0 l = Let0123456789YSym1 l+    type family Let0123456789Y x :: Nat where+      Let0123456789Y x = Apply SuccSym0 x+    type Let0123456789YSym0 = Let0123456789Y+    type Let0123456789ZSym0 = Let0123456789Z+    type family Let0123456789Y where+      Let0123456789Y = Apply SuccSym0 ZeroSym0+    type family Let0123456789Z where+      Let0123456789Z = Apply SuccSym0 Let0123456789YSym0+    type Let0123456789YSym1 t = Let0123456789Y t+    instance SuppressUnusedWarnings Let0123456789YSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789YSym0KindInference GHC.Tuple.())+    data Let0123456789YSym0 l+      = forall arg. KindOf (Apply Let0123456789YSym0 arg) ~ KindOf (Let0123456789YSym1 arg) =>+        Let0123456789YSym0KindInference+    type instance Apply Let0123456789YSym0 l = Let0123456789YSym1 l+    type family Let0123456789Y x :: Nat where+      Let0123456789Y x = Apply SuccSym0 ZeroSym0+    type Foo14Sym1 (t :: Nat) = Foo14 t+    instance SuppressUnusedWarnings Foo14Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo14Sym0KindInference GHC.Tuple.())+    data Foo14Sym0 (l :: TyFun Nat (Nat, Nat))+      = forall arg. KindOf (Apply Foo14Sym0 arg) ~ KindOf (Foo14Sym1 arg) =>+        Foo14Sym0KindInference+    type instance Apply Foo14Sym0 l = Foo14Sym1 l+    type Foo13_Sym1 (t :: a) = Foo13_ t+    instance SuppressUnusedWarnings Foo13_Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo13_Sym0KindInference GHC.Tuple.())+    data Foo13_Sym0 (l :: TyFun a a)+      = forall arg. KindOf (Apply Foo13_Sym0 arg) ~ KindOf (Foo13_Sym1 arg) =>+        Foo13_Sym0KindInference+    type instance Apply Foo13_Sym0 l = Foo13_Sym1 l+    type Foo13Sym1 (t :: a) = Foo13 t+    instance SuppressUnusedWarnings Foo13Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo13Sym0KindInference GHC.Tuple.())+    data Foo13Sym0 (l :: TyFun a a)+      = forall arg. KindOf (Apply Foo13Sym0 arg) ~ KindOf (Foo13Sym1 arg) =>+        Foo13Sym0KindInference+    type instance Apply Foo13Sym0 l = Foo13Sym1 l+    type Foo12Sym1 (t :: Nat) = Foo12 t+    instance SuppressUnusedWarnings Foo12Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo12Sym0KindInference GHC.Tuple.())+    data Foo12Sym0 (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply Foo12Sym0 arg) ~ KindOf (Foo12Sym1 arg) =>+        Foo12Sym0KindInference+    type instance Apply Foo12Sym0 l = Foo12Sym1 l+    type Foo11Sym1 (t :: Nat) = Foo11 t+    instance SuppressUnusedWarnings Foo11Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo11Sym0KindInference GHC.Tuple.())+    data Foo11Sym0 (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply Foo11Sym0 arg) ~ KindOf (Foo11Sym1 arg) =>+        Foo11Sym0KindInference+    type instance Apply Foo11Sym0 l = Foo11Sym1 l+    type Foo10Sym1 (t :: Nat) = Foo10 t+    instance SuppressUnusedWarnings Foo10Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo10Sym0KindInference GHC.Tuple.())+    data Foo10Sym0 (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply Foo10Sym0 arg) ~ KindOf (Foo10Sym1 arg) =>+        Foo10Sym0KindInference+    type instance Apply Foo10Sym0 l = Foo10Sym1 l+    type Foo9Sym1 (t :: Nat) = Foo9 t+    instance SuppressUnusedWarnings Foo9Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo9Sym0KindInference GHC.Tuple.())+    data Foo9Sym0 (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply Foo9Sym0 arg) ~ KindOf (Foo9Sym1 arg) =>+        Foo9Sym0KindInference+    type instance Apply Foo9Sym0 l = Foo9Sym1 l+    type Foo8Sym1 (t :: Nat) = Foo8 t+    instance SuppressUnusedWarnings Foo8Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo8Sym0KindInference GHC.Tuple.())+    data Foo8Sym0 (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply Foo8Sym0 arg) ~ KindOf (Foo8Sym1 arg) =>+        Foo8Sym0KindInference+    type instance Apply Foo8Sym0 l = Foo8Sym1 l+    type Foo7Sym1 (t :: Nat) = Foo7 t+    instance SuppressUnusedWarnings Foo7Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo7Sym0KindInference GHC.Tuple.())+    data Foo7Sym0 (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply Foo7Sym0 arg) ~ KindOf (Foo7Sym1 arg) =>+        Foo7Sym0KindInference+    type instance Apply Foo7Sym0 l = Foo7Sym1 l+    type Foo6Sym1 (t :: Nat) = Foo6 t+    instance SuppressUnusedWarnings Foo6Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo6Sym0KindInference GHC.Tuple.())+    data Foo6Sym0 (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply Foo6Sym0 arg) ~ KindOf (Foo6Sym1 arg) =>+        Foo6Sym0KindInference+    type instance Apply Foo6Sym0 l = Foo6Sym1 l+    type Foo5Sym1 (t :: Nat) = Foo5 t+    instance SuppressUnusedWarnings Foo5Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo5Sym0KindInference GHC.Tuple.())+    data Foo5Sym0 (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply Foo5Sym0 arg) ~ KindOf (Foo5Sym1 arg) =>+        Foo5Sym0KindInference+    type instance Apply Foo5Sym0 l = Foo5Sym1 l+    type Foo4Sym1 (t :: Nat) = Foo4 t+    instance SuppressUnusedWarnings Foo4Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo4Sym0KindInference GHC.Tuple.())+    data Foo4Sym0 (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply Foo4Sym0 arg) ~ KindOf (Foo4Sym1 arg) =>+        Foo4Sym0KindInference+    type instance Apply Foo4Sym0 l = Foo4Sym1 l+    type Foo3Sym1 (t :: Nat) = Foo3 t+    instance SuppressUnusedWarnings Foo3Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo3Sym0KindInference GHC.Tuple.())+    data Foo3Sym0 (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply Foo3Sym0 arg) ~ KindOf (Foo3Sym1 arg) =>+        Foo3Sym0KindInference+    type instance Apply Foo3Sym0 l = Foo3Sym1 l+    type Foo2Sym0 = Foo2+    type Foo1Sym1 (t :: Nat) = Foo1 t+    instance SuppressUnusedWarnings Foo1Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo1Sym0KindInference GHC.Tuple.())+    data Foo1Sym0 (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply Foo1Sym0 arg) ~ KindOf (Foo1Sym1 arg) =>+        Foo1Sym0KindInference+    type instance Apply Foo1Sym0 l = Foo1Sym1 l+    type family Foo14 (a :: Nat) :: (Nat, Nat) where+      Foo14 x = Apply (Apply Tuple2Sym0 (Let0123456789ZSym1 x)) (Let0123456789YSym1 x)+    type family Foo13_ (a :: a) :: a where+      Foo13_ y = y+    type family Foo13 (a :: a) :: a where+      Foo13 x = Apply Foo13_Sym0 (Let0123456789BarSym1 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)) (Let0123456789ZSym1 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 (Let0123456789ZSym1 x) x+    type family Foo8 (a :: Nat) :: Nat where+      Foo8 x = Let0123456789ZSym1 x+    type family Foo7 (a :: Nat) :: Nat where+      Foo7 x = Let0123456789XSym1 x+    type family Foo6 (a :: Nat) :: Nat where+      Foo6 x = Let0123456789ZSym1 x+    type family Foo5 (a :: Nat) :: Nat where+      Foo5 x = Apply (Let0123456789FSym1 x) x+    type family Foo4 (a :: Nat) :: Nat where+      Foo4 x = Apply (Let0123456789FSym1 x) x+    type family Foo3 (a :: Nat) :: Nat where+      Foo3 x = Let0123456789YSym1 x+    type family Foo2 :: Nat where+      Foo2 = Let0123456789ZSym0+    type family Foo1 (a :: Nat) :: Nat where+      Foo1 x = Let0123456789YSym1 x+    sFoo14 ::+      forall (t :: Nat). Sing t -> Sing (Apply Foo14Sym0 t :: (Nat, Nat))+    sFoo13_ ::+      forall (t :: a). Sing t -> Sing (Apply Foo13_Sym0 t :: a)+    sFoo13 :: forall (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+      = let+          lambda ::+            forall x. t ~ x => Sing x -> Sing (Apply Foo14Sym0 x :: (Nat, Nat))+          lambda x+            = let+                sY :: Sing (Let0123456789YSym1 x)+                sZ :: Sing (Let0123456789ZSym1 x)+                sX_0123456789 :: Sing (Let0123456789X_0123456789Sym1 x)+                sY+                  = case sX_0123456789 of {+                      STuple2 sY_0123456789 _s_z_0123456789+                        -> let+                             lambda ::+                               forall y_0123456789+                                      _z_0123456789. Apply (Apply Tuple2Sym0 y_0123456789) _z_0123456789 ~ Let0123456789X_0123456789Sym1 x =>+                               Sing y_0123456789+                               -> Sing _z_0123456789+                                  -> Sing (Case_0123456789 x (Apply (Apply Tuple2Sym0 y_0123456789) _z_0123456789))+                             lambda y_0123456789 _z_0123456789 = y_0123456789+                           in lambda sY_0123456789 _s_z_0123456789 } ::+                      Sing (Case_0123456789 x (Let0123456789X_0123456789Sym1 x))+                sZ+                  = case sX_0123456789 of {+                      STuple2 _s_z_0123456789 sY_0123456789+                        -> let+                             lambda ::+                               forall _z_0123456789+                                      y_0123456789. Apply (Apply Tuple2Sym0 _z_0123456789) y_0123456789 ~ Let0123456789X_0123456789Sym1 x =>+                               Sing _z_0123456789+                               -> Sing y_0123456789+                                  -> Sing (Case_0123456789 x (Apply (Apply Tuple2Sym0 _z_0123456789) y_0123456789))+                             lambda _z_0123456789 y_0123456789 = y_0123456789+                           in lambda _s_z_0123456789 sY_0123456789 } ::+                      Sing (Case_0123456789 x (Let0123456789X_0123456789Sym1 x))+                sX_0123456789+                  = applySing+                      (applySing+                         (singFun2 (Proxy :: Proxy Tuple2Sym0) STuple2)+                         (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) x))+                      x+              in+                applySing+                  (applySing (singFun2 (Proxy :: Proxy Tuple2Sym0) STuple2) sZ) sY+        in lambda sX+    sFoo13_ sY+      = let+          lambda ::+            forall y. t ~ y => Sing y -> Sing (Apply Foo13_Sym0 y :: a)+          lambda y = y+        in lambda sY+    sFoo13 sX+      = let+          lambda ::+            forall x. t ~ x => Sing x -> Sing (Apply Foo13Sym0 x :: a)+          lambda x+            = let+                sBar :: Sing (Let0123456789BarSym1 x :: a)+                sBar = x+              in applySing (singFun1 (Proxy :: Proxy Foo13_Sym0) sFoo13_) sBar+        in lambda sX+    sFoo12 sX+      = let+          lambda ::+            forall x. t ~ x => Sing x -> Sing (Apply Foo12Sym0 x :: Nat)+          lambda x+            = let+                (%:+) ::+                  forall (t :: Nat) (t :: Nat).+                  Sing t+                  -> Sing t+                     -> Sing (Apply (Apply ((:<<<%%%%%%%%%%:+$$) x) t) t :: Nat)+                (%:+) SZero sM+                  = let+                      lambda ::+                        forall m. (t ~ ZeroSym0, t ~ m) =>+                        Sing m+                        -> Sing (Apply (Apply ((:<<<%%%%%%%%%%:+$$) x) ZeroSym0) m :: Nat)+                      lambda m = m+                    in lambda sM+                (%:+) (SSucc sN) sM+                  = let+                      lambda ::+                        forall n m. (t ~ Apply SuccSym0 n, t ~ m) =>+                        Sing n+                        -> Sing m+                           -> Sing (Apply (Apply ((:<<<%%%%%%%%%%:+$$) x) (Apply SuccSym0 n)) m :: Nat)+                      lambda n m+                        = applySing+                            (singFun1 (Proxy :: Proxy SuccSym0) SSucc)+                            (applySing+                               (applySing+                                  (singFun2 (Proxy :: Proxy ((:<<<%%%%%%%%%%:+$$) x)) (%:+)) n)+                               x)+                    in lambda sN sM+              in+                applySing+                  (applySing+                     (singFun2 (Proxy :: Proxy ((:<<<%%%%%%%%%%:+$$) x)) (%:+)) x)+                  (applySing+                     (singFun1 (Proxy :: Proxy SuccSym0) SSucc)+                     (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))+        in lambda sX+    sFoo11 sX+      = let+          lambda ::+            forall x. t ~ x => Sing x -> Sing (Apply Foo11Sym0 x :: Nat)+          lambda x+            = let+                sZ :: Sing (Let0123456789ZSym1 x :: Nat)+                (%:+) ::+                  forall (t :: Nat) (t :: Nat).+                  Sing t+                  -> Sing t+                     -> Sing (Apply (Apply ((:<<<%%%%%%%%%%:+$$) x) t) t :: Nat)+                sZ = x+                (%:+) SZero sM+                  = let+                      lambda ::+                        forall m. (t ~ ZeroSym0, t ~ m) =>+                        Sing m+                        -> Sing (Apply (Apply ((:<<<%%%%%%%%%%:+$$) x) ZeroSym0) m :: Nat)+                      lambda m = m+                    in lambda sM+                (%:+) (SSucc sN) sM+                  = let+                      lambda ::+                        forall n m. (t ~ Apply SuccSym0 n, t ~ m) =>+                        Sing n+                        -> Sing m+                           -> Sing (Apply (Apply ((:<<<%%%%%%%%%%:+$$) x) (Apply SuccSym0 n)) m :: Nat)+                      lambda n m+                        = applySing+                            (singFun1 (Proxy :: Proxy SuccSym0) SSucc)+                            (applySing+                               (applySing+                                  (singFun2 (Proxy :: Proxy ((:<<<%%%%%%%%%%:+$$) x)) (%:+)) n)+                               m)+                    in lambda sN sM+              in+                applySing+                  (applySing+                     (singFun2 (Proxy :: Proxy ((:<<<%%%%%%%%%%:+$$) x)) (%:+))+                     (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))+                  sZ+        in lambda sX+    sFoo10 sX+      = let+          lambda ::+            forall x. t ~ x => Sing x -> Sing (Apply Foo10Sym0 x :: Nat)+          lambda x+            = let+                (%:+) ::+                  forall (t :: Nat) (t :: Nat).+                  Sing t+                  -> Sing t+                     -> Sing (Apply (Apply ((:<<<%%%%%%%%%%:+$$) x) t) t :: Nat)+                (%:+) SZero sM+                  = let+                      lambda ::+                        forall m. (t ~ ZeroSym0, t ~ m) =>+                        Sing m+                        -> Sing (Apply (Apply ((:<<<%%%%%%%%%%:+$$) x) ZeroSym0) m :: Nat)+                      lambda m = m+                    in lambda sM+                (%:+) (SSucc sN) sM+                  = let+                      lambda ::+                        forall n m. (t ~ Apply SuccSym0 n, t ~ m) =>+                        Sing n+                        -> Sing m+                           -> Sing (Apply (Apply ((:<<<%%%%%%%%%%:+$$) x) (Apply SuccSym0 n)) m :: Nat)+                      lambda n m+                        = applySing+                            (singFun1 (Proxy :: Proxy SuccSym0) SSucc)+                            (applySing+                               (applySing+                                  (singFun2 (Proxy :: Proxy ((:<<<%%%%%%%%%%:+$$) x)) (%:+)) n)+                               m)+                    in lambda sN sM+              in+                applySing+                  (applySing+                     (singFun2 (Proxy :: Proxy ((:<<<%%%%%%%%%%:+$$) x)) (%:+))+                     (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))+                  x+        in lambda sX+    sFoo9 sX+      = let+          lambda ::+            forall x. t ~ x => Sing x -> Sing (Apply Foo9Sym0 x :: Nat)+          lambda x+            = let+                sZ ::+                  forall (t :: Nat).+                  Sing t -> Sing (Apply (Let0123456789ZSym1 x) t :: Nat)+                sZ sA_0123456789+                  = let+                      lambda ::+                        forall a_0123456789. t ~ a_0123456789 =>+                        Sing a_0123456789+                        -> Sing (Apply (Let0123456789ZSym1 x) a_0123456789 :: Nat)+                      lambda a_0123456789+                        = applySing+                            (singFun1+                               (Proxy ::+                                  Proxy (Apply (Apply Lambda_0123456789Sym0 x) a_0123456789))+                               (\ sX+                                  -> let+                                       lambda ::+                                         forall x.+                                         Sing x+                                         -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 x) a_0123456789) x)+                                       lambda x = x+                                     in lambda sX))+                            a_0123456789+                    in lambda sA_0123456789+              in+                applySing (singFun1 (Proxy :: Proxy (Let0123456789ZSym1 x)) sZ) x+        in lambda sX+    sFoo8 sX+      = let+          lambda ::+            forall x. t ~ x => Sing x -> Sing (Apply Foo8Sym0 x :: Nat)+          lambda x+            = let+                sZ :: Sing (Let0123456789ZSym1 x :: Nat)+                sZ+                  = applySing+                      (singFun1+                         (Proxy :: Proxy (Apply Lambda_0123456789Sym0 x))+                         (\ sX+                            -> let+                                 lambda ::+                                   forall x.+                                   Sing x -> Sing (Apply (Apply Lambda_0123456789Sym0 x) x)+                                 lambda x = x+                               in lambda sX))+                      SZero+              in sZ+        in lambda sX+    sFoo7 sX+      = let+          lambda ::+            forall x. t ~ x => Sing x -> Sing (Apply Foo7Sym0 x :: Nat)+          lambda x+            = let+                sX :: Sing (Let0123456789XSym1 x :: Nat)+                sX = SZero+              in sX+        in lambda sX+    sFoo6 sX+      = let+          lambda ::+            forall x. t ~ x => Sing x -> Sing (Apply Foo6Sym0 x :: Nat)+          lambda x+            = let+                sF ::+                  forall (t :: Nat).+                  Sing t -> Sing (Apply (Let0123456789FSym1 x) t :: Nat)+                sF sY+                  = let+                      lambda ::+                        forall y. t ~ y =>+                        Sing y -> Sing (Apply (Let0123456789FSym1 x) y :: Nat)+                      lambda y = applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) y+                    in lambda sY in+              let+                sZ :: Sing (Let0123456789ZSym1 x :: Nat)+                sZ+                  = applySing (singFun1 (Proxy :: Proxy (Let0123456789FSym1 x)) sF) x+              in sZ+        in lambda sX+    sFoo5 sX+      = let+          lambda ::+            forall x. t ~ x => Sing x -> Sing (Apply Foo5Sym0 x :: Nat)+          lambda x+            = let+                sF ::+                  forall (t :: Nat).+                  Sing t -> Sing (Apply (Let0123456789FSym1 x) t :: Nat)+                sF sY+                  = let+                      lambda ::+                        forall y. t ~ y =>+                        Sing y -> Sing (Apply (Let0123456789FSym1 x) y :: Nat)+                      lambda y+                        = let+                            sZ :: Sing (Let0123456789ZSym2 x y :: Nat)+                            sZ = applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) y+                          in applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) sZ+                    in lambda sY+              in+                applySing (singFun1 (Proxy :: Proxy (Let0123456789FSym1 x)) sF) x+        in lambda sX+    sFoo4 sX+      = let+          lambda ::+            forall x. t ~ x => Sing x -> Sing (Apply Foo4Sym0 x :: Nat)+          lambda x+            = let+                sF ::+                  forall (t :: Nat).+                  Sing t -> Sing (Apply (Let0123456789FSym1 x) t :: Nat)+                sF sY+                  = let+                      lambda ::+                        forall y. t ~ y =>+                        Sing y -> Sing (Apply (Let0123456789FSym1 x) y :: Nat)+                      lambda y = applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) y+                    in lambda sY+              in+                applySing (singFun1 (Proxy :: Proxy (Let0123456789FSym1 x)) sF) x+        in lambda sX+    sFoo3 sX+      = let+          lambda ::+            forall x. t ~ x => Sing x -> Sing (Apply Foo3Sym0 x :: Nat)+          lambda x+            = let+                sY :: Sing (Let0123456789YSym1 x :: Nat)+                sY = applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) x+              in sY+        in lambda sX+    sFoo2+      = let+          sY :: Sing Let0123456789YSym0+          sZ :: Sing Let0123456789ZSym0+          sY = applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero+          sZ = applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) sY+        in sZ+    sFoo1 sX+      = let+          lambda ::+            forall x. t ~ x => Sing x -> Sing (Apply Foo1Sym0 x :: Nat)+          lambda x+            = let+                sY :: Sing (Let0123456789YSym1 x :: Nat)+                sY = applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero+              in sY+        in lambda sX
− tests/compile-and-dump/Singletons/LetStatements.ghc78.template
@@ -1,967 +0,0 @@-Singletons/LetStatements.hs: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) |]-  ======>-    Singletons/LetStatements.hs:(0,0)-(0,0)-    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_ :: forall a. a -> a-    foo13_ y = y-    foo14 :: Nat -> (Nat, Nat)-    foo14 x = let (y, z) = (Succ x, x) in (z, y)-    type family Case_0123456789 x t where-      Case_0123456789 x '(y_0123456789, z) = y_0123456789-    type family Case_0123456789 x t where-      Case_0123456789 x '(z, y_0123456789) = y_0123456789-    type Let0123456789YSym1 t = Let0123456789Y t-    instance SuppressUnusedWarnings Let0123456789YSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789YSym0KindInference GHC.Tuple.())-    data Let0123456789YSym0 l-      = forall arg. KindOf (Apply Let0123456789YSym0 arg) ~ KindOf (Let0123456789YSym1 arg) =>-        Let0123456789YSym0KindInference-    type instance Apply Let0123456789YSym0 l = Let0123456789YSym1 l-    type Let0123456789ZSym1 t = Let0123456789Z t-    instance SuppressUnusedWarnings Let0123456789ZSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789ZSym0KindInference GHC.Tuple.())-    data Let0123456789ZSym0 l-      = forall arg. KindOf (Apply Let0123456789ZSym0 arg) ~ KindOf (Let0123456789ZSym1 arg) =>-        Let0123456789ZSym0KindInference-    type instance Apply Let0123456789ZSym0 l = Let0123456789ZSym1 l-    type Let0123456789X_0123456789Sym1 t = Let0123456789X_0123456789 t-    instance SuppressUnusedWarnings Let0123456789X_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789X_0123456789Sym0KindInference GHC.Tuple.())-    data Let0123456789X_0123456789Sym0 l-      = forall arg. KindOf (Apply Let0123456789X_0123456789Sym0 arg) ~ KindOf (Let0123456789X_0123456789Sym1 arg) =>-        Let0123456789X_0123456789Sym0KindInference-    type instance Apply Let0123456789X_0123456789Sym0 l = Let0123456789X_0123456789Sym1 l-    type Let0123456789Y x =-        Case_0123456789 x (Let0123456789X_0123456789Sym1 x)-    type Let0123456789Z x =-        Case_0123456789 x (Let0123456789X_0123456789Sym1 x)-    type Let0123456789X_0123456789 x =-        Apply (Apply Tuple2Sym0 (Apply SuccSym0 x)) x-    type Let0123456789BarSym1 t = Let0123456789Bar t-    instance SuppressUnusedWarnings Let0123456789BarSym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Let0123456789BarSym0KindInference GHC.Tuple.())-    data Let0123456789BarSym0 l-      = forall arg. KindOf (Apply Let0123456789BarSym0 arg) ~ KindOf (Let0123456789BarSym1 arg) =>-        Let0123456789BarSym0KindInference-    type instance Apply Let0123456789BarSym0 l = Let0123456789BarSym1 l-    type Let0123456789Bar x = (x :: a)-    type (:<<<%%%%%%%%%%:+$$$$) t (t :: Nat) (t :: Nat) =-        (:<<<%%%%%%%%%%:+) t t t-    instance SuppressUnusedWarnings (:<<<%%%%%%%%%%:+$$$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:<<<%%%%%%%%%%:+$$$###) GHC.Tuple.())-    data (:<<<%%%%%%%%%%:+$$$) l (l :: Nat) (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply ((:<<<%%%%%%%%%%:+$$$) l l) arg) ~ KindOf ((:<<<%%%%%%%%%%:+$$$$) l l arg) =>-        (:<<<%%%%%%%%%%:+$$$###)-    type instance Apply ((:<<<%%%%%%%%%%:+$$$) l l) l = (:<<<%%%%%%%%%%:+$$$$) l l l-    instance SuppressUnusedWarnings (:<<<%%%%%%%%%%:+$$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:<<<%%%%%%%%%%:+$$###) GHC.Tuple.())-    data (:<<<%%%%%%%%%%:+$$) l (l :: TyFun Nat (TyFun Nat Nat -> *))-      = forall arg. KindOf (Apply ((:<<<%%%%%%%%%%:+$$) l) arg) ~ KindOf ((:<<<%%%%%%%%%%:+$$$) l arg) =>-        (:<<<%%%%%%%%%%:+$$###)-    type instance Apply ((:<<<%%%%%%%%%%:+$$) l) l = (:<<<%%%%%%%%%%:+$$$) l l-    instance SuppressUnusedWarnings (:<<<%%%%%%%%%%:+$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:<<<%%%%%%%%%%:+$###) GHC.Tuple.())-    data (:<<<%%%%%%%%%%:+$) l-      = forall arg. KindOf (Apply (:<<<%%%%%%%%%%:+$) arg) ~ KindOf ((:<<<%%%%%%%%%%:+$$) arg) =>-        (:<<<%%%%%%%%%%:+$###)-    type instance Apply (:<<<%%%%%%%%%%:+$) l = (:<<<%%%%%%%%%%:+$$) l-    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 Let0123456789ZSym1 t = Let0123456789Z t-    instance SuppressUnusedWarnings Let0123456789ZSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789ZSym0KindInference GHC.Tuple.())-    data Let0123456789ZSym0 l-      = forall arg. KindOf (Apply Let0123456789ZSym0 arg) ~ KindOf (Let0123456789ZSym1 arg) =>-        Let0123456789ZSym0KindInference-    type instance Apply Let0123456789ZSym0 l = Let0123456789ZSym1 l-    type (:<<<%%%%%%%%%%:+$$$$) t (t :: Nat) (t :: Nat) =-        (:<<<%%%%%%%%%%:+) t t t-    instance SuppressUnusedWarnings (:<<<%%%%%%%%%%:+$$$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:<<<%%%%%%%%%%:+$$$###) GHC.Tuple.())-    data (:<<<%%%%%%%%%%:+$$$) l (l :: Nat) (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply ((:<<<%%%%%%%%%%:+$$$) l l) arg) ~ KindOf ((:<<<%%%%%%%%%%:+$$$$) l l arg) =>-        (:<<<%%%%%%%%%%:+$$$###)-    type instance Apply ((:<<<%%%%%%%%%%:+$$$) l l) l = (:<<<%%%%%%%%%%:+$$$$) l l l-    instance SuppressUnusedWarnings (:<<<%%%%%%%%%%:+$$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:<<<%%%%%%%%%%:+$$###) GHC.Tuple.())-    data (:<<<%%%%%%%%%%:+$$) l (l :: TyFun Nat (TyFun Nat Nat -> *))-      = forall arg. KindOf (Apply ((:<<<%%%%%%%%%%:+$$) l) arg) ~ KindOf ((:<<<%%%%%%%%%%:+$$$) l arg) =>-        (:<<<%%%%%%%%%%:+$$###)-    type instance Apply ((:<<<%%%%%%%%%%:+$$) l) l = (:<<<%%%%%%%%%%:+$$$) l l-    instance SuppressUnusedWarnings (:<<<%%%%%%%%%%:+$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:<<<%%%%%%%%%%:+$###) GHC.Tuple.())-    data (:<<<%%%%%%%%%%:+$) l-      = forall arg. KindOf (Apply (:<<<%%%%%%%%%%:+$) arg) ~ KindOf ((:<<<%%%%%%%%%%:+$$) arg) =>-        (:<<<%%%%%%%%%%:+$###)-    type instance Apply (:<<<%%%%%%%%%%:+$) l = (:<<<%%%%%%%%%%:+$$) l-    type Let0123456789Z x = (x :: 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 (:<<<%%%%%%%%%%:+$$$$) t (t :: Nat) (t :: Nat) =-        (:<<<%%%%%%%%%%:+) t t t-    instance SuppressUnusedWarnings (:<<<%%%%%%%%%%:+$$$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:<<<%%%%%%%%%%:+$$$###) GHC.Tuple.())-    data (:<<<%%%%%%%%%%:+$$$) l (l :: Nat) (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply ((:<<<%%%%%%%%%%:+$$$) l l) arg) ~ KindOf ((:<<<%%%%%%%%%%:+$$$$) l l arg) =>-        (:<<<%%%%%%%%%%:+$$$###)-    type instance Apply ((:<<<%%%%%%%%%%:+$$$) l l) l = (:<<<%%%%%%%%%%:+$$$$) l l l-    instance SuppressUnusedWarnings (:<<<%%%%%%%%%%:+$$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:<<<%%%%%%%%%%:+$$###) GHC.Tuple.())-    data (:<<<%%%%%%%%%%:+$$) l (l :: TyFun Nat (TyFun Nat Nat -> *))-      = forall arg. KindOf (Apply ((:<<<%%%%%%%%%%:+$$) l) arg) ~ KindOf ((:<<<%%%%%%%%%%:+$$$) l arg) =>-        (:<<<%%%%%%%%%%:+$$###)-    type instance Apply ((:<<<%%%%%%%%%%:+$$) l) l = (:<<<%%%%%%%%%%:+$$$) l l-    instance SuppressUnusedWarnings (:<<<%%%%%%%%%%:+$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:<<<%%%%%%%%%%:+$###) GHC.Tuple.())-    data (:<<<%%%%%%%%%%:+$) l-      = forall arg. KindOf (Apply (:<<<%%%%%%%%%%:+$) arg) ~ KindOf ((:<<<%%%%%%%%%%:+$$) arg) =>-        (:<<<%%%%%%%%%%:+$###)-    type instance Apply (:<<<%%%%%%%%%%:+$) l = (:<<<%%%%%%%%%%:+$$) l-    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_0123456789 x a_0123456789 t where-      Lambda_0123456789 x a_0123456789 x = x-    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())-    data Lambda_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>-        Lambda_0123456789Sym2KindInference-    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type Let0123456789ZSym2 t (t :: Nat) = Let0123456789Z t t-    instance SuppressUnusedWarnings Let0123456789ZSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789ZSym1KindInference GHC.Tuple.())-    data Let0123456789ZSym1 l (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply (Let0123456789ZSym1 l) arg) ~ KindOf (Let0123456789ZSym2 l arg) =>-        Let0123456789ZSym1KindInference-    type instance Apply (Let0123456789ZSym1 l) l = Let0123456789ZSym2 l l-    instance SuppressUnusedWarnings Let0123456789ZSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789ZSym0KindInference GHC.Tuple.())-    data Let0123456789ZSym0 l-      = forall arg. KindOf (Apply Let0123456789ZSym0 arg) ~ KindOf (Let0123456789ZSym1 arg) =>-        Let0123456789ZSym0KindInference-    type instance Apply Let0123456789ZSym0 l = Let0123456789ZSym1 l-    type family Let0123456789Z x (a :: Nat) :: Nat where-      Let0123456789Z x a_0123456789 = Apply (Apply (Apply Lambda_0123456789Sym0 x) a_0123456789) a_0123456789-    type family Lambda_0123456789 x t where-      Lambda_0123456789 x x = x-    type Lambda_0123456789Sym2 t t = Lambda_0123456789 t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type Let0123456789ZSym1 t = Let0123456789Z t-    instance SuppressUnusedWarnings Let0123456789ZSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789ZSym0KindInference GHC.Tuple.())-    data Let0123456789ZSym0 l-      = forall arg. KindOf (Apply Let0123456789ZSym0 arg) ~ KindOf (Let0123456789ZSym1 arg) =>-        Let0123456789ZSym0KindInference-    type instance Apply Let0123456789ZSym0 l = Let0123456789ZSym1 l-    type Let0123456789Z x =-        (Apply (Apply Lambda_0123456789Sym0 x) ZeroSym0 :: Nat)-    type Let0123456789XSym1 t = Let0123456789X t-    instance SuppressUnusedWarnings Let0123456789XSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789XSym0KindInference GHC.Tuple.())-    data Let0123456789XSym0 l-      = forall arg. KindOf (Apply Let0123456789XSym0 arg) ~ KindOf (Let0123456789XSym1 arg) =>-        Let0123456789XSym0KindInference-    type instance Apply Let0123456789XSym0 l = Let0123456789XSym1 l-    type Let0123456789X x = (ZeroSym0 :: Nat)-    type Let0123456789FSym2 t (t :: Nat) = Let0123456789F t t-    instance SuppressUnusedWarnings Let0123456789FSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789FSym1KindInference GHC.Tuple.())-    data Let0123456789FSym1 l (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply (Let0123456789FSym1 l) arg) ~ KindOf (Let0123456789FSym2 l arg) =>-        Let0123456789FSym1KindInference-    type instance Apply (Let0123456789FSym1 l) l = Let0123456789FSym2 l l-    instance SuppressUnusedWarnings Let0123456789FSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789FSym0KindInference GHC.Tuple.())-    data Let0123456789FSym0 l-      = forall arg. KindOf (Apply Let0123456789FSym0 arg) ~ KindOf (Let0123456789FSym1 arg) =>-        Let0123456789FSym0KindInference-    type instance Apply Let0123456789FSym0 l = Let0123456789FSym1 l-    type family Let0123456789F x (a :: Nat) :: Nat where-      Let0123456789F x y = Apply SuccSym0 y-    type Let0123456789ZSym1 t = Let0123456789Z t-    instance SuppressUnusedWarnings Let0123456789ZSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789ZSym0KindInference GHC.Tuple.())-    data Let0123456789ZSym0 l-      = forall arg. KindOf (Apply Let0123456789ZSym0 arg) ~ KindOf (Let0123456789ZSym1 arg) =>-        Let0123456789ZSym0KindInference-    type instance Apply Let0123456789ZSym0 l = Let0123456789ZSym1 l-    type Let0123456789Z x = (Apply (Let0123456789FSym1 x) x :: Nat)-    type Let0123456789ZSym2 t t = Let0123456789Z t t-    instance SuppressUnusedWarnings Let0123456789ZSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789ZSym1KindInference GHC.Tuple.())-    data Let0123456789ZSym1 l l-      = forall arg. KindOf (Apply (Let0123456789ZSym1 l) arg) ~ KindOf (Let0123456789ZSym2 l arg) =>-        Let0123456789ZSym1KindInference-    type instance Apply (Let0123456789ZSym1 l) l = Let0123456789ZSym2 l l-    instance SuppressUnusedWarnings Let0123456789ZSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789ZSym0KindInference GHC.Tuple.())-    data Let0123456789ZSym0 l-      = forall arg. KindOf (Apply Let0123456789ZSym0 arg) ~ KindOf (Let0123456789ZSym1 arg) =>-        Let0123456789ZSym0KindInference-    type instance Apply Let0123456789ZSym0 l = Let0123456789ZSym1 l-    type Let0123456789Z x y = (Apply SuccSym0 y :: Nat)-    type Let0123456789FSym2 t (t :: Nat) = Let0123456789F t t-    instance SuppressUnusedWarnings Let0123456789FSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789FSym1KindInference GHC.Tuple.())-    data Let0123456789FSym1 l (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply (Let0123456789FSym1 l) arg) ~ KindOf (Let0123456789FSym2 l arg) =>-        Let0123456789FSym1KindInference-    type instance Apply (Let0123456789FSym1 l) l = Let0123456789FSym2 l l-    instance SuppressUnusedWarnings Let0123456789FSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789FSym0KindInference GHC.Tuple.())-    data Let0123456789FSym0 l-      = forall arg. KindOf (Apply Let0123456789FSym0 arg) ~ KindOf (Let0123456789FSym1 arg) =>-        Let0123456789FSym0KindInference-    type instance Apply Let0123456789FSym0 l = Let0123456789FSym1 l-    type family Let0123456789F x (a :: Nat) :: Nat where-      Let0123456789F x y = Apply SuccSym0 (Let0123456789ZSym2 x y)-    type Let0123456789FSym2 t (t :: Nat) = Let0123456789F t t-    instance SuppressUnusedWarnings Let0123456789FSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789FSym1KindInference GHC.Tuple.())-    data Let0123456789FSym1 l (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply (Let0123456789FSym1 l) arg) ~ KindOf (Let0123456789FSym2 l arg) =>-        Let0123456789FSym1KindInference-    type instance Apply (Let0123456789FSym1 l) l = Let0123456789FSym2 l l-    instance SuppressUnusedWarnings Let0123456789FSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789FSym0KindInference GHC.Tuple.())-    data Let0123456789FSym0 l-      = forall arg. KindOf (Apply Let0123456789FSym0 arg) ~ KindOf (Let0123456789FSym1 arg) =>-        Let0123456789FSym0KindInference-    type instance Apply Let0123456789FSym0 l = Let0123456789FSym1 l-    type family Let0123456789F x (a :: Nat) :: Nat where-      Let0123456789F x y = Apply SuccSym0 y-    type Let0123456789YSym1 t = Let0123456789Y t-    instance SuppressUnusedWarnings Let0123456789YSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789YSym0KindInference GHC.Tuple.())-    data Let0123456789YSym0 l-      = forall arg. KindOf (Apply Let0123456789YSym0 arg) ~ KindOf (Let0123456789YSym1 arg) =>-        Let0123456789YSym0KindInference-    type instance Apply Let0123456789YSym0 l = Let0123456789YSym1 l-    type Let0123456789Y x = (Apply SuccSym0 x :: Nat)-    type Let0123456789YSym0 = Let0123456789Y-    type Let0123456789ZSym0 = Let0123456789Z-    type Let0123456789Y = Apply SuccSym0 ZeroSym0-    type Let0123456789Z = Apply SuccSym0 Let0123456789YSym0-    type Let0123456789YSym1 t = Let0123456789Y t-    instance SuppressUnusedWarnings Let0123456789YSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789YSym0KindInference GHC.Tuple.())-    data Let0123456789YSym0 l-      = forall arg. KindOf (Apply Let0123456789YSym0 arg) ~ KindOf (Let0123456789YSym1 arg) =>-        Let0123456789YSym0KindInference-    type instance Apply Let0123456789YSym0 l = Let0123456789YSym1 l-    type Let0123456789Y x = (Apply SuccSym0 ZeroSym0 :: Nat)-    type Foo14Sym1 (t :: Nat) = Foo14 t-    instance SuppressUnusedWarnings Foo14Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo14Sym0KindInference GHC.Tuple.())-    data Foo14Sym0 (l :: TyFun Nat (Nat, Nat))-      = forall arg. KindOf (Apply Foo14Sym0 arg) ~ KindOf (Foo14Sym1 arg) =>-        Foo14Sym0KindInference-    type instance Apply Foo14Sym0 l = Foo14Sym1 l-    type Foo13_Sym1 (t :: a) = Foo13_ t-    instance SuppressUnusedWarnings Foo13_Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo13_Sym0KindInference GHC.Tuple.())-    data Foo13_Sym0 (l :: TyFun a a)-      = forall arg. KindOf (Apply Foo13_Sym0 arg) ~ KindOf (Foo13_Sym1 arg) =>-        Foo13_Sym0KindInference-    type instance Apply Foo13_Sym0 l = Foo13_Sym1 l-    type Foo13Sym1 (t :: a) = Foo13 t-    instance SuppressUnusedWarnings Foo13Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo13Sym0KindInference GHC.Tuple.())-    data Foo13Sym0 (l :: TyFun a a)-      = forall arg. KindOf (Apply Foo13Sym0 arg) ~ KindOf (Foo13Sym1 arg) =>-        Foo13Sym0KindInference-    type instance Apply Foo13Sym0 l = Foo13Sym1 l-    type Foo12Sym1 (t :: Nat) = Foo12 t-    instance SuppressUnusedWarnings Foo12Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo12Sym0KindInference GHC.Tuple.())-    data Foo12Sym0 (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply Foo12Sym0 arg) ~ KindOf (Foo12Sym1 arg) =>-        Foo12Sym0KindInference-    type instance Apply Foo12Sym0 l = Foo12Sym1 l-    type Foo11Sym1 (t :: Nat) = Foo11 t-    instance SuppressUnusedWarnings Foo11Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo11Sym0KindInference GHC.Tuple.())-    data Foo11Sym0 (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply Foo11Sym0 arg) ~ KindOf (Foo11Sym1 arg) =>-        Foo11Sym0KindInference-    type instance Apply Foo11Sym0 l = Foo11Sym1 l-    type Foo10Sym1 (t :: Nat) = Foo10 t-    instance SuppressUnusedWarnings Foo10Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo10Sym0KindInference GHC.Tuple.())-    data Foo10Sym0 (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply Foo10Sym0 arg) ~ KindOf (Foo10Sym1 arg) =>-        Foo10Sym0KindInference-    type instance Apply Foo10Sym0 l = Foo10Sym1 l-    type Foo9Sym1 (t :: Nat) = Foo9 t-    instance SuppressUnusedWarnings Foo9Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo9Sym0KindInference GHC.Tuple.())-    data Foo9Sym0 (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply Foo9Sym0 arg) ~ KindOf (Foo9Sym1 arg) =>-        Foo9Sym0KindInference-    type instance Apply Foo9Sym0 l = Foo9Sym1 l-    type Foo8Sym1 (t :: Nat) = Foo8 t-    instance SuppressUnusedWarnings Foo8Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo8Sym0KindInference GHC.Tuple.())-    data Foo8Sym0 (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply Foo8Sym0 arg) ~ KindOf (Foo8Sym1 arg) =>-        Foo8Sym0KindInference-    type instance Apply Foo8Sym0 l = Foo8Sym1 l-    type Foo7Sym1 (t :: Nat) = Foo7 t-    instance SuppressUnusedWarnings Foo7Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo7Sym0KindInference GHC.Tuple.())-    data Foo7Sym0 (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply Foo7Sym0 arg) ~ KindOf (Foo7Sym1 arg) =>-        Foo7Sym0KindInference-    type instance Apply Foo7Sym0 l = Foo7Sym1 l-    type Foo6Sym1 (t :: Nat) = Foo6 t-    instance SuppressUnusedWarnings Foo6Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo6Sym0KindInference GHC.Tuple.())-    data Foo6Sym0 (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply Foo6Sym0 arg) ~ KindOf (Foo6Sym1 arg) =>-        Foo6Sym0KindInference-    type instance Apply Foo6Sym0 l = Foo6Sym1 l-    type Foo5Sym1 (t :: Nat) = Foo5 t-    instance SuppressUnusedWarnings Foo5Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo5Sym0KindInference GHC.Tuple.())-    data Foo5Sym0 (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply Foo5Sym0 arg) ~ KindOf (Foo5Sym1 arg) =>-        Foo5Sym0KindInference-    type instance Apply Foo5Sym0 l = Foo5Sym1 l-    type Foo4Sym1 (t :: Nat) = Foo4 t-    instance SuppressUnusedWarnings Foo4Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo4Sym0KindInference GHC.Tuple.())-    data Foo4Sym0 (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply Foo4Sym0 arg) ~ KindOf (Foo4Sym1 arg) =>-        Foo4Sym0KindInference-    type instance Apply Foo4Sym0 l = Foo4Sym1 l-    type Foo3Sym1 (t :: Nat) = Foo3 t-    instance SuppressUnusedWarnings Foo3Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo3Sym0KindInference GHC.Tuple.())-    data Foo3Sym0 (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply Foo3Sym0 arg) ~ KindOf (Foo3Sym1 arg) =>-        Foo3Sym0KindInference-    type instance Apply Foo3Sym0 l = Foo3Sym1 l-    type Foo2Sym0 = Foo2-    type Foo1Sym1 (t :: Nat) = Foo1 t-    instance SuppressUnusedWarnings Foo1Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo1Sym0KindInference GHC.Tuple.())-    data Foo1Sym0 (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply Foo1Sym0 arg) ~ KindOf (Foo1Sym1 arg) =>-        Foo1Sym0KindInference-    type instance Apply Foo1Sym0 l = Foo1Sym1 l-    type family Foo14 (a :: Nat) :: (Nat, Nat) where-      Foo14 x = Apply (Apply Tuple2Sym0 (Let0123456789ZSym1 x)) (Let0123456789YSym1 x)-    type family Foo13_ (a :: a) :: a where-      Foo13_ y = y-    type family Foo13 (a :: a) :: a where-      Foo13 x = Apply Foo13_Sym0 (Let0123456789BarSym1 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)) (Let0123456789ZSym1 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 (Let0123456789ZSym1 x) x-    type family Foo8 (a :: Nat) :: Nat where-      Foo8 x = Let0123456789ZSym1 x-    type family Foo7 (a :: Nat) :: Nat where-      Foo7 x = Let0123456789XSym1 x-    type family Foo6 (a :: Nat) :: Nat where-      Foo6 x = Let0123456789ZSym1 x-    type family Foo5 (a :: Nat) :: Nat where-      Foo5 x = Apply (Let0123456789FSym1 x) x-    type family Foo4 (a :: Nat) :: Nat where-      Foo4 x = Apply (Let0123456789FSym1 x) x-    type family Foo3 (a :: Nat) :: Nat where-      Foo3 x = Let0123456789YSym1 x-    type Foo2 = (Let0123456789ZSym0 :: Nat)-    type family Foo1 (a :: Nat) :: Nat where-      Foo1 x = Let0123456789YSym1 x-    sFoo14 :: forall (t :: Nat). Sing t -> Sing (Apply Foo14Sym0 t)-    sFoo13_ :: forall (t :: a). Sing t -> Sing (Apply Foo13_Sym0 t)-    sFoo13 :: forall (t :: a). Sing t -> Sing (Apply Foo13Sym0 t)-    sFoo12 :: forall (t :: Nat). Sing t -> Sing (Apply Foo12Sym0 t)-    sFoo11 :: forall (t :: Nat). Sing t -> Sing (Apply Foo11Sym0 t)-    sFoo10 :: forall (t :: Nat). Sing t -> Sing (Apply Foo10Sym0 t)-    sFoo9 :: forall (t :: Nat). Sing t -> Sing (Apply Foo9Sym0 t)-    sFoo8 :: forall (t :: Nat). Sing t -> Sing (Apply Foo8Sym0 t)-    sFoo7 :: forall (t :: Nat). Sing t -> Sing (Apply Foo7Sym0 t)-    sFoo6 :: forall (t :: Nat). Sing t -> Sing (Apply Foo6Sym0 t)-    sFoo5 :: forall (t :: Nat). Sing t -> Sing (Apply Foo5Sym0 t)-    sFoo4 :: forall (t :: Nat). Sing t -> Sing (Apply Foo4Sym0 t)-    sFoo3 :: forall (t :: Nat). Sing t -> Sing (Apply Foo3Sym0 t)-    sFoo2 :: Sing Foo2Sym0-    sFoo1 :: forall (t :: Nat). Sing t -> Sing (Apply Foo1Sym0 t)-    sFoo14 sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo14Sym0 x)-          lambda x-            = let-                sY :: Sing (Let0123456789YSym1 x)-                sZ :: Sing (Let0123456789ZSym1 x)-                sX_0123456789 :: Sing (Let0123456789X_0123456789Sym1 x)-                sY-                  = case sX_0123456789 of {-                      STuple2 sY_0123456789 _-                        -> let-                             lambda ::-                               forall y_0123456789 wild.-                               Sing y_0123456789-                               -> Sing (Case_0123456789 x (Apply (Apply Tuple2Sym0 y_0123456789) wild))-                             lambda y_0123456789 = y_0123456789-                           in lambda sY_0123456789 }-                sZ-                  = case sX_0123456789 of {-                      STuple2 _ sY_0123456789-                        -> let-                             lambda ::-                               forall y_0123456789 wild.-                               Sing y_0123456789-                               -> Sing (Case_0123456789 x (Apply (Apply Tuple2Sym0 wild) y_0123456789))-                             lambda y_0123456789 = y_0123456789-                           in lambda sY_0123456789 }-                sX_0123456789-                  = applySing-                      (applySing-                         (singFun2 (Proxy :: Proxy Tuple2Sym0) STuple2)-                         (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) x))-                      x-              in-                applySing-                  (applySing (singFun2 (Proxy :: Proxy Tuple2Sym0) STuple2) sZ) sY-        in lambda sX-    sFoo13_ sY-      = let-          lambda :: forall y. t ~ y => Sing y -> Sing (Apply Foo13_Sym0 y)-          lambda y = y-        in lambda sY-    sFoo13 sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo13Sym0 x)-          lambda x-            = let-                sBar :: Sing (Let0123456789BarSym1 x)-                sBar = x-              in applySing (singFun1 (Proxy :: Proxy Foo13_Sym0) sFoo13_) sBar-        in lambda sX-    sFoo12 sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo12Sym0 x)-          lambda x-            = let-                (%:+) ::-                  forall t t.-                  Sing t-                  -> Sing t -> Sing (Apply (Apply ((:<<<%%%%%%%%%%:+$$) x) t) t)-                (%:+) SZero sM-                  = let-                      lambda ::-                        forall m. (t ~ ZeroSym0, t ~ m) =>-                        Sing m -> Sing (Apply (Apply ((:<<<%%%%%%%%%%:+$$) x) ZeroSym0) m)-                      lambda m = m-                    in lambda sM-                (%:+) (SSucc sN) sM-                  = let-                      lambda ::-                        forall n m. (t ~ Apply SuccSym0 n, t ~ m) =>-                        Sing n-                        -> Sing m-                           -> Sing (Apply (Apply ((:<<<%%%%%%%%%%:+$$) x) (Apply SuccSym0 n)) m)-                      lambda n m-                        = applySing-                            (singFun1 (Proxy :: Proxy SuccSym0) SSucc)-                            (applySing-                               (applySing-                                  (singFun2 (Proxy :: Proxy ((:<<<%%%%%%%%%%:+$$) x)) (%:+)) n)-                               x)-                    in lambda sN sM-              in-                applySing-                  (applySing-                     (singFun2 (Proxy :: Proxy ((:<<<%%%%%%%%%%:+$$) x)) (%:+)) x)-                  (applySing-                     (singFun1 (Proxy :: Proxy SuccSym0) SSucc)-                     (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))-        in lambda sX-    sFoo11 sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo11Sym0 x)-          lambda x-            = let-                sZ :: Sing (Let0123456789ZSym1 x)-                (%:+) ::-                  forall t t.-                  Sing t-                  -> Sing t -> Sing (Apply (Apply ((:<<<%%%%%%%%%%:+$$) x) t) t)-                sZ = x-                (%:+) SZero sM-                  = let-                      lambda ::-                        forall m. (t ~ ZeroSym0, t ~ m) =>-                        Sing m -> Sing (Apply (Apply ((:<<<%%%%%%%%%%:+$$) x) ZeroSym0) m)-                      lambda m = m-                    in lambda sM-                (%:+) (SSucc sN) sM-                  = let-                      lambda ::-                        forall n m. (t ~ Apply SuccSym0 n, t ~ m) =>-                        Sing n-                        -> Sing m-                           -> Sing (Apply (Apply ((:<<<%%%%%%%%%%:+$$) x) (Apply SuccSym0 n)) m)-                      lambda n m-                        = applySing-                            (singFun1 (Proxy :: Proxy SuccSym0) SSucc)-                            (applySing-                               (applySing-                                  (singFun2 (Proxy :: Proxy ((:<<<%%%%%%%%%%:+$$) x)) (%:+)) n)-                               m)-                    in lambda sN sM-              in-                applySing-                  (applySing-                     (singFun2 (Proxy :: Proxy ((:<<<%%%%%%%%%%:+$$) x)) (%:+))-                     (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))-                  sZ-        in lambda sX-    sFoo10 sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo10Sym0 x)-          lambda x-            = let-                (%:+) ::-                  forall t t.-                  Sing t-                  -> Sing t -> Sing (Apply (Apply ((:<<<%%%%%%%%%%:+$$) x) t) t)-                (%:+) SZero sM-                  = let-                      lambda ::-                        forall m. (t ~ ZeroSym0, t ~ m) =>-                        Sing m -> Sing (Apply (Apply ((:<<<%%%%%%%%%%:+$$) x) ZeroSym0) m)-                      lambda m = m-                    in lambda sM-                (%:+) (SSucc sN) sM-                  = let-                      lambda ::-                        forall n m. (t ~ Apply SuccSym0 n, t ~ m) =>-                        Sing n-                        -> Sing m-                           -> Sing (Apply (Apply ((:<<<%%%%%%%%%%:+$$) x) (Apply SuccSym0 n)) m)-                      lambda n m-                        = applySing-                            (singFun1 (Proxy :: Proxy SuccSym0) SSucc)-                            (applySing-                               (applySing-                                  (singFun2 (Proxy :: Proxy ((:<<<%%%%%%%%%%:+$$) x)) (%:+)) n)-                               m)-                    in lambda sN sM-              in-                applySing-                  (applySing-                     (singFun2 (Proxy :: Proxy ((:<<<%%%%%%%%%%:+$$) x)) (%:+))-                     (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))-                  x-        in lambda sX-    sFoo9 sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo9Sym0 x)-          lambda x-            = let-                sZ :: forall t. Sing t -> Sing (Apply (Let0123456789ZSym1 x) t)-                sZ sA_0123456789-                  = let-                      lambda ::-                        forall a_0123456789. t ~ a_0123456789 =>-                        Sing a_0123456789-                        -> Sing (Apply (Let0123456789ZSym1 x) a_0123456789)-                      lambda a_0123456789-                        = applySing-                            (singFun1-                               (Proxy ::-                                  Proxy (Apply (Apply Lambda_0123456789Sym0 x) a_0123456789))-                               (\ sX-                                  -> let-                                       lambda ::-                                         forall x.-                                         Sing x-                                         -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 x) a_0123456789) x)-                                       lambda x = x-                                     in lambda sX))-                            a_0123456789-                    in lambda sA_0123456789-              in-                applySing (singFun1 (Proxy :: Proxy (Let0123456789ZSym1 x)) sZ) x-        in lambda sX-    sFoo8 sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo8Sym0 x)-          lambda x-            = let-                sZ :: Sing (Let0123456789ZSym1 x)-                sZ-                  = applySing-                      (singFun1-                         (Proxy :: Proxy (Apply Lambda_0123456789Sym0 x))-                         (\ sX-                            -> let-                                 lambda ::-                                   forall x.-                                   Sing x -> Sing (Apply (Apply Lambda_0123456789Sym0 x) x)-                                 lambda x = x-                               in lambda sX))-                      SZero-              in sZ-        in lambda sX-    sFoo7 sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo7Sym0 x)-          lambda x-            = let-                sX :: Sing (Let0123456789XSym1 x)-                sX = SZero-              in sX-        in lambda sX-    sFoo6 sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo6Sym0 x)-          lambda x-            = let-                sF :: forall t. Sing t -> Sing (Apply (Let0123456789FSym1 x) t)-                sF sY-                  = let-                      lambda ::-                        forall y. t ~ y => Sing y -> Sing (Apply (Let0123456789FSym1 x) y)-                      lambda y = applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) y-                    in lambda sY in-              let-                sZ :: Sing (Let0123456789ZSym1 x)-                sZ-                  = applySing (singFun1 (Proxy :: Proxy (Let0123456789FSym1 x)) sF) x-              in sZ-        in lambda sX-    sFoo5 sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo5Sym0 x)-          lambda x-            = let-                sF :: forall t. Sing t -> Sing (Apply (Let0123456789FSym1 x) t)-                sF sY-                  = let-                      lambda ::-                        forall y. t ~ y => Sing y -> Sing (Apply (Let0123456789FSym1 x) y)-                      lambda y-                        = let-                            sZ :: Sing (Let0123456789ZSym2 x y)-                            sZ = applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) y-                          in applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) sZ-                    in lambda sY-              in-                applySing (singFun1 (Proxy :: Proxy (Let0123456789FSym1 x)) sF) x-        in lambda sX-    sFoo4 sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo4Sym0 x)-          lambda x-            = let-                sF :: forall t. Sing t -> Sing (Apply (Let0123456789FSym1 x) t)-                sF sY-                  = let-                      lambda ::-                        forall y. t ~ y => Sing y -> Sing (Apply (Let0123456789FSym1 x) y)-                      lambda y = applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) y-                    in lambda sY-              in-                applySing (singFun1 (Proxy :: Proxy (Let0123456789FSym1 x)) sF) x-        in lambda sX-    sFoo3 sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo3Sym0 x)-          lambda x-            = let-                sY :: Sing (Let0123456789YSym1 x)-                sY = applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) x-              in sY-        in lambda sX-    sFoo2-      = let-          sY :: Sing Let0123456789YSym0-          sZ :: Sing Let0123456789ZSym0-          sY = applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero-          sZ = applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) sY-        in sZ-    sFoo1 sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply Foo1Sym0 x)-          lambda x-            = let-                sY :: Sing (Let0123456789YSym1 x)-                sY = applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero-              in sY-        in lambda sX
+ tests/compile-and-dump/Singletons/Maybe.ghc710.template view
@@ -0,0 +1,66 @@+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 family Equals_0123456789 (a :: Maybe k)+                                  (b :: Maybe k) :: Bool where+      Equals_0123456789 Nothing Nothing = TrueSym0+      Equals_0123456789 (Just a) (Just b) = (:==) a b+      Equals_0123456789 (a :: Maybe k) (b :: Maybe k) = FalseSym0+    instance PEq (KProxy :: KProxy (Maybe k)) where+      type (:==) (a :: Maybe k) (b :: Maybe k) = Equals_0123456789 a b+    type NothingSym0 = Nothing+    type JustSym1 (t :: a) = Just t+    instance SuppressUnusedWarnings JustSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) JustSym0KindInference GHC.Tuple.())+    data JustSym0 (l :: TyFun a (Maybe a))+      = forall arg. KindOf (Apply JustSym0 arg) ~ KindOf (JustSym1 arg) =>+        JustSym0KindInference+    type instance Apply JustSym0 l = JustSym1 l+    data instance Sing (z :: Maybe a)+      = z ~ Nothing => SNothing |+        forall (n :: a). z ~ Just n => SJust (Sing (n :: a))+    type SMaybe = (Sing :: Maybe a -> *)+    instance SingKind (KProxy :: KProxy a) =>+             SingKind (KProxy :: KProxy (Maybe a)) where+      type DemoteRep (KProxy :: KProxy (Maybe a)) = Maybe (DemoteRep (KProxy :: KProxy a))+      fromSing SNothing = Nothing+      fromSing (SJust b) = Just (fromSing b)+      toSing Nothing = SomeSing SNothing+      toSing (Just b)+        = case toSing b :: SomeSing (KProxy :: KProxy a) of {+            SomeSing c -> SomeSing (SJust c) }+    instance SEq (KProxy :: KProxy a) =>+             SEq (KProxy :: KProxy (Maybe a)) where+      (%:==) SNothing SNothing = STrue+      (%:==) SNothing (SJust _) = SFalse+      (%:==) (SJust _) SNothing = SFalse+      (%:==) (SJust a) (SJust b) = (%:==) a b+    instance SDecide (KProxy :: KProxy a) =>+             SDecide (KProxy :: KProxy (Maybe a)) where+      (%~) SNothing SNothing = Proved Refl+      (%~) SNothing (SJust _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SJust _) SNothing+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SJust a) (SJust b)+        = case (%~) a b of {+            Proved Refl -> Proved Refl+            Disproved contra+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl }) }+    instance SingI Nothing where+      sing = SNothing+    instance SingI n => SingI (Just (n :: a)) where+      sing = SJust sing
− tests/compile-and-dump/Singletons/Maybe.ghc78.template
@@ -1,67 +0,0 @@-Singletons/Maybe.hs:0:0: Splicing declarations-    singletons-      [d| data Maybe a-            = Nothing | Just a-            deriving (Eq, Show) |]-  ======>-    Singletons/Maybe.hs:(0,0)-(0,0)-    data Maybe a-      = Nothing | Just a-      deriving (Eq, Show)-    type family Equals_0123456789 (a :: Maybe k)-                                  (b :: Maybe k) :: Bool where-      Equals_0123456789 Nothing Nothing = TrueSym0-      Equals_0123456789 (Just a) (Just b) = (:==) a b-      Equals_0123456789 (a :: Maybe k) (b :: Maybe k) = FalseSym0-    instance PEq (KProxy :: KProxy (Maybe k)) where-      type (:==) (a :: Maybe k) (b :: Maybe k) = Equals_0123456789 a b-    type NothingSym0 = Nothing-    type JustSym1 (t :: a) = Just t-    instance SuppressUnusedWarnings JustSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) JustSym0KindInference GHC.Tuple.())-    data JustSym0 (l :: TyFun a (Maybe a))-      = forall arg. KindOf (Apply JustSym0 arg) ~ KindOf (JustSym1 arg) =>-        JustSym0KindInference-    type instance Apply JustSym0 l = JustSym1 l-    data instance Sing (z :: Maybe a)-      = z ~ Nothing => SNothing |-        forall (n :: a). z ~ Just n => SJust (Sing n)-    type SMaybe (z :: Maybe a) = Sing z-    instance SingKind (KProxy :: KProxy a) =>-             SingKind (KProxy :: KProxy (Maybe a)) where-      type DemoteRep (KProxy :: KProxy (Maybe a)) = Maybe (DemoteRep (KProxy :: KProxy a))-      fromSing SNothing = Nothing-      fromSing (SJust b) = Just (fromSing b)-      toSing Nothing = SomeSing SNothing-      toSing (Just b)-        = case toSing b :: SomeSing (KProxy :: KProxy a) of {-            SomeSing c -> SomeSing (SJust c) }-    instance SEq (KProxy :: KProxy a) =>-             SEq (KProxy :: KProxy (Maybe a)) where-      (%:==) SNothing SNothing = STrue-      (%:==) SNothing (SJust _) = SFalse-      (%:==) (SJust _) SNothing = SFalse-      (%:==) (SJust a) (SJust b) = (%:==) a b-    instance SDecide (KProxy :: KProxy a) =>-             SDecide (KProxy :: KProxy (Maybe a)) where-      (%~) SNothing SNothing = Proved Refl-      (%~) SNothing (SJust _)-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) (SJust _) SNothing-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) (SJust a) (SJust b)-        = case (%~) a b of {-            Proved Refl -> Proved Refl-            Disproved contra-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl }) }-    instance SingI Nothing where-      sing = SNothing-    instance SingI n => SingI (Just (n :: a)) where-      sing = SJust sing
+ tests/compile-and-dump/Singletons/Nat.ghc710.template view
@@ -0,0 +1,143 @@+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) |]+  ======>+    data Nat+      = Zero | Succ Nat+      deriving (Eq, Show, Read)+    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 family Equals_0123456789 (a :: Nat) (b :: Nat) :: Bool where+      Equals_0123456789 Zero Zero = TrueSym0+      Equals_0123456789 (Succ a) (Succ b) = (:==) a b+      Equals_0123456789 (a :: Nat) (b :: Nat) = FalseSym0+    instance PEq (KProxy :: KProxy Nat) where+      type (:==) (a :: Nat) (b :: Nat) = Equals_0123456789 a b+    type ZeroSym0 = Zero+    type SuccSym1 (t :: Nat) = Succ t+    instance SuppressUnusedWarnings SuccSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) SuccSym0KindInference GHC.Tuple.())+    data SuccSym0 (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply SuccSym0 arg) ~ KindOf (SuccSym1 arg) =>+        SuccSym0KindInference+    type instance Apply SuccSym0 l = SuccSym1 l+    type PredSym1 (t :: Nat) = Pred t+    instance SuppressUnusedWarnings PredSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) PredSym0KindInference GHC.Tuple.())+    data PredSym0 (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply PredSym0 arg) ~ KindOf (PredSym1 arg) =>+        PredSym0KindInference+    type instance Apply PredSym0 l = PredSym1 l+    type PlusSym2 (t :: Nat) (t :: Nat) = Plus t t+    instance SuppressUnusedWarnings PlusSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) PlusSym1KindInference GHC.Tuple.())+    data PlusSym1 (l :: Nat) (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply (PlusSym1 l) arg) ~ KindOf (PlusSym2 l arg) =>+        PlusSym1KindInference+    type instance Apply (PlusSym1 l) l = PlusSym2 l l+    instance SuppressUnusedWarnings PlusSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) PlusSym0KindInference GHC.Tuple.())+    data PlusSym0 (l :: TyFun Nat (TyFun Nat Nat -> *))+      = forall arg. KindOf (Apply PlusSym0 arg) ~ KindOf (PlusSym1 arg) =>+        PlusSym0KindInference+    type instance Apply PlusSym0 l = PlusSym1 l+    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)+    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+      = let+          lambda :: t ~ ZeroSym0 => Sing (Apply PredSym0 ZeroSym0 :: Nat)+          lambda = SZero+        in lambda+    sPred (SSucc sN)+      = let+          lambda ::+            forall n. t ~ Apply SuccSym0 n =>+            Sing n -> Sing (Apply PredSym0 (Apply SuccSym0 n) :: Nat)+          lambda n = n+        in lambda sN+    sPlus SZero sM+      = let+          lambda ::+            forall m. (t ~ ZeroSym0, t ~ m) =>+            Sing m -> Sing (Apply (Apply PlusSym0 ZeroSym0) m :: Nat)+          lambda m = m+        in lambda sM+    sPlus (SSucc sN) sM+      = let+          lambda ::+            forall n m. (t ~ Apply SuccSym0 n, t ~ m) =>+            Sing n+            -> Sing m+               -> Sing (Apply (Apply PlusSym0 (Apply SuccSym0 n)) m :: Nat)+          lambda n m+            = applySing+                (singFun1 (Proxy :: Proxy SuccSym0) SSucc)+                (applySing+                   (applySing (singFun2 (Proxy :: Proxy PlusSym0) sPlus) n) m)+        in lambda sN sM+    data instance Sing (z :: Nat)+      = z ~ Zero => SZero |+        forall (n :: Nat). z ~ Succ n => SSucc (Sing (n :: Nat))+    type SNat = (Sing :: Nat -> *)+    instance SingKind (KProxy :: KProxy Nat) where+      type DemoteRep (KProxy :: KProxy Nat) = Nat+      fromSing SZero = Zero+      fromSing (SSucc b) = Succ (fromSing b)+      toSing Zero = SomeSing SZero+      toSing (Succ b)+        = case toSing b :: SomeSing (KProxy :: KProxy Nat) of {+            SomeSing c -> SomeSing (SSucc c) }+    instance SEq (KProxy :: KProxy Nat) where+      (%:==) SZero SZero = STrue+      (%:==) SZero (SSucc _) = SFalse+      (%:==) (SSucc _) SZero = SFalse+      (%:==) (SSucc a) (SSucc b) = (%:==) a b+    instance SDecide (KProxy :: KProxy Nat) where+      (%~) SZero SZero = Proved Refl+      (%~) SZero (SSucc _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SSucc _) SZero+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SSucc a) (SSucc b)+        = case (%~) a b of {+            Proved Refl -> Proved Refl+            Disproved contra+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl }) }+    instance SingI Zero where+      sing = SZero+    instance SingI n => SingI (Succ (n :: Nat)) where+      sing = SSucc sing
− tests/compile-and-dump/Singletons/Nat.ghc78.template
@@ -1,142 +0,0 @@-Singletons/Nat.hs: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) |]-  ======>-    Singletons/Nat.hs:(0,0)-(0,0)-    data Nat-      = Zero | Succ Nat-      deriving (Eq, Show, Read)-    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 family Equals_0123456789 (a :: Nat) (b :: Nat) :: Bool where-      Equals_0123456789 Zero Zero = TrueSym0-      Equals_0123456789 (Succ a) (Succ b) = (:==) a b-      Equals_0123456789 (a :: Nat) (b :: Nat) = FalseSym0-    instance PEq (KProxy :: KProxy Nat) where-      type (:==) (a :: Nat) (b :: Nat) = Equals_0123456789 a b-    type ZeroSym0 = Zero-    type SuccSym1 (t :: Nat) = Succ t-    instance SuppressUnusedWarnings SuccSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) SuccSym0KindInference GHC.Tuple.())-    data SuccSym0 (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply SuccSym0 arg) ~ KindOf (SuccSym1 arg) =>-        SuccSym0KindInference-    type instance Apply SuccSym0 l = SuccSym1 l-    type PredSym1 (t :: Nat) = Pred t-    instance SuppressUnusedWarnings PredSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) PredSym0KindInference GHC.Tuple.())-    data PredSym0 (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply PredSym0 arg) ~ KindOf (PredSym1 arg) =>-        PredSym0KindInference-    type instance Apply PredSym0 l = PredSym1 l-    type PlusSym2 (t :: Nat) (t :: Nat) = Plus t t-    instance SuppressUnusedWarnings PlusSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) PlusSym1KindInference GHC.Tuple.())-    data PlusSym1 (l :: Nat) (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply (PlusSym1 l) arg) ~ KindOf (PlusSym2 l arg) =>-        PlusSym1KindInference-    type instance Apply (PlusSym1 l) l = PlusSym2 l l-    instance SuppressUnusedWarnings PlusSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) PlusSym0KindInference GHC.Tuple.())-    data PlusSym0 (l :: TyFun Nat (TyFun Nat Nat -> *))-      = forall arg. KindOf (Apply PlusSym0 arg) ~ KindOf (PlusSym1 arg) =>-        PlusSym0KindInference-    type instance Apply PlusSym0 l = PlusSym1 l-    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)-    sPred :: forall (t :: Nat). Sing t -> Sing (Apply PredSym0 t)-    sPlus ::-      forall (t :: Nat) (t :: Nat).-      Sing t -> Sing t -> Sing (Apply (Apply PlusSym0 t) t)-    sPred SZero-      = let-          lambda :: t ~ ZeroSym0 => Sing (Apply PredSym0 ZeroSym0)-          lambda = SZero-        in lambda-    sPred (SSucc sN)-      = let-          lambda ::-            forall n. t ~ Apply SuccSym0 n =>-            Sing n -> Sing (Apply PredSym0 (Apply SuccSym0 n))-          lambda n = n-        in lambda sN-    sPlus SZero sM-      = let-          lambda ::-            forall m. (t ~ ZeroSym0, t ~ m) =>-            Sing m -> Sing (Apply (Apply PlusSym0 ZeroSym0) m)-          lambda m = m-        in lambda sM-    sPlus (SSucc sN) sM-      = let-          lambda ::-            forall n m. (t ~ Apply SuccSym0 n, t ~ m) =>-            Sing n-            -> Sing m -> Sing (Apply (Apply PlusSym0 (Apply SuccSym0 n)) m)-          lambda n m-            = applySing-                (singFun1 (Proxy :: Proxy SuccSym0) SSucc)-                (applySing-                   (applySing (singFun2 (Proxy :: Proxy PlusSym0) sPlus) n) m)-        in lambda sN sM-    data instance Sing (z :: Nat)-      = z ~ Zero => SZero |-        forall (n :: Nat). z ~ Succ n => SSucc (Sing n)-    type SNat (z :: Nat) = Sing z-    instance SingKind (KProxy :: KProxy Nat) where-      type DemoteRep (KProxy :: KProxy Nat) = Nat-      fromSing SZero = Zero-      fromSing (SSucc b) = Succ (fromSing b)-      toSing Zero = SomeSing SZero-      toSing (Succ b)-        = case toSing b :: SomeSing (KProxy :: KProxy Nat) of {-            SomeSing c -> SomeSing (SSucc c) }-    instance SEq (KProxy :: KProxy Nat) where-      (%:==) SZero SZero = STrue-      (%:==) SZero (SSucc _) = SFalse-      (%:==) (SSucc _) SZero = SFalse-      (%:==) (SSucc a) (SSucc b) = (%:==) a b-    instance SDecide (KProxy :: KProxy Nat) where-      (%~) SZero SZero = Proved Refl-      (%~) SZero (SSucc _)-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) (SSucc _) SZero-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) (SSucc a) (SSucc b)-        = case (%~) a b of {-            Proved Refl -> Proved Refl-            Disproved contra-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl }) }-    instance SingI Zero where-      sing = SZero-    instance SingI n => SingI (Succ (n :: Nat)) where-      sing = SSucc sing
+ tests/compile-and-dump/Singletons/Operators.ghc710.template view
@@ -0,0 +1,125 @@+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 = FLeaf | :+: 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 (:+:$$$) (t :: Foo) (t :: Foo) = (:+:) t t+    instance SuppressUnusedWarnings (:+:$$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:+:$$###) GHC.Tuple.())+    data (:+:$$) (l :: Foo) (l :: TyFun Foo Foo)+      = forall arg. KindOf (Apply ((:+:$$) l) arg) ~ KindOf ((:+:$$$) l arg) =>+        :+:$$###+    type instance Apply ((:+:$$) l) l = (:+:$$$) l l+    instance SuppressUnusedWarnings (:+:$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:+:$###) GHC.Tuple.())+    data (:+:$) (l :: TyFun Foo (TyFun Foo Foo -> *))+      = forall arg. KindOf (Apply (:+:$) arg) ~ KindOf ((:+:$$) arg) =>+        :+:$###+    type instance Apply (:+:$) l = (:+:$$) l+    type (:+$$$) (t :: Nat) (t :: Nat) = (:+) t t+    instance SuppressUnusedWarnings (:+$$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:+$$###) GHC.Tuple.())+    data (:+$$) (l :: Nat) (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply ((:+$$) l) arg) ~ KindOf ((:+$$$) l arg) =>+        :+$$###+    type instance Apply ((:+$$) l) l = (:+$$$) l l+    instance SuppressUnusedWarnings (:+$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:+$###) GHC.Tuple.())+    data (:+$) (l :: TyFun Nat (TyFun Nat Nat -> *))+      = forall arg. KindOf (Apply (:+$) arg) ~ KindOf ((:+$$) arg) =>+        :+$###+    type instance Apply (:+$) l = (:+$$) l+    type ChildSym1 (t :: Foo) = Child t+    instance SuppressUnusedWarnings ChildSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) ChildSym0KindInference GHC.Tuple.())+    data ChildSym0 (l :: TyFun Foo Foo)+      = forall arg. KindOf (Apply ChildSym0 arg) ~ KindOf (ChildSym1 arg) =>+        ChildSym0KindInference+    type instance Apply ChildSym0 l = ChildSym1 l+    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 _z_0123456789) = 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+      = let+          lambda ::+            forall m. (t ~ ZeroSym0, t ~ m) =>+            Sing m -> Sing (Apply (Apply (:+$) ZeroSym0) m :: Nat)+          lambda m = m+        in lambda sM+    (%:+) (SSucc sN) sM+      = let+          lambda ::+            forall n m. (t ~ Apply SuccSym0 n, t ~ m) =>+            Sing n+            -> Sing m -> Sing (Apply (Apply (:+$) (Apply SuccSym0 n)) m :: Nat)+          lambda n m+            = applySing+                (singFun1 (Proxy :: Proxy SuccSym0) SSucc)+                (applySing (applySing (singFun2 (Proxy :: Proxy (:+$)) (%:+)) n) m)+        in lambda sN sM+    sChild SFLeaf+      = let+          lambda :: t ~ FLeafSym0 => Sing (Apply ChildSym0 FLeafSym0 :: Foo)+          lambda = SFLeaf+        in lambda+    sChild ((:%+:) sA _s_z_0123456789)+      = let+          lambda ::+            forall a _z_0123456789. t ~ Apply (Apply (:+:$) a) _z_0123456789 =>+            Sing a+            -> Sing _z_0123456789+               -> Sing (Apply ChildSym0 (Apply (Apply (:+:$) a) _z_0123456789) :: Foo)+          lambda a _z_0123456789 = a+        in lambda sA _s_z_0123456789+    data instance Sing (z :: Foo)+      = z ~ FLeaf => SFLeaf |+        forall (n :: Foo) (n :: Foo). z ~ (:+:) n n =>+        :%+: (Sing (n :: Foo)) (Sing (n :: Foo))+    type SFoo = (Sing :: Foo -> *)+    instance SingKind (KProxy :: KProxy Foo) where+      type DemoteRep (KProxy :: KProxy Foo) = Foo+      fromSing SFLeaf = FLeaf+      fromSing ((:%+:) b b) = (:+:) (fromSing b) (fromSing b)+      toSing FLeaf = SomeSing SFLeaf+      toSing ((:+:) b b)+        = case+              GHC.Tuple.(,)+                (toSing b :: SomeSing (KProxy :: KProxy Foo))+                (toSing b :: SomeSing (KProxy :: KProxy Foo))+          of {+            GHC.Tuple.(,) (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
− tests/compile-and-dump/Singletons/Operators.ghc78.template
@@ -1,122 +0,0 @@-Singletons/Operators.hs: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 |]-  ======>-    Singletons/Operators.hs:(0,0)-(0,0)-    data Foo = FLeaf | (:+:) 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 (:+:$$$) (t :: Foo) (t :: Foo) = (:+:) t t-    instance SuppressUnusedWarnings (:+:$$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:+:$$###) GHC.Tuple.())-    data (:+:$$) (l :: Foo) (l :: TyFun Foo Foo)-      = forall arg. KindOf (Apply ((:+:$$) l) arg) ~ KindOf ((:+:$$$) l arg) =>-        (:+:$$###)-    type instance Apply ((:+:$$) l) l = (:+:$$$) l l-    instance SuppressUnusedWarnings (:+:$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:+:$###) GHC.Tuple.())-    data (:+:$) (l :: TyFun Foo (TyFun Foo Foo -> *))-      = forall arg. KindOf (Apply (:+:$) arg) ~ KindOf ((:+:$$) arg) =>-        (:+:$###)-    type instance Apply (:+:$) l = (:+:$$) l-    type (:+$$$) (t :: Nat) (t :: Nat) = (:+) t t-    instance SuppressUnusedWarnings (:+$$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:+$$###) GHC.Tuple.())-    data (:+$$) (l :: Nat) (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply ((:+$$) l) arg) ~ KindOf ((:+$$$) l arg) =>-        (:+$$###)-    type instance Apply ((:+$$) l) l = (:+$$$) l l-    instance SuppressUnusedWarnings (:+$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:+$###) GHC.Tuple.())-    data (:+$) (l :: TyFun Nat (TyFun Nat Nat -> *))-      = forall arg. KindOf (Apply (:+$) arg) ~ KindOf ((:+$$) arg) =>-        (:+$###)-    type instance Apply (:+$) l = (:+$$) l-    type ChildSym1 (t :: Foo) = Child t-    instance SuppressUnusedWarnings ChildSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) ChildSym0KindInference GHC.Tuple.())-    data ChildSym0 (l :: TyFun Foo Foo)-      = forall arg. KindOf (Apply ChildSym0 arg) ~ KindOf (ChildSym1 arg) =>-        ChildSym0KindInference-    type instance Apply ChildSym0 l = ChildSym1 l-    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 z) = a-    (%:+) ::-      forall (t :: Nat) (t :: Nat).-      Sing t -> Sing t -> Sing (Apply (Apply (:+$) t) t)-    sChild :: forall (t :: Foo). Sing t -> Sing (Apply ChildSym0 t)-    (%:+) SZero sM-      = let-          lambda ::-            forall m. (t ~ ZeroSym0, t ~ m) =>-            Sing m -> Sing (Apply (Apply (:+$) ZeroSym0) m)-          lambda m = m-        in lambda sM-    (%:+) (SSucc sN) sM-      = let-          lambda ::-            forall n m. (t ~ Apply SuccSym0 n, t ~ m) =>-            Sing n -> Sing m -> Sing (Apply (Apply (:+$) (Apply SuccSym0 n)) m)-          lambda n m-            = applySing-                (singFun1 (Proxy :: Proxy SuccSym0) SSucc)-                (applySing (applySing (singFun2 (Proxy :: Proxy (:+$)) (%:+)) n) m)-        in lambda sN sM-    sChild SFLeaf-      = let-          lambda :: t ~ FLeafSym0 => Sing (Apply ChildSym0 FLeafSym0)-          lambda = SFLeaf-        in lambda-    sChild ((:%+:) sA _)-      = let-          lambda ::-            forall a wild. t ~ Apply (Apply (:+:$) a) wild =>-            Sing a -> Sing (Apply ChildSym0 (Apply (Apply (:+:$) a) wild))-          lambda a = a-        in lambda sA-    data instance Sing (z :: Foo)-      = z ~ FLeaf => SFLeaf |-        forall (n :: Foo) (n :: Foo). z ~ (:+:) n n =>-        (:%+:) (Sing n) (Sing n)-    type SFoo (z :: Foo) = Sing z-    instance SingKind (KProxy :: KProxy Foo) where-      type DemoteRep (KProxy :: KProxy Foo) = Foo-      fromSing SFLeaf = FLeaf-      fromSing ((:%+:) b b) = (:+:) (fromSing b) (fromSing b)-      toSing FLeaf = SomeSing SFLeaf-      toSing ((:+:) b b)-        = case-              GHC.Tuple.(,)-                (toSing b :: SomeSing (KProxy :: KProxy Foo))-                (toSing b :: SomeSing (KProxy :: KProxy Foo))-          of {-            GHC.Tuple.(,) (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
+ tests/compile-and-dump/Singletons/OrdDeriving.ghc710.template view
@@ -0,0 +1,2830 @@+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 family Equals_0123456789 (a :: Nat) (b :: Nat) :: Bool where+      Equals_0123456789 Zero Zero = TrueSym0+      Equals_0123456789 (Succ a) (Succ b) = (:==) a b+      Equals_0123456789 (a :: Nat) (b :: Nat) = FalseSym0+    instance PEq (KProxy :: KProxy Nat) where+      type (:==) (a :: Nat) (b :: Nat) = Equals_0123456789 a b+    type ZeroSym0 = Zero+    type SuccSym1 (t :: Nat) = Succ t+    instance SuppressUnusedWarnings SuccSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) SuccSym0KindInference GHC.Tuple.())+    data SuccSym0 (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply SuccSym0 arg) ~ KindOf (SuccSym1 arg) =>+        SuccSym0KindInference+    type instance Apply SuccSym0 l = SuccSym1 l+    type family Equals_0123456789 (a :: Foo k k k k)+                                  (b :: Foo k k k k) :: Bool where+      Equals_0123456789 (A a a a a) (A b b b b) = (:&&) ((:==) a b) ((:&&) ((:==) a b) ((:&&) ((:==) a b) ((:==) a b)))+      Equals_0123456789 (B a a a a) (B b b b b) = (:&&) ((:==) a b) ((:&&) ((:==) a b) ((:&&) ((:==) a b) ((:==) a b)))+      Equals_0123456789 (C a a a a) (C b b b b) = (:&&) ((:==) a b) ((:&&) ((:==) a b) ((:&&) ((:==) a b) ((:==) a b)))+      Equals_0123456789 (D a a a a) (D b b b b) = (:&&) ((:==) a b) ((:&&) ((:==) a b) ((:&&) ((:==) a b) ((:==) a b)))+      Equals_0123456789 (E a a a a) (E b b b b) = (:&&) ((:==) a b) ((:&&) ((:==) a b) ((:&&) ((:==) a b) ((:==) a b)))+      Equals_0123456789 (F a a a a) (F b b b b) = (:&&) ((:==) a b) ((:&&) ((:==) a b) ((:&&) ((:==) a b) ((:==) a b)))+      Equals_0123456789 (a :: Foo k k k k) (b :: Foo k k k k) = FalseSym0+    instance PEq (KProxy :: KProxy (Foo k k k k)) where+      type (:==) (a :: Foo k k k k) (b :: Foo k k k k) = Equals_0123456789 a b+    type ASym4 (t :: a) (t :: b) (t :: c) (t :: d) = A t t t t+    instance SuppressUnusedWarnings ASym3 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) ASym3KindInference GHC.Tuple.())+    data ASym3 (l :: a) (l :: b) (l :: c) (l :: TyFun d (Foo a b c d))+      = forall arg. KindOf (Apply (ASym3 l l l) arg) ~ KindOf (ASym4 l l l arg) =>+        ASym3KindInference+    type instance Apply (ASym3 l l l) l = ASym4 l l l l+    instance SuppressUnusedWarnings ASym2 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) ASym2KindInference GHC.Tuple.())+    data ASym2 (l :: a)+               (l :: b)+               (l :: TyFun c (TyFun d (Foo a b c d) -> *))+      = forall arg. KindOf (Apply (ASym2 l l) arg) ~ KindOf (ASym3 l l arg) =>+        ASym2KindInference+    type instance Apply (ASym2 l l) l = ASym3 l l l+    instance SuppressUnusedWarnings ASym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) ASym1KindInference GHC.Tuple.())+    data ASym1 (l :: a)+               (l :: TyFun b (TyFun c (TyFun d (Foo a b c d) -> *) -> *))+      = forall arg. KindOf (Apply (ASym1 l) arg) ~ KindOf (ASym2 l arg) =>+        ASym1KindInference+    type instance Apply (ASym1 l) l = ASym2 l l+    instance SuppressUnusedWarnings ASym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) ASym0KindInference GHC.Tuple.())+    data ASym0 (l :: TyFun a (TyFun b (TyFun c (TyFun d (Foo a b c d)+                                                -> *)+                                       -> *)+                              -> *))+      = forall arg. KindOf (Apply ASym0 arg) ~ KindOf (ASym1 arg) =>+        ASym0KindInference+    type instance Apply ASym0 l = ASym1 l+    type BSym4 (t :: a) (t :: b) (t :: c) (t :: d) = B t t t t+    instance SuppressUnusedWarnings BSym3 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) BSym3KindInference GHC.Tuple.())+    data BSym3 (l :: a) (l :: b) (l :: c) (l :: TyFun d (Foo a b c d))+      = forall arg. KindOf (Apply (BSym3 l l l) arg) ~ KindOf (BSym4 l l l arg) =>+        BSym3KindInference+    type instance Apply (BSym3 l l l) l = BSym4 l l l l+    instance SuppressUnusedWarnings BSym2 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) BSym2KindInference GHC.Tuple.())+    data BSym2 (l :: a)+               (l :: b)+               (l :: TyFun c (TyFun d (Foo a b c d) -> *))+      = forall arg. KindOf (Apply (BSym2 l l) arg) ~ KindOf (BSym3 l l arg) =>+        BSym2KindInference+    type instance Apply (BSym2 l l) l = BSym3 l l l+    instance SuppressUnusedWarnings BSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) BSym1KindInference GHC.Tuple.())+    data BSym1 (l :: a)+               (l :: TyFun b (TyFun c (TyFun d (Foo a b c d) -> *) -> *))+      = forall arg. KindOf (Apply (BSym1 l) arg) ~ KindOf (BSym2 l arg) =>+        BSym1KindInference+    type instance Apply (BSym1 l) l = BSym2 l l+    instance SuppressUnusedWarnings BSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) BSym0KindInference GHC.Tuple.())+    data BSym0 (l :: TyFun a (TyFun b (TyFun c (TyFun d (Foo a b c d)+                                                -> *)+                                       -> *)+                              -> *))+      = forall arg. KindOf (Apply BSym0 arg) ~ KindOf (BSym1 arg) =>+        BSym0KindInference+    type instance Apply BSym0 l = BSym1 l+    type CSym4 (t :: a) (t :: b) (t :: c) (t :: d) = C t t t t+    instance SuppressUnusedWarnings CSym3 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) CSym3KindInference GHC.Tuple.())+    data CSym3 (l :: a) (l :: b) (l :: c) (l :: TyFun d (Foo a b c d))+      = forall arg. KindOf (Apply (CSym3 l l l) arg) ~ KindOf (CSym4 l l l arg) =>+        CSym3KindInference+    type instance Apply (CSym3 l l l) l = CSym4 l l l l+    instance SuppressUnusedWarnings CSym2 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) CSym2KindInference GHC.Tuple.())+    data CSym2 (l :: a)+               (l :: b)+               (l :: TyFun c (TyFun d (Foo a b c d) -> *))+      = forall arg. KindOf (Apply (CSym2 l l) arg) ~ KindOf (CSym3 l l arg) =>+        CSym2KindInference+    type instance Apply (CSym2 l l) l = CSym3 l l l+    instance SuppressUnusedWarnings CSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) CSym1KindInference GHC.Tuple.())+    data CSym1 (l :: a)+               (l :: TyFun b (TyFun c (TyFun d (Foo a b c d) -> *) -> *))+      = forall arg. KindOf (Apply (CSym1 l) arg) ~ KindOf (CSym2 l arg) =>+        CSym1KindInference+    type instance Apply (CSym1 l) l = CSym2 l l+    instance SuppressUnusedWarnings CSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) CSym0KindInference GHC.Tuple.())+    data CSym0 (l :: TyFun a (TyFun b (TyFun c (TyFun d (Foo a b c d)+                                                -> *)+                                       -> *)+                              -> *))+      = forall arg. KindOf (Apply CSym0 arg) ~ KindOf (CSym1 arg) =>+        CSym0KindInference+    type instance Apply CSym0 l = CSym1 l+    type DSym4 (t :: a) (t :: b) (t :: c) (t :: d) = D t t t t+    instance SuppressUnusedWarnings DSym3 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) DSym3KindInference GHC.Tuple.())+    data DSym3 (l :: a) (l :: b) (l :: c) (l :: TyFun d (Foo a b c d))+      = forall arg. KindOf (Apply (DSym3 l l l) arg) ~ KindOf (DSym4 l l l arg) =>+        DSym3KindInference+    type instance Apply (DSym3 l l l) l = DSym4 l l l l+    instance SuppressUnusedWarnings DSym2 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) DSym2KindInference GHC.Tuple.())+    data DSym2 (l :: a)+               (l :: b)+               (l :: TyFun c (TyFun d (Foo a b c d) -> *))+      = forall arg. KindOf (Apply (DSym2 l l) arg) ~ KindOf (DSym3 l l arg) =>+        DSym2KindInference+    type instance Apply (DSym2 l l) l = DSym3 l l l+    instance SuppressUnusedWarnings DSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) DSym1KindInference GHC.Tuple.())+    data DSym1 (l :: a)+               (l :: TyFun b (TyFun c (TyFun d (Foo a b c d) -> *) -> *))+      = forall arg. KindOf (Apply (DSym1 l) arg) ~ KindOf (DSym2 l arg) =>+        DSym1KindInference+    type instance Apply (DSym1 l) l = DSym2 l l+    instance SuppressUnusedWarnings DSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) DSym0KindInference GHC.Tuple.())+    data DSym0 (l :: TyFun a (TyFun b (TyFun c (TyFun d (Foo a b c d)+                                                -> *)+                                       -> *)+                              -> *))+      = forall arg. KindOf (Apply DSym0 arg) ~ KindOf (DSym1 arg) =>+        DSym0KindInference+    type instance Apply DSym0 l = DSym1 l+    type ESym4 (t :: a) (t :: b) (t :: c) (t :: d) = E t t t t+    instance SuppressUnusedWarnings ESym3 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) ESym3KindInference GHC.Tuple.())+    data ESym3 (l :: a) (l :: b) (l :: c) (l :: TyFun d (Foo a b c d))+      = forall arg. KindOf (Apply (ESym3 l l l) arg) ~ KindOf (ESym4 l l l arg) =>+        ESym3KindInference+    type instance Apply (ESym3 l l l) l = ESym4 l l l l+    instance SuppressUnusedWarnings ESym2 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) ESym2KindInference GHC.Tuple.())+    data ESym2 (l :: a)+               (l :: b)+               (l :: TyFun c (TyFun d (Foo a b c d) -> *))+      = forall arg. KindOf (Apply (ESym2 l l) arg) ~ KindOf (ESym3 l l arg) =>+        ESym2KindInference+    type instance Apply (ESym2 l l) l = ESym3 l l l+    instance SuppressUnusedWarnings ESym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) ESym1KindInference GHC.Tuple.())+    data ESym1 (l :: a)+               (l :: TyFun b (TyFun c (TyFun d (Foo a b c d) -> *) -> *))+      = forall arg. KindOf (Apply (ESym1 l) arg) ~ KindOf (ESym2 l arg) =>+        ESym1KindInference+    type instance Apply (ESym1 l) l = ESym2 l l+    instance SuppressUnusedWarnings ESym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) ESym0KindInference GHC.Tuple.())+    data ESym0 (l :: TyFun a (TyFun b (TyFun c (TyFun d (Foo a b c d)+                                                -> *)+                                       -> *)+                              -> *))+      = forall arg. KindOf (Apply ESym0 arg) ~ KindOf (ESym1 arg) =>+        ESym0KindInference+    type instance Apply ESym0 l = ESym1 l+    type FSym4 (t :: a) (t :: b) (t :: c) (t :: d) = F t t t t+    instance SuppressUnusedWarnings FSym3 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) FSym3KindInference GHC.Tuple.())+    data FSym3 (l :: a) (l :: b) (l :: c) (l :: TyFun d (Foo a b c d))+      = forall arg. KindOf (Apply (FSym3 l l l) arg) ~ KindOf (FSym4 l l l arg) =>+        FSym3KindInference+    type instance Apply (FSym3 l l l) l = FSym4 l l l l+    instance SuppressUnusedWarnings FSym2 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) FSym2KindInference GHC.Tuple.())+    data FSym2 (l :: a)+               (l :: b)+               (l :: TyFun c (TyFun d (Foo a b c d) -> *))+      = forall arg. KindOf (Apply (FSym2 l l) arg) ~ KindOf (FSym3 l l arg) =>+        FSym2KindInference+    type instance Apply (FSym2 l l) l = FSym3 l l l+    instance SuppressUnusedWarnings FSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) FSym1KindInference GHC.Tuple.())+    data FSym1 (l :: a)+               (l :: TyFun b (TyFun c (TyFun d (Foo a b c d) -> *) -> *))+      = forall arg. KindOf (Apply (FSym1 l) arg) ~ KindOf (FSym2 l arg) =>+        FSym1KindInference+    type instance Apply (FSym1 l) l = FSym2 l l+    instance SuppressUnusedWarnings FSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) FSym0KindInference GHC.Tuple.())+    data FSym0 (l :: TyFun a (TyFun b (TyFun c (TyFun d (Foo a b c d)+                                                -> *)+                                       -> *)+                              -> *))+      = forall arg. KindOf (Apply FSym0 arg) ~ KindOf (FSym1 arg) =>+        FSym0KindInference+    type instance Apply FSym0 l = FSym1 l+    type family Compare_0123456789 (a :: Nat)+                                   (a :: Nat) :: Ordering where+      Compare_0123456789 Zero Zero = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) '[]+      Compare_0123456789 (Succ a_0123456789) (Succ b_0123456789) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) '[])+      Compare_0123456789 Zero (Succ _z_0123456789) = LTSym0+      Compare_0123456789 (Succ _z_0123456789) Zero = GTSym0+    type Compare_0123456789Sym2 (t :: Nat) (t :: Nat) =+        Compare_0123456789 t t+    instance SuppressUnusedWarnings Compare_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Compare_0123456789Sym1KindInference GHC.Tuple.())+    data Compare_0123456789Sym1 (l :: Nat) (l :: TyFun Nat Ordering)+      = forall arg. KindOf (Apply (Compare_0123456789Sym1 l) arg) ~ KindOf (Compare_0123456789Sym2 l arg) =>+        Compare_0123456789Sym1KindInference+    type instance Apply (Compare_0123456789Sym1 l) l = Compare_0123456789Sym2 l l+    instance SuppressUnusedWarnings Compare_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Compare_0123456789Sym0KindInference GHC.Tuple.())+    data Compare_0123456789Sym0 (l :: TyFun Nat (TyFun Nat Ordering+                                                 -> *))+      = forall arg. KindOf (Apply Compare_0123456789Sym0 arg) ~ KindOf (Compare_0123456789Sym1 arg) =>+        Compare_0123456789Sym0KindInference+    type instance Apply Compare_0123456789Sym0 l = Compare_0123456789Sym1 l+    instance POrd (KProxy :: KProxy Nat) where+      type Compare (a :: Nat) (a :: Nat) = Apply (Apply Compare_0123456789Sym0 a) a+    type family Compare_0123456789 (a :: Foo a b c d)+                                   (a :: Foo a b c d) :: Ordering where+      Compare_0123456789 (A a_0123456789 a_0123456789 a_0123456789 a_0123456789) (A b_0123456789 b_0123456789 b_0123456789 b_0123456789) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) '[]))))+      Compare_0123456789 (B a_0123456789 a_0123456789 a_0123456789 a_0123456789) (B b_0123456789 b_0123456789 b_0123456789 b_0123456789) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) '[]))))+      Compare_0123456789 (C a_0123456789 a_0123456789 a_0123456789 a_0123456789) (C b_0123456789 b_0123456789 b_0123456789 b_0123456789) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) '[]))))+      Compare_0123456789 (D a_0123456789 a_0123456789 a_0123456789 a_0123456789) (D b_0123456789 b_0123456789 b_0123456789 b_0123456789) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) '[]))))+      Compare_0123456789 (E a_0123456789 a_0123456789 a_0123456789 a_0123456789) (E b_0123456789 b_0123456789 b_0123456789 b_0123456789) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) '[]))))+      Compare_0123456789 (F a_0123456789 a_0123456789 a_0123456789 a_0123456789) (F b_0123456789 b_0123456789 b_0123456789 b_0123456789) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) '[]))))+      Compare_0123456789 (A _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (B _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = LTSym0+      Compare_0123456789 (A _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (C _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = LTSym0+      Compare_0123456789 (A _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (D _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = LTSym0+      Compare_0123456789 (A _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (E _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = LTSym0+      Compare_0123456789 (A _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (F _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = LTSym0+      Compare_0123456789 (B _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (A _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = GTSym0+      Compare_0123456789 (B _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (C _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = LTSym0+      Compare_0123456789 (B _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (D _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = LTSym0+      Compare_0123456789 (B _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (E _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = LTSym0+      Compare_0123456789 (B _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (F _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = LTSym0+      Compare_0123456789 (C _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (A _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = GTSym0+      Compare_0123456789 (C _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (B _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = GTSym0+      Compare_0123456789 (C _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (D _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = LTSym0+      Compare_0123456789 (C _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (E _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = LTSym0+      Compare_0123456789 (C _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (F _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = LTSym0+      Compare_0123456789 (D _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (A _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = GTSym0+      Compare_0123456789 (D _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (B _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = GTSym0+      Compare_0123456789 (D _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (C _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = GTSym0+      Compare_0123456789 (D _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (E _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = LTSym0+      Compare_0123456789 (D _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (F _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = LTSym0+      Compare_0123456789 (E _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (A _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = GTSym0+      Compare_0123456789 (E _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (B _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = GTSym0+      Compare_0123456789 (E _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (C _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = GTSym0+      Compare_0123456789 (E _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (D _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = GTSym0+      Compare_0123456789 (E _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (F _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = LTSym0+      Compare_0123456789 (F _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (A _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = GTSym0+      Compare_0123456789 (F _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (B _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = GTSym0+      Compare_0123456789 (F _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (C _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = GTSym0+      Compare_0123456789 (F _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (D _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = GTSym0+      Compare_0123456789 (F _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) (E _z_0123456789 _z_0123456789 _z_0123456789 _z_0123456789) = GTSym0+    type Compare_0123456789Sym2 (t :: Foo a b c d) (t :: Foo a b c d) =+        Compare_0123456789 t t+    instance SuppressUnusedWarnings Compare_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Compare_0123456789Sym1KindInference GHC.Tuple.())+    data Compare_0123456789Sym1 (l :: Foo a b c d)+                                (l :: TyFun (Foo a b c d) Ordering)+      = forall arg. KindOf (Apply (Compare_0123456789Sym1 l) arg) ~ KindOf (Compare_0123456789Sym2 l arg) =>+        Compare_0123456789Sym1KindInference+    type instance Apply (Compare_0123456789Sym1 l) l = Compare_0123456789Sym2 l l+    instance SuppressUnusedWarnings Compare_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Compare_0123456789Sym0KindInference GHC.Tuple.())+    data Compare_0123456789Sym0 (l :: TyFun (Foo a b c d) (TyFun (Foo a b c d) Ordering+                                                           -> *))+      = forall arg. KindOf (Apply Compare_0123456789Sym0 arg) ~ KindOf (Compare_0123456789Sym1 arg) =>+        Compare_0123456789Sym0KindInference+    type instance Apply Compare_0123456789Sym0 l = Compare_0123456789Sym1 l+    instance POrd (KProxy :: KProxy (Foo a b c d)) where+      type Compare (a :: Foo a b c d) (a :: Foo a b c d) = Apply (Apply Compare_0123456789Sym0 a) a+    data instance Sing (z :: Nat)+      = z ~ Zero => SZero |+        forall (n :: Nat). z ~ Succ n => SSucc (Sing (n :: Nat))+    type SNat = (Sing :: Nat -> *)+    instance SingKind (KProxy :: KProxy Nat) where+      type DemoteRep (KProxy :: KProxy Nat) = Nat+      fromSing SZero = Zero+      fromSing (SSucc b) = Succ (fromSing b)+      toSing Zero = SomeSing SZero+      toSing (Succ b)+        = case toSing b :: SomeSing (KProxy :: KProxy Nat) of {+            SomeSing c -> SomeSing (SSucc c) }+    instance SEq (KProxy :: KProxy Nat) where+      (%:==) SZero SZero = STrue+      (%:==) SZero (SSucc _) = SFalse+      (%:==) (SSucc _) SZero = SFalse+      (%:==) (SSucc a) (SSucc b) = (%:==) a b+    instance SDecide (KProxy :: KProxy Nat) where+      (%~) SZero SZero = Proved Refl+      (%~) SZero (SSucc _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SSucc _) SZero+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SSucc a) (SSucc b)+        = case (%~) a b of {+            Proved Refl -> Proved Refl+            Disproved contra+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl }) }+    data instance Sing (z :: Foo a b c d)+      = forall (n :: a) (n :: b) (n :: c) (n :: d). z ~ A n n n n =>+        SA (Sing (n :: a)) (Sing (n :: b)) (Sing (n :: c)) (Sing (n :: d)) |+        forall (n :: a) (n :: b) (n :: c) (n :: d). z ~ B n n n n =>+        SB (Sing (n :: a)) (Sing (n :: b)) (Sing (n :: c)) (Sing (n :: d)) |+        forall (n :: a) (n :: b) (n :: c) (n :: d). z ~ C n n n n =>+        SC (Sing (n :: a)) (Sing (n :: b)) (Sing (n :: c)) (Sing (n :: d)) |+        forall (n :: a) (n :: b) (n :: c) (n :: d). z ~ D n n n n =>+        SD (Sing (n :: a)) (Sing (n :: b)) (Sing (n :: c)) (Sing (n :: d)) |+        forall (n :: a) (n :: b) (n :: c) (n :: d). z ~ E n n n n =>+        SE (Sing (n :: a)) (Sing (n :: b)) (Sing (n :: c)) (Sing (n :: d)) |+        forall (n :: a) (n :: b) (n :: c) (n :: d). z ~ F n n n n =>+        SF (Sing (n :: a)) (Sing (n :: b)) (Sing (n :: c)) (Sing (n :: d))+    type SFoo = (Sing :: Foo a b c d -> *)+    instance (SingKind (KProxy :: KProxy a),+              SingKind (KProxy :: KProxy b),+              SingKind (KProxy :: KProxy c),+              SingKind (KProxy :: KProxy d)) =>+             SingKind (KProxy :: KProxy (Foo a b c d)) where+      type DemoteRep (KProxy :: KProxy (Foo a b c d)) = Foo (DemoteRep (KProxy :: KProxy a)) (DemoteRep (KProxy :: KProxy b)) (DemoteRep (KProxy :: KProxy c)) (DemoteRep (KProxy :: KProxy 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 b b b)+        = case+              GHC.Tuple.(,,,)+                (toSing b :: SomeSing (KProxy :: KProxy a))+                (toSing b :: SomeSing (KProxy :: KProxy b))+                (toSing b :: SomeSing (KProxy :: KProxy c))+                (toSing b :: SomeSing (KProxy :: KProxy d))+          of {+            GHC.Tuple.(,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)+              -> SomeSing (SA c c c c) }+      toSing (B b b b b)+        = case+              GHC.Tuple.(,,,)+                (toSing b :: SomeSing (KProxy :: KProxy a))+                (toSing b :: SomeSing (KProxy :: KProxy b))+                (toSing b :: SomeSing (KProxy :: KProxy c))+                (toSing b :: SomeSing (KProxy :: KProxy d))+          of {+            GHC.Tuple.(,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)+              -> SomeSing (SB c c c c) }+      toSing (C b b b b)+        = case+              GHC.Tuple.(,,,)+                (toSing b :: SomeSing (KProxy :: KProxy a))+                (toSing b :: SomeSing (KProxy :: KProxy b))+                (toSing b :: SomeSing (KProxy :: KProxy c))+                (toSing b :: SomeSing (KProxy :: KProxy d))+          of {+            GHC.Tuple.(,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)+              -> SomeSing (SC c c c c) }+      toSing (D b b b b)+        = case+              GHC.Tuple.(,,,)+                (toSing b :: SomeSing (KProxy :: KProxy a))+                (toSing b :: SomeSing (KProxy :: KProxy b))+                (toSing b :: SomeSing (KProxy :: KProxy c))+                (toSing b :: SomeSing (KProxy :: KProxy d))+          of {+            GHC.Tuple.(,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)+              -> SomeSing (SD c c c c) }+      toSing (E b b b b)+        = case+              GHC.Tuple.(,,,)+                (toSing b :: SomeSing (KProxy :: KProxy a))+                (toSing b :: SomeSing (KProxy :: KProxy b))+                (toSing b :: SomeSing (KProxy :: KProxy c))+                (toSing b :: SomeSing (KProxy :: KProxy d))+          of {+            GHC.Tuple.(,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)+              -> SomeSing (SE c c c c) }+      toSing (F b b b b)+        = case+              GHC.Tuple.(,,,)+                (toSing b :: SomeSing (KProxy :: KProxy a))+                (toSing b :: SomeSing (KProxy :: KProxy b))+                (toSing b :: SomeSing (KProxy :: KProxy c))+                (toSing b :: SomeSing (KProxy :: KProxy d))+          of {+            GHC.Tuple.(,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)+              -> SomeSing (SF c c c c) }+    instance (SEq (KProxy :: KProxy a),+              SEq (KProxy :: KProxy b),+              SEq (KProxy :: KProxy c),+              SEq (KProxy :: KProxy d)) =>+             SEq (KProxy :: KProxy (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 (KProxy :: KProxy a),+              SDecide (KProxy :: KProxy b),+              SDecide (KProxy :: KProxy c),+              SDecide (KProxy :: KProxy d)) =>+             SDecide (KProxy :: KProxy (Foo a b c d)) where+      (%~) (SA a a a a) (SA b b b b)+        = case+              GHC.Tuple.(,,,) ((%~) a b) ((%~) a b) ((%~) a b) ((%~) a b)+          of {+            GHC.Tuple.(,,,) (Proved Refl)+                            (Proved Refl)+                            (Proved Refl)+                            (Proved Refl)+              -> Proved Refl+            GHC.Tuple.(,,,) (Disproved contra) _ _ _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,,,) _ (Disproved contra) _ _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,,,) _ _ (Disproved contra) _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,,,) _ _ _ (Disproved contra)+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl }) }+      (%~) (SA _ _ _ _) (SB _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SA _ _ _ _) (SC _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SA _ _ _ _) (SD _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SA _ _ _ _) (SE _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SA _ _ _ _) (SF _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SB _ _ _ _) (SA _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SB a a a a) (SB b b b b)+        = case+              GHC.Tuple.(,,,) ((%~) a b) ((%~) a b) ((%~) a b) ((%~) a b)+          of {+            GHC.Tuple.(,,,) (Proved Refl)+                            (Proved Refl)+                            (Proved Refl)+                            (Proved Refl)+              -> Proved Refl+            GHC.Tuple.(,,,) (Disproved contra) _ _ _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,,,) _ (Disproved contra) _ _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,,,) _ _ (Disproved contra) _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,,,) _ _ _ (Disproved contra)+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl }) }+      (%~) (SB _ _ _ _) (SC _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SB _ _ _ _) (SD _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SB _ _ _ _) (SE _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SB _ _ _ _) (SF _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SC _ _ _ _) (SA _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SC _ _ _ _) (SB _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SC a a a a) (SC b b b b)+        = case+              GHC.Tuple.(,,,) ((%~) a b) ((%~) a b) ((%~) a b) ((%~) a b)+          of {+            GHC.Tuple.(,,,) (Proved Refl)+                            (Proved Refl)+                            (Proved Refl)+                            (Proved Refl)+              -> Proved Refl+            GHC.Tuple.(,,,) (Disproved contra) _ _ _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,,,) _ (Disproved contra) _ _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,,,) _ _ (Disproved contra) _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,,,) _ _ _ (Disproved contra)+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl }) }+      (%~) (SC _ _ _ _) (SD _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SC _ _ _ _) (SE _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SC _ _ _ _) (SF _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SD _ _ _ _) (SA _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SD _ _ _ _) (SB _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SD _ _ _ _) (SC _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SD a a a a) (SD b b b b)+        = case+              GHC.Tuple.(,,,) ((%~) a b) ((%~) a b) ((%~) a b) ((%~) a b)+          of {+            GHC.Tuple.(,,,) (Proved Refl)+                            (Proved Refl)+                            (Proved Refl)+                            (Proved Refl)+              -> Proved Refl+            GHC.Tuple.(,,,) (Disproved contra) _ _ _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,,,) _ (Disproved contra) _ _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,,,) _ _ (Disproved contra) _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,,,) _ _ _ (Disproved contra)+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl }) }+      (%~) (SD _ _ _ _) (SE _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SD _ _ _ _) (SF _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SE _ _ _ _) (SA _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SE _ _ _ _) (SB _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SE _ _ _ _) (SC _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SE _ _ _ _) (SD _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SE a a a a) (SE b b b b)+        = case+              GHC.Tuple.(,,,) ((%~) a b) ((%~) a b) ((%~) a b) ((%~) a b)+          of {+            GHC.Tuple.(,,,) (Proved Refl)+                            (Proved Refl)+                            (Proved Refl)+                            (Proved Refl)+              -> Proved Refl+            GHC.Tuple.(,,,) (Disproved contra) _ _ _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,,,) _ (Disproved contra) _ _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,,,) _ _ (Disproved contra) _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,,,) _ _ _ (Disproved contra)+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl }) }+      (%~) (SE _ _ _ _) (SF _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SF _ _ _ _) (SA _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SF _ _ _ _) (SB _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SF _ _ _ _) (SC _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SF _ _ _ _) (SD _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SF _ _ _ _) (SE _ _ _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SF a a a a) (SF b b b b)+        = case+              GHC.Tuple.(,,,) ((%~) a b) ((%~) a b) ((%~) a b) ((%~) a b)+          of {+            GHC.Tuple.(,,,) (Proved Refl)+                            (Proved Refl)+                            (Proved Refl)+                            (Proved Refl)+              -> Proved Refl+            GHC.Tuple.(,,,) (Disproved contra) _ _ _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,,,) _ (Disproved contra) _ _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,,,) _ _ (Disproved contra) _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,,,) _ _ _ (Disproved contra)+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl }) }+    instance SOrd (KProxy :: KProxy Nat) =>+             SOrd (KProxy :: KProxy Nat) where+      sCompare ::+        forall (t0 :: Nat) (t1 :: Nat).+        Sing t0+        -> Sing t1+           -> Sing (Apply (Apply (CompareSym0 :: TyFun Nat (TyFun Nat Ordering+                                                            -> *)+                                                 -> *) t0 :: TyFun Nat Ordering+                                                             -> *) t1 :: Ordering)+      sCompare SZero SZero+        = let+            lambda ::+              (t0 ~ ZeroSym0, t1 ~ ZeroSym0) =>+              Sing (Apply (Apply CompareSym0 ZeroSym0) ZeroSym0 :: Ordering)+            lambda+              = applySing+                  (applySing+                     (applySing+                        (singFun3 (Proxy :: Proxy FoldlSym0) sFoldl)+                        (singFun2 (Proxy :: Proxy ThenCmpSym0) sThenCmp))+                     SEQ)+                  SNil+          in lambda+      sCompare (SSucc sA_0123456789) (SSucc sB_0123456789)+        = let+            lambda ::+              forall a_0123456789+                     b_0123456789. (t0 ~ Apply SuccSym0 a_0123456789,+                                    t1 ~ Apply SuccSym0 b_0123456789) =>+              Sing a_0123456789+              -> Sing b_0123456789+                 -> Sing (Apply (Apply CompareSym0 (Apply SuccSym0 a_0123456789)) (Apply SuccSym0 b_0123456789) :: Ordering)+            lambda a_0123456789 b_0123456789+              = applySing+                  (applySing+                     (applySing+                        (singFun3 (Proxy :: Proxy FoldlSym0) sFoldl)+                        (singFun2 (Proxy :: Proxy ThenCmpSym0) sThenCmp))+                     SEQ)+                  (applySing+                     (applySing+                        (singFun2 (Proxy :: Proxy (:$)) SCons)+                        (applySing+                           (applySing+                              (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                           b_0123456789))+                     SNil)+          in lambda sA_0123456789 sB_0123456789+      sCompare SZero (SSucc _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789. (t0 ~ ZeroSym0,+                                     t1 ~ Apply SuccSym0 _z_0123456789) =>+              Sing _z_0123456789+              -> Sing (Apply (Apply CompareSym0 ZeroSym0) (Apply SuccSym0 _z_0123456789) :: Ordering)+            lambda _z_0123456789 = SLT+          in lambda _s_z_0123456789+      sCompare (SSucc _s_z_0123456789) SZero+        = let+            lambda ::+              forall _z_0123456789. (t0 ~ Apply SuccSym0 _z_0123456789,+                                     t1 ~ ZeroSym0) =>+              Sing _z_0123456789+              -> Sing (Apply (Apply CompareSym0 (Apply SuccSym0 _z_0123456789)) ZeroSym0 :: Ordering)+            lambda _z_0123456789 = SGT+          in lambda _s_z_0123456789+    instance (SOrd (KProxy :: KProxy a),+              SOrd (KProxy :: KProxy b),+              SOrd (KProxy :: KProxy c),+              SOrd (KProxy :: KProxy d)) =>+             SOrd (KProxy :: KProxy (Foo a b c d)) where+      sCompare ::+        forall (t0 :: Foo a b c d) (t1 :: Foo a b c d).+        Sing t0+        -> Sing t1+           -> Sing (Apply (Apply (CompareSym0 :: TyFun (Foo a b c d) (TyFun (Foo a b c d) Ordering+                                                                      -> *)+                                                 -> *) t0 :: TyFun (Foo a b c d) Ordering+                                                             -> *) t1 :: Ordering)+      sCompare+        (SA sA_0123456789 sA_0123456789 sA_0123456789 sA_0123456789)+        (SA sB_0123456789 sB_0123456789 sB_0123456789 sB_0123456789)+        = let+            lambda ::+              forall a_0123456789+                     a_0123456789+                     a_0123456789+                     a_0123456789+                     b_0123456789+                     b_0123456789+                     b_0123456789+                     b_0123456789. (t0 ~ Apply (Apply (Apply (Apply ASym0 a_0123456789) a_0123456789) a_0123456789) a_0123456789,+                                    t1 ~ Apply (Apply (Apply (Apply ASym0 b_0123456789) b_0123456789) b_0123456789) b_0123456789) =>+              Sing a_0123456789+              -> Sing a_0123456789+                 -> Sing a_0123456789+                    -> Sing a_0123456789+                       -> Sing b_0123456789+                          -> Sing b_0123456789+                             -> Sing b_0123456789+                                -> Sing b_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply ASym0 a_0123456789) a_0123456789) a_0123456789) a_0123456789)) (Apply (Apply (Apply (Apply ASym0 b_0123456789) b_0123456789) b_0123456789) b_0123456789) :: Ordering)+            lambda+              a_0123456789+              a_0123456789+              a_0123456789+              a_0123456789+              b_0123456789+              b_0123456789+              b_0123456789+              b_0123456789+              = applySing+                  (applySing+                     (applySing+                        (singFun3 (Proxy :: Proxy FoldlSym0) sFoldl)+                        (singFun2 (Proxy :: Proxy ThenCmpSym0) sThenCmp))+                     SEQ)+                  (applySing+                     (applySing+                        (singFun2 (Proxy :: Proxy (:$)) SCons)+                        (applySing+                           (applySing+                              (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                           b_0123456789))+                     (applySing+                        (applySing+                           (singFun2 (Proxy :: Proxy (:$)) SCons)+                           (applySing+                              (applySing+                                 (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                              b_0123456789))+                        (applySing+                           (applySing+                              (singFun2 (Proxy :: Proxy (:$)) SCons)+                              (applySing+                                 (applySing+                                    (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                                 b_0123456789))+                           (applySing+                              (applySing+                                 (singFun2 (Proxy :: Proxy (:$)) SCons)+                                 (applySing+                                    (applySing+                                       (singFun2 (Proxy :: Proxy CompareSym0) sCompare)+                                       a_0123456789)+                                    b_0123456789))+                              SNil))))+          in+            lambda+              sA_0123456789+              sA_0123456789+              sA_0123456789+              sA_0123456789+              sB_0123456789+              sB_0123456789+              sB_0123456789+              sB_0123456789+      sCompare+        (SB sA_0123456789 sA_0123456789 sA_0123456789 sA_0123456789)+        (SB sB_0123456789 sB_0123456789 sB_0123456789 sB_0123456789)+        = let+            lambda ::+              forall a_0123456789+                     a_0123456789+                     a_0123456789+                     a_0123456789+                     b_0123456789+                     b_0123456789+                     b_0123456789+                     b_0123456789. (t0 ~ Apply (Apply (Apply (Apply BSym0 a_0123456789) a_0123456789) a_0123456789) a_0123456789,+                                    t1 ~ Apply (Apply (Apply (Apply BSym0 b_0123456789) b_0123456789) b_0123456789) b_0123456789) =>+              Sing a_0123456789+              -> Sing a_0123456789+                 -> Sing a_0123456789+                    -> Sing a_0123456789+                       -> Sing b_0123456789+                          -> Sing b_0123456789+                             -> Sing b_0123456789+                                -> Sing b_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply BSym0 a_0123456789) a_0123456789) a_0123456789) a_0123456789)) (Apply (Apply (Apply (Apply BSym0 b_0123456789) b_0123456789) b_0123456789) b_0123456789) :: Ordering)+            lambda+              a_0123456789+              a_0123456789+              a_0123456789+              a_0123456789+              b_0123456789+              b_0123456789+              b_0123456789+              b_0123456789+              = applySing+                  (applySing+                     (applySing+                        (singFun3 (Proxy :: Proxy FoldlSym0) sFoldl)+                        (singFun2 (Proxy :: Proxy ThenCmpSym0) sThenCmp))+                     SEQ)+                  (applySing+                     (applySing+                        (singFun2 (Proxy :: Proxy (:$)) SCons)+                        (applySing+                           (applySing+                              (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                           b_0123456789))+                     (applySing+                        (applySing+                           (singFun2 (Proxy :: Proxy (:$)) SCons)+                           (applySing+                              (applySing+                                 (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                              b_0123456789))+                        (applySing+                           (applySing+                              (singFun2 (Proxy :: Proxy (:$)) SCons)+                              (applySing+                                 (applySing+                                    (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                                 b_0123456789))+                           (applySing+                              (applySing+                                 (singFun2 (Proxy :: Proxy (:$)) SCons)+                                 (applySing+                                    (applySing+                                       (singFun2 (Proxy :: Proxy CompareSym0) sCompare)+                                       a_0123456789)+                                    b_0123456789))+                              SNil))))+          in+            lambda+              sA_0123456789+              sA_0123456789+              sA_0123456789+              sA_0123456789+              sB_0123456789+              sB_0123456789+              sB_0123456789+              sB_0123456789+      sCompare+        (SC sA_0123456789 sA_0123456789 sA_0123456789 sA_0123456789)+        (SC sB_0123456789 sB_0123456789 sB_0123456789 sB_0123456789)+        = let+            lambda ::+              forall a_0123456789+                     a_0123456789+                     a_0123456789+                     a_0123456789+                     b_0123456789+                     b_0123456789+                     b_0123456789+                     b_0123456789. (t0 ~ Apply (Apply (Apply (Apply CSym0 a_0123456789) a_0123456789) a_0123456789) a_0123456789,+                                    t1 ~ Apply (Apply (Apply (Apply CSym0 b_0123456789) b_0123456789) b_0123456789) b_0123456789) =>+              Sing a_0123456789+              -> Sing a_0123456789+                 -> Sing a_0123456789+                    -> Sing a_0123456789+                       -> Sing b_0123456789+                          -> Sing b_0123456789+                             -> Sing b_0123456789+                                -> Sing b_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply CSym0 a_0123456789) a_0123456789) a_0123456789) a_0123456789)) (Apply (Apply (Apply (Apply CSym0 b_0123456789) b_0123456789) b_0123456789) b_0123456789) :: Ordering)+            lambda+              a_0123456789+              a_0123456789+              a_0123456789+              a_0123456789+              b_0123456789+              b_0123456789+              b_0123456789+              b_0123456789+              = applySing+                  (applySing+                     (applySing+                        (singFun3 (Proxy :: Proxy FoldlSym0) sFoldl)+                        (singFun2 (Proxy :: Proxy ThenCmpSym0) sThenCmp))+                     SEQ)+                  (applySing+                     (applySing+                        (singFun2 (Proxy :: Proxy (:$)) SCons)+                        (applySing+                           (applySing+                              (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                           b_0123456789))+                     (applySing+                        (applySing+                           (singFun2 (Proxy :: Proxy (:$)) SCons)+                           (applySing+                              (applySing+                                 (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                              b_0123456789))+                        (applySing+                           (applySing+                              (singFun2 (Proxy :: Proxy (:$)) SCons)+                              (applySing+                                 (applySing+                                    (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                                 b_0123456789))+                           (applySing+                              (applySing+                                 (singFun2 (Proxy :: Proxy (:$)) SCons)+                                 (applySing+                                    (applySing+                                       (singFun2 (Proxy :: Proxy CompareSym0) sCompare)+                                       a_0123456789)+                                    b_0123456789))+                              SNil))))+          in+            lambda+              sA_0123456789+              sA_0123456789+              sA_0123456789+              sA_0123456789+              sB_0123456789+              sB_0123456789+              sB_0123456789+              sB_0123456789+      sCompare+        (SD sA_0123456789 sA_0123456789 sA_0123456789 sA_0123456789)+        (SD sB_0123456789 sB_0123456789 sB_0123456789 sB_0123456789)+        = let+            lambda ::+              forall a_0123456789+                     a_0123456789+                     a_0123456789+                     a_0123456789+                     b_0123456789+                     b_0123456789+                     b_0123456789+                     b_0123456789. (t0 ~ Apply (Apply (Apply (Apply DSym0 a_0123456789) a_0123456789) a_0123456789) a_0123456789,+                                    t1 ~ Apply (Apply (Apply (Apply DSym0 b_0123456789) b_0123456789) b_0123456789) b_0123456789) =>+              Sing a_0123456789+              -> Sing a_0123456789+                 -> Sing a_0123456789+                    -> Sing a_0123456789+                       -> Sing b_0123456789+                          -> Sing b_0123456789+                             -> Sing b_0123456789+                                -> Sing b_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply DSym0 a_0123456789) a_0123456789) a_0123456789) a_0123456789)) (Apply (Apply (Apply (Apply DSym0 b_0123456789) b_0123456789) b_0123456789) b_0123456789) :: Ordering)+            lambda+              a_0123456789+              a_0123456789+              a_0123456789+              a_0123456789+              b_0123456789+              b_0123456789+              b_0123456789+              b_0123456789+              = applySing+                  (applySing+                     (applySing+                        (singFun3 (Proxy :: Proxy FoldlSym0) sFoldl)+                        (singFun2 (Proxy :: Proxy ThenCmpSym0) sThenCmp))+                     SEQ)+                  (applySing+                     (applySing+                        (singFun2 (Proxy :: Proxy (:$)) SCons)+                        (applySing+                           (applySing+                              (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                           b_0123456789))+                     (applySing+                        (applySing+                           (singFun2 (Proxy :: Proxy (:$)) SCons)+                           (applySing+                              (applySing+                                 (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                              b_0123456789))+                        (applySing+                           (applySing+                              (singFun2 (Proxy :: Proxy (:$)) SCons)+                              (applySing+                                 (applySing+                                    (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                                 b_0123456789))+                           (applySing+                              (applySing+                                 (singFun2 (Proxy :: Proxy (:$)) SCons)+                                 (applySing+                                    (applySing+                                       (singFun2 (Proxy :: Proxy CompareSym0) sCompare)+                                       a_0123456789)+                                    b_0123456789))+                              SNil))))+          in+            lambda+              sA_0123456789+              sA_0123456789+              sA_0123456789+              sA_0123456789+              sB_0123456789+              sB_0123456789+              sB_0123456789+              sB_0123456789+      sCompare+        (SE sA_0123456789 sA_0123456789 sA_0123456789 sA_0123456789)+        (SE sB_0123456789 sB_0123456789 sB_0123456789 sB_0123456789)+        = let+            lambda ::+              forall a_0123456789+                     a_0123456789+                     a_0123456789+                     a_0123456789+                     b_0123456789+                     b_0123456789+                     b_0123456789+                     b_0123456789. (t0 ~ Apply (Apply (Apply (Apply ESym0 a_0123456789) a_0123456789) a_0123456789) a_0123456789,+                                    t1 ~ Apply (Apply (Apply (Apply ESym0 b_0123456789) b_0123456789) b_0123456789) b_0123456789) =>+              Sing a_0123456789+              -> Sing a_0123456789+                 -> Sing a_0123456789+                    -> Sing a_0123456789+                       -> Sing b_0123456789+                          -> Sing b_0123456789+                             -> Sing b_0123456789+                                -> Sing b_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply ESym0 a_0123456789) a_0123456789) a_0123456789) a_0123456789)) (Apply (Apply (Apply (Apply ESym0 b_0123456789) b_0123456789) b_0123456789) b_0123456789) :: Ordering)+            lambda+              a_0123456789+              a_0123456789+              a_0123456789+              a_0123456789+              b_0123456789+              b_0123456789+              b_0123456789+              b_0123456789+              = applySing+                  (applySing+                     (applySing+                        (singFun3 (Proxy :: Proxy FoldlSym0) sFoldl)+                        (singFun2 (Proxy :: Proxy ThenCmpSym0) sThenCmp))+                     SEQ)+                  (applySing+                     (applySing+                        (singFun2 (Proxy :: Proxy (:$)) SCons)+                        (applySing+                           (applySing+                              (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                           b_0123456789))+                     (applySing+                        (applySing+                           (singFun2 (Proxy :: Proxy (:$)) SCons)+                           (applySing+                              (applySing+                                 (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                              b_0123456789))+                        (applySing+                           (applySing+                              (singFun2 (Proxy :: Proxy (:$)) SCons)+                              (applySing+                                 (applySing+                                    (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                                 b_0123456789))+                           (applySing+                              (applySing+                                 (singFun2 (Proxy :: Proxy (:$)) SCons)+                                 (applySing+                                    (applySing+                                       (singFun2 (Proxy :: Proxy CompareSym0) sCompare)+                                       a_0123456789)+                                    b_0123456789))+                              SNil))))+          in+            lambda+              sA_0123456789+              sA_0123456789+              sA_0123456789+              sA_0123456789+              sB_0123456789+              sB_0123456789+              sB_0123456789+              sB_0123456789+      sCompare+        (SF sA_0123456789 sA_0123456789 sA_0123456789 sA_0123456789)+        (SF sB_0123456789 sB_0123456789 sB_0123456789 sB_0123456789)+        = let+            lambda ::+              forall a_0123456789+                     a_0123456789+                     a_0123456789+                     a_0123456789+                     b_0123456789+                     b_0123456789+                     b_0123456789+                     b_0123456789. (t0 ~ Apply (Apply (Apply (Apply FSym0 a_0123456789) a_0123456789) a_0123456789) a_0123456789,+                                    t1 ~ Apply (Apply (Apply (Apply FSym0 b_0123456789) b_0123456789) b_0123456789) b_0123456789) =>+              Sing a_0123456789+              -> Sing a_0123456789+                 -> Sing a_0123456789+                    -> Sing a_0123456789+                       -> Sing b_0123456789+                          -> Sing b_0123456789+                             -> Sing b_0123456789+                                -> Sing b_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply FSym0 a_0123456789) a_0123456789) a_0123456789) a_0123456789)) (Apply (Apply (Apply (Apply FSym0 b_0123456789) b_0123456789) b_0123456789) b_0123456789) :: Ordering)+            lambda+              a_0123456789+              a_0123456789+              a_0123456789+              a_0123456789+              b_0123456789+              b_0123456789+              b_0123456789+              b_0123456789+              = applySing+                  (applySing+                     (applySing+                        (singFun3 (Proxy :: Proxy FoldlSym0) sFoldl)+                        (singFun2 (Proxy :: Proxy ThenCmpSym0) sThenCmp))+                     SEQ)+                  (applySing+                     (applySing+                        (singFun2 (Proxy :: Proxy (:$)) SCons)+                        (applySing+                           (applySing+                              (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                           b_0123456789))+                     (applySing+                        (applySing+                           (singFun2 (Proxy :: Proxy (:$)) SCons)+                           (applySing+                              (applySing+                                 (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                              b_0123456789))+                        (applySing+                           (applySing+                              (singFun2 (Proxy :: Proxy (:$)) SCons)+                              (applySing+                                 (applySing+                                    (singFun2 (Proxy :: Proxy CompareSym0) sCompare) a_0123456789)+                                 b_0123456789))+                           (applySing+                              (applySing+                                 (singFun2 (Proxy :: Proxy (:$)) SCons)+                                 (applySing+                                    (applySing+                                       (singFun2 (Proxy :: Proxy CompareSym0) sCompare)+                                       a_0123456789)+                                    b_0123456789))+                              SNil))))+          in+            lambda+              sA_0123456789+              sA_0123456789+              sA_0123456789+              sA_0123456789+              sB_0123456789+              sB_0123456789+              sB_0123456789+              sB_0123456789+      sCompare+        (SA _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SB _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SLT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SA _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SC _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SLT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SA _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SD _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SLT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SA _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SE _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SLT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SA _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SF _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SLT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SB _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SA _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SGT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SB _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SC _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SLT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SB _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SD _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SLT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SB _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SE _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SLT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SB _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SF _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SLT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SC _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SA _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SGT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SC _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SB _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SGT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SC _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SD _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SLT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SC _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SE _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SLT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SC _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SF _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SLT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SD _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SA _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SGT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SD _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SB _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SGT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SD _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SC _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SGT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SD _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SE _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SLT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SD _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SF _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SLT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SE _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SA _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SGT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SE _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SB _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SGT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SE _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SC _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SGT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SE _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SD _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SGT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SE _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SF _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SLT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SF _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SA _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply ASym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SGT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SF _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SB _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply BSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SGT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SF _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SC _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply CSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SGT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SF _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SD _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply DSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SGT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+      sCompare+        (SF _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        (SE _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789+            _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789,+                                     t1 ~ Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing _z_0123456789+                       -> Sing _z_0123456789+                          -> Sing _z_0123456789+                             -> Sing _z_0123456789+                                -> Sing _z_0123456789+                                   -> Sing (Apply (Apply CompareSym0 (Apply (Apply (Apply (Apply FSym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789)) (Apply (Apply (Apply (Apply ESym0 _z_0123456789) _z_0123456789) _z_0123456789) _z_0123456789) :: Ordering)+            lambda+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              _z_0123456789+              = SGT+          in+            lambda+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+              _s_z_0123456789+    instance SingI Zero where+      sing = SZero+    instance SingI n => SingI (Succ (n :: Nat)) where+      sing = SSucc sing+    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 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 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 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 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 n, SingI n, SingI n, SingI n) =>+             SingI (F (n :: a) (n :: b) (n :: c) (n :: d)) where+      sing = SF sing sing sing sing
+ tests/compile-and-dump/Singletons/OrdDeriving.hs view
@@ -0,0 +1,58 @@+module Singletons.OrdDeriving where++import Data.Singletons.Prelude+import Data.Singletons.TH++$(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)+  |])++foo1a :: Proxy (Zero :< Succ Zero)+foo1a = Proxy++foo1b :: Proxy True+foo1b = foo1a++foo2a :: Proxy (Succ (Succ Zero) `Compare` Zero)+foo2a = Proxy++foo2b :: Proxy GT+foo2b = foo2a++foo3a :: Proxy (A 1 2 3 4 `Compare` A 1 2 3 4)+foo3a = Proxy++foo3b :: Proxy EQ+foo3b = foo3a++foo4a :: Proxy (A 1 2 3 4 `Compare` A 1 2 3 5)+foo4a = Proxy++foo4b :: Proxy LT+foo4b = foo4a++foo5a :: Proxy (A 1 2 3 4 `Compare` A 1 2 3 3)+foo5a = Proxy++foo5b :: Proxy GT+foo5b = foo5a++foo6a :: Proxy (A 1 2 3 4 `Compare` B 1 2 3 4)+foo6a = Proxy++foo6b :: Proxy LT+foo6b = foo6a++foo7a :: Proxy (B 1 2 3 4 `Compare` A 1 2 3 4)+foo7a = Proxy++foo7b :: Proxy GT+foo7b = foo7a
+ tests/compile-and-dump/Singletons/PatternMatching.ghc710.template view
@@ -0,0 +1,639 @@+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 (t :: a) (t :: b) = Pair t t+    instance SuppressUnusedWarnings PairSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) PairSym1KindInference GHC.Tuple.())+    data PairSym1 (l :: a) (l :: TyFun b (Pair a b))+      = forall arg. KindOf (Apply (PairSym1 l) arg) ~ KindOf (PairSym2 l arg) =>+        PairSym1KindInference+    type instance Apply (PairSym1 l) l = PairSym2 l l+    instance SuppressUnusedWarnings PairSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) PairSym0KindInference GHC.Tuple.())+    data PairSym0 (l :: TyFun a (TyFun b (Pair a b) -> *))+      = forall arg. KindOf (Apply PairSym0 arg) ~ KindOf (PairSym1 arg) =>+        PairSym0KindInference+    type instance Apply PairSym0 l = PairSym1 l+    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) '[])+    sAList :: Sing AListSym0+    sTuple :: Sing TupleSym0+    sComplex :: Sing ComplexSym0+    sPr :: Sing PrSym0+    sAList+      = applySing+          (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SZero)+          (applySing+             (applySing+                (singFun2 (Proxy :: Proxy (:$)) SCons)+                (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))+             (applySing+                (applySing+                   (singFun2 (Proxy :: Proxy (:$)) SCons)+                   (applySing+                      (singFun1 (Proxy :: Proxy SuccSym0) SSucc)+                      (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero)))+                SNil))+    sTuple+      = applySing+          (applySing+             (applySing (singFun3 (Proxy :: Proxy Tuple3Sym0) STuple3) SFalse)+             (applySing (singFun1 (Proxy :: Proxy JustSym0) SJust) SZero))+          STrue+    sComplex+      = applySing+          (applySing+             (singFun2 (Proxy :: Proxy PairSym0) SPair)+             (applySing+                (applySing+                   (singFun2 (Proxy :: Proxy PairSym0) SPair)+                   (applySing (singFun1 (Proxy :: Proxy JustSym0) SJust) SZero))+                SZero))+          SFalse+    sPr+      = applySing+          (applySing+             (singFun2 (Proxy :: Proxy PairSym0) SPair)+             (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))+          (applySing+             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SZero) SNil)+    data instance Sing (z :: Pair a b)+      = forall (n :: a) (n :: b). z ~ Pair n n =>+        SPair (Sing (n :: a)) (Sing (n :: b))+    type SPair = (Sing :: Pair a b -> *)+    instance (SingKind (KProxy :: KProxy a),+              SingKind (KProxy :: KProxy b)) =>+             SingKind (KProxy :: KProxy (Pair a b)) where+      type DemoteRep (KProxy :: KProxy (Pair a b)) = Pair (DemoteRep (KProxy :: KProxy a)) (DemoteRep (KProxy :: KProxy b))+      fromSing (SPair b b) = Pair (fromSing b) (fromSing b)+      toSing (Pair b b)+        = case+              GHC.Tuple.(,)+                (toSing b :: SomeSing (KProxy :: KProxy a))+                (toSing b :: SomeSing (KProxy :: KProxy b))+          of {+            GHC.Tuple.(,) (SomeSing c) (SomeSing c) -> SomeSing (SPair c c) }+    instance (SingI n, SingI n) => SingI (Pair (n :: a) (n :: b)) where+      sing = SPair sing sing+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 :: forall a b. (a, b) -> a+    foo1 (x, y) = \ _ -> x y+    foo2 :: forall a b. (# a, b #) -> a+    foo2 t@(# x, y #) = case t of { (# a, b #) -> \ _ -> a b }+    silly :: forall a. a -> ()+    silly x = case x of { _ -> GHC.Tuple.() }+    type Let0123456789Scrutinee_0123456789Sym1 t =+        Let0123456789Scrutinee_0123456789 t+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym0 l+      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>+        Let0123456789Scrutinee_0123456789Sym0KindInference+    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l+    type family Let0123456789Scrutinee_0123456789 x where+      Let0123456789Scrutinee_0123456789 x = x+    type family Case_0123456789 x t where+      Case_0123456789 x _z_0123456789 = Tuple0Sym0+    type Let0123456789TSym2 t t = Let0123456789T t t+    instance SuppressUnusedWarnings Let0123456789TSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789TSym1KindInference GHC.Tuple.())+    data Let0123456789TSym1 l l+      = forall arg. KindOf (Apply (Let0123456789TSym1 l) arg) ~ KindOf (Let0123456789TSym2 l arg) =>+        Let0123456789TSym1KindInference+    type instance Apply (Let0123456789TSym1 l) l = Let0123456789TSym2 l l+    instance SuppressUnusedWarnings Let0123456789TSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Let0123456789TSym0KindInference GHC.Tuple.())+    data Let0123456789TSym0 l+      = forall arg. KindOf (Apply Let0123456789TSym0 arg) ~ KindOf (Let0123456789TSym1 arg) =>+        Let0123456789TSym0KindInference+    type instance Apply Let0123456789TSym0 l = Let0123456789TSym1 l+    type family Let0123456789T x y where+      Let0123456789T x y = Apply (Apply Tuple2Sym0 x) y+    type Let0123456789Scrutinee_0123456789Sym2 t t =+        Let0123456789Scrutinee_0123456789 t t+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym1KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym1 l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym2 l arg) =>+        Let0123456789Scrutinee_0123456789Sym1KindInference+    type instance Apply (Let0123456789Scrutinee_0123456789Sym1 l) l = Let0123456789Scrutinee_0123456789Sym2 l l+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym0 l+      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>+        Let0123456789Scrutinee_0123456789Sym0KindInference+    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l+    type family Let0123456789Scrutinee_0123456789 x y where+      Let0123456789Scrutinee_0123456789 x y = Let0123456789TSym2 x y+    type family Case_0123456789 x y a b arg_0123456789 t where+      Case_0123456789 x y a b arg_0123456789 _z_0123456789 = a+    type family Lambda_0123456789 x y a b t where+      Lambda_0123456789 x y a b arg_0123456789 = Case_0123456789 x y a b arg_0123456789 arg_0123456789+    type Lambda_0123456789Sym5 t t t t t = Lambda_0123456789 t t t t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym4 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym4KindInference GHC.Tuple.())+    data Lambda_0123456789Sym4 l l l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym4 l l l l) arg) ~ KindOf (Lambda_0123456789Sym5 l l l l arg) =>+        Lambda_0123456789Sym4KindInference+    type instance Apply (Lambda_0123456789Sym4 l l l l) l = Lambda_0123456789Sym5 l l l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym3 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym3KindInference GHC.Tuple.())+    data Lambda_0123456789Sym3 l l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym3 l l l) arg) ~ KindOf (Lambda_0123456789Sym4 l l l arg) =>+        Lambda_0123456789Sym3KindInference+    type instance Apply (Lambda_0123456789Sym3 l l l) l = Lambda_0123456789Sym4 l l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())+    data Lambda_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>+        Lambda_0123456789Sym2KindInference+    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type family Case_0123456789 x y t where+      Case_0123456789 x y '(a,+                            b) = Apply (Apply (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) a) b) b+    type family Case_0123456789 x y arg_0123456789 t where+      Case_0123456789 x y arg_0123456789 _z_0123456789 = x+    type family Lambda_0123456789 x y t where+      Lambda_0123456789 x y arg_0123456789 = Case_0123456789 x y arg_0123456789 arg_0123456789+    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t+    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())+    data Lambda_0123456789Sym2 l l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>+        Lambda_0123456789Sym2KindInference+    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())+    data Lambda_0123456789Sym1 l l+      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>+        Lambda_0123456789Sym1KindInference+    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type family Case_0123456789 t where+      Case_0123456789 '[_z_0123456789,+                        y_0123456789,+                        Succ _z_0123456789] = y_0123456789+    type family Case_0123456789 t where+      Case_0123456789 '[_z_0123456789,+                        _z_0123456789,+                        Succ y_0123456789] = y_0123456789+    type family Case_0123456789 t where+      Case_0123456789 '(y_0123456789,+                        _z_0123456789,+                        _z_0123456789) = y_0123456789+    type family Case_0123456789 t where+      Case_0123456789 '(_z_0123456789,+                        y_0123456789,+                        _z_0123456789) = y_0123456789+    type family Case_0123456789 t where+      Case_0123456789 '(_z_0123456789,+                        _z_0123456789,+                        y_0123456789) = y_0123456789+    type family Case_0123456789 t where+      Case_0123456789 (Pair (Pair y_0123456789 _z_0123456789) _z_0123456789) = y_0123456789+    type family Case_0123456789 t where+      Case_0123456789 (Pair (Pair _z_0123456789 y_0123456789) _z_0123456789) = y_0123456789+    type family Case_0123456789 t where+      Case_0123456789 (Pair (Pair _z_0123456789 _z_0123456789) y_0123456789) = y_0123456789+    type family Case_0123456789 t where+      Case_0123456789 (Pair y_0123456789 _z_0123456789) = y_0123456789+    type family Case_0123456789 t where+      Case_0123456789 (Pair _z_0123456789 y_0123456789) = y_0123456789+    type SillySym1 (t :: a) = Silly t+    instance SuppressUnusedWarnings SillySym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) SillySym0KindInference GHC.Tuple.())+    data SillySym0 (l :: TyFun a ())+      = forall arg. KindOf (Apply SillySym0 arg) ~ KindOf (SillySym1 arg) =>+        SillySym0KindInference+    type instance Apply SillySym0 l = SillySym1 l+    type Foo2Sym1 (t :: (a, b)) = Foo2 t+    instance SuppressUnusedWarnings Foo2Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo2Sym0KindInference GHC.Tuple.())+    data Foo2Sym0 (l :: TyFun (a, b) a)+      = forall arg. KindOf (Apply Foo2Sym0 arg) ~ KindOf (Foo2Sym1 arg) =>+        Foo2Sym0KindInference+    type instance Apply Foo2Sym0 l = Foo2Sym1 l+    type Foo1Sym1 (t :: (a, b)) = Foo1 t+    instance SuppressUnusedWarnings Foo1Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Foo1Sym0KindInference GHC.Tuple.())+    data Foo1Sym0 (l :: TyFun (a, b) a)+      = forall arg. KindOf (Apply Foo1Sym0 arg) ~ KindOf (Foo1Sym1 arg) =>+        Foo1Sym0KindInference+    type instance Apply Foo1Sym0 l = Foo1Sym1 l+    type LszSym0 = Lsz+    type BlimySym0 = Blimy+    type TfSym0 = Tf+    type TjzSym0 = Tjz+    type TtSym0 = Tt+    type JzSym0 = Jz+    type ZzSym0 = Zz+    type FlsSym0 = Fls+    type SzSym0 = Sz+    type LzSym0 = Lz+    type X_0123456789Sym0 = X_0123456789+    type X_0123456789Sym0 = X_0123456789+    type X_0123456789Sym0 = X_0123456789+    type X_0123456789Sym0 = X_0123456789+    type family Silly (a :: a) :: () where+      Silly x = Case_0123456789 x (Let0123456789Scrutinee_0123456789Sym1 x)+    type family Foo2 (a :: (a, b)) :: a where+      Foo2 '(x,+             y) = Case_0123456789 x y (Let0123456789Scrutinee_0123456789Sym2 x y)+    type family Foo1 (a :: (a, b)) :: a where+      Foo1 '(x, y) = Apply (Apply (Apply Lambda_0123456789Sym0 x) y) y+    type family Lsz :: Nat where+      Lsz = Case_0123456789 X_0123456789Sym0+    type family Blimy where+      Blimy = Case_0123456789 X_0123456789Sym0+    type family Tf where+      Tf = Case_0123456789 X_0123456789Sym0+    type family Tjz where+      Tjz = Case_0123456789 X_0123456789Sym0+    type family Tt where+      Tt = Case_0123456789 X_0123456789Sym0+    type family Jz where+      Jz = Case_0123456789 X_0123456789Sym0+    type family Zz where+      Zz = Case_0123456789 X_0123456789Sym0+    type family Fls :: Bool where+      Fls = Case_0123456789 X_0123456789Sym0+    type family Sz where+      Sz = Case_0123456789 X_0123456789Sym0+    type family Lz where+      Lz = Case_0123456789 X_0123456789Sym0+    type family X_0123456789 where+      X_0123456789 = PrSym0+    type family X_0123456789 where+      X_0123456789 = ComplexSym0+    type family X_0123456789 where+      X_0123456789 = TupleSym0+    type family X_0123456789 where+      X_0123456789 = AListSym0+    sSilly :: forall (t :: a). Sing t -> Sing (Apply SillySym0 t :: ())+    sFoo2 ::+      forall (t :: (a, b)). Sing t -> Sing (Apply Foo2Sym0 t :: a)+    sFoo1 ::+      forall (t :: (a, b)). Sing t -> Sing (Apply Foo1Sym0 t :: a)+    sLsz :: Sing (LszSym0 :: Nat)+    sBlimy :: Sing BlimySym0+    sTf :: Sing TfSym0+    sTjz :: Sing TjzSym0+    sTt :: Sing TtSym0+    sJz :: Sing JzSym0+    sZz :: Sing ZzSym0+    sFls :: Sing (FlsSym0 :: Bool)+    sSz :: Sing SzSym0+    sLz :: Sing LzSym0+    sX_0123456789 :: Sing X_0123456789Sym0+    sX_0123456789 :: Sing X_0123456789Sym0+    sX_0123456789 :: Sing X_0123456789Sym0+    sX_0123456789 :: Sing X_0123456789Sym0+    sSilly sX+      = let+          lambda ::+            forall x. t ~ x => Sing x -> Sing (Apply SillySym0 x :: ())+          lambda x+            = let+                sScrutinee_0123456789 ::+                  Sing (Let0123456789Scrutinee_0123456789Sym1 x)+                sScrutinee_0123456789 = x+              in  case sScrutinee_0123456789 of {+                    _s_z_0123456789+                      -> let+                           lambda ::+                             forall _z_0123456789. _z_0123456789 ~ Let0123456789Scrutinee_0123456789Sym1 x =>+                             Sing _z_0123456789 -> Sing (Case_0123456789 x _z_0123456789)+                           lambda _z_0123456789 = STuple0+                         in lambda _s_z_0123456789 } ::+                    Sing (Case_0123456789 x (Let0123456789Scrutinee_0123456789Sym1 x))+        in lambda sX+    sFoo2 (STuple2 sX sY)+      = let+          lambda ::+            forall x y. t ~ Apply (Apply Tuple2Sym0 x) y =>+            Sing x+            -> Sing y+               -> Sing (Apply Foo2Sym0 (Apply (Apply Tuple2Sym0 x) y) :: a)+          lambda x y+            = let+                sT :: Sing (Let0123456789TSym2 x y)+                sT+                  = applySing+                      (applySing (singFun2 (Proxy :: Proxy Tuple2Sym0) STuple2) x) y in+              let+                sScrutinee_0123456789 ::+                  Sing (Let0123456789Scrutinee_0123456789Sym2 x y)+                sScrutinee_0123456789 = sT+              in  case sScrutinee_0123456789 of {+                    STuple2 sA sB+                      -> let+                           lambda ::+                             forall a+                                    b. Apply (Apply Tuple2Sym0 a) b ~ Let0123456789Scrutinee_0123456789Sym2 x y =>+                             Sing a+                             -> Sing b+                                -> Sing (Case_0123456789 x y (Apply (Apply Tuple2Sym0 a) b))+                           lambda a b+                             = applySing+                                 (singFun1+                                    (Proxy ::+                                       Proxy (Apply (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) a) b))+                                    (\ sArg_0123456789+                                       -> let+                                            lambda ::+                                              forall arg_0123456789.+                                              Sing arg_0123456789+                                              -> Sing (Apply (Apply (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) a) b) arg_0123456789)+                                            lambda arg_0123456789+                                              = case arg_0123456789 of {+                                                  _s_z_0123456789+                                                    -> let+                                                         lambda ::+                                                           forall _z_0123456789. _z_0123456789 ~ arg_0123456789 =>+                                                           Sing _z_0123456789+                                                           -> Sing (Case_0123456789 x y a b arg_0123456789 _z_0123456789)+                                                         lambda _z_0123456789 = a+                                                       in lambda _s_z_0123456789 } ::+                                                  Sing (Case_0123456789 x y a b arg_0123456789 arg_0123456789)+                                          in lambda sArg_0123456789))+                                 b+                         in lambda sA sB } ::+                    Sing (Case_0123456789 x y (Let0123456789Scrutinee_0123456789Sym2 x y))+        in lambda sX sY+    sFoo1 (STuple2 sX sY)+      = let+          lambda ::+            forall x y. t ~ Apply (Apply Tuple2Sym0 x) y =>+            Sing x+            -> Sing y+               -> Sing (Apply Foo1Sym0 (Apply (Apply Tuple2Sym0 x) y) :: a)+          lambda x y+            = applySing+                (singFun1+                   (Proxy :: Proxy (Apply (Apply Lambda_0123456789Sym0 x) y))+                   (\ sArg_0123456789+                      -> let+                           lambda ::+                             forall arg_0123456789.+                             Sing arg_0123456789+                             -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) arg_0123456789)+                           lambda arg_0123456789+                             = case arg_0123456789 of {+                                 _s_z_0123456789+                                   -> let+                                        lambda ::+                                          forall _z_0123456789. _z_0123456789 ~ arg_0123456789 =>+                                          Sing _z_0123456789+                                          -> Sing (Case_0123456789 x y arg_0123456789 _z_0123456789)+                                        lambda _z_0123456789 = x+                                      in lambda _s_z_0123456789 } ::+                                 Sing (Case_0123456789 x y arg_0123456789 arg_0123456789)+                         in lambda sArg_0123456789))+                y+        in lambda sX sY+    sLsz+      = case sX_0123456789 of {+          SCons _s_z_0123456789+                (SCons sY_0123456789 (SCons (SSucc _s_z_0123456789) SNil))+            -> let+                 lambda ::+                   forall _z_0123456789+                          y_0123456789+                          _z_0123456789. Apply (Apply (:$) _z_0123456789) (Apply (Apply (:$) y_0123456789) (Apply (Apply (:$) (Apply SuccSym0 _z_0123456789)) '[])) ~ X_0123456789Sym0 =>+                   Sing _z_0123456789+                   -> Sing y_0123456789+                      -> Sing _z_0123456789+                         -> Sing (Case_0123456789 (Apply (Apply (:$) _z_0123456789) (Apply (Apply (:$) y_0123456789) (Apply (Apply (:$) (Apply SuccSym0 _z_0123456789)) '[]))))+                 lambda _z_0123456789 y_0123456789 _z_0123456789 = y_0123456789+               in lambda _s_z_0123456789 sY_0123456789 _s_z_0123456789 } ::+          Sing (Case_0123456789 X_0123456789Sym0)+    sBlimy+      = case sX_0123456789 of {+          SCons _s_z_0123456789+                (SCons _s_z_0123456789 (SCons (SSucc sY_0123456789) SNil))+            -> let+                 lambda ::+                   forall _z_0123456789+                          _z_0123456789+                          y_0123456789. Apply (Apply (:$) _z_0123456789) (Apply (Apply (:$) _z_0123456789) (Apply (Apply (:$) (Apply SuccSym0 y_0123456789)) '[])) ~ X_0123456789Sym0 =>+                   Sing _z_0123456789+                   -> Sing _z_0123456789+                      -> Sing y_0123456789+                         -> Sing (Case_0123456789 (Apply (Apply (:$) _z_0123456789) (Apply (Apply (:$) _z_0123456789) (Apply (Apply (:$) (Apply SuccSym0 y_0123456789)) '[]))))+                 lambda _z_0123456789 _z_0123456789 y_0123456789 = y_0123456789+               in lambda _s_z_0123456789 _s_z_0123456789 sY_0123456789 } ::+          Sing (Case_0123456789 X_0123456789Sym0)+    sTf+      = case sX_0123456789 of {+          STuple3 sY_0123456789 _s_z_0123456789 _s_z_0123456789+            -> let+                 lambda ::+                   forall y_0123456789+                          _z_0123456789+                          _z_0123456789. Apply (Apply (Apply Tuple3Sym0 y_0123456789) _z_0123456789) _z_0123456789 ~ X_0123456789Sym0 =>+                   Sing y_0123456789+                   -> Sing _z_0123456789+                      -> Sing _z_0123456789+                         -> Sing (Case_0123456789 (Apply (Apply (Apply Tuple3Sym0 y_0123456789) _z_0123456789) _z_0123456789))+                 lambda y_0123456789 _z_0123456789 _z_0123456789 = y_0123456789+               in lambda sY_0123456789 _s_z_0123456789 _s_z_0123456789 } ::+          Sing (Case_0123456789 X_0123456789Sym0)+    sTjz+      = case sX_0123456789 of {+          STuple3 _s_z_0123456789 sY_0123456789 _s_z_0123456789+            -> let+                 lambda ::+                   forall _z_0123456789+                          y_0123456789+                          _z_0123456789. Apply (Apply (Apply Tuple3Sym0 _z_0123456789) y_0123456789) _z_0123456789 ~ X_0123456789Sym0 =>+                   Sing _z_0123456789+                   -> Sing y_0123456789+                      -> Sing _z_0123456789+                         -> Sing (Case_0123456789 (Apply (Apply (Apply Tuple3Sym0 _z_0123456789) y_0123456789) _z_0123456789))+                 lambda _z_0123456789 y_0123456789 _z_0123456789 = y_0123456789+               in lambda _s_z_0123456789 sY_0123456789 _s_z_0123456789 } ::+          Sing (Case_0123456789 X_0123456789Sym0)+    sTt+      = case sX_0123456789 of {+          STuple3 _s_z_0123456789 _s_z_0123456789 sY_0123456789+            -> let+                 lambda ::+                   forall _z_0123456789+                          _z_0123456789+                          y_0123456789. Apply (Apply (Apply Tuple3Sym0 _z_0123456789) _z_0123456789) y_0123456789 ~ X_0123456789Sym0 =>+                   Sing _z_0123456789+                   -> Sing _z_0123456789+                      -> Sing y_0123456789+                         -> Sing (Case_0123456789 (Apply (Apply (Apply Tuple3Sym0 _z_0123456789) _z_0123456789) y_0123456789))+                 lambda _z_0123456789 _z_0123456789 y_0123456789 = y_0123456789+               in lambda _s_z_0123456789 _s_z_0123456789 sY_0123456789 } ::+          Sing (Case_0123456789 X_0123456789Sym0)+    sJz+      = case sX_0123456789 of {+          SPair (SPair sY_0123456789 _s_z_0123456789) _s_z_0123456789+            -> let+                 lambda ::+                   forall y_0123456789+                          _z_0123456789+                          _z_0123456789. Apply (Apply PairSym0 (Apply (Apply PairSym0 y_0123456789) _z_0123456789)) _z_0123456789 ~ X_0123456789Sym0 =>+                   Sing y_0123456789+                   -> Sing _z_0123456789+                      -> Sing _z_0123456789+                         -> Sing (Case_0123456789 (Apply (Apply PairSym0 (Apply (Apply PairSym0 y_0123456789) _z_0123456789)) _z_0123456789))+                 lambda y_0123456789 _z_0123456789 _z_0123456789 = y_0123456789+               in lambda sY_0123456789 _s_z_0123456789 _s_z_0123456789 } ::+          Sing (Case_0123456789 X_0123456789Sym0)+    sZz+      = case sX_0123456789 of {+          SPair (SPair _s_z_0123456789 sY_0123456789) _s_z_0123456789+            -> let+                 lambda ::+                   forall _z_0123456789+                          y_0123456789+                          _z_0123456789. Apply (Apply PairSym0 (Apply (Apply PairSym0 _z_0123456789) y_0123456789)) _z_0123456789 ~ X_0123456789Sym0 =>+                   Sing _z_0123456789+                   -> Sing y_0123456789+                      -> Sing _z_0123456789+                         -> Sing (Case_0123456789 (Apply (Apply PairSym0 (Apply (Apply PairSym0 _z_0123456789) y_0123456789)) _z_0123456789))+                 lambda _z_0123456789 y_0123456789 _z_0123456789 = y_0123456789+               in lambda _s_z_0123456789 sY_0123456789 _s_z_0123456789 } ::+          Sing (Case_0123456789 X_0123456789Sym0)+    sFls+      = case sX_0123456789 of {+          SPair (SPair _s_z_0123456789 _s_z_0123456789) sY_0123456789+            -> let+                 lambda ::+                   forall _z_0123456789+                          _z_0123456789+                          y_0123456789. Apply (Apply PairSym0 (Apply (Apply PairSym0 _z_0123456789) _z_0123456789)) y_0123456789 ~ X_0123456789Sym0 =>+                   Sing _z_0123456789+                   -> Sing _z_0123456789+                      -> Sing y_0123456789+                         -> Sing (Case_0123456789 (Apply (Apply PairSym0 (Apply (Apply PairSym0 _z_0123456789) _z_0123456789)) y_0123456789))+                 lambda _z_0123456789 _z_0123456789 y_0123456789 = y_0123456789+               in lambda _s_z_0123456789 _s_z_0123456789 sY_0123456789 } ::+          Sing (Case_0123456789 X_0123456789Sym0)+    sSz+      = case sX_0123456789 of {+          SPair sY_0123456789 _s_z_0123456789+            -> let+                 lambda ::+                   forall y_0123456789+                          _z_0123456789. Apply (Apply PairSym0 y_0123456789) _z_0123456789 ~ X_0123456789Sym0 =>+                   Sing y_0123456789+                   -> Sing _z_0123456789+                      -> Sing (Case_0123456789 (Apply (Apply PairSym0 y_0123456789) _z_0123456789))+                 lambda y_0123456789 _z_0123456789 = y_0123456789+               in lambda sY_0123456789 _s_z_0123456789 } ::+          Sing (Case_0123456789 X_0123456789Sym0)+    sLz+      = case sX_0123456789 of {+          SPair _s_z_0123456789 sY_0123456789+            -> let+                 lambda ::+                   forall _z_0123456789+                          y_0123456789. Apply (Apply PairSym0 _z_0123456789) y_0123456789 ~ X_0123456789Sym0 =>+                   Sing _z_0123456789+                   -> Sing y_0123456789+                      -> Sing (Case_0123456789 (Apply (Apply PairSym0 _z_0123456789) y_0123456789))+                 lambda _z_0123456789 y_0123456789 = y_0123456789+               in lambda _s_z_0123456789 sY_0123456789 } ::+          Sing (Case_0123456789 X_0123456789Sym0)+    sX_0123456789 = sPr+    sX_0123456789 = sComplex+    sX_0123456789 = sTuple+    sX_0123456789 = sAList
− tests/compile-and-dump/Singletons/PatternMatching.ghc78.template
@@ -1,506 +0,0 @@-Singletons/PatternMatching.hs: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) |]-  ======>-    Singletons/PatternMatching.hs:(0,0)-(0,0)-    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 (t :: a) (t :: b) = Pair t t-    instance SuppressUnusedWarnings PairSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) PairSym1KindInference GHC.Tuple.())-    data PairSym1 (l :: a) (l :: TyFun b (Pair a b))-      = forall arg. KindOf (Apply (PairSym1 l) arg) ~ KindOf (PairSym2 l arg) =>-        PairSym1KindInference-    type instance Apply (PairSym1 l) l = PairSym2 l l-    instance SuppressUnusedWarnings PairSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) PairSym0KindInference GHC.Tuple.())-    data PairSym0 (l :: TyFun a (TyFun b (Pair a b) -> *))-      = forall arg. KindOf (Apply PairSym0 arg) ~ KindOf (PairSym1 arg) =>-        PairSym0KindInference-    type instance Apply PairSym0 l = PairSym1 l-    type AListSym0 = AList-    type TupleSym0 = Tuple-    type ComplexSym0 = Complex-    type PrSym0 = Pr-    type AList =-        Apply (Apply (:$) ZeroSym0) (Apply (Apply (:$) (Apply SuccSym0 ZeroSym0)) (Apply (Apply (:$) (Apply SuccSym0 (Apply SuccSym0 ZeroSym0))) '[]))-    type Tuple =-        Apply (Apply (Apply Tuple3Sym0 FalseSym0) (Apply JustSym0 ZeroSym0)) TrueSym0-    type Complex =-        Apply (Apply PairSym0 (Apply (Apply PairSym0 (Apply JustSym0 ZeroSym0)) ZeroSym0)) FalseSym0-    type Pr =-        Apply (Apply PairSym0 (Apply SuccSym0 ZeroSym0)) (Apply (Apply (:$) ZeroSym0) '[])-    sAList :: Sing AListSym0-    sTuple :: Sing TupleSym0-    sComplex :: Sing ComplexSym0-    sPr :: Sing PrSym0-    sAList-      = applySing-          (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SZero)-          (applySing-             (applySing-                (singFun2 (Proxy :: Proxy (:$)) SCons)-                (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))-             (applySing-                (applySing-                   (singFun2 (Proxy :: Proxy (:$)) SCons)-                   (applySing-                      (singFun1 (Proxy :: Proxy SuccSym0) SSucc)-                      (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero)))-                SNil))-    sTuple-      = applySing-          (applySing-             (applySing (singFun3 (Proxy :: Proxy Tuple3Sym0) STuple3) SFalse)-             (applySing (singFun1 (Proxy :: Proxy JustSym0) SJust) SZero))-          STrue-    sComplex-      = applySing-          (applySing-             (singFun2 (Proxy :: Proxy PairSym0) SPair)-             (applySing-                (applySing-                   (singFun2 (Proxy :: Proxy PairSym0) SPair)-                   (applySing (singFun1 (Proxy :: Proxy JustSym0) SJust) SZero))-                SZero))-          SFalse-    sPr-      = applySing-          (applySing-             (singFun2 (Proxy :: Proxy PairSym0) SPair)-             (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))-          (applySing-             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SZero) SNil)-    data instance Sing (z :: Pair a b)-      = forall (n :: a) (n :: b). z ~ Pair n n => SPair (Sing n) (Sing n)-    type SPair (z :: Pair a b) = Sing z-    instance (SingKind (KProxy :: KProxy a),-              SingKind (KProxy :: KProxy b)) =>-             SingKind (KProxy :: KProxy (Pair a b)) where-      type DemoteRep (KProxy :: KProxy (Pair a b)) = Pair (DemoteRep (KProxy :: KProxy a)) (DemoteRep (KProxy :: KProxy b))-      fromSing (SPair b b) = Pair (fromSing b) (fromSing b)-      toSing (Pair b b)-        = case-              GHC.Tuple.(,)-                (toSing b :: SomeSing (KProxy :: KProxy a))-                (toSing b :: SomeSing (KProxy :: KProxy b))-          of {-            GHC.Tuple.(,) (SomeSing c) (SomeSing c) -> SomeSing (SPair c c) }-    instance (SingI n, SingI n) => SingI (Pair (n :: a) (n :: b)) where-      sing = SPair sing sing-Singletons/PatternMatching.hs: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 } |]-  ======>-    Singletons/PatternMatching.hs:(0,0)-(0,0)-    Pair sz lz = pr-    Pair (Pair jz zz) fls = complex-    (tf, tjz, tt) = tuple-    [_, lsz, Succ blimy] = aList-    lsz :: Nat-    fls :: Bool-    foo1 :: forall a b. (a, b) -> a-    foo1 (x, y) = \ _ -> x y-    foo2 :: forall a b. (# a, b #) -> a-    foo2 t@(# x, y #) = case t of { (# a, b #) -> \ _ -> a b }-    type Let0123456789TSym2 t t = Let0123456789T t t-    instance SuppressUnusedWarnings Let0123456789TSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789TSym1KindInference GHC.Tuple.())-    data Let0123456789TSym1 l l-      = forall arg. KindOf (Apply (Let0123456789TSym1 l) arg) ~ KindOf (Let0123456789TSym2 l arg) =>-        Let0123456789TSym1KindInference-    type instance Apply (Let0123456789TSym1 l) l = Let0123456789TSym2 l l-    instance SuppressUnusedWarnings Let0123456789TSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Let0123456789TSym0KindInference GHC.Tuple.())-    data Let0123456789TSym0 l-      = forall arg. KindOf (Apply Let0123456789TSym0 arg) ~ KindOf (Let0123456789TSym1 arg) =>-        Let0123456789TSym0KindInference-    type instance Apply Let0123456789TSym0 l = Let0123456789TSym1 l-    type Let0123456789T x y = Apply (Apply Tuple2Sym0 x) y-    type Let0123456789Scrutinee_0123456789Sym2 t t =-        Let0123456789Scrutinee_0123456789 t t-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym1KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Let0123456789Scrutinee_0123456789Sym1 l) arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym2 l arg) =>-        Let0123456789Scrutinee_0123456789Sym1KindInference-    type instance Apply (Let0123456789Scrutinee_0123456789Sym1 l) l = Let0123456789Scrutinee_0123456789Sym2 l l-    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,)-               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())-    data Let0123456789Scrutinee_0123456789Sym0 l-      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>-        Let0123456789Scrutinee_0123456789Sym0KindInference-    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l-    type Let0123456789Scrutinee_0123456789 x y = Let0123456789TSym2 x y-    type family Case_0123456789 x y a b arg_0123456789 t where-      Case_0123456789 x y a b arg_0123456789 z = a-    type family Lambda_0123456789 x y a b t where-      Lambda_0123456789 x y a b arg_0123456789 = Case_0123456789 x y a b arg_0123456789 arg_0123456789-    type Lambda_0123456789Sym5 t t t t t = Lambda_0123456789 t t t t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym4 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym4KindInference GHC.Tuple.())-    data Lambda_0123456789Sym4 l l l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym4 l l l l) arg) ~ KindOf (Lambda_0123456789Sym5 l l l l arg) =>-        Lambda_0123456789Sym4KindInference-    type instance Apply (Lambda_0123456789Sym4 l l l l) l = Lambda_0123456789Sym5 l l l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym3 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym3KindInference GHC.Tuple.())-    data Lambda_0123456789Sym3 l l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym3 l l l) arg) ~ KindOf (Lambda_0123456789Sym4 l l l arg) =>-        Lambda_0123456789Sym3KindInference-    type instance Apply (Lambda_0123456789Sym3 l l l) l = Lambda_0123456789Sym4 l l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())-    data Lambda_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>-        Lambda_0123456789Sym2KindInference-    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type family Case_0123456789 x y t where-      Case_0123456789 x y '(a,-                            b) = Apply (Apply (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) a) b) b-    type family Case_0123456789 x y arg_0123456789 t where-      Case_0123456789 x y arg_0123456789 z = x-    type family Lambda_0123456789 x y t where-      Lambda_0123456789 x y arg_0123456789 = Case_0123456789 x y arg_0123456789 arg_0123456789-    type Lambda_0123456789Sym3 t t t = Lambda_0123456789 t t t-    instance SuppressUnusedWarnings Lambda_0123456789Sym2 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym2KindInference GHC.Tuple.())-    data Lambda_0123456789Sym2 l l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym2 l l) arg) ~ KindOf (Lambda_0123456789Sym3 l l arg) =>-        Lambda_0123456789Sym2KindInference-    type instance Apply (Lambda_0123456789Sym2 l l) l = Lambda_0123456789Sym3 l l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym1 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym1KindInference GHC.Tuple.())-    data Lambda_0123456789Sym1 l l-      = forall arg. KindOf (Apply (Lambda_0123456789Sym1 l) arg) ~ KindOf (Lambda_0123456789Sym2 l arg) =>-        Lambda_0123456789Sym1KindInference-    type instance Apply (Lambda_0123456789Sym1 l) l = Lambda_0123456789Sym2 l l-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type family Case_0123456789 t where-      Case_0123456789 '[z, y_0123456789, Succ z] = y_0123456789-    type family Case_0123456789 t where-      Case_0123456789 '[z, z, Succ y_0123456789] = y_0123456789-    type family Case_0123456789 t where-      Case_0123456789 '(y_0123456789, z, z) = y_0123456789-    type family Case_0123456789 t where-      Case_0123456789 '(z, y_0123456789, z) = y_0123456789-    type family Case_0123456789 t where-      Case_0123456789 '(z, z, y_0123456789) = y_0123456789-    type family Case_0123456789 t where-      Case_0123456789 (Pair (Pair y_0123456789 z) z) = y_0123456789-    type family Case_0123456789 t where-      Case_0123456789 (Pair (Pair z y_0123456789) z) = y_0123456789-    type family Case_0123456789 t where-      Case_0123456789 (Pair (Pair z z) y_0123456789) = y_0123456789-    type family Case_0123456789 t where-      Case_0123456789 (Pair y_0123456789 z) = y_0123456789-    type family Case_0123456789 t where-      Case_0123456789 (Pair z y_0123456789) = y_0123456789-    type Foo2Sym1 (t :: (a, b)) = Foo2 t-    instance SuppressUnusedWarnings Foo2Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo2Sym0KindInference GHC.Tuple.())-    data Foo2Sym0 (l :: TyFun (a, b) a)-      = forall arg. KindOf (Apply Foo2Sym0 arg) ~ KindOf (Foo2Sym1 arg) =>-        Foo2Sym0KindInference-    type instance Apply Foo2Sym0 l = Foo2Sym1 l-    type Foo1Sym1 (t :: (a, b)) = Foo1 t-    instance SuppressUnusedWarnings Foo1Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Foo1Sym0KindInference GHC.Tuple.())-    data Foo1Sym0 (l :: TyFun (a, b) a)-      = forall arg. KindOf (Apply Foo1Sym0 arg) ~ KindOf (Foo1Sym1 arg) =>-        Foo1Sym0KindInference-    type instance Apply Foo1Sym0 l = Foo1Sym1 l-    type LszSym0 = Lsz-    type BlimySym0 = Blimy-    type TfSym0 = Tf-    type TjzSym0 = Tjz-    type TtSym0 = Tt-    type JzSym0 = Jz-    type ZzSym0 = Zz-    type FlsSym0 = Fls-    type SzSym0 = Sz-    type LzSym0 = Lz-    type X_0123456789Sym0 = X_0123456789-    type X_0123456789Sym0 = X_0123456789-    type X_0123456789Sym0 = X_0123456789-    type X_0123456789Sym0 = X_0123456789-    type family Foo2 (a :: (a, b)) :: a where-      Foo2 '(x,-             y) = Case_0123456789 x y (Let0123456789Scrutinee_0123456789Sym2 x y)-    type family Foo1 (a :: (a, b)) :: a where-      Foo1 '(x, y) = Apply (Apply (Apply Lambda_0123456789Sym0 x) y) y-    type Lsz = (Case_0123456789 X_0123456789Sym0 :: Nat)-    type Blimy = Case_0123456789 X_0123456789Sym0-    type Tf = Case_0123456789 X_0123456789Sym0-    type Tjz = Case_0123456789 X_0123456789Sym0-    type Tt = Case_0123456789 X_0123456789Sym0-    type Jz = Case_0123456789 X_0123456789Sym0-    type Zz = Case_0123456789 X_0123456789Sym0-    type Fls = (Case_0123456789 X_0123456789Sym0 :: Bool)-    type Sz = Case_0123456789 X_0123456789Sym0-    type Lz = Case_0123456789 X_0123456789Sym0-    type X_0123456789 = PrSym0-    type X_0123456789 = ComplexSym0-    type X_0123456789 = TupleSym0-    type X_0123456789 = AListSym0-    sFoo2 :: forall (t :: (a, b)). Sing t -> Sing (Apply Foo2Sym0 t)-    sFoo1 :: forall (t :: (a, b)). Sing t -> Sing (Apply Foo1Sym0 t)-    sLsz :: Sing LszSym0-    sBlimy :: Sing BlimySym0-    sTf :: Sing TfSym0-    sTjz :: Sing TjzSym0-    sTt :: Sing TtSym0-    sJz :: Sing JzSym0-    sZz :: Sing ZzSym0-    sFls :: Sing FlsSym0-    sSz :: Sing SzSym0-    sLz :: Sing LzSym0-    sX_0123456789 :: Sing X_0123456789Sym0-    sX_0123456789 :: Sing X_0123456789Sym0-    sX_0123456789 :: Sing X_0123456789Sym0-    sX_0123456789 :: Sing X_0123456789Sym0-    sFoo2 (STuple2 sX sY)-      = let-          lambda ::-            forall x y. t ~ Apply (Apply Tuple2Sym0 x) y =>-            Sing x-            -> Sing y -> Sing (Apply Foo2Sym0 (Apply (Apply Tuple2Sym0 x) y))-          lambda x y-            = let-                sT :: Sing (Let0123456789TSym2 x y)-                sT-                  = applySing-                      (applySing (singFun2 (Proxy :: Proxy Tuple2Sym0) STuple2) x) y in-              let-                sScrutinee_0123456789 ::-                  Sing (Let0123456789Scrutinee_0123456789Sym2 x y)-                sScrutinee_0123456789 = sT-              in-                case sScrutinee_0123456789 of {-                  STuple2 sA sB-                    -> let-                         lambda ::-                           forall a b.-                           Sing a-                           -> Sing b-                              -> Sing (Case_0123456789 x y (Apply (Apply Tuple2Sym0 a) b))-                         lambda a b-                           = applySing-                               (singFun1-                                  (Proxy ::-                                     Proxy (Apply (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) a) b))-                                  (\ sArg_0123456789-                                     -> let-                                          lambda ::-                                            forall arg_0123456789.-                                            Sing arg_0123456789-                                            -> Sing (Apply (Apply (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) a) b) arg_0123456789)-                                          lambda arg_0123456789-                                            = case arg_0123456789 of {-                                                _ -> let-                                                       lambda ::-                                                         forall wild.-                                                         Sing (Case_0123456789 x y a b arg_0123456789 wild)-                                                       lambda = a-                                                     in lambda }-                                        in lambda sArg_0123456789))-                               b-                       in lambda sA sB }-        in lambda sX sY-    sFoo1 (STuple2 sX sY)-      = let-          lambda ::-            forall x y. t ~ Apply (Apply Tuple2Sym0 x) y =>-            Sing x-            -> Sing y -> Sing (Apply Foo1Sym0 (Apply (Apply Tuple2Sym0 x) y))-          lambda x y-            = applySing-                (singFun1-                   (Proxy :: Proxy (Apply (Apply Lambda_0123456789Sym0 x) y))-                   (\ sArg_0123456789-                      -> let-                           lambda ::-                             forall arg_0123456789.-                             Sing arg_0123456789-                             -> Sing (Apply (Apply (Apply Lambda_0123456789Sym0 x) y) arg_0123456789)-                           lambda arg_0123456789-                             = case arg_0123456789 of {-                                 _ -> let-                                        lambda ::-                                          forall wild.-                                          Sing (Case_0123456789 x y arg_0123456789 wild)-                                        lambda = x-                                      in lambda }-                         in lambda sArg_0123456789))-                y-        in lambda sX sY-    sLsz-      = case sX_0123456789 of {-          SCons _ (SCons sY_0123456789 (SCons (SSucc _) SNil))-            -> let-                 lambda ::-                   forall y_0123456789 wild wild.-                   Sing y_0123456789-                   -> Sing (Case_0123456789 (Apply (Apply (:$) wild) (Apply (Apply (:$) y_0123456789) (Apply (Apply (:$) (Apply SuccSym0 wild)) '[]))))-                 lambda y_0123456789 = y_0123456789-               in lambda sY_0123456789 }-    sBlimy-      = case sX_0123456789 of {-          SCons _ (SCons _ (SCons (SSucc sY_0123456789) SNil))-            -> let-                 lambda ::-                   forall y_0123456789 wild wild.-                   Sing y_0123456789-                   -> Sing (Case_0123456789 (Apply (Apply (:$) wild) (Apply (Apply (:$) wild) (Apply (Apply (:$) (Apply SuccSym0 y_0123456789)) '[]))))-                 lambda y_0123456789 = y_0123456789-               in lambda sY_0123456789 }-    sTf-      = case sX_0123456789 of {-          STuple3 sY_0123456789 _ _-            -> let-                 lambda ::-                   forall y_0123456789 wild wild.-                   Sing y_0123456789-                   -> Sing (Case_0123456789 (Apply (Apply (Apply Tuple3Sym0 y_0123456789) wild) wild))-                 lambda y_0123456789 = y_0123456789-               in lambda sY_0123456789 }-    sTjz-      = case sX_0123456789 of {-          STuple3 _ sY_0123456789 _-            -> let-                 lambda ::-                   forall y_0123456789 wild wild.-                   Sing y_0123456789-                   -> Sing (Case_0123456789 (Apply (Apply (Apply Tuple3Sym0 wild) y_0123456789) wild))-                 lambda y_0123456789 = y_0123456789-               in lambda sY_0123456789 }-    sTt-      = case sX_0123456789 of {-          STuple3 _ _ sY_0123456789-            -> let-                 lambda ::-                   forall y_0123456789 wild wild.-                   Sing y_0123456789-                   -> Sing (Case_0123456789 (Apply (Apply (Apply Tuple3Sym0 wild) wild) y_0123456789))-                 lambda y_0123456789 = y_0123456789-               in lambda sY_0123456789 }-    sJz-      = case sX_0123456789 of {-          SPair (SPair sY_0123456789 _) _-            -> let-                 lambda ::-                   forall y_0123456789 wild wild.-                   Sing y_0123456789-                   -> Sing (Case_0123456789 (Apply (Apply PairSym0 (Apply (Apply PairSym0 y_0123456789) wild)) wild))-                 lambda y_0123456789 = y_0123456789-               in lambda sY_0123456789 }-    sZz-      = case sX_0123456789 of {-          SPair (SPair _ sY_0123456789) _-            -> let-                 lambda ::-                   forall y_0123456789 wild wild.-                   Sing y_0123456789-                   -> Sing (Case_0123456789 (Apply (Apply PairSym0 (Apply (Apply PairSym0 wild) y_0123456789)) wild))-                 lambda y_0123456789 = y_0123456789-               in lambda sY_0123456789 }-    sFls-      = case sX_0123456789 of {-          SPair (SPair _ _) sY_0123456789-            -> let-                 lambda ::-                   forall y_0123456789 wild wild.-                   Sing y_0123456789-                   -> Sing (Case_0123456789 (Apply (Apply PairSym0 (Apply (Apply PairSym0 wild) wild)) y_0123456789))-                 lambda y_0123456789 = y_0123456789-               in lambda sY_0123456789 }-    sSz-      = case sX_0123456789 of {-          SPair sY_0123456789 _-            -> let-                 lambda ::-                   forall y_0123456789 wild.-                   Sing y_0123456789-                   -> Sing (Case_0123456789 (Apply (Apply PairSym0 y_0123456789) wild))-                 lambda y_0123456789 = y_0123456789-               in lambda sY_0123456789 }-    sLz-      = case sX_0123456789 of {-          SPair _ sY_0123456789-            -> let-                 lambda ::-                   forall y_0123456789 wild.-                   Sing y_0123456789-                   -> Sing (Case_0123456789 (Apply (Apply PairSym0 wild) y_0123456789))-                 lambda y_0123456789 = y_0123456789-               in lambda sY_0123456789 }-    sX_0123456789 = sPr-    sX_0123456789 = sComplex-    sX_0123456789 = sTuple-    sX_0123456789 = sAList
tests/compile-and-dump/Singletons/PatternMatching.hs view
@@ -22,9 +22,6 @@   [_, lsz, (Succ blimy)] = aList   lsz :: Nat   fls :: Bool-#if __GLASGOW_HASKELL__ < 707-  blimy :: Nat   -- this is necessary to promote nested patterns-#endif    foo1 :: (a, b) -> a   foo1 (x, y) = (\_ -> x) y@@ -32,6 +29,9 @@   foo2 :: (# a, b #) -> a   foo2 t@(# x, y #) = case t of                         (# a, b #) -> (\_ -> a) b++  silly :: a -> ()+  silly x = case x of _ -> ()   |])  test1 :: Proxy (Foo1 '(Int, Char)) -> Proxy Int
+ tests/compile-and-dump/Singletons/Records.ghc710.template view
@@ -0,0 +1,59 @@+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 Field1Sym1 (t :: Record a) = Field1 t+    instance SuppressUnusedWarnings Field1Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Field1Sym0KindInference GHC.Tuple.())+    data Field1Sym0 (l :: TyFun (Record a) a)+      = forall arg. KindOf (Apply Field1Sym0 arg) ~ KindOf (Field1Sym1 arg) =>+        Field1Sym0KindInference+    type instance Apply Field1Sym0 l = Field1Sym1 l+    type Field2Sym1 (t :: Record a) = Field2 t+    instance SuppressUnusedWarnings Field2Sym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) Field2Sym0KindInference GHC.Tuple.())+    data Field2Sym0 (l :: TyFun (Record a) Bool)+      = forall arg. KindOf (Apply Field2Sym0 arg) ~ KindOf (Field2Sym1 arg) =>+        Field2Sym0KindInference+    type instance Apply Field2Sym0 l = Field2Sym1 l+    type family Field1 (a :: Record a) :: a where+      Field1 (MkRecord field _z_0123456789) = field+    type family Field2 (a :: Record a) :: Bool where+      Field2 (MkRecord _z_0123456789 field) = field+    type MkRecordSym2 (t :: a) (t :: Bool) = MkRecord t t+    instance SuppressUnusedWarnings MkRecordSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) MkRecordSym1KindInference GHC.Tuple.())+    data MkRecordSym1 (l :: a) (l :: TyFun Bool (Record a))+      = forall arg. KindOf (Apply (MkRecordSym1 l) arg) ~ KindOf (MkRecordSym2 l arg) =>+        MkRecordSym1KindInference+    type instance Apply (MkRecordSym1 l) l = MkRecordSym2 l l+    instance SuppressUnusedWarnings MkRecordSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) MkRecordSym0KindInference GHC.Tuple.())+    data MkRecordSym0 (l :: TyFun a (TyFun Bool (Record a) -> *))+      = forall arg. KindOf (Apply MkRecordSym0 arg) ~ KindOf (MkRecordSym1 arg) =>+        MkRecordSym0KindInference+    type instance Apply MkRecordSym0 l = MkRecordSym1 l+    data instance Sing (z :: Record a)+      = forall (n :: a) (n :: Bool). z ~ MkRecord n n =>+        SMkRecord {sField1 :: Sing (n :: a), sField2 :: Sing (n :: Bool)}+    type SRecord = (Sing :: Record a -> *)+    instance SingKind (KProxy :: KProxy a) =>+             SingKind (KProxy :: KProxy (Record a)) where+      type DemoteRep (KProxy :: KProxy (Record a)) = Record (DemoteRep (KProxy :: KProxy a))+      fromSing (SMkRecord b b) = MkRecord (fromSing b) (fromSing b)+      toSing (MkRecord b b)+        = case+              GHC.Tuple.(,)+                (toSing b :: SomeSing (KProxy :: KProxy a))+                (toSing b :: SomeSing (KProxy :: KProxy Bool))+          of {+            GHC.Tuple.(,) (SomeSing c) (SomeSing c)+              -> SomeSing (SMkRecord c c) }+    instance (SingI n, SingI n) =>+             SingI (MkRecord (n :: a) (n :: Bool)) where+      sing = SMkRecord sing sing
− tests/compile-and-dump/Singletons/Records.ghc78.template
@@ -1,60 +0,0 @@-Singletons/Records.hs:0:0: Splicing declarations-    singletons-      [d| data Record a = MkRecord {field1 :: a, field2 :: Bool} |]-  ======>-    Singletons/Records.hs:(0,0)-(0,0)-    data Record a = MkRecord {field1 :: a, field2 :: Bool}-    type Field1Sym1 (t :: Record a) = Field1 t-    instance SuppressUnusedWarnings Field1Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Field1Sym0KindInference GHC.Tuple.())-    data Field1Sym0 (l :: TyFun (Record a) a)-      = forall arg. KindOf (Apply Field1Sym0 arg) ~ KindOf (Field1Sym1 arg) =>-        Field1Sym0KindInference-    type instance Apply Field1Sym0 l = Field1Sym1 l-    type Field2Sym1 (t :: Record a) = Field2 t-    instance SuppressUnusedWarnings Field2Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Field2Sym0KindInference GHC.Tuple.())-    data Field2Sym0 (l :: TyFun (Record a) Bool)-      = forall arg. KindOf (Apply Field2Sym0 arg) ~ KindOf (Field2Sym1 arg) =>-        Field2Sym0KindInference-    type instance Apply Field2Sym0 l = Field2Sym1 l-    type family Field1 (a :: Record a) :: a where-      Field1 (MkRecord field z) = field-    type family Field2 (a :: Record a) :: Bool where-      Field2 (MkRecord z field) = field-    type MkRecordSym2 (t :: a) (t :: Bool) = MkRecord t t-    instance SuppressUnusedWarnings MkRecordSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) MkRecordSym1KindInference GHC.Tuple.())-    data MkRecordSym1 (l :: a) (l :: TyFun Bool (Record a))-      = forall arg. KindOf (Apply (MkRecordSym1 l) arg) ~ KindOf (MkRecordSym2 l arg) =>-        MkRecordSym1KindInference-    type instance Apply (MkRecordSym1 l) l = MkRecordSym2 l l-    instance SuppressUnusedWarnings MkRecordSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) MkRecordSym0KindInference GHC.Tuple.())-    data MkRecordSym0 (l :: TyFun a (TyFun Bool (Record a) -> *))-      = forall arg. KindOf (Apply MkRecordSym0 arg) ~ KindOf (MkRecordSym1 arg) =>-        MkRecordSym0KindInference-    type instance Apply MkRecordSym0 l = MkRecordSym1 l-    data instance Sing (z :: Record a)-      = forall (n :: a) (n :: Bool). z ~ MkRecord n n =>-        SMkRecord {sField1 :: Sing n, sField2 :: Sing n}-    type SRecord (z :: Record a) = Sing z-    instance SingKind (KProxy :: KProxy a) =>-             SingKind (KProxy :: KProxy (Record a)) where-      type DemoteRep (KProxy :: KProxy (Record a)) = Record (DemoteRep (KProxy :: KProxy a))-      fromSing (SMkRecord b b) = MkRecord (fromSing b) (fromSing b)-      toSing (MkRecord b b)-        = case-              GHC.Tuple.(,)-                (toSing b :: SomeSing (KProxy :: KProxy a))-                (toSing b :: SomeSing (KProxy :: KProxy Bool))-          of {-            GHC.Tuple.(,) (SomeSing c) (SomeSing c)-              -> SomeSing (SMkRecord c c) }-    instance (SingI n, SingI n) =>-             SingI (MkRecord (n :: a) (n :: Bool)) where-      sing = SMkRecord sing sing
+ tests/compile-and-dump/Singletons/ReturnFunc.ghc710.template view
@@ -0,0 +1,93 @@+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 :: forall a. a -> a+    id x = x+    idFoo :: forall c a. c -> a -> a+    idFoo _ = id+    type IdSym1 (t :: a) = Id t+    instance SuppressUnusedWarnings IdSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) IdSym0KindInference GHC.Tuple.())+    data IdSym0 (l :: TyFun a a)+      = forall arg. KindOf (Apply IdSym0 arg) ~ KindOf (IdSym1 arg) =>+        IdSym0KindInference+    type instance Apply IdSym0 l = IdSym1 l+    type IdFooSym2 (t :: c) (t :: a) = IdFoo t t+    instance SuppressUnusedWarnings IdFooSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) IdFooSym1KindInference GHC.Tuple.())+    data IdFooSym1 (l :: c) (l :: TyFun a a)+      = forall arg. KindOf (Apply (IdFooSym1 l) arg) ~ KindOf (IdFooSym2 l arg) =>+        IdFooSym1KindInference+    type instance Apply (IdFooSym1 l) l = IdFooSym2 l l+    instance SuppressUnusedWarnings IdFooSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) IdFooSym0KindInference GHC.Tuple.())+    data IdFooSym0 (l :: TyFun c (TyFun a a -> *))+      = forall arg. KindOf (Apply IdFooSym0 arg) ~ KindOf (IdFooSym1 arg) =>+        IdFooSym0KindInference+    type instance Apply IdFooSym0 l = IdFooSym1 l+    type ReturnFuncSym2 (t :: Nat) (t :: Nat) = ReturnFunc t t+    instance SuppressUnusedWarnings ReturnFuncSym1 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) ReturnFuncSym1KindInference GHC.Tuple.())+    data ReturnFuncSym1 (l :: Nat) (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply (ReturnFuncSym1 l) arg) ~ KindOf (ReturnFuncSym2 l arg) =>+        ReturnFuncSym1KindInference+    type instance Apply (ReturnFuncSym1 l) l = ReturnFuncSym2 l l+    instance SuppressUnusedWarnings ReturnFuncSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) ReturnFuncSym0KindInference GHC.Tuple.())+    data ReturnFuncSym0 (l :: TyFun Nat (TyFun Nat Nat -> *))+      = forall arg. KindOf (Apply ReturnFuncSym0 arg) ~ KindOf (ReturnFuncSym1 arg) =>+        ReturnFuncSym0KindInference+    type instance Apply ReturnFuncSym0 l = ReturnFuncSym1 l+    type family Id (a :: a) :: a where+      Id x = x+    type family IdFoo (a :: c) (a :: a) :: a where+      IdFoo _z_0123456789 a_0123456789 = Apply IdSym0 a_0123456789+    type family ReturnFunc (a :: Nat) (a :: Nat) :: Nat where+      ReturnFunc _z_0123456789 a_0123456789 = Apply SuccSym0 a_0123456789+    sId :: forall (t :: a). Sing t -> Sing (Apply IdSym0 t :: a)+    sIdFoo ::+      forall (t :: c) (t :: a).+      Sing t -> Sing t -> Sing (Apply (Apply IdFooSym0 t) t :: a)+    sReturnFunc ::+      forall (t :: Nat) (t :: Nat).+      Sing t -> Sing t -> Sing (Apply (Apply ReturnFuncSym0 t) t :: Nat)+    sId sX+      = let+          lambda :: forall x. t ~ x => Sing x -> Sing (Apply IdSym0 x :: a)+          lambda x = x+        in lambda sX+    sIdFoo _s_z_0123456789 sA_0123456789+      = let+          lambda ::+            forall _z_0123456789 a_0123456789. (t ~ _z_0123456789,+                                                t ~ a_0123456789) =>+            Sing _z_0123456789+            -> Sing a_0123456789+               -> Sing (Apply (Apply IdFooSym0 _z_0123456789) a_0123456789 :: a)+          lambda _z_0123456789 a_0123456789+            = applySing (singFun1 (Proxy :: Proxy IdSym0) sId) a_0123456789+        in lambda _s_z_0123456789 sA_0123456789+    sReturnFunc _s_z_0123456789 sA_0123456789+      = let+          lambda ::+            forall _z_0123456789 a_0123456789. (t ~ _z_0123456789,+                                                t ~ a_0123456789) =>+            Sing _z_0123456789+            -> Sing a_0123456789+               -> Sing (Apply (Apply ReturnFuncSym0 _z_0123456789) a_0123456789 :: Nat)+          lambda _z_0123456789 a_0123456789+            = applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) a_0123456789+        in lambda _s_z_0123456789 sA_0123456789
− tests/compile-and-dump/Singletons/ReturnFunc.ghc78.template
@@ -1,90 +0,0 @@-Singletons/ReturnFunc.hs:0:0: Splicing declarations-    singletons-      [d| returnFunc :: Nat -> Nat -> Nat-          returnFunc _ = Succ-          id :: a -> a-          id x = x-          idFoo :: c -> a -> a-          idFoo _ = id |]-  ======>-    Singletons/ReturnFunc.hs:(0,0)-(0,0)-    returnFunc :: Nat -> Nat -> Nat-    returnFunc _ = Succ-    id :: forall a. a -> a-    id x = x-    idFoo :: forall c a. c -> a -> a-    idFoo _ = id-    type IdSym1 (t :: a) = Id t-    instance SuppressUnusedWarnings IdSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) IdSym0KindInference GHC.Tuple.())-    data IdSym0 (l :: TyFun a a)-      = forall arg. KindOf (Apply IdSym0 arg) ~ KindOf (IdSym1 arg) =>-        IdSym0KindInference-    type instance Apply IdSym0 l = IdSym1 l-    type IdFooSym2 (t :: c) (t :: a) = IdFoo t t-    instance SuppressUnusedWarnings IdFooSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) IdFooSym1KindInference GHC.Tuple.())-    data IdFooSym1 (l :: c) (l :: TyFun a a)-      = forall arg. KindOf (Apply (IdFooSym1 l) arg) ~ KindOf (IdFooSym2 l arg) =>-        IdFooSym1KindInference-    type instance Apply (IdFooSym1 l) l = IdFooSym2 l l-    instance SuppressUnusedWarnings IdFooSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) IdFooSym0KindInference GHC.Tuple.())-    data IdFooSym0 (l :: TyFun c (TyFun a a -> *))-      = forall arg. KindOf (Apply IdFooSym0 arg) ~ KindOf (IdFooSym1 arg) =>-        IdFooSym0KindInference-    type instance Apply IdFooSym0 l = IdFooSym1 l-    type ReturnFuncSym2 (t :: Nat) (t :: Nat) = ReturnFunc t t-    instance SuppressUnusedWarnings ReturnFuncSym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) ReturnFuncSym1KindInference GHC.Tuple.())-    data ReturnFuncSym1 (l :: Nat) (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply (ReturnFuncSym1 l) arg) ~ KindOf (ReturnFuncSym2 l arg) =>-        ReturnFuncSym1KindInference-    type instance Apply (ReturnFuncSym1 l) l = ReturnFuncSym2 l l-    instance SuppressUnusedWarnings ReturnFuncSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) ReturnFuncSym0KindInference GHC.Tuple.())-    data ReturnFuncSym0 (l :: TyFun Nat (TyFun Nat Nat -> *))-      = forall arg. KindOf (Apply ReturnFuncSym0 arg) ~ KindOf (ReturnFuncSym1 arg) =>-        ReturnFuncSym0KindInference-    type instance Apply ReturnFuncSym0 l = ReturnFuncSym1 l-    type family Id (a :: a) :: a where-      Id x = x-    type family IdFoo (a :: c) (a :: a) :: a where-      IdFoo z a_0123456789 = Apply IdSym0 a_0123456789-    type family ReturnFunc (a :: Nat) (a :: Nat) :: Nat where-      ReturnFunc z a_0123456789 = Apply SuccSym0 a_0123456789-    sId :: forall (t :: a). Sing t -> Sing (Apply IdSym0 t)-    sIdFoo ::-      forall (t :: c) (t :: a).-      Sing t -> Sing t -> Sing (Apply (Apply IdFooSym0 t) t)-    sReturnFunc ::-      forall (t :: Nat) (t :: Nat).-      Sing t -> Sing t -> Sing (Apply (Apply ReturnFuncSym0 t) t)-    sId sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply IdSym0 x)-          lambda x = x-        in lambda sX-    sIdFoo _ sA_0123456789-      = let-          lambda ::-            forall a_0123456789 wild. (t ~ wild, t ~ a_0123456789) =>-            Sing a_0123456789-            -> Sing (Apply (Apply IdFooSym0 wild) a_0123456789)-          lambda a_0123456789-            = applySing (singFun1 (Proxy :: Proxy IdSym0) sId) a_0123456789-        in lambda sA_0123456789-    sReturnFunc _ sA_0123456789-      = let-          lambda ::-            forall a_0123456789 wild. (t ~ wild, t ~ a_0123456789) =>-            Sing a_0123456789-            -> Sing (Apply (Apply ReturnFuncSym0 wild) a_0123456789)-          lambda a_0123456789-            = applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) a_0123456789-        in lambda sA_0123456789
+ tests/compile-and-dump/Singletons/Sections.ghc710.template view
@@ -0,0 +1,143 @@+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_0123456789 t where+      Lambda_0123456789 lhs_0123456789 = Apply (Apply (:+$) lhs_0123456789) (Apply SuccSym0 ZeroSym0)+    type Lambda_0123456789Sym1 t = Lambda_0123456789 t+    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())+    data Lambda_0123456789Sym0 l+      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>+        Lambda_0123456789Sym0KindInference+    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l+    type (:+$$$) (t :: Nat) (t :: Nat) = (:+) t t+    instance SuppressUnusedWarnings (:+$$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:+$$###) GHC.Tuple.())+    data (:+$$) (l :: Nat) (l :: TyFun Nat Nat)+      = forall arg. KindOf (Apply ((:+$$) l) arg) ~ KindOf ((:+$$$) l arg) =>+        :+$$###+    type instance Apply ((:+$$) l) l = (:+$$$) l l+    instance SuppressUnusedWarnings (:+$) where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) (:+$###) GHC.Tuple.())+    data (:+$) (l :: TyFun Nat (TyFun Nat Nat -> *))+      = forall arg. KindOf (Apply (:+$) arg) ~ KindOf ((:+$$) arg) =>+        :+$###+    type instance Apply (:+$) l = (:+$$) l+    type Foo1Sym0 = Foo1+    type Foo2Sym0 = Foo2+    type Foo3Sym0 = Foo3+    type family (:+) (a :: Nat) (a :: Nat) :: Nat where+      (:+) Zero m = m+      (:+) (Succ n) m = Apply SuccSym0 (Apply (Apply (:+$) n) m)+    type family Foo1 :: [Nat] where+      Foo1 = Apply (Apply MapSym0 (Apply (:+$) (Apply SuccSym0 ZeroSym0))) (Apply (Apply (:$) ZeroSym0) (Apply (Apply (:$) (Apply SuccSym0 ZeroSym0)) '[]))+    type family Foo2 :: [Nat] where+      Foo2 = Apply (Apply MapSym0 Lambda_0123456789Sym0) (Apply (Apply (:$) ZeroSym0) (Apply (Apply (:$) (Apply SuccSym0 ZeroSym0)) '[]))+    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)) '[]))+    (%:+) ::+      forall (t :: Nat) (t :: Nat).+      Sing t -> Sing t -> Sing (Apply (Apply (:+$) t) t :: Nat)+    sFoo1 :: Sing (Foo1Sym0 :: [Nat])+    sFoo2 :: Sing (Foo2Sym0 :: [Nat])+    sFoo3 :: Sing (Foo3Sym0 :: [Nat])+    (%:+) SZero sM+      = let+          lambda ::+            forall m. (t ~ ZeroSym0, t ~ m) =>+            Sing m -> Sing (Apply (Apply (:+$) ZeroSym0) m :: Nat)+          lambda m = m+        in lambda sM+    (%:+) (SSucc sN) sM+      = let+          lambda ::+            forall n m. (t ~ Apply SuccSym0 n, t ~ m) =>+            Sing n+            -> Sing m -> Sing (Apply (Apply (:+$) (Apply SuccSym0 n)) m :: Nat)+          lambda n m+            = applySing+                (singFun1 (Proxy :: Proxy SuccSym0) SSucc)+                (applySing (applySing (singFun2 (Proxy :: Proxy (:+$)) (%:+)) n) m)+        in lambda sN sM+    sFoo1+      = applySing+          (applySing+             (singFun2 (Proxy :: Proxy MapSym0) sMap)+             (applySing+                (singFun2 (Proxy :: Proxy (:+$)) (%:+))+                (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero)))+          (applySing+             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SZero)+             (applySing+                (applySing+                   (singFun2 (Proxy :: Proxy (:$)) SCons)+                   (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))+                SNil))+    sFoo2+      = applySing+          (applySing+             (singFun2 (Proxy :: Proxy MapSym0) sMap)+             (singFun1+                (Proxy :: Proxy Lambda_0123456789Sym0)+                (\ sLhs_0123456789+                   -> let+                        lambda ::+                          forall lhs_0123456789.+                          Sing lhs_0123456789+                          -> Sing (Apply Lambda_0123456789Sym0 lhs_0123456789)+                        lambda lhs_0123456789+                          = applySing+                              (applySing (singFun2 (Proxy :: Proxy (:+$)) (%:+)) lhs_0123456789)+                              (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero)+                      in lambda sLhs_0123456789)))+          (applySing+             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SZero)+             (applySing+                (applySing+                   (singFun2 (Proxy :: Proxy (:$)) SCons)+                   (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))+                SNil))+    sFoo3+      = applySing+          (applySing+             (applySing+                (singFun3 (Proxy :: Proxy ZipWithSym0) sZipWith)+                (singFun2 (Proxy :: Proxy (:+$)) (%:+)))+             (applySing+                (applySing+                   (singFun2 (Proxy :: Proxy (:$)) SCons)+                   (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))+                (applySing+                   (applySing+                      (singFun2 (Proxy :: Proxy (:$)) SCons)+                      (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))+                   SNil)))+          (applySing+             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SZero)+             (applySing+                (applySing+                   (singFun2 (Proxy :: Proxy (:$)) SCons)+                   (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))+                SNil))
− tests/compile-and-dump/Singletons/Sections.ghc78.template
@@ -1,143 +0,0 @@-Singletons/Sections.hs: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] |]-  ======>-    Singletons/Sections.hs:(0,0)-(0,0)-    (+) :: 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_0123456789 t where-      Lambda_0123456789 lhs_0123456789 = Apply (Apply (:+$) lhs_0123456789) (Apply SuccSym0 ZeroSym0)-    type Lambda_0123456789Sym1 t = Lambda_0123456789 t-    instance SuppressUnusedWarnings Lambda_0123456789Sym0 where-      suppressUnusedWarnings _-        = snd-            (GHC.Tuple.(,) Lambda_0123456789Sym0KindInference GHC.Tuple.())-    data Lambda_0123456789Sym0 l-      = forall arg. KindOf (Apply Lambda_0123456789Sym0 arg) ~ KindOf (Lambda_0123456789Sym1 arg) =>-        Lambda_0123456789Sym0KindInference-    type instance Apply Lambda_0123456789Sym0 l = Lambda_0123456789Sym1 l-    type (:+$$$) (t :: Nat) (t :: Nat) = (:+) t t-    instance SuppressUnusedWarnings (:+$$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:+$$###) GHC.Tuple.())-    data (:+$$) (l :: Nat) (l :: TyFun Nat Nat)-      = forall arg. KindOf (Apply ((:+$$) l) arg) ~ KindOf ((:+$$$) l arg) =>-        (:+$$###)-    type instance Apply ((:+$$) l) l = (:+$$$) l l-    instance SuppressUnusedWarnings (:+$) where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) (:+$###) GHC.Tuple.())-    data (:+$) (l :: TyFun Nat (TyFun Nat Nat -> *))-      = forall arg. KindOf (Apply (:+$) arg) ~ KindOf ((:+$$) arg) =>-        (:+$###)-    type instance Apply (:+$) l = (:+$$) l-    type Foo1Sym0 = Foo1-    type Foo2Sym0 = Foo2-    type Foo3Sym0 = Foo3-    type family (:+) (a :: Nat) (a :: Nat) :: Nat where-      (:+) Zero m = m-      (:+) (Succ n) m = Apply SuccSym0 (Apply (Apply (:+$) n) m)-    type Foo1 =-        (Apply (Apply MapSym0 (Apply (:+$) (Apply SuccSym0 ZeroSym0))) (Apply (Apply (:$) ZeroSym0) (Apply (Apply (:$) (Apply SuccSym0 ZeroSym0)) '[])) :: [Nat])-    type Foo2 =-        (Apply (Apply MapSym0 Lambda_0123456789Sym0) (Apply (Apply (:$) ZeroSym0) (Apply (Apply (:$) (Apply SuccSym0 ZeroSym0)) '[])) :: [Nat])-    type Foo3 =-        (Apply (Apply (Apply ZipWithSym0 (:+$)) (Apply (Apply (:$) (Apply SuccSym0 ZeroSym0)) (Apply (Apply (:$) (Apply SuccSym0 ZeroSym0)) '[]))) (Apply (Apply (:$) ZeroSym0) (Apply (Apply (:$) (Apply SuccSym0 ZeroSym0)) '[])) :: [Nat])-    (%:+) ::-      forall (t :: Nat) (t :: Nat).-      Sing t -> Sing t -> Sing (Apply (Apply (:+$) t) t)-    sFoo1 :: Sing Foo1Sym0-    sFoo2 :: Sing Foo2Sym0-    sFoo3 :: Sing Foo3Sym0-    (%:+) SZero sM-      = let-          lambda ::-            forall m. (t ~ ZeroSym0, t ~ m) =>-            Sing m -> Sing (Apply (Apply (:+$) ZeroSym0) m)-          lambda m = m-        in lambda sM-    (%:+) (SSucc sN) sM-      = let-          lambda ::-            forall n m. (t ~ Apply SuccSym0 n, t ~ m) =>-            Sing n -> Sing m -> Sing (Apply (Apply (:+$) (Apply SuccSym0 n)) m)-          lambda n m-            = applySing-                (singFun1 (Proxy :: Proxy SuccSym0) SSucc)-                (applySing (applySing (singFun2 (Proxy :: Proxy (:+$)) (%:+)) n) m)-        in lambda sN sM-    sFoo1-      = applySing-          (applySing-             (singFun2 (Proxy :: Proxy MapSym0) sMap)-             (applySing-                (singFun2 (Proxy :: Proxy (:+$)) (%:+))-                (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero)))-          (applySing-             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SZero)-             (applySing-                (applySing-                   (singFun2 (Proxy :: Proxy (:$)) SCons)-                   (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))-                SNil))-    sFoo2-      = applySing-          (applySing-             (singFun2 (Proxy :: Proxy MapSym0) sMap)-             (singFun1-                (Proxy :: Proxy Lambda_0123456789Sym0)-                (\ sLhs_0123456789-                   -> let-                        lambda ::-                          forall lhs_0123456789.-                          Sing lhs_0123456789-                          -> Sing (Apply Lambda_0123456789Sym0 lhs_0123456789)-                        lambda lhs_0123456789-                          = applySing-                              (applySing (singFun2 (Proxy :: Proxy (:+$)) (%:+)) lhs_0123456789)-                              (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero)-                      in lambda sLhs_0123456789)))-          (applySing-             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SZero)-             (applySing-                (applySing-                   (singFun2 (Proxy :: Proxy (:$)) SCons)-                   (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))-                SNil))-    sFoo3-      = applySing-          (applySing-             (applySing-                (singFun3 (Proxy :: Proxy ZipWithSym0) sZipWith)-                (singFun2 (Proxy :: Proxy (:+$)) (%:+)))-             (applySing-                (applySing-                   (singFun2 (Proxy :: Proxy (:$)) SCons)-                   (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))-                (applySing-                   (applySing-                      (singFun2 (Proxy :: Proxy (:$)) SCons)-                      (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))-                   SNil)))-          (applySing-             (applySing (singFun2 (Proxy :: Proxy (:$)) SCons) SZero)-             (applySing-                (applySing-                   (singFun2 (Proxy :: Proxy (:$)) SCons)-                   (applySing (singFun1 (Proxy :: Proxy SuccSym0) SSucc) SZero))-                SNil))
+ tests/compile-and-dump/Singletons/Star.ghc710.template view
@@ -0,0 +1,587 @@+Singletons/Star.hs:0:0:: Splicing declarations+    singletonStar [''Nat, ''Int, ''String, ''Maybe, ''Vec]+  ======>+    data Rep+      = Singletons.Star.Nat |+        Singletons.Star.Int |+        Singletons.Star.String |+        Singletons.Star.Maybe Rep |+        Singletons.Star.Vec Rep Nat+      deriving (Eq, Show, Read)+    type family Equals_0123456789 (a :: *) (b :: *) :: Bool where+      Equals_0123456789 Nat Nat = TrueSym0+      Equals_0123456789 Int Int = TrueSym0+      Equals_0123456789 String String = TrueSym0+      Equals_0123456789 (Maybe a) (Maybe b) = (:==) a b+      Equals_0123456789 (Vec a a) (Vec b b) = (:&&) ((:==) a b) ((:==) a b)+      Equals_0123456789 (a :: *) (b :: *) = FalseSym0+    instance PEq (KProxy :: KProxy *) where+      type (:==) (a :: *) (b :: *) = Equals_0123456789 a b+    type NatSym0 = Nat+    type IntSym0 = Int+    type StringSym0 = String+    type MaybeSym1 (t :: *) = Maybe t+    instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings MaybeSym0 where+      Data.Singletons.SuppressUnusedWarnings.suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) MaybeSym0KindInference GHC.Tuple.())+    data MaybeSym0 (l :: TyFun * *)+      = forall arg. KindOf (Apply MaybeSym0 arg) ~ KindOf (MaybeSym1 arg) =>+        MaybeSym0KindInference+    type instance Apply MaybeSym0 l = MaybeSym1 l+    type VecSym2 (t :: *) (t :: Nat) = Vec t t+    instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings VecSym1 where+      Data.Singletons.SuppressUnusedWarnings.suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) VecSym1KindInference GHC.Tuple.())+    data VecSym1 (l :: *) (l :: TyFun Nat *)+      = forall arg. KindOf (Apply (VecSym1 l) arg) ~ KindOf (VecSym2 l arg) =>+        VecSym1KindInference+    type instance Apply (VecSym1 l) l = VecSym2 l l+    instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings VecSym0 where+      Data.Singletons.SuppressUnusedWarnings.suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) VecSym0KindInference GHC.Tuple.())+    data VecSym0 (l :: TyFun * (TyFun Nat * -> *))+      = forall arg. KindOf (Apply VecSym0 arg) ~ KindOf (VecSym1 arg) =>+        VecSym0KindInference+    type instance Apply VecSym0 l = VecSym1 l+    type family Compare_0123456789 (a :: *) (a :: *) :: Ordering where+      Compare_0123456789 Nat Nat = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) '[]+      Compare_0123456789 Int Int = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) '[]+      Compare_0123456789 String String = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) '[]+      Compare_0123456789 (Maybe a_0123456789) (Maybe b_0123456789) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) '[])+      Compare_0123456789 (Vec a_0123456789 a_0123456789) (Vec b_0123456789 b_0123456789) = Apply (Apply (Apply FoldlSym0 ThenCmpSym0) EQSym0) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) (Apply (Apply (:$) (Apply (Apply CompareSym0 a_0123456789) b_0123456789)) '[]))+      Compare_0123456789 Nat Int = LTSym0+      Compare_0123456789 Nat String = LTSym0+      Compare_0123456789 Nat (Maybe _z_0123456789) = LTSym0+      Compare_0123456789 Nat (Vec _z_0123456789 _z_0123456789) = LTSym0+      Compare_0123456789 Int Nat = GTSym0+      Compare_0123456789 Int String = LTSym0+      Compare_0123456789 Int (Maybe _z_0123456789) = LTSym0+      Compare_0123456789 Int (Vec _z_0123456789 _z_0123456789) = LTSym0+      Compare_0123456789 String Nat = GTSym0+      Compare_0123456789 String Int = GTSym0+      Compare_0123456789 String (Maybe _z_0123456789) = LTSym0+      Compare_0123456789 String (Vec _z_0123456789 _z_0123456789) = LTSym0+      Compare_0123456789 (Maybe _z_0123456789) Nat = GTSym0+      Compare_0123456789 (Maybe _z_0123456789) Int = GTSym0+      Compare_0123456789 (Maybe _z_0123456789) String = GTSym0+      Compare_0123456789 (Maybe _z_0123456789) (Vec _z_0123456789 _z_0123456789) = LTSym0+      Compare_0123456789 (Vec _z_0123456789 _z_0123456789) Nat = GTSym0+      Compare_0123456789 (Vec _z_0123456789 _z_0123456789) Int = GTSym0+      Compare_0123456789 (Vec _z_0123456789 _z_0123456789) String = GTSym0+      Compare_0123456789 (Vec _z_0123456789 _z_0123456789) (Maybe _z_0123456789) = GTSym0+    type Compare_0123456789Sym2 (t :: *) (t :: *) =+        Compare_0123456789 t t+    instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings Compare_0123456789Sym1 where+      Data.Singletons.SuppressUnusedWarnings.suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Compare_0123456789Sym1KindInference GHC.Tuple.())+    data Compare_0123456789Sym1 (l :: *) (l :: TyFun * Ordering)+      = forall arg. KindOf (Apply (Compare_0123456789Sym1 l) arg) ~ KindOf (Compare_0123456789Sym2 l arg) =>+        Compare_0123456789Sym1KindInference+    type instance Apply (Compare_0123456789Sym1 l) l = Compare_0123456789Sym2 l l+    instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings Compare_0123456789Sym0 where+      Data.Singletons.SuppressUnusedWarnings.suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,) Compare_0123456789Sym0KindInference GHC.Tuple.())+    data Compare_0123456789Sym0 (l :: TyFun * (TyFun * Ordering -> *))+      = forall arg. KindOf (Apply Compare_0123456789Sym0 arg) ~ KindOf (Compare_0123456789Sym1 arg) =>+        Compare_0123456789Sym0KindInference+    type instance Apply Compare_0123456789Sym0 l = Compare_0123456789Sym1 l+    instance POrd (KProxy :: KProxy *) where+      type Compare (a :: *) (a :: *) = Apply (Apply Compare_0123456789Sym0 a) a+    instance (SOrd (KProxy :: KProxy *),+              SOrd (KProxy :: KProxy Nat)) =>+             SOrd (KProxy :: KProxy *) where+      sCompare ::+        forall (t0 :: *) (t1 :: *).+        Sing t0+        -> Sing t1+           -> Sing (Apply (Apply (CompareSym0 :: TyFun * (TyFun * Ordering+                                                          -> *)+                                                 -> *) t0 :: TyFun * Ordering -> *) t1 :: Ordering)+      sCompare SNat SNat+        = let+            lambda ::+              (t0 ~ NatSym0, t1 ~ NatSym0) =>+              Sing (Apply (Apply CompareSym0 NatSym0) NatSym0 :: Ordering)+            lambda+              = applySing+                  (applySing+                     (applySing+                        (singFun3 (Data.Proxy.Proxy :: Data.Proxy.Proxy FoldlSym0) sFoldl)+                        (singFun2+                           (Data.Proxy.Proxy :: Data.Proxy.Proxy ThenCmpSym0) sThenCmp))+                     SEQ)+                  SNil+          in lambda+      sCompare SInt SInt+        = let+            lambda ::+              (t0 ~ IntSym0, t1 ~ IntSym0) =>+              Sing (Apply (Apply CompareSym0 IntSym0) IntSym0 :: Ordering)+            lambda+              = applySing+                  (applySing+                     (applySing+                        (singFun3 (Data.Proxy.Proxy :: Data.Proxy.Proxy FoldlSym0) sFoldl)+                        (singFun2+                           (Data.Proxy.Proxy :: Data.Proxy.Proxy ThenCmpSym0) sThenCmp))+                     SEQ)+                  SNil+          in lambda+      sCompare SString SString+        = let+            lambda ::+              (t0 ~ StringSym0, t1 ~ StringSym0) =>+              Sing (Apply (Apply CompareSym0 StringSym0) StringSym0 :: Ordering)+            lambda+              = applySing+                  (applySing+                     (applySing+                        (singFun3 (Data.Proxy.Proxy :: Data.Proxy.Proxy FoldlSym0) sFoldl)+                        (singFun2+                           (Data.Proxy.Proxy :: Data.Proxy.Proxy ThenCmpSym0) sThenCmp))+                     SEQ)+                  SNil+          in lambda+      sCompare (SMaybe sA_0123456789) (SMaybe sB_0123456789)+        = let+            lambda ::+              forall a_0123456789+                     b_0123456789. (t0 ~ Apply MaybeSym0 a_0123456789,+                                    t1 ~ Apply MaybeSym0 b_0123456789) =>+              Sing a_0123456789+              -> Sing b_0123456789+                 -> Sing (Apply (Apply CompareSym0 (Apply MaybeSym0 a_0123456789)) (Apply MaybeSym0 b_0123456789) :: Ordering)+            lambda a_0123456789 b_0123456789+              = applySing+                  (applySing+                     (applySing+                        (singFun3 (Data.Proxy.Proxy :: Data.Proxy.Proxy FoldlSym0) sFoldl)+                        (singFun2+                           (Data.Proxy.Proxy :: Data.Proxy.Proxy ThenCmpSym0) sThenCmp))+                     SEQ)+                  (applySing+                     (applySing+                        (singFun2 (Data.Proxy.Proxy :: Data.Proxy.Proxy (:$)) SCons)+                        (applySing+                           (applySing+                              (singFun2+                                 (Data.Proxy.Proxy :: Data.Proxy.Proxy CompareSym0) sCompare)+                              a_0123456789)+                           b_0123456789))+                     SNil)+          in lambda sA_0123456789 sB_0123456789+      sCompare+        (SVec sA_0123456789 sA_0123456789)+        (SVec sB_0123456789 sB_0123456789)+        = let+            lambda ::+              forall a_0123456789+                     a_0123456789+                     b_0123456789+                     b_0123456789. (t0 ~ Apply (Apply VecSym0 a_0123456789) a_0123456789,+                                    t1 ~ Apply (Apply VecSym0 b_0123456789) b_0123456789) =>+              Sing a_0123456789+              -> Sing a_0123456789+                 -> Sing b_0123456789+                    -> Sing b_0123456789+                       -> Sing (Apply (Apply CompareSym0 (Apply (Apply VecSym0 a_0123456789) a_0123456789)) (Apply (Apply VecSym0 b_0123456789) b_0123456789) :: Ordering)+            lambda a_0123456789 a_0123456789 b_0123456789 b_0123456789+              = applySing+                  (applySing+                     (applySing+                        (singFun3 (Data.Proxy.Proxy :: Data.Proxy.Proxy FoldlSym0) sFoldl)+                        (singFun2+                           (Data.Proxy.Proxy :: Data.Proxy.Proxy ThenCmpSym0) sThenCmp))+                     SEQ)+                  (applySing+                     (applySing+                        (singFun2 (Data.Proxy.Proxy :: Data.Proxy.Proxy (:$)) SCons)+                        (applySing+                           (applySing+                              (singFun2+                                 (Data.Proxy.Proxy :: Data.Proxy.Proxy CompareSym0) sCompare)+                              a_0123456789)+                           b_0123456789))+                     (applySing+                        (applySing+                           (singFun2 (Data.Proxy.Proxy :: Data.Proxy.Proxy (:$)) SCons)+                           (applySing+                              (applySing+                                 (singFun2+                                    (Data.Proxy.Proxy :: Data.Proxy.Proxy CompareSym0) sCompare)+                                 a_0123456789)+                              b_0123456789))+                        SNil))+          in lambda sA_0123456789 sA_0123456789 sB_0123456789 sB_0123456789+      sCompare SNat SInt+        = let+            lambda ::+              (t0 ~ NatSym0, t1 ~ IntSym0) =>+              Sing (Apply (Apply CompareSym0 NatSym0) IntSym0 :: Ordering)+            lambda = SLT+          in lambda+      sCompare SNat SString+        = let+            lambda ::+              (t0 ~ NatSym0, t1 ~ StringSym0) =>+              Sing (Apply (Apply CompareSym0 NatSym0) StringSym0 :: Ordering)+            lambda = SLT+          in lambda+      sCompare SNat (SMaybe _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789. (t0 ~ NatSym0,+                                     t1 ~ Apply MaybeSym0 _z_0123456789) =>+              Sing _z_0123456789+              -> Sing (Apply (Apply CompareSym0 NatSym0) (Apply MaybeSym0 _z_0123456789) :: Ordering)+            lambda _z_0123456789 = SLT+          in lambda _s_z_0123456789+      sCompare SNat (SVec _s_z_0123456789 _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789 _z_0123456789. (t0 ~ NatSym0,+                                                   t1 ~ Apply (Apply VecSym0 _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing (Apply (Apply CompareSym0 NatSym0) (Apply (Apply VecSym0 _z_0123456789) _z_0123456789) :: Ordering)+            lambda _z_0123456789 _z_0123456789 = SLT+          in lambda _s_z_0123456789 _s_z_0123456789+      sCompare SInt SNat+        = let+            lambda ::+              (t0 ~ IntSym0, t1 ~ NatSym0) =>+              Sing (Apply (Apply CompareSym0 IntSym0) NatSym0 :: Ordering)+            lambda = SGT+          in lambda+      sCompare SInt SString+        = let+            lambda ::+              (t0 ~ IntSym0, t1 ~ StringSym0) =>+              Sing (Apply (Apply CompareSym0 IntSym0) StringSym0 :: Ordering)+            lambda = SLT+          in lambda+      sCompare SInt (SMaybe _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789. (t0 ~ IntSym0,+                                     t1 ~ Apply MaybeSym0 _z_0123456789) =>+              Sing _z_0123456789+              -> Sing (Apply (Apply CompareSym0 IntSym0) (Apply MaybeSym0 _z_0123456789) :: Ordering)+            lambda _z_0123456789 = SLT+          in lambda _s_z_0123456789+      sCompare SInt (SVec _s_z_0123456789 _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789 _z_0123456789. (t0 ~ IntSym0,+                                                   t1 ~ Apply (Apply VecSym0 _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing (Apply (Apply CompareSym0 IntSym0) (Apply (Apply VecSym0 _z_0123456789) _z_0123456789) :: Ordering)+            lambda _z_0123456789 _z_0123456789 = SLT+          in lambda _s_z_0123456789 _s_z_0123456789+      sCompare SString SNat+        = let+            lambda ::+              (t0 ~ StringSym0, t1 ~ NatSym0) =>+              Sing (Apply (Apply CompareSym0 StringSym0) NatSym0 :: Ordering)+            lambda = SGT+          in lambda+      sCompare SString SInt+        = let+            lambda ::+              (t0 ~ StringSym0, t1 ~ IntSym0) =>+              Sing (Apply (Apply CompareSym0 StringSym0) IntSym0 :: Ordering)+            lambda = SGT+          in lambda+      sCompare SString (SMaybe _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789. (t0 ~ StringSym0,+                                     t1 ~ Apply MaybeSym0 _z_0123456789) =>+              Sing _z_0123456789+              -> Sing (Apply (Apply CompareSym0 StringSym0) (Apply MaybeSym0 _z_0123456789) :: Ordering)+            lambda _z_0123456789 = SLT+          in lambda _s_z_0123456789+      sCompare SString (SVec _s_z_0123456789 _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789 _z_0123456789. (t0 ~ StringSym0,+                                                   t1 ~ Apply (Apply VecSym0 _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing (Apply (Apply CompareSym0 StringSym0) (Apply (Apply VecSym0 _z_0123456789) _z_0123456789) :: Ordering)+            lambda _z_0123456789 _z_0123456789 = SLT+          in lambda _s_z_0123456789 _s_z_0123456789+      sCompare (SMaybe _s_z_0123456789) SNat+        = let+            lambda ::+              forall _z_0123456789. (t0 ~ Apply MaybeSym0 _z_0123456789,+                                     t1 ~ NatSym0) =>+              Sing _z_0123456789+              -> Sing (Apply (Apply CompareSym0 (Apply MaybeSym0 _z_0123456789)) NatSym0 :: Ordering)+            lambda _z_0123456789 = SGT+          in lambda _s_z_0123456789+      sCompare (SMaybe _s_z_0123456789) SInt+        = let+            lambda ::+              forall _z_0123456789. (t0 ~ Apply MaybeSym0 _z_0123456789,+                                     t1 ~ IntSym0) =>+              Sing _z_0123456789+              -> Sing (Apply (Apply CompareSym0 (Apply MaybeSym0 _z_0123456789)) IntSym0 :: Ordering)+            lambda _z_0123456789 = SGT+          in lambda _s_z_0123456789+      sCompare (SMaybe _s_z_0123456789) SString+        = let+            lambda ::+              forall _z_0123456789. (t0 ~ Apply MaybeSym0 _z_0123456789,+                                     t1 ~ StringSym0) =>+              Sing _z_0123456789+              -> Sing (Apply (Apply CompareSym0 (Apply MaybeSym0 _z_0123456789)) StringSym0 :: Ordering)+            lambda _z_0123456789 = SGT+          in lambda _s_z_0123456789+      sCompare+        (SMaybe _s_z_0123456789)+        (SVec _s_z_0123456789 _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply MaybeSym0 _z_0123456789,+                                     t1 ~ Apply (Apply VecSym0 _z_0123456789) _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing (Apply (Apply CompareSym0 (Apply MaybeSym0 _z_0123456789)) (Apply (Apply VecSym0 _z_0123456789) _z_0123456789) :: Ordering)+            lambda _z_0123456789 _z_0123456789 _z_0123456789 = SLT+          in lambda _s_z_0123456789 _s_z_0123456789 _s_z_0123456789+      sCompare (SVec _s_z_0123456789 _s_z_0123456789) SNat+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply VecSym0 _z_0123456789) _z_0123456789,+                                     t1 ~ NatSym0) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing (Apply (Apply CompareSym0 (Apply (Apply VecSym0 _z_0123456789) _z_0123456789)) NatSym0 :: Ordering)+            lambda _z_0123456789 _z_0123456789 = SGT+          in lambda _s_z_0123456789 _s_z_0123456789+      sCompare (SVec _s_z_0123456789 _s_z_0123456789) SInt+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply VecSym0 _z_0123456789) _z_0123456789,+                                     t1 ~ IntSym0) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing (Apply (Apply CompareSym0 (Apply (Apply VecSym0 _z_0123456789) _z_0123456789)) IntSym0 :: Ordering)+            lambda _z_0123456789 _z_0123456789 = SGT+          in lambda _s_z_0123456789 _s_z_0123456789+      sCompare (SVec _s_z_0123456789 _s_z_0123456789) SString+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply VecSym0 _z_0123456789) _z_0123456789,+                                     t1 ~ StringSym0) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing (Apply (Apply CompareSym0 (Apply (Apply VecSym0 _z_0123456789) _z_0123456789)) StringSym0 :: Ordering)+            lambda _z_0123456789 _z_0123456789 = SGT+          in lambda _s_z_0123456789 _s_z_0123456789+      sCompare+        (SVec _s_z_0123456789 _s_z_0123456789)+        (SMaybe _s_z_0123456789)+        = let+            lambda ::+              forall _z_0123456789+                     _z_0123456789+                     _z_0123456789. (t0 ~ Apply (Apply VecSym0 _z_0123456789) _z_0123456789,+                                     t1 ~ Apply MaybeSym0 _z_0123456789) =>+              Sing _z_0123456789+              -> Sing _z_0123456789+                 -> Sing _z_0123456789+                    -> Sing (Apply (Apply CompareSym0 (Apply (Apply VecSym0 _z_0123456789) _z_0123456789)) (Apply MaybeSym0 _z_0123456789) :: Ordering)+            lambda _z_0123456789 _z_0123456789 _z_0123456789 = SGT+          in lambda _s_z_0123456789 _s_z_0123456789 _s_z_0123456789+    data instance Sing (z :: *)+      = z ~ Nat => SNat |+        z ~ Int => SInt |+        z ~ String => SString |+        forall (n :: *). z ~ Maybe n => SMaybe (Sing (n :: *)) |+        forall (n :: *) (n :: Nat). z ~ Vec n n =>+        SVec (Sing (n :: *)) (Sing (n :: Nat))+    type SRep = (Sing :: * -> *)+    instance SingKind (KProxy :: KProxy *) where+      type DemoteRep (KProxy :: KProxy *) = 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)+        = case toSing b :: SomeSing (KProxy :: KProxy *) of {+            SomeSing c -> SomeSing (SMaybe c) }+      toSing (Singletons.Star.Vec b b)+        = case+              GHC.Tuple.(,)+                (toSing b :: SomeSing (KProxy :: KProxy *))+                (toSing b :: SomeSing (KProxy :: KProxy Nat))+          of {+            GHC.Tuple.(,) (SomeSing c) (SomeSing c) -> SomeSing (SVec c c) }+    instance SEq (KProxy :: KProxy *) 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 (KProxy :: KProxy *) where+      (%~) SNat SNat = Proved Refl+      (%~) SNat SInt+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SNat SString+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SNat (SMaybe _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SNat (SVec _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SInt SNat+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SInt SInt = Proved Refl+      (%~) SInt SString+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SInt (SMaybe _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SInt (SVec _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SString SNat+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SString SInt+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SString SString = Proved Refl+      (%~) SString (SMaybe _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) SString (SVec _ _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SMaybe _) SNat+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SMaybe _) SInt+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SMaybe _) SString+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (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 {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SVec _ _) SNat+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SVec _ _) SInt+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SVec _ _) SString+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SVec _ _) (SMaybe _)+        = Disproved+            (\ x+               -> case x of {+                    _ -> error "Empty case reached -- this should be impossible" })+      (%~) (SVec a a) (SVec b b)+        = case GHC.Tuple.(,) ((%~) a b) ((%~) a b) of {+            GHC.Tuple.(,) (Proved Refl) (Proved Refl) -> Proved Refl+            GHC.Tuple.(,) (Disproved contra) _+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })+            GHC.Tuple.(,) _ (Disproved contra)+              -> Disproved (\ refl -> case refl of { Refl -> contra Refl }) }+    instance SingI Nat where+      sing = SNat+    instance SingI Int where+      sing = SInt+    instance SingI String where+      sing = SString+    instance SingI n => SingI (Maybe (n :: *)) where+      sing = SMaybe sing+    instance (SingI n, SingI n) =>+             SingI (Vec (n :: *) (n :: Nat)) where+      sing = SVec sing sing
− tests/compile-and-dump/Singletons/Star.ghc78.template
@@ -1,252 +0,0 @@-Singletons/Star.hs:0:0: Splicing declarations-    singletonStar [''Nat, ''Int, ''String, ''Maybe, ''Vec]-  ======>-    Singletons/Star.hs:0:0:-    data Rep-      = Singletons.Star.Nat |-        Singletons.Star.Int |-        Singletons.Star.String |-        Singletons.Star.Maybe Rep |-        Singletons.Star.Vec Rep Nat-      deriving (Eq, Show, Read)-    type family Equals_0123456789 (a :: *) (b :: *) :: Bool where-      Equals_0123456789 Nat Nat = TrueSym0-      Equals_0123456789 Int Int = TrueSym0-      Equals_0123456789 String String = TrueSym0-      Equals_0123456789 (Maybe a) (Maybe b) = (:==) a b-      Equals_0123456789 (Vec a a) (Vec b b) = (:&&) ((:==) a b) ((:==) a b)-      Equals_0123456789 (a :: *) (b :: *) = FalseSym0-    instance PEq (KProxy :: KProxy *) where-      type (:==) (a :: *) (b :: *) = Equals_0123456789 a b-    instance POrd (KProxy :: KProxy *) where-      type Compare Nat Nat = EQ-      type Compare Nat Int = LT-      type Compare Nat String = LT-      type Compare Nat (Maybe rhs) = LT-      type Compare Nat (Vec rhs rhs) = LT-      type Compare Int Nat = GT-      type Compare Int Int = EQ-      type Compare Int String = LT-      type Compare Int (Maybe rhs) = LT-      type Compare Int (Vec rhs rhs) = LT-      type Compare String Nat = GT-      type Compare String Int = GT-      type Compare String String = EQ-      type Compare String (Maybe rhs) = LT-      type Compare String (Vec rhs rhs) = LT-      type Compare (Maybe lhs) Nat = GT-      type Compare (Maybe lhs) Int = GT-      type Compare (Maybe lhs) String = GT-      type Compare (Maybe lhs) (Maybe rhs) = ThenCmp EQ (Compare lhs rhs)-      type Compare (Maybe lhs) (Vec rhs rhs) = LT-      type Compare (Vec lhs lhs) Nat = GT-      type Compare (Vec lhs lhs) Int = GT-      type Compare (Vec lhs lhs) String = GT-      type Compare (Vec lhs lhs) (Maybe rhs) = GT-      type Compare (Vec lhs lhs) (Vec rhs rhs) = ThenCmp (ThenCmp EQ (Compare lhs rhs)) (Compare lhs rhs)-    type NatSym0 = Nat-    type IntSym0 = Int-    type StringSym0 = String-    type MaybeSym1 (t :: *) = Maybe t-    instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings MaybeSym0 where-      Data.Singletons.SuppressUnusedWarnings.suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) MaybeSym0KindInference GHC.Tuple.())-    data MaybeSym0 (l :: TyFun * *)-      = forall arg. KindOf (Apply MaybeSym0 arg) ~ KindOf (MaybeSym1 arg) =>-        MaybeSym0KindInference-    type instance Apply MaybeSym0 l = MaybeSym1 l-    type VecSym2 (t :: *) (t :: Nat) = Vec t t-    instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings VecSym1 where-      Data.Singletons.SuppressUnusedWarnings.suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) VecSym1KindInference GHC.Tuple.())-    data VecSym1 (l :: *) (l :: TyFun Nat *)-      = forall arg. KindOf (Apply (VecSym1 l) arg) ~ KindOf (VecSym2 l arg) =>-        VecSym1KindInference-    type instance Apply (VecSym1 l) l = VecSym2 l l-    instance Data.Singletons.SuppressUnusedWarnings.SuppressUnusedWarnings VecSym0 where-      Data.Singletons.SuppressUnusedWarnings.suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) VecSym0KindInference GHC.Tuple.())-    data VecSym0 (l :: TyFun * (TyFun Nat * -> *))-      = forall arg. KindOf (Apply VecSym0 arg) ~ KindOf (VecSym1 arg) =>-        VecSym0KindInference-    type instance Apply VecSym0 l = VecSym1 l-    data instance Sing (z :: *)-      = z ~ Nat => SNat |-        z ~ Int => SInt |-        z ~ String => SString |-        forall (n :: *). z ~ Maybe n => SMaybe (Sing n) |-        forall (n :: *) (n :: Nat). z ~ Vec n n => SVec (Sing n) (Sing n)-    type SRep (z :: *) = Sing z-    instance SingKind (KProxy :: KProxy *) where-      type DemoteRep (KProxy :: KProxy *) = 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)-        = case toSing b :: SomeSing (KProxy :: KProxy *) of {-            SomeSing c -> SomeSing (SMaybe c) }-      toSing (Singletons.Star.Vec b b)-        = case-              GHC.Tuple.(,)-                (toSing b :: SomeSing (KProxy :: KProxy *))-                (toSing b :: SomeSing (KProxy :: KProxy Nat))-          of {-            GHC.Tuple.(,) (SomeSing c) (SomeSing c) -> SomeSing (SVec c c) }-    instance SEq (KProxy :: KProxy *) 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 (KProxy :: KProxy *) where-      (%~) SNat SNat = Proved Refl-      (%~) SNat SInt-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SNat SString-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SNat (SMaybe _)-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SNat (SVec _ _)-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SInt SNat-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SInt SInt = Proved Refl-      (%~) SInt SString-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SInt (SMaybe _)-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SInt (SVec _ _)-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SString SNat-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SString SInt-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SString SString = Proved Refl-      (%~) SString (SMaybe _)-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) SString (SVec _ _)-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) (SMaybe _) SNat-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) (SMaybe _) SInt-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) (SMaybe _) SString-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) (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 {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) (SVec _ _) SNat-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) (SVec _ _) SInt-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) (SVec _ _) SString-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) (SVec _ _) (SMaybe _)-        = Disproved-            (\ x-               -> case x of {-                    _ -> error "Empty case reached -- this should be impossible" })-      (%~) (SVec a a) (SVec b b)-        = case GHC.Tuple.(,) ((%~) a b) ((%~) a b) of {-            GHC.Tuple.(,) (Proved Refl) (Proved Refl) -> Proved Refl-            GHC.Tuple.(,) (Disproved contra) _-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl })-            GHC.Tuple.(,) _ (Disproved contra)-              -> Disproved (\ refl -> case refl of { Refl -> contra Refl }) }-    instance SingI Nat where-      sing = SNat-    instance SingI Int where-      sing = SInt-    instance SingI String where-      sing = SString-    instance SingI n => SingI (Maybe (n :: *)) where-      sing = SMaybe sing-    instance (SingI n, SingI n) =>-             SingI (Vec (n :: *) (n :: Nat)) where-      sing = SVec sing sing
+ tests/compile-and-dump/Singletons/T124.ghc710.template view
@@ -0,0 +1,37 @@+Singletons/T124.hs:(0,0)-(0,0): Splicing declarations+    singletons+      [d| foo :: Bool -> ()+          foo True = ()+          foo False = () |]+  ======>+    foo :: Bool -> ()+    foo True = GHC.Tuple.()+    foo False = GHC.Tuple.()+    type FooSym1 (t :: Bool) = Foo t+    instance SuppressUnusedWarnings FooSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) FooSym0KindInference GHC.Tuple.())+    data FooSym0 (l :: TyFun Bool ())+      = forall arg. KindOf (Apply FooSym0 arg) ~ KindOf (FooSym1 arg) =>+        FooSym0KindInference+    type instance Apply FooSym0 l = FooSym1 l+    type family Foo (a :: Bool) :: () where+      Foo True = Tuple0Sym0+      Foo False = Tuple0Sym0+    sFoo :: forall (t :: Bool). Sing t -> Sing (Apply FooSym0 t :: ())+    sFoo STrue+      = let+          lambda :: t ~ TrueSym0 => Sing (Apply FooSym0 TrueSym0 :: ())+          lambda = STuple0+        in lambda+    sFoo SFalse+      = let+          lambda :: t ~ FalseSym0 => Sing (Apply FooSym0 FalseSym0 :: ())+          lambda = STuple0+        in lambda+Singletons/T124.hs:0:0:: Splicing expression+    sCases ''Bool [| b |] [| STuple0 |]+  ======>+    case b of {+      SFalse -> STuple0+      STrue -> STuple0 }
+ tests/compile-and-dump/Singletons/T124.hs view
@@ -0,0 +1,13 @@+module Singletons.T124 where++import Data.Singletons.TH+import Data.Singletons.Prelude++$(singletons [d|+  foo :: Bool -> ()+  foo True = ()+  foo False = ()+  |])++bar :: SBool b -> STuple0 (Foo b)+bar b = $(sCases ''Bool [| b |] [| STuple0 |])
+ tests/compile-and-dump/Singletons/T29.ghc710.template view
@@ -0,0 +1,127 @@+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 (t :: Bool) = Ban t+    instance SuppressUnusedWarnings BanSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) BanSym0KindInference GHC.Tuple.())+    data BanSym0 (l :: TyFun Bool Bool)+      = forall arg. KindOf (Apply BanSym0 arg) ~ KindOf (BanSym1 arg) =>+        BanSym0KindInference+    type instance Apply BanSym0 l = BanSym1 l+    type BazSym1 (t :: Bool) = Baz t+    instance SuppressUnusedWarnings BazSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) BazSym0KindInference GHC.Tuple.())+    data BazSym0 (l :: TyFun Bool Bool)+      = forall arg. KindOf (Apply BazSym0 arg) ~ KindOf (BazSym1 arg) =>+        BazSym0KindInference+    type instance Apply BazSym0 l = BazSym1 l+    type BarSym1 (t :: Bool) = Bar t+    instance SuppressUnusedWarnings BarSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) BarSym0KindInference GHC.Tuple.())+    data BarSym0 (l :: TyFun Bool Bool)+      = forall arg. KindOf (Apply BarSym0 arg) ~ KindOf (BarSym1 arg) =>+        BarSym0KindInference+    type instance Apply BarSym0 l = BarSym1 l+    type FooSym1 (t :: Bool) = Foo t+    instance SuppressUnusedWarnings FooSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) FooSym0KindInference GHC.Tuple.())+    data FooSym0 (l :: TyFun Bool Bool)+      = forall arg. KindOf (Apply FooSym0 arg) ~ KindOf (FooSym1 arg) =>+        FooSym0KindInference+    type instance Apply FooSym0 l = FooSym1 l+    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+      = let+          lambda ::+            forall x. t ~ x => Sing x -> Sing (Apply BanSym0 x :: Bool)+          lambda x+            = applySing+                (applySing+                   (singFun2 (Proxy :: Proxy ($!$)) (%$!))+                   (applySing+                      (applySing+                         (singFun3 (Proxy :: Proxy (:.$)) (%:.))+                         (singFun1 (Proxy :: Proxy NotSym0) sNot))+                      (applySing+                         (applySing+                            (singFun3 (Proxy :: Proxy (:.$)) (%:.))+                            (singFun1 (Proxy :: Proxy NotSym0) sNot))+                         (singFun1 (Proxy :: Proxy NotSym0) sNot))))+                x+        in lambda sX+    sBaz sX+      = let+          lambda ::+            forall x. t ~ x => Sing x -> Sing (Apply BazSym0 x :: Bool)+          lambda x+            = applySing+                (applySing+                   (singFun2 (Proxy :: Proxy ($!$)) (%$!))+                   (singFun1 (Proxy :: Proxy NotSym0) sNot))+                x+        in lambda sX+    sBar sX+      = let+          lambda ::+            forall x. t ~ x => Sing x -> Sing (Apply BarSym0 x :: Bool)+          lambda x+            = applySing+                (applySing+                   (singFun2 (Proxy :: Proxy ($$)) (%$))+                   (applySing+                      (applySing+                         (singFun3 (Proxy :: Proxy (:.$)) (%:.))+                         (singFun1 (Proxy :: Proxy NotSym0) sNot))+                      (applySing+                         (applySing+                            (singFun3 (Proxy :: Proxy (:.$)) (%:.))+                            (singFun1 (Proxy :: Proxy NotSym0) sNot))+                         (singFun1 (Proxy :: Proxy NotSym0) sNot))))+                x+        in lambda sX+    sFoo sX+      = let+          lambda ::+            forall x. t ~ x => Sing x -> Sing (Apply FooSym0 x :: Bool)+          lambda x+            = applySing+                (applySing+                   (singFun2 (Proxy :: Proxy ($$)) (%$))+                   (singFun1 (Proxy :: Proxy NotSym0) sNot))+                x+        in lambda sX
− tests/compile-and-dump/Singletons/T29.ghc78.template
@@ -1,120 +0,0 @@-Singletons/T29.hs: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 |]-  ======>-    Singletons/T29.hs:(0,0)-(0,0)-    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 (t :: Bool) = Ban t-    instance SuppressUnusedWarnings BanSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) BanSym0KindInference GHC.Tuple.())-    data BanSym0 (l :: TyFun Bool Bool)-      = forall arg. KindOf (Apply BanSym0 arg) ~ KindOf (BanSym1 arg) =>-        BanSym0KindInference-    type instance Apply BanSym0 l = BanSym1 l-    type BazSym1 (t :: Bool) = Baz t-    instance SuppressUnusedWarnings BazSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) BazSym0KindInference GHC.Tuple.())-    data BazSym0 (l :: TyFun Bool Bool)-      = forall arg. KindOf (Apply BazSym0 arg) ~ KindOf (BazSym1 arg) =>-        BazSym0KindInference-    type instance Apply BazSym0 l = BazSym1 l-    type BarSym1 (t :: Bool) = Bar t-    instance SuppressUnusedWarnings BarSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) BarSym0KindInference GHC.Tuple.())-    data BarSym0 (l :: TyFun Bool Bool)-      = forall arg. KindOf (Apply BarSym0 arg) ~ KindOf (BarSym1 arg) =>-        BarSym0KindInference-    type instance Apply BarSym0 l = BarSym1 l-    type FooSym1 (t :: Bool) = Foo t-    instance SuppressUnusedWarnings FooSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) FooSym0KindInference GHC.Tuple.())-    data FooSym0 (l :: TyFun Bool Bool)-      = forall arg. KindOf (Apply FooSym0 arg) ~ KindOf (FooSym1 arg) =>-        FooSym0KindInference-    type instance Apply FooSym0 l = FooSym1 l-    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)-    sBaz :: forall (t :: Bool). Sing t -> Sing (Apply BazSym0 t)-    sBar :: forall (t :: Bool). Sing t -> Sing (Apply BarSym0 t)-    sFoo :: forall (t :: Bool). Sing t -> Sing (Apply FooSym0 t)-    sBan sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply BanSym0 x)-          lambda x-            = applySing-                (applySing-                   (singFun2 (Proxy :: Proxy ($!$)) (%$!))-                   (applySing-                      (applySing-                         (singFun3 (Proxy :: Proxy (:.$)) (%:.))-                         (singFun1 (Proxy :: Proxy NotSym0) sNot))-                      (applySing-                         (applySing-                            (singFun3 (Proxy :: Proxy (:.$)) (%:.))-                            (singFun1 (Proxy :: Proxy NotSym0) sNot))-                         (singFun1 (Proxy :: Proxy NotSym0) sNot))))-                x-        in lambda sX-    sBaz sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply BazSym0 x)-          lambda x-            = applySing-                (applySing-                   (singFun2 (Proxy :: Proxy ($!$)) (%$!))-                   (singFun1 (Proxy :: Proxy NotSym0) sNot))-                x-        in lambda sX-    sBar sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply BarSym0 x)-          lambda x-            = applySing-                (applySing-                   (singFun2 (Proxy :: Proxy ($$)) (%$))-                   (applySing-                      (applySing-                         (singFun3 (Proxy :: Proxy (:.$)) (%:.))-                         (singFun1 (Proxy :: Proxy NotSym0) sNot))-                      (applySing-                         (applySing-                            (singFun3 (Proxy :: Proxy (:.$)) (%:.))-                            (singFun1 (Proxy :: Proxy NotSym0) sNot))-                         (singFun1 (Proxy :: Proxy NotSym0) sNot))))-                x-        in lambda sX-    sFoo sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply FooSym0 x)-          lambda x-            = applySing-                (applySing-                   (singFun2 (Proxy :: Proxy ($$)) (%$))-                   (singFun1 (Proxy :: Proxy NotSym0) sNot))-                x-        in lambda sX
+ tests/compile-and-dump/Singletons/T33.ghc710.template view
@@ -0,0 +1,35 @@+Singletons/T33.hs:(0,0)-(0,0): Splicing declarations+    singletons+      [d| foo :: (Bool, Bool) -> ()+          foo ~(_, _) = () |]+  ======>+    foo :: (Bool, Bool) -> ()+    foo ~(_, _) = GHC.Tuple.()+    type FooSym1 (t :: (Bool, Bool)) = Foo t+    instance SuppressUnusedWarnings FooSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) FooSym0KindInference GHC.Tuple.())+    data FooSym0 (l :: TyFun (Bool, Bool) ())+      = forall arg. KindOf (Apply FooSym0 arg) ~ KindOf (FooSym1 arg) =>+        FooSym0KindInference+    type instance Apply FooSym0 l = FooSym1 l+    type family Foo (a :: (Bool, Bool)) :: () where+      Foo '(_z_0123456789, _z_0123456789) = Tuple0Sym0+    sFoo ::+      forall (t :: (Bool, Bool)). Sing t -> Sing (Apply FooSym0 t :: ())+    sFoo (STuple2 _s_z_0123456789 _s_z_0123456789)+      = let+          lambda ::+            forall _z_0123456789+                   _z_0123456789. t ~ Apply (Apply Tuple2Sym0 _z_0123456789) _z_0123456789 =>+            Sing _z_0123456789+            -> Sing _z_0123456789+               -> Sing (Apply FooSym0 (Apply (Apply Tuple2Sym0 _z_0123456789) _z_0123456789) :: ())+          lambda _z_0123456789 _z_0123456789 = STuple0+        in lambda _s_z_0123456789 _s_z_0123456789++Singletons/T33.hs:0:0: Warning:+    Lazy pattern converted into regular pattern in promotion++Singletons/T33.hs:0:0: Warning:+    Lazy pattern converted into regular pattern during singleton generation.
− tests/compile-and-dump/Singletons/T33.ghc78.template
@@ -1,33 +0,0 @@-Singletons/T33.hs:0:0: Splicing declarations-    singletons-      [d| foo :: (Bool, Bool) -> ()-          foo ~(_, _) = () |]-  ======>-    Singletons/T33.hs:(0,0)-(0,0)-    foo :: (Bool, Bool) -> ()-    foo ~(_, _) = GHC.Tuple.()-    type FooSym1 (t :: (Bool, Bool)) = Foo t-    instance SuppressUnusedWarnings FooSym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) FooSym0KindInference GHC.Tuple.())-    data FooSym0 (l :: TyFun (Bool, Bool) ())-      = forall arg. KindOf (Apply FooSym0 arg) ~ KindOf (FooSym1 arg) =>-        FooSym0KindInference-    type instance Apply FooSym0 l = FooSym1 l-    type family Foo (a :: (Bool, Bool)) :: () where-      Foo '(z, z) = Tuple0Sym0-    sFoo ::-      forall (t :: (Bool, Bool)). Sing t -> Sing (Apply FooSym0 t)-    sFoo (STuple2 _ _)-      = let-          lambda ::-            forall wild wild. t ~ Apply (Apply Tuple2Sym0 wild) wild =>-            Sing (Apply FooSym0 (Apply (Apply Tuple2Sym0 wild) wild))-          lambda = STuple0-        in lambda--Singletons/T33.hs:0:0: Warning:-    Lazy pattern converted into regular pattern in promotion--Singletons/T33.hs:0:0: Warning:-    Lazy pattern converted into regular pattern during singleton generation.
+ tests/compile-and-dump/Singletons/T54.ghc710.template view
@@ -0,0 +1,59 @@+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 Let0123456789Scrutinee_0123456789Sym1 t =+        Let0123456789Scrutinee_0123456789 t+    instance SuppressUnusedWarnings Let0123456789Scrutinee_0123456789Sym0 where+      suppressUnusedWarnings _+        = snd+            (GHC.Tuple.(,)+               Let0123456789Scrutinee_0123456789Sym0KindInference GHC.Tuple.())+    data Let0123456789Scrutinee_0123456789Sym0 l+      = forall arg. KindOf (Apply Let0123456789Scrutinee_0123456789Sym0 arg) ~ KindOf (Let0123456789Scrutinee_0123456789Sym1 arg) =>+        Let0123456789Scrutinee_0123456789Sym0KindInference+    type instance Apply Let0123456789Scrutinee_0123456789Sym0 l = Let0123456789Scrutinee_0123456789Sym1 l+    type family Let0123456789Scrutinee_0123456789 e where+      Let0123456789Scrutinee_0123456789 e = Apply (Apply (:$) NotSym0) '[]+    type family Case_0123456789 e t where+      Case_0123456789 e '[_z_0123456789] = NotSym0+    type GSym1 (t :: Bool) = G t+    instance SuppressUnusedWarnings GSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) GSym0KindInference GHC.Tuple.())+    data GSym0 (l :: TyFun Bool Bool)+      = forall arg. KindOf (Apply GSym0 arg) ~ KindOf (GSym1 arg) =>+        GSym0KindInference+    type instance Apply GSym0 l = GSym1 l+    type family G (a :: Bool) :: Bool where+      G e = Apply (Case_0123456789 e (Let0123456789Scrutinee_0123456789Sym1 e)) e+    sG :: forall (t :: Bool). Sing t -> Sing (Apply GSym0 t :: Bool)+    sG sE+      = let+          lambda :: forall e. t ~ e => Sing e -> Sing (Apply GSym0 e :: Bool)+          lambda e+            = applySing+                (let+                   sScrutinee_0123456789 ::+                     Sing (Let0123456789Scrutinee_0123456789Sym1 e)+                   sScrutinee_0123456789+                     = applySing+                         (applySing+                            (singFun2 (Proxy :: Proxy (:$)) SCons)+                            (singFun1 (Proxy :: Proxy NotSym0) sNot))+                         SNil+                 in  case sScrutinee_0123456789 of {+                       SCons _s_z_0123456789 SNil+                         -> let+                              lambda ::+                                forall _z_0123456789. Apply (Apply (:$) _z_0123456789) '[] ~ Let0123456789Scrutinee_0123456789Sym1 e =>+                                Sing _z_0123456789+                                -> Sing (Case_0123456789 e (Apply (Apply (:$) _z_0123456789) '[]))+                              lambda _z_0123456789 = singFun1 (Proxy :: Proxy NotSym0) sNot+                            in lambda _s_z_0123456789 } ::+                       Sing (Case_0123456789 e (Let0123456789Scrutinee_0123456789Sym1 e)))+                e+        in lambda sE
+ tests/compile-and-dump/Singletons/T54.hs view
@@ -0,0 +1,12 @@+{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}++module Singletons.T54 where++import Data.Singletons.TH+import Data.Singletons.Prelude++$(singletons [d|+  g :: Bool -> Bool+  g e = (case [not] of+            [_] -> not) e+  |])
+ tests/compile-and-dump/Singletons/T78.ghc710.template view
@@ -0,0 +1,45 @@+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 (t :: Maybe Bool) = Foo t+    instance SuppressUnusedWarnings FooSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) FooSym0KindInference GHC.Tuple.())+    data FooSym0 (l :: TyFun (Maybe Bool) Bool)+      = forall arg. KindOf (Apply FooSym0 arg) ~ KindOf (FooSym1 arg) =>+        FooSym0KindInference+    type instance Apply FooSym0 l = FooSym1 l+    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)+      = let+          lambda ::+            t ~ Apply JustSym0 FalseSym0 =>+            Sing (Apply FooSym0 (Apply JustSym0 FalseSym0) :: Bool)+          lambda = SFalse+        in lambda+    sFoo (SJust STrue)+      = let+          lambda ::+            t ~ Apply JustSym0 TrueSym0 =>+            Sing (Apply FooSym0 (Apply JustSym0 TrueSym0) :: Bool)+          lambda = STrue+        in lambda+    sFoo SNothing+      = let+          lambda ::+            t ~ NothingSym0 => Sing (Apply FooSym0 NothingSym0 :: Bool)+          lambda = SFalse+        in lambda
+ tests/compile-and-dump/Singletons/T78.hs view
@@ -0,0 +1,13 @@+module Singletons.T78 where++import Data.Singletons.TH+import Data.Singletons.Prelude++type MaybeBool = Maybe Bool++$(singletons [d|+  foo :: MaybeBool -> Bool+  foo (Just False) = False+  foo (Just True)  = True+  foo Nothing      = False+  |])
+ tests/compile-and-dump/Singletons/TopLevelPatterns.ghc710.template view
@@ -0,0 +1,404 @@+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 (t :: Bool) (t :: Bool) = Bar t t+    instance SuppressUnusedWarnings BarSym1 where+      suppressUnusedWarnings _+        = Data.Tuple.snd (GHC.Tuple.(,) BarSym1KindInference GHC.Tuple.())+    data BarSym1 (l :: Bool) (l :: TyFun Bool Foo)+      = forall arg. KindOf (Apply (BarSym1 l) arg) ~ KindOf (BarSym2 l arg) =>+        BarSym1KindInference+    type instance Apply (BarSym1 l) l = BarSym2 l l+    instance SuppressUnusedWarnings BarSym0 where+      suppressUnusedWarnings _+        = Data.Tuple.snd (GHC.Tuple.(,) BarSym0KindInference GHC.Tuple.())+    data BarSym0 (l :: TyFun Bool (TyFun Bool Foo -> *))+      = forall arg. KindOf (Apply BarSym0 arg) ~ KindOf (BarSym1 arg) =>+        BarSym0KindInference+    type instance Apply BarSym0 l = BarSym1 l+    data instance Sing (z :: Bool)+      = z ~ False => SFalse | z ~ True => STrue+    type SBool = (Sing :: Bool -> *)+    instance SingKind (KProxy :: KProxy Bool) where+      type DemoteRep (KProxy :: KProxy Bool) = Bool+      fromSing SFalse = False+      fromSing STrue = True+      toSing False = SomeSing SFalse+      toSing True = SomeSing STrue+    data instance Sing (z :: Foo)+      = forall (n :: Bool) (n :: Bool). z ~ Bar n n =>+        SBar (Sing (n :: Bool)) (Sing (n :: Bool))+    type SFoo = (Sing :: Foo -> *)+    instance SingKind (KProxy :: KProxy Foo) where+      type DemoteRep (KProxy :: KProxy Foo) = Foo+      fromSing (SBar b b) = Bar (fromSing b) (fromSing b)+      toSing (Bar b b)+        = case+              GHC.Tuple.(,)+                (toSing b :: SomeSing (KProxy :: KProxy Bool))+                (toSing b :: SomeSing (KProxy :: KProxy Bool))+          of {+            GHC.Tuple.(,) (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+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 :: forall a. 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_0123456789 a_0123456789 t where+      Case_0123456789 a_0123456789 '[y_0123456789,+                                     _z_0123456789] = y_0123456789+    type family Case_0123456789 a_0123456789 t where+      Case_0123456789 a_0123456789 '[_z_0123456789,+                                     y_0123456789] = y_0123456789+    type family Case_0123456789 a_0123456789 t where+      Case_0123456789 a_0123456789 '(y_0123456789,+                                     _z_0123456789) = y_0123456789+    type family Case_0123456789 a_0123456789 t where+      Case_0123456789 a_0123456789 '(_z_0123456789,+                                     y_0123456789) = y_0123456789+    type family Case_0123456789 t where+      Case_0123456789 (Bar y_0123456789 _z_0123456789) = y_0123456789+    type family Case_0123456789 t where+      Case_0123456789 (Bar _z_0123456789 y_0123456789) = y_0123456789+    type family Case_0123456789 t where+      Case_0123456789 '[y_0123456789, _z_0123456789] = y_0123456789+    type family Case_0123456789 t where+      Case_0123456789 '[_z_0123456789, y_0123456789] = y_0123456789+    type False_Sym0 = False_+    type NotSym1 (t :: Bool) = Not t+    instance SuppressUnusedWarnings NotSym0 where+      suppressUnusedWarnings _+        = Data.Tuple.snd (GHC.Tuple.(,) NotSym0KindInference GHC.Tuple.())+    data NotSym0 (l :: TyFun Bool Bool)+      = forall arg. KindOf (Apply NotSym0 arg) ~ KindOf (NotSym1 arg) =>+        NotSym0KindInference+    type instance Apply NotSym0 l = NotSym1 l+    type IdSym1 (t :: a) = Id t+    instance SuppressUnusedWarnings IdSym0 where+      suppressUnusedWarnings _+        = Data.Tuple.snd (GHC.Tuple.(,) IdSym0KindInference GHC.Tuple.())+    data IdSym0 (l :: TyFun a a)+      = forall arg. KindOf (Apply IdSym0 arg) ~ KindOf (IdSym1 arg) =>+        IdSym0KindInference+    type instance Apply IdSym0 l = IdSym1 l+    type FSym1 (t :: Bool) = F t+    instance SuppressUnusedWarnings FSym0 where+      suppressUnusedWarnings _+        = Data.Tuple.snd (GHC.Tuple.(,) FSym0KindInference GHC.Tuple.())+    data FSym0 (l :: TyFun Bool Bool)+      = forall arg. KindOf (Apply FSym0 arg) ~ KindOf (FSym1 arg) =>+        FSym0KindInference+    type instance Apply FSym0 l = FSym1 l+    type GSym1 (t :: Bool) = G t+    instance SuppressUnusedWarnings GSym0 where+      suppressUnusedWarnings _+        = Data.Tuple.snd (GHC.Tuple.(,) GSym0KindInference GHC.Tuple.())+    data GSym0 (l :: TyFun Bool Bool)+      = forall arg. KindOf (Apply GSym0 arg) ~ KindOf (GSym1 arg) =>+        GSym0KindInference+    type instance Apply GSym0 l = GSym1 l+    type HSym1 (t :: Bool) = H t+    instance SuppressUnusedWarnings HSym0 where+      suppressUnusedWarnings _+        = Data.Tuple.snd (GHC.Tuple.(,) HSym0KindInference GHC.Tuple.())+    data HSym0 (l :: TyFun Bool Bool)+      = forall arg. KindOf (Apply HSym0 arg) ~ KindOf (HSym1 arg) =>+        HSym0KindInference+    type instance Apply HSym0 l = HSym1 l+    type ISym1 (t :: Bool) = I t+    instance SuppressUnusedWarnings ISym0 where+      suppressUnusedWarnings _+        = Data.Tuple.snd (GHC.Tuple.(,) ISym0KindInference GHC.Tuple.())+    data ISym0 (l :: TyFun Bool Bool)+      = forall arg. KindOf (Apply ISym0 arg) ~ KindOf (ISym1 arg) =>+        ISym0KindInference+    type instance Apply ISym0 l = ISym1 l+    type JSym0 = J+    type KSym0 = K+    type LSym0 = L+    type MSym0 = M+    type OtherwiseSym0 = Otherwise+    type X_0123456789Sym0 = X_0123456789+    type X_0123456789Sym0 = X_0123456789+    type X_0123456789Sym0 = X_0123456789+    type X_0123456789Sym0 = X_0123456789+    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 F (a :: Bool) :: Bool where+      F a_0123456789 = Apply (Case_0123456789 a_0123456789 X_0123456789Sym0) a_0123456789+    type family G (a :: Bool) :: Bool where+      G a_0123456789 = Apply (Case_0123456789 a_0123456789 X_0123456789Sym0) a_0123456789+    type family H (a :: Bool) :: Bool where+      H a_0123456789 = Apply (Case_0123456789 a_0123456789 X_0123456789Sym0) a_0123456789+    type family I (a :: Bool) :: Bool where+      I a_0123456789 = Apply (Case_0123456789 a_0123456789 X_0123456789Sym0) a_0123456789+    type family J :: Bool where+      J = Case_0123456789 X_0123456789Sym0+    type family K :: Bool where+      K = Case_0123456789 X_0123456789Sym0+    type family L :: Bool where+      L = Case_0123456789 X_0123456789Sym0+    type family M :: Bool where+      M = Case_0123456789 X_0123456789Sym0+    type family Otherwise :: Bool where+      Otherwise = TrueSym0+    type family X_0123456789 where+      X_0123456789 = Apply (Apply (:$) NotSym0) (Apply (Apply (:$) IdSym0) '[])+    type family X_0123456789 where+      X_0123456789 = Apply (Apply Tuple2Sym0 FSym0) GSym0+    type family X_0123456789 where+      X_0123456789 = Apply (Apply BarSym0 TrueSym0) (Apply HSym0 FalseSym0)+    type family X_0123456789 where+      X_0123456789 = Apply (Apply (:$) (Apply NotSym0 TrueSym0)) (Apply (Apply (:$) (Apply IdSym0 FalseSym0)) '[])+    sFalse_ :: Sing False_Sym0+    sNot ::+      forall (t :: Bool). Sing t -> Sing (Apply NotSym0 t :: Bool)+    sId :: forall (t :: a). Sing t -> Sing (Apply IdSym0 t :: a)+    sF :: forall (t :: Bool). Sing t -> Sing (Apply FSym0 t :: Bool)+    sG :: forall (t :: Bool). Sing t -> Sing (Apply GSym0 t :: Bool)+    sH :: forall (t :: Bool). Sing t -> Sing (Apply HSym0 t :: Bool)+    sI :: forall (t :: Bool). Sing t -> Sing (Apply ISym0 t :: Bool)+    sJ :: Sing (JSym0 :: Bool)+    sK :: Sing (KSym0 :: Bool)+    sL :: Sing (LSym0 :: Bool)+    sM :: Sing (MSym0 :: Bool)+    sOtherwise :: Sing (OtherwiseSym0 :: Bool)+    sX_0123456789 :: Sing X_0123456789Sym0+    sX_0123456789 :: Sing X_0123456789Sym0+    sX_0123456789 :: Sing X_0123456789Sym0+    sX_0123456789 :: Sing X_0123456789Sym0+    sFalse_ = SFalse+    sNot STrue+      = let+          lambda :: t ~ TrueSym0 => Sing (Apply NotSym0 TrueSym0 :: Bool)+          lambda = SFalse+        in lambda+    sNot SFalse+      = let+          lambda :: t ~ FalseSym0 => Sing (Apply NotSym0 FalseSym0 :: Bool)+          lambda = STrue+        in lambda+    sId sX+      = let+          lambda :: forall x. t ~ x => Sing x -> Sing (Apply IdSym0 x :: a)+          lambda x = x+        in lambda sX+    sF sA_0123456789+      = let+          lambda ::+            forall a_0123456789. t ~ a_0123456789 =>+            Sing a_0123456789 -> Sing (Apply FSym0 a_0123456789 :: Bool)+          lambda a_0123456789+            = applySing+                (case sX_0123456789 of {+                   SCons sY_0123456789 (SCons _s_z_0123456789 SNil)+                     -> let+                          lambda ::+                            forall y_0123456789+                                   _z_0123456789. Apply (Apply (:$) y_0123456789) (Apply (Apply (:$) _z_0123456789) '[]) ~ X_0123456789Sym0 =>+                            Sing y_0123456789+                            -> Sing _z_0123456789+                               -> Sing (Case_0123456789 a_0123456789 (Apply (Apply (:$) y_0123456789) (Apply (Apply (:$) _z_0123456789) '[])))+                          lambda y_0123456789 _z_0123456789 = y_0123456789+                        in lambda sY_0123456789 _s_z_0123456789 } ::+                   Sing (Case_0123456789 a_0123456789 X_0123456789Sym0))+                a_0123456789+        in lambda sA_0123456789+    sG sA_0123456789+      = let+          lambda ::+            forall a_0123456789. t ~ a_0123456789 =>+            Sing a_0123456789 -> Sing (Apply GSym0 a_0123456789 :: Bool)+          lambda a_0123456789+            = applySing+                (case sX_0123456789 of {+                   SCons _s_z_0123456789 (SCons sY_0123456789 SNil)+                     -> let+                          lambda ::+                            forall _z_0123456789+                                   y_0123456789. Apply (Apply (:$) _z_0123456789) (Apply (Apply (:$) y_0123456789) '[]) ~ X_0123456789Sym0 =>+                            Sing _z_0123456789+                            -> Sing y_0123456789+                               -> Sing (Case_0123456789 a_0123456789 (Apply (Apply (:$) _z_0123456789) (Apply (Apply (:$) y_0123456789) '[])))+                          lambda _z_0123456789 y_0123456789 = y_0123456789+                        in lambda _s_z_0123456789 sY_0123456789 } ::+                   Sing (Case_0123456789 a_0123456789 X_0123456789Sym0))+                a_0123456789+        in lambda sA_0123456789+    sH sA_0123456789+      = let+          lambda ::+            forall a_0123456789. t ~ a_0123456789 =>+            Sing a_0123456789 -> Sing (Apply HSym0 a_0123456789 :: Bool)+          lambda a_0123456789+            = applySing+                (case sX_0123456789 of {+                   STuple2 sY_0123456789 _s_z_0123456789+                     -> let+                          lambda ::+                            forall y_0123456789+                                   _z_0123456789. Apply (Apply Tuple2Sym0 y_0123456789) _z_0123456789 ~ X_0123456789Sym0 =>+                            Sing y_0123456789+                            -> Sing _z_0123456789+                               -> Sing (Case_0123456789 a_0123456789 (Apply (Apply Tuple2Sym0 y_0123456789) _z_0123456789))+                          lambda y_0123456789 _z_0123456789 = y_0123456789+                        in lambda sY_0123456789 _s_z_0123456789 } ::+                   Sing (Case_0123456789 a_0123456789 X_0123456789Sym0))+                a_0123456789+        in lambda sA_0123456789+    sI sA_0123456789+      = let+          lambda ::+            forall a_0123456789. t ~ a_0123456789 =>+            Sing a_0123456789 -> Sing (Apply ISym0 a_0123456789 :: Bool)+          lambda a_0123456789+            = applySing+                (case sX_0123456789 of {+                   STuple2 _s_z_0123456789 sY_0123456789+                     -> let+                          lambda ::+                            forall _z_0123456789+                                   y_0123456789. Apply (Apply Tuple2Sym0 _z_0123456789) y_0123456789 ~ X_0123456789Sym0 =>+                            Sing _z_0123456789+                            -> Sing y_0123456789+                               -> Sing (Case_0123456789 a_0123456789 (Apply (Apply Tuple2Sym0 _z_0123456789) y_0123456789))+                          lambda _z_0123456789 y_0123456789 = y_0123456789+                        in lambda _s_z_0123456789 sY_0123456789 } ::+                   Sing (Case_0123456789 a_0123456789 X_0123456789Sym0))+                a_0123456789+        in lambda sA_0123456789+    sJ+      = case sX_0123456789 of {+          SBar sY_0123456789 _s_z_0123456789+            -> let+                 lambda ::+                   forall y_0123456789+                          _z_0123456789. Apply (Apply BarSym0 y_0123456789) _z_0123456789 ~ X_0123456789Sym0 =>+                   Sing y_0123456789+                   -> Sing _z_0123456789+                      -> Sing (Case_0123456789 (Apply (Apply BarSym0 y_0123456789) _z_0123456789))+                 lambda y_0123456789 _z_0123456789 = y_0123456789+               in lambda sY_0123456789 _s_z_0123456789 } ::+          Sing (Case_0123456789 X_0123456789Sym0)+    sK+      = case sX_0123456789 of {+          SBar _s_z_0123456789 sY_0123456789+            -> let+                 lambda ::+                   forall _z_0123456789+                          y_0123456789. Apply (Apply BarSym0 _z_0123456789) y_0123456789 ~ X_0123456789Sym0 =>+                   Sing _z_0123456789+                   -> Sing y_0123456789+                      -> Sing (Case_0123456789 (Apply (Apply BarSym0 _z_0123456789) y_0123456789))+                 lambda _z_0123456789 y_0123456789 = y_0123456789+               in lambda _s_z_0123456789 sY_0123456789 } ::+          Sing (Case_0123456789 X_0123456789Sym0)+    sL+      = case sX_0123456789 of {+          SCons sY_0123456789 (SCons _s_z_0123456789 SNil)+            -> let+                 lambda ::+                   forall y_0123456789+                          _z_0123456789. Apply (Apply (:$) y_0123456789) (Apply (Apply (:$) _z_0123456789) '[]) ~ X_0123456789Sym0 =>+                   Sing y_0123456789+                   -> Sing _z_0123456789+                      -> Sing (Case_0123456789 (Apply (Apply (:$) y_0123456789) (Apply (Apply (:$) _z_0123456789) '[])))+                 lambda y_0123456789 _z_0123456789 = y_0123456789+               in lambda sY_0123456789 _s_z_0123456789 } ::+          Sing (Case_0123456789 X_0123456789Sym0)+    sM+      = case sX_0123456789 of {+          SCons _s_z_0123456789 (SCons sY_0123456789 SNil)+            -> let+                 lambda ::+                   forall _z_0123456789+                          y_0123456789. Apply (Apply (:$) _z_0123456789) (Apply (Apply (:$) y_0123456789) '[]) ~ X_0123456789Sym0 =>+                   Sing _z_0123456789+                   -> Sing y_0123456789+                      -> Sing (Case_0123456789 (Apply (Apply (:$) _z_0123456789) (Apply (Apply (:$) y_0123456789) '[])))+                 lambda _z_0123456789 y_0123456789 = y_0123456789+               in lambda _s_z_0123456789 sY_0123456789 } ::+          Sing (Case_0123456789 X_0123456789Sym0)+    sOtherwise = STrue+    sX_0123456789+      = applySing+          (applySing+             (singFun2 (Proxy :: Proxy (:$)) SCons)+             (singFun1 (Proxy :: Proxy NotSym0) sNot))+          (applySing+             (applySing+                (singFun2 (Proxy :: Proxy (:$)) SCons)+                (singFun1 (Proxy :: Proxy IdSym0) sId))+             SNil)+    sX_0123456789+      = applySing+          (applySing+             (singFun2 (Proxy :: Proxy Tuple2Sym0) STuple2)+             (singFun1 (Proxy :: Proxy FSym0) sF))+          (singFun1 (Proxy :: Proxy GSym0) sG)+    sX_0123456789+      = applySing+          (applySing (singFun2 (Proxy :: Proxy BarSym0) SBar) STrue)+          (applySing (singFun1 (Proxy :: Proxy HSym0) sH) SFalse)+    sX_0123456789+      = applySing+          (applySing+             (singFun2 (Proxy :: Proxy (:$)) SCons)+             (applySing (singFun1 (Proxy :: Proxy NotSym0) sNot) STrue))+          (applySing+             (applySing+                (singFun2 (Proxy :: Proxy (:$)) SCons)+                (applySing (singFun1 (Proxy :: Proxy IdSym0) sId) SFalse))+             SNil)
− tests/compile-and-dump/Singletons/TopLevelPatterns.ghc78.template
@@ -1,121 +0,0 @@-Singletons/TopLevelPatterns.hs:0:0: Splicing declarations-    singletons-      [d| data Bool = False | True-          data Foo = Bar Bool Bool |]-  ======>-    Singletons/TopLevelPatterns.hs:(0,0)-(0,0)-    data Bool = False | True-    data Foo = Bar Bool Bool-    type FalseSym0 = False-    type TrueSym0 = True-    type BarSym2 (t :: Bool) (t :: Bool) = Bar t t-    instance SuppressUnusedWarnings BarSym1 where-      suppressUnusedWarnings _-        = Data.Tuple.snd (GHC.Tuple.(,) BarSym1KindInference GHC.Tuple.())-    data BarSym1 (l :: Bool) (l :: TyFun Bool Foo)-      = forall arg. KindOf (Apply (BarSym1 l) arg) ~ KindOf (BarSym2 l arg) =>-        BarSym1KindInference-    type instance Apply (BarSym1 l) l = BarSym2 l l-    instance SuppressUnusedWarnings BarSym0 where-      suppressUnusedWarnings _-        = Data.Tuple.snd (GHC.Tuple.(,) BarSym0KindInference GHC.Tuple.())-    data BarSym0 (l :: TyFun Bool (TyFun Bool Foo -> *))-      = forall arg. KindOf (Apply BarSym0 arg) ~ KindOf (BarSym1 arg) =>-        BarSym0KindInference-    type instance Apply BarSym0 l = BarSym1 l-    data instance Sing (z :: Bool)-      = z ~ False => SFalse | z ~ True => STrue-    type SBool (z :: Bool) = Sing z-    instance SingKind (KProxy :: KProxy Bool) where-      type DemoteRep (KProxy :: KProxy Bool) = Bool-      fromSing SFalse = False-      fromSing STrue = True-      toSing False = SomeSing SFalse-      toSing True = SomeSing STrue-    data instance Sing (z :: Foo)-      = forall (n :: Bool) (n :: Bool). z ~ Bar n n =>-        SBar (Sing n) (Sing n)-    type SFoo (z :: Foo) = Sing z-    instance SingKind (KProxy :: KProxy Foo) where-      type DemoteRep (KProxy :: KProxy Foo) = Foo-      fromSing (SBar b b) = Bar (fromSing b) (fromSing b)-      toSing (Bar b b)-        = case-              GHC.Tuple.(,)-                (toSing b :: SomeSing (KProxy :: KProxy Bool))-                (toSing b :: SomeSing (KProxy :: KProxy Bool))-          of {-            GHC.Tuple.(,) (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-Singletons/TopLevelPatterns.hs: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 |]-  ======>-    Singletons/TopLevelPatterns.hs:(0,0)-(0,0)-    otherwise :: Bool-    otherwise = True-    id :: forall a. a -> a-    id x = x-    not :: Bool -> Bool-    not True = False-    not False = True-    false_ = False-    type False_Sym0 = False_-    type NotSym1 (t :: Bool) = Not t-    instance SuppressUnusedWarnings NotSym0 where-      suppressUnusedWarnings _-        = Data.Tuple.snd (GHC.Tuple.(,) NotSym0KindInference GHC.Tuple.())-    data NotSym0 (l :: TyFun Bool Bool)-      = forall arg. KindOf (Apply NotSym0 arg) ~ KindOf (NotSym1 arg) =>-        NotSym0KindInference-    type instance Apply NotSym0 l = NotSym1 l-    type IdSym1 (t :: a) = Id t-    instance SuppressUnusedWarnings IdSym0 where-      suppressUnusedWarnings _-        = Data.Tuple.snd (GHC.Tuple.(,) IdSym0KindInference GHC.Tuple.())-    data IdSym0 (l :: TyFun a a)-      = forall arg. KindOf (Apply IdSym0 arg) ~ KindOf (IdSym1 arg) =>-        IdSym0KindInference-    type instance Apply IdSym0 l = IdSym1 l-    type OtherwiseSym0 = Otherwise-    type 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 Otherwise = (TrueSym0 :: Bool)-    sFalse_ :: Sing False_Sym0-    sNot :: forall (t :: Bool). Sing t -> Sing (Apply NotSym0 t)-    sId :: forall (t :: a). Sing t -> Sing (Apply IdSym0 t)-    sOtherwise :: Sing OtherwiseSym0-    sFalse_ = SFalse-    sNot STrue-      = let-          lambda :: t ~ TrueSym0 => Sing (Apply NotSym0 TrueSym0)-          lambda = SFalse-        in lambda-    sNot SFalse-      = let-          lambda :: t ~ FalseSym0 => Sing (Apply NotSym0 FalseSym0)-          lambda = STrue-        in lambda-    sId sX-      = let-          lambda :: forall x. t ~ x => Sing x -> Sing (Apply IdSym0 x)-          lambda x = x-        in lambda sX-    sOtherwise = STrue
tests/compile-and-dump/Singletons/TopLevelPatterns.hs view
@@ -26,7 +26,6 @@    false_ = False -{- Commented out until #54 is fixed   f,g :: Bool -> Bool   [f,g] = [not, id] @@ -38,5 +37,4 @@    l,m :: Bool   [l,m] = [not True, id False]--}  |])
− tests/compile-and-dump/Singletons/Tuples.ghc78.template
@@ -1,606 +0,0 @@-Singletons/Tuples.hs:0:0: Splicing declarations-    genSingletons-      [''(), ''(,), ''(,,), ''(,,,), ''(,,,,), ''(,,,,,), ''(,,,,,,)]-  ======>-    Singletons/Tuples.hs:(0,0)-(0,0)-    type Tuple0Sym0 = '()-    data instance Sing (z :: ()) = z ~ '() => STuple0-    type STuple0 (z :: ()) = Sing z-    instance SingKind (KProxy :: KProxy ()) where-      type DemoteRep (KProxy :: KProxy ()) = ()-      fromSing STuple0 = GHC.Tuple.()-      toSing GHC.Tuple.() = SomeSing STuple0-    instance SingI '() where-      sing = STuple0-    type Tuple2Sym2 (t :: a) (t :: b) = '(t, t)-    instance SuppressUnusedWarnings Tuple2Sym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple2Sym1KindInference GHC.Tuple.())-    data Tuple2Sym1 (l :: a) (l :: TyFun b (a, b))-      = forall arg. KindOf (Apply (Tuple2Sym1 l) arg) ~ KindOf (Tuple2Sym2 l arg) =>-        Tuple2Sym1KindInference-    type instance Apply (Tuple2Sym1 l) l = Tuple2Sym2 l l-    instance SuppressUnusedWarnings Tuple2Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple2Sym0KindInference GHC.Tuple.())-    data Tuple2Sym0 (l :: TyFun a (TyFun b (a, b) -> *))-      = forall arg. KindOf (Apply Tuple2Sym0 arg) ~ KindOf (Tuple2Sym1 arg) =>-        Tuple2Sym0KindInference-    type instance Apply Tuple2Sym0 l = Tuple2Sym1 l-    data instance Sing (z :: (a, b))-      = forall (n :: a) (n :: b). z ~ '(n, n) =>-        STuple2 (Sing n) (Sing n)-    type STuple2 (z :: (a, b)) = Sing z-    instance (SingKind (KProxy :: KProxy a),-              SingKind (KProxy :: KProxy b)) =>-             SingKind (KProxy :: KProxy (a, b)) where-      type DemoteRep (KProxy :: KProxy (a,-                                        b)) = (DemoteRep (KProxy :: KProxy a),-                                               DemoteRep (KProxy :: KProxy b))-      fromSing (STuple2 b b) = GHC.Tuple.(,) (fromSing b) (fromSing b)-      toSing (GHC.Tuple.(,) b b)-        = case-              GHC.Tuple.(,)-                (toSing b :: SomeSing (KProxy :: KProxy a))-                (toSing b :: SomeSing (KProxy :: KProxy b))-          of {-            GHC.Tuple.(,) (SomeSing c) (SomeSing c) -> SomeSing (STuple2 c c) }-    instance (SingI n, SingI n) => SingI '((n :: a), (n :: b)) where-      sing = STuple2 sing sing-    type Tuple3Sym3 (t :: a) (t :: b) (t :: c) = '(t, t, t)-    instance SuppressUnusedWarnings Tuple3Sym2 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple3Sym2KindInference GHC.Tuple.())-    data Tuple3Sym2 (l :: a) (l :: b) (l :: TyFun c (a, b, c))-      = forall arg. KindOf (Apply (Tuple3Sym2 l l) arg) ~ KindOf (Tuple3Sym3 l l arg) =>-        Tuple3Sym2KindInference-    type instance Apply (Tuple3Sym2 l l) l = Tuple3Sym3 l l l-    instance SuppressUnusedWarnings Tuple3Sym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple3Sym1KindInference GHC.Tuple.())-    data Tuple3Sym1 (l :: a) (l :: TyFun b (TyFun c (a, b, c) -> *))-      = forall arg. KindOf (Apply (Tuple3Sym1 l) arg) ~ KindOf (Tuple3Sym2 l arg) =>-        Tuple3Sym1KindInference-    type instance Apply (Tuple3Sym1 l) l = Tuple3Sym2 l l-    instance SuppressUnusedWarnings Tuple3Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple3Sym0KindInference GHC.Tuple.())-    data Tuple3Sym0 (l :: TyFun a (TyFun b (TyFun c (a, b, c) -> *)-                                   -> *))-      = forall arg. KindOf (Apply Tuple3Sym0 arg) ~ KindOf (Tuple3Sym1 arg) =>-        Tuple3Sym0KindInference-    type instance Apply Tuple3Sym0 l = Tuple3Sym1 l-    data instance Sing (z :: (a, b, c))-      = forall (n :: a) (n :: b) (n :: c). z ~ '(n, n, n) =>-        STuple3 (Sing n) (Sing n) (Sing n)-    type STuple3 (z :: (a, b, c)) = Sing z-    instance (SingKind (KProxy :: KProxy a),-              SingKind (KProxy :: KProxy b),-              SingKind (KProxy :: KProxy c)) =>-             SingKind (KProxy :: KProxy (a, b, c)) where-      type DemoteRep (KProxy :: KProxy (a,-                                        b,-                                        c)) = (DemoteRep (KProxy :: KProxy a),-                                               DemoteRep (KProxy :: KProxy b),-                                               DemoteRep (KProxy :: KProxy c))-      fromSing (STuple3 b b b)-        = GHC.Tuple.(,,) (fromSing b) (fromSing b) (fromSing b)-      toSing (GHC.Tuple.(,,) b b b)-        = case-              GHC.Tuple.(,,)-                (toSing b :: SomeSing (KProxy :: KProxy a))-                (toSing b :: SomeSing (KProxy :: KProxy b))-                (toSing b :: SomeSing (KProxy :: KProxy c))-          of {-            GHC.Tuple.(,,) (SomeSing c) (SomeSing c) (SomeSing c)-              -> SomeSing (STuple3 c c c) }-    instance (SingI n, SingI n, SingI n) =>-             SingI '((n :: a), (n :: b), (n :: c)) where-      sing = STuple3 sing sing sing-    type Tuple4Sym4 (t :: a) (t :: b) (t :: c) (t :: d) = '(t, t, t, t)-    instance SuppressUnusedWarnings Tuple4Sym3 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple4Sym3KindInference GHC.Tuple.())-    data Tuple4Sym3 (l :: a)-                    (l :: b)-                    (l :: c)-                    (l :: TyFun d (a, b, c, d))-      = forall arg. KindOf (Apply (Tuple4Sym3 l l l) arg) ~ KindOf (Tuple4Sym4 l l l arg) =>-        Tuple4Sym3KindInference-    type instance Apply (Tuple4Sym3 l l l) l = Tuple4Sym4 l l l l-    instance SuppressUnusedWarnings Tuple4Sym2 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple4Sym2KindInference GHC.Tuple.())-    data Tuple4Sym2 (l :: a)-                    (l :: b)-                    (l :: TyFun c (TyFun d (a, b, c, d) -> *))-      = forall arg. KindOf (Apply (Tuple4Sym2 l l) arg) ~ KindOf (Tuple4Sym3 l l arg) =>-        Tuple4Sym2KindInference-    type instance Apply (Tuple4Sym2 l l) l = Tuple4Sym3 l l l-    instance SuppressUnusedWarnings Tuple4Sym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple4Sym1KindInference GHC.Tuple.())-    data Tuple4Sym1 (l :: a)-                    (l :: TyFun b (TyFun c (TyFun d (a, b, c, d) -> *) -> *))-      = forall arg. KindOf (Apply (Tuple4Sym1 l) arg) ~ KindOf (Tuple4Sym2 l arg) =>-        Tuple4Sym1KindInference-    type instance Apply (Tuple4Sym1 l) l = Tuple4Sym2 l l-    instance SuppressUnusedWarnings Tuple4Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple4Sym0KindInference GHC.Tuple.())-    data Tuple4Sym0 (l :: TyFun a (TyFun b (TyFun c (TyFun d (a,-                                                              b,-                                                              c,-                                                              d)-                                                     -> *)-                                            -> *)-                                   -> *))-      = forall arg. KindOf (Apply Tuple4Sym0 arg) ~ KindOf (Tuple4Sym1 arg) =>-        Tuple4Sym0KindInference-    type instance Apply Tuple4Sym0 l = Tuple4Sym1 l-    data instance Sing (z :: (a, b, c, d))-      = forall (n :: a) (n :: b) (n :: c) (n :: d). z ~ '(n, n, n, n) =>-        STuple4 (Sing n) (Sing n) (Sing n) (Sing n)-    type STuple4 (z :: (a, b, c, d)) = Sing z-    instance (SingKind (KProxy :: KProxy a),-              SingKind (KProxy :: KProxy b),-              SingKind (KProxy :: KProxy c),-              SingKind (KProxy :: KProxy d)) =>-             SingKind (KProxy :: KProxy (a, b, c, d)) where-      type DemoteRep (KProxy :: KProxy (a,-                                        b,-                                        c,-                                        d)) = (DemoteRep (KProxy :: KProxy a),-                                               DemoteRep (KProxy :: KProxy b),-                                               DemoteRep (KProxy :: KProxy c),-                                               DemoteRep (KProxy :: KProxy d))-      fromSing (STuple4 b b b b)-        = GHC.Tuple.(,,,)-            (fromSing b) (fromSing b) (fromSing b) (fromSing b)-      toSing (GHC.Tuple.(,,,) b b b b)-        = case-              GHC.Tuple.(,,,)-                (toSing b :: SomeSing (KProxy :: KProxy a))-                (toSing b :: SomeSing (KProxy :: KProxy b))-                (toSing b :: SomeSing (KProxy :: KProxy c))-                (toSing b :: SomeSing (KProxy :: KProxy d))-          of {-            GHC.Tuple.(,,,) (SomeSing c) (SomeSing c) (SomeSing c) (SomeSing c)-              -> SomeSing (STuple4 c c c c) }-    instance (SingI n, SingI n, SingI n, SingI n) =>-             SingI '((n :: a), (n :: b), (n :: c), (n :: d)) where-      sing = STuple4 sing sing sing sing-    type Tuple5Sym5 (t :: a) (t :: b) (t :: c) (t :: d) (t :: e) =-        '(t, t, t, t, t)-    instance SuppressUnusedWarnings Tuple5Sym4 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple5Sym4KindInference GHC.Tuple.())-    data Tuple5Sym4 (l :: a)-                    (l :: b)-                    (l :: c)-                    (l :: d)-                    (l :: TyFun e (a, b, c, d, e))-      = forall arg. KindOf (Apply (Tuple5Sym4 l l l l) arg) ~ KindOf (Tuple5Sym5 l l l l arg) =>-        Tuple5Sym4KindInference-    type instance Apply (Tuple5Sym4 l l l l) l = Tuple5Sym5 l l l l l-    instance SuppressUnusedWarnings Tuple5Sym3 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple5Sym3KindInference GHC.Tuple.())-    data Tuple5Sym3 (l :: a)-                    (l :: b)-                    (l :: c)-                    (l :: TyFun d (TyFun e (a, b, c, d, e) -> *))-      = forall arg. KindOf (Apply (Tuple5Sym3 l l l) arg) ~ KindOf (Tuple5Sym4 l l l arg) =>-        Tuple5Sym3KindInference-    type instance Apply (Tuple5Sym3 l l l) l = Tuple5Sym4 l l l l-    instance SuppressUnusedWarnings Tuple5Sym2 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple5Sym2KindInference GHC.Tuple.())-    data Tuple5Sym2 (l :: a)-                    (l :: b)-                    (l :: TyFun c (TyFun d (TyFun e (a, b, c, d, e) -> *) -> *))-      = forall arg. KindOf (Apply (Tuple5Sym2 l l) arg) ~ KindOf (Tuple5Sym3 l l arg) =>-        Tuple5Sym2KindInference-    type instance Apply (Tuple5Sym2 l l) l = Tuple5Sym3 l l l-    instance SuppressUnusedWarnings Tuple5Sym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple5Sym1KindInference GHC.Tuple.())-    data Tuple5Sym1 (l :: a)-                    (l :: TyFun b (TyFun c (TyFun d (TyFun e (a, b, c, d, e) -> *)-                                            -> *)-                                   -> *))-      = forall arg. KindOf (Apply (Tuple5Sym1 l) arg) ~ KindOf (Tuple5Sym2 l arg) =>-        Tuple5Sym1KindInference-    type instance Apply (Tuple5Sym1 l) l = Tuple5Sym2 l l-    instance SuppressUnusedWarnings Tuple5Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple5Sym0KindInference GHC.Tuple.())-    data Tuple5Sym0 (l :: TyFun a (TyFun b (TyFun c (TyFun d (TyFun e (a,-                                                                       b,-                                                                       c,-                                                                       d,-                                                                       e)-                                                              -> *)-                                                     -> *)-                                            -> *)-                                   -> *))-      = forall arg. KindOf (Apply Tuple5Sym0 arg) ~ KindOf (Tuple5Sym1 arg) =>-        Tuple5Sym0KindInference-    type instance Apply Tuple5Sym0 l = Tuple5Sym1 l-    data instance Sing (z :: (a, b, c, d, e))-      = forall (n :: a) (n :: b) (n :: c) (n :: d) (n :: e). z ~ '(n,-                                                                   n,-                                                                   n,-                                                                   n,-                                                                   n) =>-        STuple5 (Sing n) (Sing n) (Sing n) (Sing n) (Sing n)-    type STuple5 (z :: (a, b, c, d, e)) = Sing z-    instance (SingKind (KProxy :: KProxy a),-              SingKind (KProxy :: KProxy b),-              SingKind (KProxy :: KProxy c),-              SingKind (KProxy :: KProxy d),-              SingKind (KProxy :: KProxy e)) =>-             SingKind (KProxy :: KProxy (a, b, c, d, e)) where-      type DemoteRep (KProxy :: KProxy (a,-                                        b,-                                        c,-                                        d,-                                        e)) = (DemoteRep (KProxy :: KProxy a),-                                               DemoteRep (KProxy :: KProxy b),-                                               DemoteRep (KProxy :: KProxy c),-                                               DemoteRep (KProxy :: KProxy d),-                                               DemoteRep (KProxy :: KProxy e))-      fromSing (STuple5 b b b b b)-        = GHC.Tuple.(,,,,)-            (fromSing b) (fromSing b) (fromSing b) (fromSing b) (fromSing b)-      toSing (GHC.Tuple.(,,,,) b b b b b)-        = case-              GHC.Tuple.(,,,,)-                (toSing b :: SomeSing (KProxy :: KProxy a))-                (toSing b :: SomeSing (KProxy :: KProxy b))-                (toSing b :: SomeSing (KProxy :: KProxy c))-                (toSing b :: SomeSing (KProxy :: KProxy d))-                (toSing b :: SomeSing (KProxy :: KProxy e))-          of {-            GHC.Tuple.(,,,,) (SomeSing c)-                             (SomeSing c)-                             (SomeSing c)-                             (SomeSing c)-                             (SomeSing c)-              -> SomeSing (STuple5 c c c c c) }-    instance (SingI n, SingI n, SingI n, SingI n, SingI n) =>-             SingI '((n :: a), (n :: b), (n :: c), (n :: d), (n :: e)) where-      sing = STuple5 sing sing sing sing sing-    type Tuple6Sym6 (t :: a)-                    (t :: b)-                    (t :: c)-                    (t :: d)-                    (t :: e)-                    (t :: f) =-        '(t, t, t, t, t, t)-    instance SuppressUnusedWarnings Tuple6Sym5 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple6Sym5KindInference GHC.Tuple.())-    data Tuple6Sym5 (l :: a)-                    (l :: b)-                    (l :: c)-                    (l :: d)-                    (l :: e)-                    (l :: TyFun f (a, b, c, d, e, f))-      = forall arg. KindOf (Apply (Tuple6Sym5 l l l l l) arg) ~ KindOf (Tuple6Sym6 l l l l l arg) =>-        Tuple6Sym5KindInference-    type instance Apply (Tuple6Sym5 l l l l l) l = Tuple6Sym6 l l l l l l-    instance SuppressUnusedWarnings Tuple6Sym4 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple6Sym4KindInference GHC.Tuple.())-    data Tuple6Sym4 (l :: a)-                    (l :: b)-                    (l :: c)-                    (l :: d)-                    (l :: TyFun e (TyFun f (a, b, c, d, e, f) -> *))-      = forall arg. KindOf (Apply (Tuple6Sym4 l l l l) arg) ~ KindOf (Tuple6Sym5 l l l l arg) =>-        Tuple6Sym4KindInference-    type instance Apply (Tuple6Sym4 l l l l) l = Tuple6Sym5 l l l l l-    instance SuppressUnusedWarnings Tuple6Sym3 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple6Sym3KindInference GHC.Tuple.())-    data Tuple6Sym3 (l :: a)-                    (l :: b)-                    (l :: c)-                    (l :: TyFun d (TyFun e (TyFun f (a, b, c, d, e, f) -> *) -> *))-      = forall arg. KindOf (Apply (Tuple6Sym3 l l l) arg) ~ KindOf (Tuple6Sym4 l l l arg) =>-        Tuple6Sym3KindInference-    type instance Apply (Tuple6Sym3 l l l) l = Tuple6Sym4 l l l l-    instance SuppressUnusedWarnings Tuple6Sym2 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple6Sym2KindInference GHC.Tuple.())-    data Tuple6Sym2 (l :: a)-                    (l :: b)-                    (l :: TyFun c (TyFun d (TyFun e (TyFun f (a, b, c, d, e, f) -> *)-                                            -> *)-                                   -> *))-      = forall arg. KindOf (Apply (Tuple6Sym2 l l) arg) ~ KindOf (Tuple6Sym3 l l arg) =>-        Tuple6Sym2KindInference-    type instance Apply (Tuple6Sym2 l l) l = Tuple6Sym3 l l l-    instance SuppressUnusedWarnings Tuple6Sym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple6Sym1KindInference GHC.Tuple.())-    data Tuple6Sym1 (l :: a)-                    (l :: TyFun b (TyFun c (TyFun d (TyFun e (TyFun f (a,-                                                                       b,-                                                                       c,-                                                                       d,-                                                                       e,-                                                                       f)-                                                              -> *)-                                                     -> *)-                                            -> *)-                                   -> *))-      = forall arg. KindOf (Apply (Tuple6Sym1 l) arg) ~ KindOf (Tuple6Sym2 l arg) =>-        Tuple6Sym1KindInference-    type instance Apply (Tuple6Sym1 l) l = Tuple6Sym2 l l-    instance SuppressUnusedWarnings Tuple6Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple6Sym0KindInference GHC.Tuple.())-    data Tuple6Sym0 (l :: TyFun a (TyFun b (TyFun c (TyFun d (TyFun e (TyFun f (a,-                                                                                b,-                                                                                c,-                                                                                d,-                                                                                e,-                                                                                f)-                                                                       -> *)-                                                              -> *)-                                                     -> *)-                                            -> *)-                                   -> *))-      = forall arg. KindOf (Apply Tuple6Sym0 arg) ~ KindOf (Tuple6Sym1 arg) =>-        Tuple6Sym0KindInference-    type instance Apply Tuple6Sym0 l = Tuple6Sym1 l-    data instance Sing (z :: (a, b, c, d, e, f))-      = forall (n :: a)-               (n :: b)-               (n :: c)-               (n :: d)-               (n :: e)-               (n :: f). z ~ '(n, n, n, n, n, n) =>-        STuple6 (Sing n) (Sing n) (Sing n) (Sing n) (Sing n) (Sing n)-    type STuple6 (z :: (a, b, c, d, e, f)) = Sing z-    instance (SingKind (KProxy :: KProxy a),-              SingKind (KProxy :: KProxy b),-              SingKind (KProxy :: KProxy c),-              SingKind (KProxy :: KProxy d),-              SingKind (KProxy :: KProxy e),-              SingKind (KProxy :: KProxy f)) =>-             SingKind (KProxy :: KProxy (a, b, c, d, e, f)) where-      type DemoteRep (KProxy :: KProxy (a,-                                        b,-                                        c,-                                        d,-                                        e,-                                        f)) = (DemoteRep (KProxy :: KProxy a),-                                               DemoteRep (KProxy :: KProxy b),-                                               DemoteRep (KProxy :: KProxy c),-                                               DemoteRep (KProxy :: KProxy d),-                                               DemoteRep (KProxy :: KProxy e),-                                               DemoteRep (KProxy :: KProxy f))-      fromSing (STuple6 b b b b b b)-        = GHC.Tuple.(,,,,,)-            (fromSing b)-            (fromSing b)-            (fromSing b)-            (fromSing b)-            (fromSing b)-            (fromSing b)-      toSing (GHC.Tuple.(,,,,,) b b b b b b)-        = case-              GHC.Tuple.(,,,,,)-                (toSing b :: SomeSing (KProxy :: KProxy a))-                (toSing b :: SomeSing (KProxy :: KProxy b))-                (toSing b :: SomeSing (KProxy :: KProxy c))-                (toSing b :: SomeSing (KProxy :: KProxy d))-                (toSing b :: SomeSing (KProxy :: KProxy e))-                (toSing b :: SomeSing (KProxy :: KProxy f))-          of {-            GHC.Tuple.(,,,,,) (SomeSing c)-                              (SomeSing c)-                              (SomeSing c)-                              (SomeSing c)-                              (SomeSing c)-                              (SomeSing c)-              -> SomeSing (STuple6 c c c c c c) }-    instance (SingI n, SingI n, SingI n, SingI n, SingI n, SingI n) =>-             SingI '((n :: a),-                     (n :: b),-                     (n :: c),-                     (n :: d),-                     (n :: e),-                     (n :: f)) where-      sing = STuple6 sing sing sing sing sing sing-    type Tuple7Sym7 (t :: a)-                    (t :: b)-                    (t :: c)-                    (t :: d)-                    (t :: e)-                    (t :: f)-                    (t :: g) =-        '(t, t, t, t, t, t, t)-    instance SuppressUnusedWarnings Tuple7Sym6 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple7Sym6KindInference GHC.Tuple.())-    data Tuple7Sym6 (l :: a)-                    (l :: b)-                    (l :: c)-                    (l :: d)-                    (l :: e)-                    (l :: f)-                    (l :: TyFun g (a, b, c, d, e, f, g))-      = forall arg. KindOf (Apply (Tuple7Sym6 l l l l l l) arg) ~ KindOf (Tuple7Sym7 l l l l l l arg) =>-        Tuple7Sym6KindInference-    type instance Apply (Tuple7Sym6 l l l l l l) l = Tuple7Sym7 l l l l l l l-    instance SuppressUnusedWarnings Tuple7Sym5 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple7Sym5KindInference GHC.Tuple.())-    data Tuple7Sym5 (l :: a)-                    (l :: b)-                    (l :: c)-                    (l :: d)-                    (l :: e)-                    (l :: TyFun f (TyFun g (a, b, c, d, e, f, g) -> *))-      = forall arg. KindOf (Apply (Tuple7Sym5 l l l l l) arg) ~ KindOf (Tuple7Sym6 l l l l l arg) =>-        Tuple7Sym5KindInference-    type instance Apply (Tuple7Sym5 l l l l l) l = Tuple7Sym6 l l l l l l-    instance SuppressUnusedWarnings Tuple7Sym4 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple7Sym4KindInference GHC.Tuple.())-    data Tuple7Sym4 (l :: a)-                    (l :: b)-                    (l :: c)-                    (l :: d)-                    (l :: TyFun e (TyFun f (TyFun g (a, b, c, d, e, f, g) -> *) -> *))-      = forall arg. KindOf (Apply (Tuple7Sym4 l l l l) arg) ~ KindOf (Tuple7Sym5 l l l l arg) =>-        Tuple7Sym4KindInference-    type instance Apply (Tuple7Sym4 l l l l) l = Tuple7Sym5 l l l l l-    instance SuppressUnusedWarnings Tuple7Sym3 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple7Sym3KindInference GHC.Tuple.())-    data Tuple7Sym3 (l :: a)-                    (l :: b)-                    (l :: c)-                    (l :: TyFun d (TyFun e (TyFun f (TyFun g (a, b, c, d, e, f, g)-                                                     -> *)-                                            -> *)-                                   -> *))-      = forall arg. KindOf (Apply (Tuple7Sym3 l l l) arg) ~ KindOf (Tuple7Sym4 l l l arg) =>-        Tuple7Sym3KindInference-    type instance Apply (Tuple7Sym3 l l l) l = Tuple7Sym4 l l l l-    instance SuppressUnusedWarnings Tuple7Sym2 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple7Sym2KindInference GHC.Tuple.())-    data Tuple7Sym2 (l :: a)-                    (l :: b)-                    (l :: TyFun c (TyFun d (TyFun e (TyFun f (TyFun g (a,-                                                                       b,-                                                                       c,-                                                                       d,-                                                                       e,-                                                                       f,-                                                                       g)-                                                              -> *)-                                                     -> *)-                                            -> *)-                                   -> *))-      = forall arg. KindOf (Apply (Tuple7Sym2 l l) arg) ~ KindOf (Tuple7Sym3 l l arg) =>-        Tuple7Sym2KindInference-    type instance Apply (Tuple7Sym2 l l) l = Tuple7Sym3 l l l-    instance SuppressUnusedWarnings Tuple7Sym1 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple7Sym1KindInference GHC.Tuple.())-    data Tuple7Sym1 (l :: a)-                    (l :: TyFun b (TyFun c (TyFun d (TyFun e (TyFun f (TyFun g (a,-                                                                                b,-                                                                                c,-                                                                                d,-                                                                                e,-                                                                                f,-                                                                                g)-                                                                       -> *)-                                                              -> *)-                                                     -> *)-                                            -> *)-                                   -> *))-      = forall arg. KindOf (Apply (Tuple7Sym1 l) arg) ~ KindOf (Tuple7Sym2 l arg) =>-        Tuple7Sym1KindInference-    type instance Apply (Tuple7Sym1 l) l = Tuple7Sym2 l l-    instance SuppressUnusedWarnings Tuple7Sym0 where-      suppressUnusedWarnings _-        = snd (GHC.Tuple.(,) Tuple7Sym0KindInference GHC.Tuple.())-    data Tuple7Sym0 (l :: TyFun a (TyFun b (TyFun c (TyFun d (TyFun e (TyFun f (TyFun g (a,-                                                                                         b,-                                                                                         c,-                                                                                         d,-                                                                                         e,-                                                                                         f,-                                                                                         g)-                                                                                -> *)-                                                                       -> *)-                                                              -> *)-                                                     -> *)-                                            -> *)-                                   -> *))-      = forall arg. KindOf (Apply Tuple7Sym0 arg) ~ KindOf (Tuple7Sym1 arg) =>-        Tuple7Sym0KindInference-    type instance Apply Tuple7Sym0 l = Tuple7Sym1 l-    data instance Sing (z :: (a, b, c, d, e, f, g))-      = forall (n :: a)-               (n :: b)-               (n :: c)-               (n :: d)-               (n :: e)-               (n :: f)-               (n :: g). z ~ '(n, n, n, n, n, n, n) =>-        STuple7 (Sing n) (Sing n) (Sing n) (Sing n) (Sing n) (Sing n) (Sing n)-    type STuple7 (z :: (a, b, c, d, e, f, g)) = Sing z-    instance (SingKind (KProxy :: KProxy a),-              SingKind (KProxy :: KProxy b),-              SingKind (KProxy :: KProxy c),-              SingKind (KProxy :: KProxy d),-              SingKind (KProxy :: KProxy e),-              SingKind (KProxy :: KProxy f),-              SingKind (KProxy :: KProxy g)) =>-             SingKind (KProxy :: KProxy (a, b, c, d, e, f, g)) where-      type DemoteRep (KProxy :: KProxy (a,-                                        b,-                                        c,-                                        d,-                                        e,-                                        f,-                                        g)) = (DemoteRep (KProxy :: KProxy a),-                                               DemoteRep (KProxy :: KProxy b),-                                               DemoteRep (KProxy :: KProxy c),-                                               DemoteRep (KProxy :: KProxy d),-                                               DemoteRep (KProxy :: KProxy e),-                                               DemoteRep (KProxy :: KProxy f),-                                               DemoteRep (KProxy :: KProxy g))-      fromSing (STuple7 b b b b b b b)-        = GHC.Tuple.(,,,,,,)-            (fromSing b)-            (fromSing b)-            (fromSing b)-            (fromSing b)-            (fromSing b)-            (fromSing b)-            (fromSing b)-      toSing (GHC.Tuple.(,,,,,,) b b b b b b b)-        = case-              GHC.Tuple.(,,,,,,)-                (toSing b :: SomeSing (KProxy :: KProxy a))-                (toSing b :: SomeSing (KProxy :: KProxy b))-                (toSing b :: SomeSing (KProxy :: KProxy c))-                (toSing b :: SomeSing (KProxy :: KProxy d))-                (toSing b :: SomeSing (KProxy :: KProxy e))-                (toSing b :: SomeSing (KProxy :: KProxy f))-                (toSing b :: SomeSing (KProxy :: KProxy g))-          of {-            GHC.Tuple.(,,,,,,) (SomeSing c)-                               (SomeSing c)-                               (SomeSing c)-                               (SomeSing c)-                               (SomeSing c)-                               (SomeSing c)-                               (SomeSing c)-              -> SomeSing (STuple7 c c c c c c c) }-    instance (SingI n,-              SingI n,-              SingI n,-              SingI n,-              SingI n,-              SingI n,-              SingI n) =>-             SingI '((n :: a),-                     (n :: b),-                     (n :: c),-                     (n :: d),-                     (n :: e),-                     (n :: f),-                     (n :: g)) where-      sing = STuple7 sing sing sing sing sing sing sing
− tests/compile-and-dump/Singletons/Tuples.hs
@@ -1,15 +0,0 @@-module Singletons.Tuples where--import Data.Singletons-import Data.Singletons.Single-import Data.Singletons.SuppressUnusedWarnings-import Data.Singletons.Types--$(genSingletons [ ''()-                , ''(,)-                , ''(,,)-                , ''(,,,)-                , ''(,,,,)-                , ''(,,,,,)-                , ''(,,,,,,)-                ])
+ tests/compile-and-dump/Singletons/Undef.ghc710.template view
@@ -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 BarSym1 (t :: Bool) = Bar t+    instance SuppressUnusedWarnings BarSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) BarSym0KindInference GHC.Tuple.())+    data BarSym0 (l :: TyFun Bool Bool)+      = forall arg. KindOf (Apply BarSym0 arg) ~ KindOf (BarSym1 arg) =>+        BarSym0KindInference+    type instance Apply BarSym0 l = BarSym1 l+    type FooSym1 (t :: Bool) = Foo t+    instance SuppressUnusedWarnings FooSym0 where+      suppressUnusedWarnings _+        = snd (GHC.Tuple.(,) FooSym0KindInference GHC.Tuple.())+    data FooSym0 (l :: TyFun Bool Bool)+      = forall arg. KindOf (Apply FooSym0 arg) ~ KindOf (FooSym1 arg) =>+        FooSym0KindInference+    type instance Apply FooSym0 l = FooSym1 l+    type family Bar (a :: Bool) :: Bool where+      Bar a_0123456789 = Apply (Apply ErrorSym0 "urk") a_0123456789+    type family Foo (a :: Bool) :: Bool where+      Foo a_0123456789 = Apply Any a_0123456789+    sBar ::+      forall (t :: Bool). Sing t -> Sing (Apply BarSym0 t :: Bool)+    sFoo ::+      forall (t :: Bool). Sing t -> Sing (Apply FooSym0 t :: Bool)+    sBar sA_0123456789+      = let+          lambda ::+            forall a_0123456789. t ~ a_0123456789 =>+            Sing a_0123456789 -> Sing (Apply BarSym0 a_0123456789 :: Bool)+          lambda a_0123456789 = sError (sing :: Sing "urk")+        in lambda sA_0123456789+    sFoo sA_0123456789+      = let+          lambda ::+            forall a_0123456789. t ~ a_0123456789 =>+            Sing a_0123456789 -> Sing (Apply FooSym0 a_0123456789 :: Bool)+          lambda a_0123456789 = undefined+        in lambda sA_0123456789
+ tests/compile-and-dump/Singletons/Undef.hs view
@@ -0,0 +1,12 @@+module Singletons.Undef where++import Data.Singletons.TH+import Data.Singletons.Prelude++$(singletons [d|+  foo :: Bool -> Bool+  foo = undefined++  bar :: Bool -> Bool+  bar = error "urk"+  |])