[project @ 1997-07-26 23:12:13 by sof]
authorsof <unknown>
Sat, 26 Jul 1997 23:13:48 +0000 (23:13 +0000)
committersof <unknown>
Sat, 26 Jul 1997 23:13:48 +0000 (23:13 +0000)
96 files changed:
ghc/tests/deSugar/should_compile/Makefile [new file with mode: 0644]
ghc/tests/deSugar/should_compile/cvh-ds-unboxed/Life2.lhs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/cvh-ds-unboxed/UCopy.hi [new file with mode: 0644]
ghc/tests/deSugar/should_compile/cvh-ds-unboxed/UTypes.hi [new file with mode: 0644]
ghc/tests/deSugar/should_compile/cvh-ds-unboxed/cvh-unbox1.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds-wildcard.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds-wildcard.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds001.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds001.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds002.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds002.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds003.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds003.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds004.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds004.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds005.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds005.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds006.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds006.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds007.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds007.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds008.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds008.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds009.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds009.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds010.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds010.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds011.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds011.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds012.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds012.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds013.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds013.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds014.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds014.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds014a.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds014a.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds015.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds015.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds016.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds016.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds017.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds017.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds018.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds018.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds019.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds019.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds020.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds020.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds021.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds021.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds022.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds022.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds023.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds023.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds024.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds024.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds025.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds025.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds026.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds026.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds027.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds027.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds028.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds028.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds029.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds029.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds030.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds030.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds031.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds031.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds032.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds032.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds033.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds033.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds034.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds034.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds035.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds035.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds036.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds036.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds037.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds037.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds038.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds038.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds039.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds039.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds040.hs [new file with mode: 0644]
ghc/tests/deSugar/should_compile/ds040.stderr [new file with mode: 0644]
ghc/tests/deSugar/should_run/Makefile [new file with mode: 0644]
ghc/tests/deSugar/should_run/ds003.hs [new file with mode: 0644]
ghc/tests/deSugar/should_run/ds004.hs [new file with mode: 0644]
ghc/tests/deSugar/should_run/ds005.hs [new file with mode: 0644]
ghc/tests/deSugar/should_run/ds006.hs [new file with mode: 0644]
ghc/tests/deSugar/should_run/dsrun001.hs [new file with mode: 0644]
ghc/tests/deSugar/should_run/dsrun002.hs [new file with mode: 0644]

diff --git a/ghc/tests/deSugar/should_compile/Makefile b/ghc/tests/deSugar/should_compile/Makefile
new file mode 100644 (file)
index 0000000..e1bca8d
--- /dev/null
@@ -0,0 +1,18 @@
+TOP = ../../../..
+include $(TOP)/mk/boilerplate.mk
+
+HS_SRCS = $(wildcard *.hs)
+
+SRC_RUNTEST_OPTS += -o1 $*.stdout -o2 $*.stderr -x 0
+HC_OPTS += -noC -dcore-lint
+
+rn017_HC_OPTS = -hi
+
+%.o : %.hs
+       $(RUNTEST) $(HC) $(RUNTEST_OPTS) -- $(HC_OPTS) -c $< -o $@
+
+all :: $(HS_OBJS)
+
+include $(TOP)/mk/target.mk
+
+
diff --git a/ghc/tests/deSugar/should_compile/cvh-ds-unboxed/Life2.lhs b/ghc/tests/deSugar/should_compile/cvh-ds-unboxed/Life2.lhs
new file mode 100644 (file)
index 0000000..30de1a3
--- /dev/null
@@ -0,0 +1,39 @@
+\section{Life2}
+
+\begin{code}
+module Life2 (life2) where 
+import UTypes
+import UCopy (copy_FI)
+
+life2 itLimit boardSize
+ = (fBStr firstBoard) ++ (fBStr secondBoard)
+   where {- ... -}
+
+\end{code}
+
+\begin{code}
+   fBStr :: FI -> String
+   fBStr FIN = []
+
+{- OK
+   firstBoard :: FI
+   firstBoard = copy_FI boardSize (case 0 of
+                                    (MkInt x) -> x)
+-}
+
+{- not happy about this -}
+   
+   firstBoard = copy_FI boardSize u0
+   u0 = unBoxInt 0
+   unBoxInt (MkInt x) = x
+{- end of not happy -}
+
+{- not happy with this either! -}
+
+   secondBoard = copy_FI boardSize u1
+
+   (MkInt u1) = 0
+{- end of second not happy -}
+\end{code}
+
+
diff --git a/ghc/tests/deSugar/should_compile/cvh-ds-unboxed/UCopy.hi b/ghc/tests/deSugar/should_compile/cvh-ds-unboxed/UCopy.hi
new file mode 100644 (file)
index 0000000..314de4e
--- /dev/null
@@ -0,0 +1,9 @@
+interface UCopy where
+import UTypes(F3I(..), FC(..), FI(..), LI(..), SC(..), SI(..))
+copy_FI :: Int -> IntPrim -> FI {-# ARITY _ = 2 #-}
+data F3I = F3IN | F3I1 IntPrim IntPrim IntPrim | F3I2 IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim | F3I3 IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim | F3I4 IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim | F3I5 IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim F3I
+data FC = FCN | FC1 Char# | FC2 Char# Char# | FC3 Char# Char# Char# | FC4 Char# Char# Char# Char# | FC5 Char# Char# Char# Char# Char# FC
+data FI = FIN | FI1 IntPrim | FI2 IntPrim IntPrim | FI3 IntPrim IntPrim IntPrim | FI4 IntPrim IntPrim IntPrim IntPrim | FI5 IntPrim IntPrim IntPrim IntPrim IntPrim FI
+data LI = LIN | LI1 IntPrim LI
+data SC = SCN | SC1 Char# SC | SC2 Char# Char# SC | SC3 Char# Char# Char# SC | SC4 Char# Char# Char# Char# SC | SC5 Char# Char# Char# Char# Char# SC
+data SI = SIN | SI1 IntPrim SI | SI2 IntPrim IntPrim SI | SI3 IntPrim IntPrim IntPrim SI | SI4 IntPrim IntPrim IntPrim IntPrim SI | SI5 IntPrim IntPrim IntPrim IntPrim IntPrim SI
diff --git a/ghc/tests/deSugar/should_compile/cvh-ds-unboxed/UTypes.hi b/ghc/tests/deSugar/should_compile/cvh-ds-unboxed/UTypes.hi
new file mode 100644 (file)
index 0000000..896a29c
--- /dev/null
@@ -0,0 +1,7 @@
+interface UTypes where
+data F3I = F3IN | F3I1 IntPrim IntPrim IntPrim | F3I2 IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim | F3I3 IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim | F3I4 IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim | F3I5 IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim F3I
+data FC = FCN | FC1 Char# | FC2 Char# Char# | FC3 Char# Char# Char# | FC4 Char# Char# Char# Char# | FC5 Char# Char# Char# Char# Char# FC
+data FI = FIN | FI1 IntPrim | FI2 IntPrim IntPrim | FI3 IntPrim IntPrim IntPrim | FI4 IntPrim IntPrim IntPrim IntPrim | FI5 IntPrim IntPrim IntPrim IntPrim IntPrim FI
+data LI = LIN | LI1 IntPrim LI
+data SC = SCN | SC1 Char# SC | SC2 Char# Char# SC | SC3 Char# Char# Char# SC | SC4 Char# Char# Char# Char# SC | SC5 Char# Char# Char# Char# Char# SC
+data SI = SIN | SI1 IntPrim SI | SI2 IntPrim IntPrim SI | SI3 IntPrim IntPrim IntPrim SI | SI4 IntPrim IntPrim IntPrim IntPrim SI | SI5 IntPrim IntPrim IntPrim IntPrim IntPrim SI
diff --git a/ghc/tests/deSugar/should_compile/cvh-ds-unboxed/cvh-unbox1.stderr b/ghc/tests/deSugar/should_compile/cvh-ds-unboxed/cvh-unbox1.stderr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ghc/tests/deSugar/should_compile/ds-wildcard.hs b/ghc/tests/deSugar/should_compile/ds-wildcard.hs
new file mode 100644 (file)
index 0000000..24c5b3b
--- /dev/null
@@ -0,0 +1,3 @@
+module ShouldSucceed where
+
+x@_ = x
diff --git a/ghc/tests/deSugar/should_compile/ds-wildcard.stderr b/ghc/tests/deSugar/should_compile/ds-wildcard.stderr
new file mode 100644 (file)
index 0000000..07da869
--- /dev/null
@@ -0,0 +1,19 @@
+
+
+================================================================================
+Desugared:
+Rec {
+x{-r1,x-}  :: 
+    _forall_ [t{-amE-}] => t{-amE-}
+{-# L #-}
+x{-r1,x-} =
+    _/\_ t{-amE-} ->
+       _letrec_ {
+         x_amC  :: 
+             t{-amE-}
+         {-# L #-}
+         x_amC =
+             x_amC;
+       } in 
+         x_amC
+end Rec }
diff --git a/ghc/tests/deSugar/should_compile/ds001.hs b/ghc/tests/deSugar/should_compile/ds001.hs
new file mode 100644 (file)
index 0000000..0358f20
--- /dev/null
@@ -0,0 +1,25 @@
+--!!! ds001 -- simple function and pattern bindings
+--
+-- this tests ultra-simple function and pattern bindings (no patterns)
+
+module Test where
+
+-- simple function bindings
+
+f x = x
+
+g x y z = f z
+
+j w x y z = g w x z
+
+h x y = f y
+  where
+    f a b = a
+
+-- simple pattern bindings
+
+a = b
+
+b = f
+
+c = c
diff --git a/ghc/tests/deSugar/should_compile/ds001.stderr b/ghc/tests/deSugar/should_compile/ds001.stderr
new file mode 100644 (file)
index 0000000..cc34719
--- /dev/null
@@ -0,0 +1,113 @@
+
+
+================================================================================
+Desugared:
+Rec {
+c{-r3I,x-}  :: 
+    _forall_ [t{-ang-}] => t{-ang-}
+{-# L #-}
+c{-r3I,x-} =
+    _/\_ t{-ang-} ->
+       _letrec_ {
+         c_ane  :: 
+             t{-ang-}
+         {-# L #-}
+         c_ane =
+             c_ane;
+       } in 
+         c_ane
+end Rec }
+h{-r3L,x-}  :: 
+    _forall_
+    [t{-anG-} t{-anC-} t{-anE-}]
+    =>
+    t{-anG-} -> t{-anC-} -> t{-anE-} -> t{-anC-}
+{-# L #-}
+h{-r3L,x-} =
+    _/\_ t{-anG-} t{-anC-} t{-anE-} -> \ x_r3z  :: 
+                                            t{-anG-}
+                                        {-# L #-}
+                                        x_r3z y_r3B  :: 
+                                                  t{-anC-}
+                                              {-# L #-}
+                                              y_r3B ->
+       let {
+         f_r3D  :: 
+             _forall_ [t{-any-} t{-anA-}] => t{-any-} -> t{-anA-} -> t{-any-}
+         {-# L #-}
+         f_r3D =
+             _/\_ t{-any-} t{-anA-} -> \ a_r3F  :: 
+                                             t{-any-}
+                                         {-# L #-}
+                                         a_r3F b_r3H  :: 
+                                                   t{-anA-}
+                                               {-# L #-}
+                                               b_r3H ->
+                 a_r3F
+       } in 
+         f_r3D
+             _@_ t{-anC-} _@_ t{-anE-} y_r3B
+f{-r3O,x-}  :: 
+    _forall_ [t{-anO-}] => t{-anO-} -> t{-anO-}
+{-# L #-}
+f{-r3O,x-} =
+    _/\_ t{-anO-} -> \ x_r3j  :: 
+                          t{-anO-}
+                      {-# L #-}
+                      x_r3j ->
+       x_r3j
+g{-r3N,x-}  :: 
+    _forall_
+    [t{-anW-} t{-ao2-} t{-ao4-}]
+    =>
+    t{-ao2-} -> t{-ao4-} -> t{-anW-} -> t{-anW-}
+{-# L #-}
+g{-r3N,x-} =
+    _/\_ t{-anW-} t{-ao2-} t{-ao4-} -> \ x_r3l  :: 
+                                            t{-ao2-}
+                                        {-# L #-}
+                                        x_r3l y_r3n  :: 
+                                                  t{-ao4-}
+                                              {-# L #-}
+                                              y_r3n z_r3p  :: 
+                                                        t{-anW-}
+                                                    {-# L #-}
+                                                    z_r3p ->
+       f{-r3O,x-}
+           _@_ t{-anW-} z_r3p
+j{-r3M,x-}  :: 
+    _forall_
+    [t{-aoe-} t{-aoh-} t{-aoj-} t{-aoo-}]
+    =>
+    t{-aoe-} -> t{-aoh-} -> t{-aoo-} -> t{-aoj-} -> t{-aoj-}
+{-# L #-}
+j{-r3M,x-} =
+    _/\_ t{-aoe-} t{-aoh-} t{-aoj-} t{-aoo-} -> \ w_r3r  :: 
+                                                     t{-aoe-}
+                                                 {-# L #-}
+                                                 w_r3r x_r3t  :: 
+                                                           t{-aoh-}
+                                                       {-# L #-}
+                                                       x_r3t y_r3v  :: 
+                                                                 t{-aoo-}
+                                                             {-# L #-}
+                                                             y_r3v z_r3x  :: 
+                                                                       t{-aoj-}
+                                                                   {-# L #-}
+                                                                   z_r3x ->
+       g{-r3N,x-}
+           _@_ t{-aoj-} _@_ t{-aoe-} _@_ t{-aoh-} w_r3r x_r3t z_r3x
+b{-r3J,x-}  :: 
+    _forall_ [t{-aou-}] => t{-aou-} -> t{-aou-}
+{-# L #-}
+b{-r3J,x-} =
+    _/\_ t{-aou-} ->
+       f{-r3O,x-}
+           _@_ t{-aou-}
+a{-r3K,x-}  :: 
+    _forall_ [t{-aoA-}] => t{-aoA-} -> t{-aoA-}
+{-# L #-}
+a{-r3K,x-} =
+    _/\_ t{-aoA-} ->
+       b{-r3J,x-}
+           _@_ t{-aoA-}
diff --git a/ghc/tests/deSugar/should_compile/ds002.hs b/ghc/tests/deSugar/should_compile/ds002.hs
new file mode 100644 (file)
index 0000000..d754636
--- /dev/null
@@ -0,0 +1,16 @@
+--!!! ds002 -- overlapping equations and guards
+--
+-- this tests "overlapping" variables and guards
+
+module Test where
+
+f x = x
+f y = y
+f z = z
+
+g x y z | True = f z
+       | True = f z
+       | True = f z
+g x y z | True = f z
+       | True = f z
+       | True = f z
diff --git a/ghc/tests/deSugar/should_compile/ds002.stderr b/ghc/tests/deSugar/should_compile/ds002.stderr
new file mode 100644 (file)
index 0000000..5e6aeeb
--- /dev/null
@@ -0,0 +1,74 @@
+ds002.hs:8: 
+    Warning: Pattern match(es) completely overlapped
+       in the definition of function `f'
+ds002.hs:9: 
+    Warning: Pattern match(es) completely overlapped
+       in the definition of function `f'
+ds002.hs:13: 
+    Warning: Possibly incomplete patterns
+       in the definition of function `g'
+
+
+================================================================================
+Desugared:
+f{-r3w,x-}  :: 
+    _forall_ [t{-an6-}] => t{-an6-} -> t{-an6-}
+{-# L #-}
+f{-r3w,x-} =
+    _/\_ t{-an6-} -> \ x_r3e  :: 
+                          t{-an6-}
+                      {-# L #-}
+                      x_r3e ->
+       x_r3e
+g{-r3v,x-}  :: 
+    _forall_
+    [t{-anr-} t{-anA-} t{-anC-}]
+    =>
+    t{-anA-} -> t{-anC-} -> t{-anr-} -> t{-anr-}
+{-# L #-}
+g{-r3v,x-} =
+    _/\_ t{-anr-} t{-anA-} t{-anC-} -> \ x_r3k  :: 
+                                            t{-anA-}
+                                        {-# L #-}
+                                        x_r3k y_r3m  :: 
+                                                  t{-anC-}
+                                              {-# L #-}
+                                              y_r3m z_r3o  :: 
+                                                        t{-anr-}
+                                                    {-# L #-}
+                                                    z_r3o ->
+       let {
+         fail_drB  :: 
+             t{-anr-}
+         {-# L #-}
+         fail_drB =
+             GHCerr.patError{-8r,p-}
+                 _@_ t{-anr-} _string_ "ds002.hs:11|function `g'" } in
+       let { fail_drG  :: 
+                 t{-anr-}
+             {-# L #-}
+             fail_drG =
+         let {
+           z_r3u  :: 
+               t{-anr-}
+           {-# L #-}
+           z_r3u =
+               z_r3o } in
+         let {
+           y_r3s  :: 
+               t{-anC-}
+           {-# L #-}
+           y_r3s =
+               y_r3m } in
+         let {
+           x_r3q  :: 
+               t{-anA-}
+           {-# L #-}
+           x_r3q =
+               x_r3k
+         } in 
+           f{-r3w,x-}
+               _@_ t{-anr-} z_r3u
+       } in
+       f{-r3w,x-}
+           _@_ t{-anr-} z_r3o
diff --git a/ghc/tests/deSugar/should_compile/ds003.hs b/ghc/tests/deSugar/should_compile/ds003.hs
new file mode 100644 (file)
index 0000000..f68346d
--- /dev/null
@@ -0,0 +1,8 @@
+--!!! ds003 -- list, tuple, lazy, as patterns
+--
+module Test where
+
+f []           y        True  = []
+f x            a@(y,ys) ~z    = []
+f (x:x1:x2:x3) ~(y,ys)  z     = []
+f x            y        True  = []
diff --git a/ghc/tests/deSugar/should_compile/ds003.stderr b/ghc/tests/deSugar/should_compile/ds003.stderr
new file mode 100644 (file)
index 0000000..a5f1cb9
--- /dev/null
@@ -0,0 +1,64 @@
+
+
+================================================================================
+Desugared:
+f{-r3C,x-}  :: 
+    _forall_
+    [t{-aBt-} t{-aBF-} t{-aBI-} t{-aBS-}]
+    =>
+    [t{-aBt-}]
+    -> (t{-aBF-}, t{-aBI-})
+    -> PrelBase.Bool{-34,p-}
+    -> [t{-aBS-}]
+{-# L #-}
+f{-r3C,x-} =
+    _/\_ t{-aBt-} t{-aBF-} t{-aBI-} t{-aBS-} -> \ ds_dGi  :: 
+                                                     [t{-aBt-}]
+                                                 {-# L #-}
+                                                 ds_dGi y_r3e  :: 
+                                                            (t{-aBF-}, t{-aBI-})
+                                                        {-# L #-}
+                                                        y_r3e ds_dGj  :: 
+                                                                  PrelBase.Bool{-34,p-}
+                                                              {-# L #-}
+                                                              ds_dGj ->
+       let {
+         fail_dGE  :: 
+             [t{-aBS-}]
+         {-# L #-}
+         fail_dGE =
+             case y_r3e of { PrelTup.(,){-62,p-}{i} y_r3k ys_r3l  ->
+             let {
+               z_r3n  :: 
+                   PrelBase.Bool{-34,p-}
+               {-# L #-}
+               z_r3n =
+                   ds_dGj } in
+             let {
+               a_r3j  :: 
+                   (t{-aBF-}, t{-aBI-})
+               {-# L #-}
+               a_r3j =
+                   y_r3e } in
+             let {
+               x_r3h  :: 
+                   [t{-aBt-}]
+               {-# L #-}
+               x_r3h =
+                   ds_dGi
+             } in 
+               PrelBase.[]{-5i,p-}{i}
+                   _@_ t{-aBS-};}
+       } in 
+         case ds_dGi of {
+           PrelBase.:{-55,p-}{i} ds_dGM ds_dGL ->
+               fail_dGE;
+           PrelBase.[]{-5i,p-}{i} ->
+               case ds_dGj of {
+                 PrelBase.False{-58,p-}{i} ->
+                     fail_dGE;
+                 PrelBase.True{-5E,p-}{i} ->
+                     PrelBase.[]{-5i,p-}{i}
+                         _@_ t{-aBS-};
+               };
+         }
diff --git a/ghc/tests/deSugar/should_compile/ds004.hs b/ghc/tests/deSugar/should_compile/ds004.hs
new file mode 100644 (file)
index 0000000..ef9d0b4
--- /dev/null
@@ -0,0 +1,9 @@
+--!!! ds004 -- nodups from SLPJ p 79
+--
+module Test where
+
+-- SLPJ, p 79
+nodups []                   = []
+nodups [x]                  = [x]
+nodups (y:x:xs) | y == x    = nodups (x:xs)
+               | True      = y : nodups (x:xs)
diff --git a/ghc/tests/deSugar/should_compile/ds004.stderr b/ghc/tests/deSugar/should_compile/ds004.stderr
new file mode 100644 (file)
index 0000000..342da36
--- /dev/null
@@ -0,0 +1,106 @@
+ds004.hs:6: 
+    Warning: Possibly incomplete patterns
+       in the definition of function `nodups'
+
+
+================================================================================
+Desugared:
+Rec {
+nodups{-r3j,x-}  :: 
+    _forall_
+    [t{-aGj-}]
+    =>
+    {PrelBase.Eq{-23,p-} t{-aGj-}} -> [t{-aGj-}] -> [t{-aGj-}]
+{-# L #-}
+nodups{-r3j,x-} =
+    _/\_ t{-aGj-} -> \ d.Eq_aGz  :: 
+                          {PrelBase.Eq{-23,p-} t{-aGj-}}
+                      {-# L #-}
+                      d.Eq_aGz ->
+       _letrec_ {
+         ==_aJI  :: 
+             t{-aGj-} -> t{-aGj-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_aJI =
+             PrelBase.=={-8Y,p-}
+                 _@_ t{-aGj-} d.Eq_aGz;
+         nodups_aG4  :: 
+             [t{-aGj-}] -> [t{-aGj-}]
+         {-# L #-}
+         nodups_aG4 =
+             \ ds_dK8  :: 
+                   [t{-aGj-}]
+               {-# L #-}
+               ds_dK8 ->
+                 let {
+                   fail_dK9  :: 
+                       [t{-aGj-}]
+                   {-# L #-}
+                   fail_dK9 =
+                       GHCerr.patError{-8r,p-}
+                           _@_ [t{-aGj-}] _string_ "ds004.hs:6|function `nodups'"
+                 } in 
+                   case ds_dK8 of {
+                     PrelBase.[]{-5i,p-}{i} ->
+                         PrelBase.[]{-5i,p-}{i}
+                             _@_ t{-aGj-};
+                     PrelBase.:{-55,p-}{i} x_r3e ds_dKq ->
+                         case ds_dKq of {
+                           PrelBase.[]{-5i,p-}{i} ->
+                               let {
+                                 ds_dKG  :: 
+                                     [t{-aGj-}]
+                                 {-# L #-}
+                                 ds_dKG =
+                                     PrelBase.[]{-5i,p-}{i}
+                                         {_@_ t{-aGj-}}
+                               } in 
+                                 PrelBase.:{-55,p-}{i}
+                                     {_@_ t{-aGj-} x_r3e ds_dKG};
+                           PrelBase.:{-55,p-}{i} x_r3h xs_r3i ->
+                               let {
+                                 y_r3g  :: 
+                                     t{-aGj-}
+                                 {-# L #-}
+                                 y_r3g =
+                                     x_r3e
+                               } in 
+                                 case
+                                     ==_aJI
+                                         y_r3g x_r3h
+                                 of {
+                                   PrelBase.True{-5E,p-}{i} ->
+                                       let {
+                                         ds_dLd  :: 
+                                             [t{-aGj-}]
+                                         {-# L #-}
+                                         ds_dLd =
+                                             PrelBase.:{-55,p-}{i}
+                                                 _@_ t{-aGj-} x_r3h xs_r3i
+                                       } in 
+                                         nodups_aG4
+                                             ds_dLd;
+                                   PrelBase.False{-58,p-}{i} ->
+                                       let { ds_dLF  :: 
+                                                 [t{-aGj-}]
+                                             {-# L #-}
+                                             ds_dLF =
+                                         let {
+                                           ds_dLN  :: 
+                                               [t{-aGj-}]
+                                           {-# L #-}
+                                           ds_dLN =
+                                               PrelBase.:{-55,p-}{i}
+                                                   _@_ t{-aGj-} x_r3h xs_r3i
+                                         } in 
+                                           nodups_aG4
+                                               ds_dLN
+                                       } in
+                                       PrelBase.:{-55,p-}{i}
+                                           _@_ t{-aGj-} y_r3g ds_dLF;
+                                 };
+                         };
+                   };
+       } in 
+         nodups_aG4
+end Rec }
diff --git a/ghc/tests/deSugar/should_compile/ds005.hs b/ghc/tests/deSugar/should_compile/ds005.hs
new file mode 100644 (file)
index 0000000..505d500
--- /dev/null
@@ -0,0 +1,15 @@
+--!!! ds005 -- mappairs from SLPJ Ch 5'
+--
+-- this simply tests a "typical" example
+
+module MapPairs where
+
+-- from SLPJ, p 78
+mappairs f []     ys     = []
+mappairs f (x:xs) []     = []
+mappairs f (x:xs) (y:ys) = f x y : mappairs f xs ys
+
+-- from p 80
+mappairs' f []     ys     = []
+mappairs' f x      []     = []
+mappairs' f (x:xs) (y:ys) = f x y : mappairs' f xs ys
diff --git a/ghc/tests/deSugar/should_compile/ds005.stderr b/ghc/tests/deSugar/should_compile/ds005.stderr
new file mode 100644 (file)
index 0000000..75f16db
--- /dev/null
@@ -0,0 +1,205 @@
+ds005.hs:13: 
+    Warning: Possibly incomplete patterns
+       in the definition of function `mappairs''
+
+
+================================================================================
+Desugared:
+Rec {
+mappairs'{-r3O,x-}  :: 
+    _forall_
+    [t{-anl-} t{-anv-} t{-anx-}]
+    =>
+    (t{-anl-} -> t{-anv-} -> t{-anx-})
+    -> [t{-anl-}]
+    -> [t{-anv-}]
+    -> [t{-anx-}]
+{-# L #-}
+mappairs'{-r3O,x-} =
+    _/\_ t{-anl-} t{-anv-} t{-anx-} ->
+       _letrec_ {
+         mappairs'_anf  :: 
+             (t{-anl-} -> t{-anv-} -> t{-anx-})
+             -> [t{-anl-}]
+             -> [t{-anv-}]
+             -> [t{-anx-}]
+         {-# L #-}
+         mappairs'_anf =
+             \ f_r3x  :: 
+                   t{-anl-} -> t{-anv-} -> t{-anx-}
+               {-# L #-}
+               f_r3x ds_duS  :: 
+                         [t{-anl-}]
+                     {-# L #-}
+                     ds_duS ys_r3A  :: 
+                                [t{-anv-}]
+                            {-# L #-}
+                            ys_r3A ->
+                 let {
+                   fail_duT  :: 
+                       [t{-anx-}]
+                   {-# L #-}
+                   fail_duT =
+                       GHCerr.patError{-8r,p-}
+                           _@_ [t{-anx-}] _string_ "ds005.hs:13|function `mappairs''" } in
+                 let { fail_dwj  :: 
+                           [t{-anx-}]
+                       {-# L #-}
+                       fail_dwj =
+                   let {
+                     fail_dvV  :: 
+                         [t{-anx-}]
+                     {-# L #-}
+                     fail_dvV =
+                         case ds_duS of {
+                           PrelBase.[]{-5i,p-}{i} ->
+                               fail_duT;
+                           PrelBase.:{-55,p-}{i} x_r3J xs_r3K ->
+                               case ys_r3A of {
+                                 PrelBase.[]{-5i,p-}{i} ->
+                                     fail_duT;
+                                 PrelBase.:{-55,p-}{i} y_r3M ys_r3N ->
+                                     let {
+                                       f_r3H  :: 
+                                           t{-anl-} -> t{-anv-} -> t{-anx-}
+                                       {-# L #-}
+                                       f_r3H =
+                                           f_r3x } in
+                                     let {
+                                       ds_dvr  :: 
+                                           t{-anx-}
+                                       {-# L #-}
+                                       ds_dvr =
+                                           f_r3H
+                                               x_r3J y_r3M } in
+                                     let {
+                                       ds_dvv  :: 
+                                           [t{-anx-}]
+                                       {-# L #-}
+                                       ds_dvv =
+                                           mappairs'_anf
+                                               f_r3H xs_r3K ys_r3N
+                                     } in 
+                                       PrelBase.:{-55,p-}{i}
+                                           _@_ t{-anx-} ds_dvr ds_dvv;
+                               };
+                         }
+                   } in 
+                     case ys_r3A of {
+                       PrelBase.:{-55,p-}{i} ds_dw3 ds_dw2 ->
+                           fail_dvV;
+                       PrelBase.[]{-5i,p-}{i} ->
+                           let {
+                             x_r3E  :: 
+                                 [t{-anl-}]
+                             {-# L #-}
+                             x_r3E =
+                                 ds_duS } in
+                           let {
+                             f_r3C  :: 
+                                 t{-anl-} -> t{-anv-} -> t{-anx-}
+                             {-# L #-}
+                             f_r3C =
+                                 f_r3x
+                           } in 
+                             PrelBase.[]{-5i,p-}{i}
+                                 _@_ t{-anx-};
+                     }
+                 } in
+                 case ds_duS of {
+                   PrelBase.:{-55,p-}{i} ds_dwr ds_dwq ->
+                       fail_dwj;
+                   PrelBase.[]{-5i,p-}{i} ->
+                       PrelBase.[]{-5i,p-}{i}
+                           _@_ t{-anx-};
+                 };
+       } in 
+         mappairs'_anf
+end Rec }
+Rec {
+mappairs{-r3P,x-}  :: 
+    _forall_
+    [t{-aoc-} t{-aoh-} t{-aoj-}]
+    =>
+    (t{-aoc-} -> t{-aoh-} -> t{-aoj-})
+    -> [t{-aoc-}]
+    -> [t{-aoh-}]
+    -> [t{-aoj-}]
+{-# L #-}
+mappairs{-r3P,x-} =
+    _/\_ t{-aoc-} t{-aoh-} t{-aoj-} ->
+       _letrec_ {
+         mappairs_anX  :: 
+             (t{-aoc-} -> t{-aoh-} -> t{-aoj-})
+             -> [t{-aoc-}]
+             -> [t{-aoh-}]
+             -> [t{-aoj-}]
+         {-# L #-}
+         mappairs_anX =
+             \ f_r3e  :: 
+                   t{-aoc-} -> t{-aoh-} -> t{-aoj-}
+               {-# L #-}
+               f_r3e ds_dx4  :: 
+                         [t{-aoc-}]
+                     {-# L #-}
+                     ds_dx4 ys_r3h  :: 
+                                [t{-aoh-}]
+                            {-# L #-}
+                            ys_r3h ->
+                 case ds_dx4 of {
+                   PrelBase.[]{-5i,p-}{i} ->
+                       PrelBase.[]{-5i,p-}{i}
+                           _@_ t{-aoj-};
+                   PrelBase.:{-55,p-}{i} x_r3l xs_r3m ->
+                       case ys_r3h of {
+                         PrelBase.[]{-5i,p-}{i} ->
+                             let {
+                               f_r3j  :: 
+                                   t{-aoc-} -> t{-aoh-} -> t{-aoj-}
+                               {-# L #-}
+                               f_r3j =
+                                   f_r3e
+                             } in 
+                               PrelBase.[]{-5i,p-}{i}
+                                   _@_ t{-aoj-};
+                         PrelBase.:{-55,p-}{i} y_r3u ys_r3v ->
+                             let {
+                               xs_r3s  :: 
+                                   [t{-aoc-}]
+                               {-# L #-}
+                               xs_r3s =
+                                   xs_r3m } in
+                             let {
+                               x_r3r  :: 
+                                   t{-aoc-}
+                               {-# L #-}
+                               x_r3r =
+                                   x_r3l } in
+                             let {
+                               f_r3p  :: 
+                                   t{-aoc-} -> t{-aoh-} -> t{-aoj-}
+                               {-# L #-}
+                               f_r3p =
+                                   f_r3e } in
+                             let {
+                               ds_dxR  :: 
+                                   t{-aoj-}
+                               {-# L #-}
+                               ds_dxR =
+                                   f_r3p
+                                       x_r3r y_r3u } in
+                             let {
+                               ds_dxV  :: 
+                                   [t{-aoj-}]
+                               {-# L #-}
+                               ds_dxV =
+                                   mappairs_anX
+                                       f_r3p xs_r3s ys_r3v
+                             } in 
+                               PrelBase.:{-55,p-}{i}
+                                   _@_ t{-aoj-} ds_dxR ds_dxV;
+                       };
+                 };
+       } in 
+         mappairs_anX
+end Rec }
diff --git a/ghc/tests/deSugar/should_compile/ds006.hs b/ghc/tests/deSugar/should_compile/ds006.hs
new file mode 100644 (file)
index 0000000..6df589e
--- /dev/null
@@ -0,0 +1,6 @@
+--!!! ds006 -- v | True = v+1 | False = v (dead code elim)
+--
+module Test where
+
+v | True  = v + 1
+  | False = v
diff --git a/ghc/tests/deSugar/should_compile/ds006.stderr b/ghc/tests/deSugar/should_compile/ds006.stderr
new file mode 100644 (file)
index 0000000..c6358f3
--- /dev/null
@@ -0,0 +1,55 @@
+
+
+================================================================================
+Desugared:
+Rec {
+d.Num_aHu  :: 
+    {PrelBase.Num{-2c,p-} PrelBase.Int{-3g,p-}}
+{-# L #-}
+d.Num_aHu =
+    PrelBase.$d3{-rb1,p-}
++_aJy  :: 
+    PrelBase.Int{-3g,p-}
+    -> PrelBase.Int{-3g,p-}
+    -> PrelBase.Int{-3g,p-}
+{-# L #-}
++_aJy =
+    PrelBase.+{-ras,p-}
+       _@_ PrelBase.Int{-3g,p-} d.Num_aHu
+d.Num_aHy  :: 
+    {PrelBase.Num{-2c,p-} PrelBase.Int{-3g,p-}}
+{-# L #-}
+d.Num_aHy =
+    d.Num_aHu
+fromInt_aJG  :: 
+    PrelBase.Int{-3g,p-} -> PrelBase.Int{-3g,p-}
+{-# L #-}
+fromInt_aJG =
+    PrelBase.fromInt{-8R,p-}
+       _@_ PrelBase.Int{-3g,p-} d.Num_aHy
+lit_aJF  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+lit_aJF =
+    let {
+      ds_dKi  :: 
+         PrelBase.Int{-3g,p-}
+      {-# L #-}
+      ds_dKi =
+         PrelBase.I#{-5b,p-}{i}
+             1
+    } in 
+      fromInt_aJG
+         ds_dKi
+v_aHa  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+v_aHa =
+    +_aJy
+       v_aHa lit_aJF
+v{-r1,x-}  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+v{-r1,x-} =
+    v_aHa
+end Rec }
diff --git a/ghc/tests/deSugar/should_compile/ds007.hs b/ghc/tests/deSugar/should_compile/ds007.hs
new file mode 100644 (file)
index 0000000..5b2b752
--- /dev/null
@@ -0,0 +1,6 @@
+--!!! ds007 -- simple local bindings
+
+module ShouldSucceed where
+
+w = a where a = y
+            y = []
diff --git a/ghc/tests/deSugar/should_compile/ds007.stderr b/ghc/tests/deSugar/should_compile/ds007.stderr
new file mode 100644 (file)
index 0000000..32cef47
--- /dev/null
@@ -0,0 +1,28 @@
+
+
+================================================================================
+Desugared:
+w{-r3f,x-}  :: 
+    _forall_ [t{-amV-}] => [t{-amV-}]
+{-# L #-}
+w{-r3f,x-} =
+    _/\_ t{-amV-} ->
+       let {
+         y_r3e  :: 
+             _forall_ [t{-amM-}] => [t{-amM-}]
+         {-# L #-}
+         y_r3e =
+             _/\_ t{-amM-} ->
+                 PrelBase.[]{-5i,p-}{i}
+                     _@_ t{-amM-} } in
+       let {
+         a_r3d  :: 
+             _forall_ [t{-amT-}] => [t{-amT-}]
+         {-# L #-}
+         a_r3d =
+             _/\_ t{-amT-} ->
+                 y_r3e
+                     _@_ t{-amT-}
+       } in 
+         a_r3d
+             _@_ t{-amV-}
diff --git a/ghc/tests/deSugar/should_compile/ds008.hs b/ghc/tests/deSugar/should_compile/ds008.hs
new file mode 100644 (file)
index 0000000..1264d13
--- /dev/null
@@ -0,0 +1,11 @@
+--!!! ds008 -- free tyvars on RHSs
+--
+-- these tests involve way-cool TyApps
+
+module Test where
+
+f x = []
+
+g x = (f [],[],[],[])
+
+h x = g (1::Int)
diff --git a/ghc/tests/deSugar/should_compile/ds008.stderr b/ghc/tests/deSugar/should_compile/ds008.stderr
new file mode 100644 (file)
index 0000000..7ca5532
--- /dev/null
@@ -0,0 +1,116 @@
+
+
+================================================================================
+Desugared:
+Rec {
+d.Num_aY4  :: 
+    {PrelBase.Num{-2c,p-} PrelBase.Int{-3g,p-}}
+{-# L #-}
+d.Num_aY4 =
+    PrelBase.$d3{-rbb,p-}
+fromInt_a117  :: 
+    PrelBase.Int{-3g,p-} -> PrelBase.Int{-3g,p-}
+{-# L #-}
+fromInt_a117 =
+    PrelBase.fromInt{-8R,p-}
+       _@_ PrelBase.Int{-3g,p-} d.Num_aY4
+lit_a11e  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+lit_a11e =
+    let {
+      ds_d11D  :: 
+         PrelBase.Int{-3g,p-}
+      {-# L #-}
+      ds_d11D =
+         PrelBase.I#{-5b,p-}{i}
+             1
+    } in 
+      fromInt_a117
+         ds_d11D
+f{-r3m,x-}  :: 
+    _forall_ [t{-aXj-} t{-aXh-}] => t{-aXj-} -> [t{-aXh-}]
+{-# L #-}
+f{-r3m,x-} =
+    _/\_ t{-aXj-} t{-aXh-} -> \ x_r3f  :: 
+                                   t{-aXj-}
+                               {-# L #-}
+                               x_r3f ->
+       PrelBase.[]{-5i,p-}{i}
+           _@_ t{-aXh-}
+g{-r3l,x-}  :: 
+    _forall_
+    [t{-aXD-} t{-aXv-} t{-aXx-} t{-aXz-} t{-aXB-}]
+    =>
+    t{-aXD-} -> ([t{-aXv-}], [t{-aXx-}], [t{-aXz-}], [t{-aXB-}])
+{-# L #-}
+g{-r3l,x-} =
+    _/\_ t{-aXD-} t{-aXv-} t{-aXx-} t{-aXz-} t{-aXB-} -> \ x_r3h  :: 
+                                                              t{-aXD-}
+                                                          {-# L #-}
+                                                          x_r3h ->
+       let { ds_d12o  :: 
+                 [t{-aXv-}]
+             {-# L #-}
+             ds_d12o =
+         let {
+           ds_d12M  :: 
+               [GHC.Void{-3T,p-}]
+           {-# L #-}
+           ds_d12M =
+               PrelBase.[]{-5i,p-}{i}
+                   _@_ GHC.Void{-3T,p-}
+         } in 
+           f{-r3m,x-}
+               _@_ [GHC.Void{-3T,p-}] _@_ t{-aXv-} ds_d12M
+       } in
+       let {
+         ds_d12s  :: 
+             [t{-aXx-}]
+         {-# L #-}
+         ds_d12s =
+             PrelBase.[]{-5i,p-}{i}
+                 _@_ t{-aXx-} } in
+       let {
+         ds_d12w  :: 
+             [t{-aXz-}]
+         {-# L #-}
+         ds_d12w =
+             PrelBase.[]{-5i,p-}{i}
+                 _@_ t{-aXz-} } in
+       let {
+         ds_d12A  :: 
+             [t{-aXB-}]
+         {-# L #-}
+         ds_d12A =
+             PrelBase.[]{-5i,p-}{i}
+                 _@_ t{-aXB-}
+       } in 
+         PrelTup.(,,,){-64,p-}{i}
+             {_@_ [t{-aXv-}]
+              _@_ [t{-aXx-}]
+              _@_ [t{-aXz-}]
+              _@_ [t{-aXB-}]
+              ds_d12o
+              ds_d12s
+              ds_d12w
+              ds_d12A}
+h{-r3k,x-}  :: 
+    _forall_
+    [t{-aY0-} t{-aXS-} t{-aXT-} t{-aXU-} t{-aXV-}]
+    =>
+    t{-aY0-} -> ([t{-aXS-}], [t{-aXT-}], [t{-aXU-}], [t{-aXV-}])
+{-# L #-}
+h{-r3k,x-} =
+    _/\_ t{-aY0-} t{-aXS-} t{-aXT-} t{-aXU-} t{-aXV-} -> \ x_r3j  :: 
+                                                              t{-aY0-}
+                                                          {-# L #-}
+                                                          x_r3j ->
+       g{-r3l,x-}
+           _@_ PrelBase.Int{-3g,p-}
+           _@_ t{-aXS-}
+           _@_ t{-aXT-}
+           _@_ t{-aXU-}
+           _@_ t{-aXV-}
+           lit_a11e
+end Rec }
diff --git a/ghc/tests/deSugar/should_compile/ds009.hs b/ghc/tests/deSugar/should_compile/ds009.hs
new file mode 100644 (file)
index 0000000..370b629
--- /dev/null
@@ -0,0 +1,13 @@
+--!!! ds009 -- simple list comprehensions
+
+module SimpleListComp where
+
+f xs = [ x | x <- xs ]
+
+g xs ys zs = [ (x,y,z) | x <- xs, y <- ys, z <- zs, True ]
+
+h xs ys = [ [x,y] | x <- xs, y <- ys, False ]
+
+i xs = [ x | all@(x,y) <- xs, all == ([],[]) ]
+
+j xs = [ (a,b) | (a,b,c,d) <- xs ]
diff --git a/ghc/tests/deSugar/should_compile/ds009.stderr b/ghc/tests/deSugar/should_compile/ds009.stderr
new file mode 100644 (file)
index 0000000..22fcc6f
--- /dev/null
@@ -0,0 +1,481 @@
+
+
+================================================================================
+Desugared:
+j{-r3R,x-}  :: 
+    _forall_
+    [t{-aXD-} t{-aXG-} t{-aXJ-} t{-aXM-} a{-aXO-}]
+    =>
+    {PrelBase.Monad{-28,p-} a{-aXO-}}
+    -> a{-aXO-} (t{-aXD-}, t{-aXG-}, t{-aXJ-}, t{-aXM-})
+    -> a{-aXO-} (t{-aXD-}, t{-aXG-})
+{-# L #-}
+j{-r3R,x-} =
+    _/\_ t{-aXD-} t{-aXG-} t{-aXJ-} t{-aXM-} a{-aXO-} -> \ d.Monad_aXY  :: 
+                                                              {PrelBase.Monad{-28,p-} a{-aXO-}}
+                                                          {-# L #-}
+                                                          d.Monad_aXY ->
+       let {
+         >>=_a1c0  :: 
+             _forall_
+             [rjI{-a107-} rjJ{-a106-}]
+             =>
+             a{-aXO-} rjI{-a107-}
+             -> (rjI{-a107-} -> a{-aXO-} rjJ{-a106-})
+             -> a{-aXO-} rjJ{-a106-}
+         {-# L #-}
+         >>=_a1c0 =
+             PrelBase.>>={-811,p-}
+                 _@_ a{-aXO-} d.Monad_aXY } in
+       let {
+         d.Monad_aY0  :: 
+             {PrelBase.Monad{-28,p-} a{-aXO-}}
+         {-# L #-}
+         d.Monad_aY0 =
+             d.Monad_aXY } in
+       let {
+         return_a1bZ  :: 
+             _forall_ [rjQ{-a108-}] => rjQ{-a108-} -> a{-aXO-} rjQ{-a108-}
+         {-# L #-}
+         return_a1bZ =
+             PrelBase.return{-816,p-}
+                 _@_ a{-aXO-} d.Monad_aY0
+       } in 
+         \ xs_r3L  :: 
+               a{-aXO-} (t{-aXD-}, t{-aXG-}, t{-aXJ-}, t{-aXM-})
+           {-# L #-}
+           xs_r3L ->
+             let {
+               ds_d1cw  :: 
+                   (t{-aXD-}, t{-aXG-}, t{-aXJ-}, t{-aXM-})
+                   -> a{-aXO-} (t{-aXD-}, t{-aXG-})
+               {-# L #-}
+               ds_d1cw =
+                   \ ds_d1cC  :: 
+                         (t{-aXD-}, t{-aXG-}, t{-aXJ-}, t{-aXM-})
+                     {-# L #-}
+                     ds_d1cC ->
+                       case
+                           ds_d1cC
+                       of {
+                       PrelTup.(,,,){-64,p-}{i} a_r3N b_r3O c_r3P d_r3Q  ->
+                       let {
+                         ds_d1cQ  :: 
+                             (t{-aXD-}, t{-aXG-})
+                         {-# L #-}
+                         ds_d1cQ =
+                             PrelTup.(,){-62,p-}{i}
+                                 {_@_ t{-aXD-} _@_ t{-aXG-} a_r3N b_r3O}
+                       } in 
+                         return_a1bZ
+                             _@_ (t{-aXD-}, t{-aXG-}) ds_d1cQ;}
+             } in 
+               >>=_a1c0
+                   _@_ (t{-aXD-}, t{-aXG-}, t{-aXJ-}, t{-aXM-})
+                   _@_ (t{-aXD-}, t{-aXG-})
+                   xs_r3L
+                   ds_d1cw
+i{-r3S,x-}  :: 
+    _forall_
+    [a{-aYh-} t{-aYm-} t{-aYo-}]
+    =>
+    {PrelBase.Eq{-23,p-} t{-aYm-}}
+    -> {PrelBase.Eq{-23,p-} t{-aYo-}}
+    -> {PrelBase.MonadZero{-29,p-} a{-aYh-}}
+    -> a{-aYh-} ([t{-aYm-}], [t{-aYo-}])
+    -> a{-aYh-} [t{-aYm-}]
+{-# L #-}
+i{-r3S,x-} =
+    _/\_ a{-aYh-} t{-aYm-} t{-aYo-} -> \ d.Eq_aYC  :: 
+                                            {PrelBase.Eq{-23,p-} t{-aYm-}}
+                                        {-# L #-}
+                                        d.Eq_aYC d.Eq_aYF  :: 
+                                                     {PrelBase.Eq{-23,p-} t{-aYo-}}
+                                                 {-# L #-}
+                                                 d.Eq_aYF d.MonadZero_aYL  :: 
+                                                              {PrelBase.MonadZero{-29,p-} a{-aYh-}}
+                                                          {-# L #-}
+                                                          d.MonadZero_aYL ->
+       let {
+         d.Monad_aYH  :: 
+             {PrelBase.Monad{-28,p-} a{-aYh-}}
+         {-# L #-}
+         d.Monad_aYH =
+             PrelBase.scsel_MonadZeroPrelBaseMonad{-a1dR,p-}
+                 _@_ a{-aYh-} d.MonadZero_aYL } in
+       let {
+         d.Eq_aYA  :: 
+             {PrelBase.Eq{-23,p-} [t{-aYm-}]}
+         {-# L #-}
+         d.Eq_aYA =
+             PrelBase.$d27{-rqA,p-}
+                 _@_ t{-aYm-} d.Eq_aYC } in
+       let {
+         d.Eq_aYD  :: 
+             {PrelBase.Eq{-23,p-} [t{-aYo-}]}
+         {-# L #-}
+         d.Eq_aYD =
+             PrelBase.$d27{-rqA,p-}
+                 _@_ t{-aYo-} d.Eq_aYF } in
+       let {
+         d.Eq_aYy  :: 
+             {PrelBase.Eq{-23,p-} ([t{-aYm-}], [t{-aYo-}])}
+         {-# L #-}
+         d.Eq_aYy =
+             PrelTup.$d9{-rq7,p-}
+                 _@_ [t{-aYm-}] _@_ [t{-aYo-}] d.Eq_aYA d.Eq_aYD } in
+       let {
+         ==_a1dH  :: 
+             ([t{-aYm-}], [t{-aYo-}])
+             -> ([t{-aYm-}], [t{-aYo-}])
+             -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1dH =
+             PrelBase.=={-8Y,p-}
+                 _@_ ([t{-aYm-}], [t{-aYo-}]) d.Eq_aYy } in
+       let {
+         >>=_a1dG  :: 
+             _forall_
+             [rjI{-a10a-} rjJ{-a109-}]
+             =>
+             a{-aYh-} rjI{-a10a-}
+             -> (rjI{-a10a-} -> a{-aYh-} rjJ{-a109-})
+             -> a{-aYh-} rjJ{-a109-}
+         {-# L #-}
+         >>=_a1dG =
+             PrelBase.>>={-811,p-}
+                 _@_ a{-aYh-} d.Monad_aYH } in
+       let {
+         d.Monad_aYJ  :: 
+             {PrelBase.Monad{-28,p-} a{-aYh-}}
+         {-# L #-}
+         d.Monad_aYJ =
+             d.Monad_aYH } in
+       let {
+         return_a1dF  :: 
+             _forall_ [rjQ{-a10b-}] => rjQ{-a10b-} -> a{-aYh-} rjQ{-a10b-}
+         {-# L #-}
+         return_a1dF =
+             PrelBase.return{-816,p-}
+                 _@_ a{-aYh-} d.Monad_aYJ } in
+       let {
+         zero_a1dE  :: 
+             _forall_ [rjD{-a10c-}] => a{-aYh-} rjD{-a10c-}
+         {-# L #-}
+         zero_a1dE =
+             PrelBase.zero{-810,p-}
+                 _@_ a{-aYh-} d.MonadZero_aYL
+       } in 
+         \ xs_r3F  :: 
+               a{-aYh-} ([t{-aYm-}], [t{-aYo-}])
+           {-# L #-}
+           xs_r3F ->
+             let {
+               ds_d1f5  :: 
+                   ([t{-aYm-}], [t{-aYo-}]) -> a{-aYh-} [t{-aYm-}]
+               {-# L #-}
+               ds_d1f5 =
+                   \ all_r3H  :: 
+                         ([t{-aYm-}], [t{-aYo-}])
+                     {-# L #-}
+                     all_r3H ->
+                       case all_r3H of { PrelTup.(,){-62,p-}{i} x_r3I y_r3J  ->
+                       case
+                           let { ds_d1fr  :: 
+                                     ([t{-aYm-}], [t{-aYo-}])
+                                 {-# L #-}
+                                 ds_d1fr =
+                             let {
+                               ds_d1fE  :: 
+                                   [t{-aYm-}]
+                               {-# L #-}
+                               ds_d1fE =
+                                   PrelBase.[]{-5i,p-}{i}
+                                       _@_ t{-aYm-} } in
+                             let {
+                               ds_d1fI  :: 
+                                   [t{-aYo-}]
+                               {-# L #-}
+                               ds_d1fI =
+                                   PrelBase.[]{-5i,p-}{i}
+                                       _@_ t{-aYo-}
+                             } in 
+                               PrelTup.(,){-62,p-}{i}
+                                   {_@_ [t{-aYm-}] _@_ [t{-aYo-}] ds_d1fE ds_d1fI}
+                           } in
+                           ==_a1dH
+                               all_r3H ds_d1fr
+                       of {
+                         PrelBase.True{-5E,p-}{i} ->
+                             return_a1dF
+                                 _@_ [t{-aYm-}] x_r3I;
+                         PrelBase.False{-58,p-}{i} ->
+                             zero_a1dE
+                                 _@_ [t{-aYm-}];
+                       };}
+             } in 
+               >>=_a1dG
+                   _@_ ([t{-aYm-}], [t{-aYo-}]) _@_ [t{-aYm-}] xs_r3F ds_d1f5
+h{-r3T,x-}  :: 
+    _forall_
+    [a{-aYU-} t{-aYZ-}]
+    =>
+    {PrelBase.MonadZero{-29,p-} a{-aYU-}}
+    -> a{-aYU-} t{-aYZ-}
+    -> a{-aYU-} t{-aYZ-}
+    -> a{-aYU-} [t{-aYZ-}]
+{-# L #-}
+h{-r3T,x-} =
+    _/\_ a{-aYU-} t{-aYZ-} -> \ d.MonadZero_aZd  :: 
+                                   {PrelBase.MonadZero{-29,p-} a{-aYU-}}
+                               {-# L #-}
+                               d.MonadZero_aZd ->
+       let {
+         d.Monad_aZ9  :: 
+             {PrelBase.Monad{-28,p-} a{-aYU-}}
+         {-# L #-}
+         d.Monad_aZ9 =
+             PrelBase.scsel_MonadZeroPrelBaseMonad{-a1dR,p-}
+                 _@_ a{-aYU-} d.MonadZero_aZd } in
+       let {
+         >>=_a1gH  :: 
+             _forall_
+             [rjI{-a10e-} rjJ{-a10d-}]
+             =>
+             a{-aYU-} rjI{-a10e-}
+             -> (rjI{-a10e-} -> a{-aYU-} rjJ{-a10d-})
+             -> a{-aYU-} rjJ{-a10d-}
+         {-# L #-}
+         >>=_a1gH =
+             PrelBase.>>={-811,p-}
+                 _@_ a{-aYU-} d.Monad_aZ9 } in
+       let {
+         d.Monad_aZb  :: 
+             {PrelBase.Monad{-28,p-} a{-aYU-}}
+         {-# L #-}
+         d.Monad_aZb =
+             d.Monad_aZ9 } in
+       let {
+         return_a1gG  :: 
+             _forall_ [rjQ{-a10f-}] => rjQ{-a10f-} -> a{-aYU-} rjQ{-a10f-}
+         {-# L #-}
+         return_a1gG =
+             PrelBase.return{-816,p-}
+                 _@_ a{-aYU-} d.Monad_aZb } in
+       let {
+         zero_a1gF  :: 
+             _forall_ [rjD{-a10g-}] => a{-aYU-} rjD{-a10g-}
+         {-# L #-}
+         zero_a1gF =
+             PrelBase.zero{-810,p-}
+                 _@_ a{-aYU-} d.MonadZero_aZd
+       } in 
+         \ xs_r3x  :: 
+               a{-aYU-} t{-aYZ-}
+           {-# L #-}
+           xs_r3x ys_r3z  :: 
+                      a{-aYU-} t{-aYZ-}
+                  {-# L #-}
+                  ys_r3z ->
+             let {
+               ds_d1hu  :: 
+                   t{-aYZ-} -> a{-aYU-} [t{-aYZ-}]
+               {-# L #-}
+               ds_d1hu =
+                   \ x_r3B  :: 
+                         t{-aYZ-}
+                     {-# L #-}
+                     x_r3B ->
+                       let {
+                         ds_d1hK  :: 
+                             t{-aYZ-} -> a{-aYU-} [t{-aYZ-}]
+                         {-# L #-}
+                         ds_d1hK =
+                             \ y_r3D  :: 
+                                   t{-aYZ-}
+                               {-# L #-}
+                               y_r3D ->
+                                 zero_a1gF
+                                     _@_ [t{-aYZ-}]
+                       } in 
+                         >>=_a1gH
+                             _@_ t{-aYZ-} _@_ [t{-aYZ-}] ys_r3z ds_d1hK
+             } in 
+               >>=_a1gH
+                   _@_ t{-aYZ-} _@_ [t{-aYZ-}] xs_r3x ds_d1hu
+g{-r3U,x-}  :: 
+    _forall_
+    [a{-aZn-} t{-aZp-} t{-aZs-} t{-aZv-}]
+    =>
+    {PrelBase.MonadZero{-29,p-} a{-aZn-}}
+    -> a{-aZn-} t{-aZp-}
+    -> a{-aZn-} t{-aZs-}
+    -> a{-aZn-} t{-aZv-}
+    -> a{-aZn-} (t{-aZp-}, t{-aZs-}, t{-aZv-})
+{-# L #-}
+g{-r3U,x-} =
+    _/\_ a{-aZn-} t{-aZp-} t{-aZs-} t{-aZv-} -> \ d.MonadZero_aZJ  :: 
+                                                     {PrelBase.MonadZero{-29,p-} a{-aZn-}}
+                                                 {-# L #-}
+                                                 d.MonadZero_aZJ ->
+       let {
+         d.Monad_aZF  :: 
+             {PrelBase.Monad{-28,p-} a{-aZn-}}
+         {-# L #-}
+         d.Monad_aZF =
+             PrelBase.scsel_MonadZeroPrelBaseMonad{-a1dR,p-}
+                 _@_ a{-aZn-} d.MonadZero_aZJ } in
+       let {
+         >>=_a1im  :: 
+             _forall_
+             [rjI{-a10i-} rjJ{-a10h-}]
+             =>
+             a{-aZn-} rjI{-a10i-}
+             -> (rjI{-a10i-} -> a{-aZn-} rjJ{-a10h-})
+             -> a{-aZn-} rjJ{-a10h-}
+         {-# L #-}
+         >>=_a1im =
+             PrelBase.>>={-811,p-}
+                 _@_ a{-aZn-} d.Monad_aZF } in
+       let {
+         d.Monad_aZH  :: 
+             {PrelBase.Monad{-28,p-} a{-aZn-}}
+         {-# L #-}
+         d.Monad_aZH =
+             d.Monad_aZF } in
+       let {
+         return_a1il  :: 
+             _forall_ [rjQ{-a10j-}] => rjQ{-a10j-} -> a{-aZn-} rjQ{-a10j-}
+         {-# L #-}
+         return_a1il =
+             PrelBase.return{-816,p-}
+                 _@_ a{-aZn-} d.Monad_aZH } in
+       let {
+         zero_a1ik  :: 
+             _forall_ [rjD{-a10k-}] => a{-aZn-} rjD{-a10k-}
+         {-# L #-}
+         zero_a1ik =
+             PrelBase.zero{-810,p-}
+                 _@_ a{-aZn-} d.MonadZero_aZJ
+       } in 
+         \ xs_r3l  :: 
+               a{-aZn-} t{-aZp-}
+           {-# L #-}
+           xs_r3l ys_r3n  :: 
+                      a{-aZn-} t{-aZs-}
+                  {-# L #-}
+                  ys_r3n zs_r3p  :: 
+                             a{-aZn-} t{-aZv-}
+                         {-# L #-}
+                         zs_r3p ->
+             let {
+               ds_d1ja  :: 
+                   t{-aZp-} -> a{-aZn-} (t{-aZp-}, t{-aZs-}, t{-aZv-})
+               {-# L #-}
+               ds_d1ja =
+                   \ x_r3r  :: 
+                         t{-aZp-}
+                     {-# L #-}
+                     x_r3r ->
+                       let {
+                         ds_d1jq  :: 
+                             t{-aZs-} -> a{-aZn-} (t{-aZp-}, t{-aZs-}, t{-aZv-})
+                         {-# L #-}
+                         ds_d1jq =
+                             \ y_r3t  :: 
+                                   t{-aZs-}
+                               {-# L #-}
+                               y_r3t ->
+                                 let {
+                                   ds_d1jG  :: 
+                                       t{-aZv-} -> a{-aZn-} (t{-aZp-}, t{-aZs-}, t{-aZv-})
+                                   {-# L #-}
+                                   ds_d1jG =
+                                       \ z_r3v  :: 
+                                             t{-aZv-}
+                                         {-# L #-}
+                                         z_r3v ->
+                                           let {
+                                             ds_d1jR  :: 
+                                                 (t{-aZp-}, t{-aZs-}, t{-aZv-})
+                                             {-# L #-}
+                                             ds_d1jR =
+                                                 PrelTup.(,,){-63,p-}{i}
+                                                     {_@_ t{-aZp-}
+                                                      _@_ t{-aZs-}
+                                                      _@_ t{-aZv-}
+                                                      x_r3r
+                                                      y_r3t
+                                                      z_r3v}
+                                           } in 
+                                             return_a1il
+                                                 _@_ (t{-aZp-}, t{-aZs-}, t{-aZv-}) ds_d1jR
+                                 } in 
+                                   >>=_a1im
+                                       _@_ t{-aZv-}
+                                       _@_ (t{-aZp-}, t{-aZs-}, t{-aZv-})
+                                       zs_r3p
+                                       ds_d1jG
+                       } in 
+                         >>=_a1im
+                             _@_ t{-aZs-} _@_ (t{-aZp-}, t{-aZs-}, t{-aZv-}) ys_r3n ds_d1jq
+             } in 
+               >>=_a1im
+                   _@_ t{-aZp-} _@_ (t{-aZp-}, t{-aZs-}, t{-aZv-}) xs_r3l ds_d1ja
+f{-r3V,x-}  :: 
+    _forall_
+    [a{-aZR-} t{-aZT-}]
+    =>
+    {PrelBase.Monad{-28,p-} a{-aZR-}}
+    -> a{-aZR-} t{-aZT-}
+    -> a{-aZR-} t{-aZT-}
+{-# L #-}
+f{-r3V,x-} =
+    _/\_ a{-aZR-} t{-aZT-} -> \ d.Monad_a103  :: 
+                                   {PrelBase.Monad{-28,p-} a{-aZR-}}
+                               {-# L #-}
+                               d.Monad_a103 ->
+       let {
+         >>=_a1ky  :: 
+             _forall_
+             [rjI{-a10m-} rjJ{-a10l-}]
+             =>
+             a{-aZR-} rjI{-a10m-}
+             -> (rjI{-a10m-} -> a{-aZR-} rjJ{-a10l-})
+             -> a{-aZR-} rjJ{-a10l-}
+         {-# L #-}
+         >>=_a1ky =
+             PrelBase.>>={-811,p-}
+                 _@_ a{-aZR-} d.Monad_a103 } in
+       let {
+         d.Monad_a105  :: 
+             {PrelBase.Monad{-28,p-} a{-aZR-}}
+         {-# L #-}
+         d.Monad_a105 =
+             d.Monad_a103 } in
+       let {
+         return_a1kx  :: 
+             _forall_ [rjQ{-a10n-}] => rjQ{-a10n-} -> a{-aZR-} rjQ{-a10n-}
+         {-# L #-}
+         return_a1kx =
+             PrelBase.return{-816,p-}
+                 _@_ a{-aZR-} d.Monad_a105
+       } in 
+         \ xs_r3h  :: 
+               a{-aZR-} t{-aZT-}
+           {-# L #-}
+           xs_r3h ->
+             let {
+               ds_d1l4  :: 
+                   t{-aZT-} -> a{-aZR-} t{-aZT-}
+               {-# L #-}
+               ds_d1l4 =
+                   \ x_r3j  :: 
+                         t{-aZT-}
+                     {-# L #-}
+                     x_r3j ->
+                       return_a1kx
+                           _@_ t{-aZT-} x_r3j
+             } in 
+               >>=_a1ky
+                   _@_ t{-aZT-} _@_ t{-aZT-} xs_r3h ds_d1l4
diff --git a/ghc/tests/deSugar/should_compile/ds010.hs b/ghc/tests/deSugar/should_compile/ds010.hs
new file mode 100644 (file)
index 0000000..a49c09c
--- /dev/null
@@ -0,0 +1,15 @@
+--!!! ds010 -- deeply-nested list comprehensions
+
+module Test where
+
+z = [ (a,b,c,d,e,f,g,h,i,j) | a <- "12",
+                             b <- "12",
+                             c <- "12",
+                             d <- "12",
+                             e <- "12",
+                             f <- "12",
+                             g <- "12",
+                             h <- "12",
+                             i <- "12",
+                             j <- "12"
+    ]
diff --git a/ghc/tests/deSugar/should_compile/ds010.stderr b/ghc/tests/deSugar/should_compile/ds010.stderr
new file mode 100644 (file)
index 0000000..35eedef
--- /dev/null
@@ -0,0 +1,338 @@
+
+
+================================================================================
+Desugared:
+Rec {
+d.Monad_aWF  :: 
+    {PrelBase.Monad{-28,p-} PrelBase.[]{-3j,p-}}
+{-# L #-}
+d.Monad_aWF =
+    PrelBase.$d24{-rq8,p-}
+>>=_a11I  :: 
+    _forall_
+    [rjI{-aWJ-} rjJ{-aWK-}]
+    =>
+    [rjI{-aWJ-}] -> (rjI{-aWJ-} -> [rjJ{-aWK-}]) -> [rjJ{-aWK-}]
+{-# L #-}
+>>=_a11I =
+    PrelBase.>>={-811,p-}
+       _@_ PrelBase.[]{-3j,p-} d.Monad_aWF
+d.Monad_aWI  :: 
+    {PrelBase.Monad{-28,p-} PrelBase.[]{-3j,p-}}
+{-# L #-}
+d.Monad_aWI =
+    d.Monad_aWF
+return_a11P  :: 
+    _forall_ [rjQ{-aWL-}] => rjQ{-aWL-} -> [rjQ{-aWL-}]
+{-# L #-}
+return_a11P =
+    PrelBase.return{-816,p-}
+       _@_ PrelBase.[]{-3j,p-} d.Monad_aWI
+z_aW0  :: 
+    [(PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})]
+{-# L #-}
+z_aW0 =
+    _letrec_ {
+      ds_d12r  :: 
+         [PrelBase.Char{-38,p-}]
+         -> [(PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})]
+      {-# L #-}
+      ds_d12r =
+         \ ds_d12w  :: 
+               [PrelBase.Char{-38,p-}]
+           {-# L #-}
+           ds_d12w ->
+             case ds_d12w of {
+               PrelBase.[]{-5i,p-}{i} ->
+                   PrelBase.[]{-5i,p-}{i}
+                       {_@_ (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})};
+               PrelBase.:{-55,p-}{i} ds_d12I ds_d12R ->
+                   let {
+                     a_r3d  :: 
+                         PrelBase.Char{-38,p-}
+                     {-# L #-}
+                     a_r3d =
+                         ds_d12I } in
+                   _letrec_ {
+                     ds_d12X  :: 
+                         [PrelBase.Char{-38,p-}]
+                         -> [(PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})]
+                     {-# L #-}
+                     ds_d12X =
+                         \ ds_d132  :: 
+                               [PrelBase.Char{-38,p-}]
+                           {-# L #-}
+                           ds_d132 ->
+                             case ds_d132 of {
+                               PrelBase.[]{-5i,p-}{i} ->
+                                   ds_d12r
+                                       ds_d12R;
+                               PrelBase.:{-55,p-}{i} ds_d13h ds_d13q ->
+                                   let {
+                                     b_r3f  :: 
+                                         PrelBase.Char{-38,p-}
+                                     {-# L #-}
+                                     b_r3f =
+                                         ds_d13h } in
+                                   _letrec_ {
+                                     ds_d13w  :: 
+                                         [PrelBase.Char{-38,p-}]
+                                         -> [(PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})]
+                                     {-# L #-}
+                                     ds_d13w =
+                                         \ ds_d13B  :: 
+                                               [PrelBase.Char{-38,p-}]
+                                           {-# L #-}
+                                           ds_d13B ->
+                                             case ds_d13B of {
+                                               PrelBase.[]{-5i,p-}{i} ->
+                                                   ds_d12X
+                                                       ds_d13q;
+                                               PrelBase.:{-55,p-}{i} ds_d13Q ds_d13Z ->
+                                                   let {
+                                                     c_r3h  :: 
+                                                         PrelBase.Char{-38,p-}
+                                                     {-# L #-}
+                                                     c_r3h =
+                                                         ds_d13Q } in
+                                                   _letrec_ {
+                                                     ds_d145  :: 
+                                                         [PrelBase.Char{-38,p-}]
+                                                         -> [(PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})]
+                                                     {-# L #-}
+                                                     ds_d145 =
+                                                         \ ds_d14a  :: 
+                                                               [PrelBase.Char{-38,p-}]
+                                                           {-# L #-}
+                                                           ds_d14a ->
+                                                             case ds_d14a of {
+                                                               PrelBase.[]{-5i,p-}{i} ->
+                                                                   ds_d13w
+                                                                       ds_d13Z;
+                                                               PrelBase.:{-55,p-}{i} ds_d14p ds_d14y ->
+                                                                   let {
+                                                                     d_r3j  :: 
+                                                                         PrelBase.Char{-38,p-}
+                                                                     {-# L #-}
+                                                                     d_r3j =
+                                                                         ds_d14p } in
+                                                                   _letrec_ {
+                                                                     ds_d14E  :: 
+                                                                         [PrelBase.Char{-38,p-}]
+                                                                         -> [(PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})]
+                                                                     {-# L #-}
+                                                                     ds_d14E =
+                                                                         \ ds_d14J  :: 
+                                                                               [PrelBase.Char{-38,p-}]
+                                                                           {-# L #-}
+                                                                           ds_d14J ->
+                                                                             case ds_d14J of {
+                                                                               PrelBase.[]{-5i,p-}{i} ->
+                                                                                   ds_d145
+                                                                                       ds_d14y;
+                                                                               PrelBase.:{-55,p-}{i} ds_d14Y ds_d157 ->
+                                                                                   let {
+                                                                                     e_r3l  :: 
+                                                                                         PrelBase.Char{-38,p-}
+                                                                                     {-# L #-}
+                                                                                     e_r3l =
+                                                                                         ds_d14Y } in
+                                                                                   _letrec_ {
+                                                                                     ds_d15d  :: 
+                                                                                         [PrelBase.Char{-38,p-}]
+                                                                                         -> [(PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})]
+                                                                                     {-# L #-}
+                                                                                     ds_d15d =
+                                                                                         \ ds_d15i  :: 
+                                                                                               [PrelBase.Char{-38,p-}]
+                                                                                           {-# L #-}
+                                                                                           ds_d15i ->
+                                                                                             case
+                                                                                                 ds_d15i
+                                                                                             of {
+                                                                                               PrelBase.[]{-5i,p-}{i} ->
+                                                                                                   ds_d14E
+                                                                                                       ds_d157;
+                                                                                               PrelBase.:{-55,p-}{i} ds_d15x ds_d15G ->
+                                                                                                   let {
+                                                                                                     f_r3n  :: 
+                                                                                                         PrelBase.Char{-38,p-}
+                                                                                                     {-# L #-}
+                                                                                                     f_r3n =
+                                                                                                         ds_d15x } in
+                                                                                                   _letrec_ {
+                                                                                                     ds_d15M  :: 
+                                                                                                         [PrelBase.Char{-38,p-}]
+                                                                                                         -> [(PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})]
+                                                                                                     {-# L #-}
+                                                                                                     ds_d15M =
+                                                                                                         \ ds_d15R  :: 
+                                                                                                               [PrelBase.Char{-38,p-}]
+                                                                                                           {-# L #-}
+                                                                                                           ds_d15R ->
+                                                                                                             case
+                                                                                                                 ds_d15R
+                                                                                                             of {
+                                                                                                               PrelBase.[]{-5i,p-}{i} ->
+                                                                                                                   ds_d15d
+                                                                                                                       ds_d15G;
+                                                                                                               PrelBase.:{-55,p-}{i} ds_d166 ds_d16f ->
+                                                                                                                   let {
+                                                                                                                     g_r3p  :: 
+                                                                                                                         PrelBase.Char{-38,p-}
+                                                                                                                     {-# L #-}
+                                                                                                                     g_r3p =
+                                                                                                                         ds_d166 } in
+                                                                                                                   _letrec_ {
+                                                                                                                     ds_d16l  :: 
+                                                                                                                         [PrelBase.Char{-38,p-}]
+                                                                                                                         -> [(PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})]
+                                                                                                                     {-# L #-}
+                                                                                                                     ds_d16l =
+                                                                                                                         \ ds_d16q  :: 
+                                                                                                                               [PrelBase.Char{-38,p-}]
+                                                                                                                           {-# L #-}
+                                                                                                                           ds_d16q ->
+                                                                                                                             case
+                                                                                                                                 ds_d16q
+                                                                                                                             of {
+                                                                                                                               PrelBase.[]{-5i,p-}{i} ->
+                                                                                                                                   ds_d15M
+                                                                                                                                       ds_d16f;
+                                                                                                                               PrelBase.:{-55,p-}{i} ds_d16F ds_d16O ->
+                                                                                                                                   let {
+                                                                                                                                     h_r3r  :: 
+                                                                                                                                         PrelBase.Char{-38,p-}
+                                                                                                                                     {-# L #-}
+                                                                                                                                     h_r3r =
+                                                                                                                                         ds_d16F } in
+                                                                                                                                   _letrec_ {
+                                                                                                                                     ds_d16U  :: 
+                                                                                                                                         [PrelBase.Char{-38,p-}]
+                                                                                                                                         -> [(PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})]
+                                                                                                                                     {-# L #-}
+                                                                                                                                     ds_d16U =
+                                                                                                                                         \ ds_d16Z  :: 
+                                                                                                                                               [PrelBase.Char{-38,p-}]
+                                                                                                                                           {-# L #-}
+                                                                                                                                           ds_d16Z ->
+                                                                                                                                             case
+                                                                                                                                                 ds_d16Z
+                                                                                                                                             of {
+                                                                                                                                               PrelBase.[]{-5i,p-}{i} ->
+                                                                                                                                                   ds_d16l
+                                                                                                                                                       ds_d16O;
+                                                                                                                                               PrelBase.:{-55,p-}{i} ds_d17e ds_d17n ->
+                                                                                                                                                   let {
+                                                                                                                                                     i_r3t  :: 
+                                                                                                                                                         PrelBase.Char{-38,p-}
+                                                                                                                                                     {-# L #-}
+                                                                                                                                                     i_r3t =
+                                                                                                                                                         ds_d17e } in
+                                                                                                                                                   _letrec_ {
+                                                                                                                                                     ds_d17t  :: 
+                                                                                                                                                         [PrelBase.Char{-38,p-}]
+                                                                                                                                                         -> [(PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})]
+                                                                                                                                                     {-# L #-}
+                                                                                                                                                     ds_d17t =
+                                                                                                                                                         \ ds_d17y  :: 
+                                                                                                                                                               [PrelBase.Char{-38,p-}]
+                                                                                                                                                           {-# L #-}
+                                                                                                                                                           ds_d17y ->
+                                                                                                                                                             case
+                                                                                                                                                                 ds_d17y
+                                                                                                                                                             of {
+                                                                                                                                                               PrelBase.[]{-5i,p-}{i} ->
+                                                                                                                                                                   ds_d16U
+                                                                                                                                                                       ds_d17n;
+                                                                                                                                                               PrelBase.:{-55,p-}{i} ds_d17N ds_d186 ->
+                                                                                                                                                                   let {
+                                                                                                                                                                     j_r3v  :: 
+                                                                                                                                                                         PrelBase.Char{-38,p-}
+                                                                                                                                                                     {-# L #-}
+                                                                                                                                                                     j_r3v =
+                                                                                                                                                                         ds_d17N } in
+                                                                                                                                                                   let {
+                                                                                                                                                                     ds_d17Z  :: 
+                                                                                                                                                                         (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})
+                                                                                                                                                                     {-# L #-}
+                                                                                                                                                                     ds_d17Z =
+                                                                                                                                                                         PrelTup.(,,,,,,,,,){-6a,p-}{i}
+                                                                                                                                                                             {_@_ PrelBase.Char{-38,p-}
+                                                                                                                                                                              _@_ PrelBase.Char{-38,p-}
+                                                                                                                                                                              _@_ PrelBase.Char{-38,p-}
+                                                                                                                                                                              _@_ PrelBase.Char{-38,p-}
+                                                                                                                                                                              _@_ PrelBase.Char{-38,p-}
+                                                                                                                                                                              _@_ PrelBase.Char{-38,p-}
+                                                                                                                                                                              _@_ PrelBase.Char{-38,p-}
+                                                                                                                                                                              _@_ PrelBase.Char{-38,p-}
+                                                                                                                                                                              _@_ PrelBase.Char{-38,p-}
+                                                                                                                                                                              _@_ PrelBase.Char{-38,p-}
+                                                                                                                                                                              a_r3d
+                                                                                                                                                                              b_r3f
+                                                                                                                                                                              c_r3h
+                                                                                                                                                                              d_r3j
+                                                                                                                                                                              e_r3l
+                                                                                                                                                                              f_r3n
+                                                                                                                                                                              g_r3p
+                                                                                                                                                                              h_r3r
+                                                                                                                                                                              i_r3t
+                                                                                                                                                                              j_r3v} } in
+                                                                                                                                                                   let {
+                                                                                                                                                                     ds_d183  :: 
+                                                                                                                                                                         [(PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})]
+                                                                                                                                                                     {-# L #-}
+                                                                                                                                                                     ds_d183 =
+                                                                                                                                                                         ds_d17t
+                                                                                                                                                                             ds_d186
+                                                                                                                                                                   } in 
+                                                                                                                                                                     PrelBase.:{-55,p-}{i}
+                                                                                                                                                                         {_@_ (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})
+                                                                                                                                                                          ds_d17Z
+                                                                                                                                                                          ds_d183};
+                                                                                                                                                             };
+                                                                                                                                                   } in 
+                                                                                                                                                     ds_d17t
+                                                                                                                                                         _string_ "12";
+                                                                                                                                             };
+                                                                                                                                   } in 
+                                                                                                                                     ds_d16U
+                                                                                                                                         _string_ "12";
+                                                                                                                             };
+                                                                                                                   } in 
+                                                                                                                     ds_d16l
+                                                                                                                         _string_ "12";
+                                                                                                             };
+                                                                                                   } in 
+                                                                                                     ds_d15M
+                                                                                                         _string_ "12";
+                                                                                             };
+                                                                                   } in 
+                                                                                     ds_d15d
+                                                                                         _string_ "12";
+                                                                             };
+                                                                   } in 
+                                                                     ds_d14E
+                                                                         _string_ "12";
+                                                             };
+                                                   } in 
+                                                     ds_d145
+                                                         _string_ "12";
+                                             };
+                                   } in 
+                                     ds_d13w
+                                         _string_ "12";
+                             };
+                   } in 
+                     ds_d12X
+                         _string_ "12";
+             };
+    } in 
+      ds_d12r
+         _string_ "12"
+z{-r3w,x-}  :: 
+    [(PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})]
+{-# L #-}
+z{-r3w,x-} =
+    z_aW0
+end Rec }
diff --git a/ghc/tests/deSugar/should_compile/ds011.hs b/ghc/tests/deSugar/should_compile/ds011.hs
new file mode 100644 (file)
index 0000000..8b12d93
--- /dev/null
@@ -0,0 +1,11 @@
+--!!! ds011 -- uses of "error"
+
+module Tests where
+
+f = error []
+
+g = error ""
+
+h = error "\""
+
+i = error "foo"
diff --git a/ghc/tests/deSugar/should_compile/ds011.stderr b/ghc/tests/deSugar/should_compile/ds011.stderr
new file mode 100644 (file)
index 0000000..6585333
--- /dev/null
@@ -0,0 +1,70 @@
+
+
+================================================================================
+Desugared:
+i{-r4,x-}  :: 
+    _forall_ [t{-amO-}] => t{-amO-}
+{-# L #-}
+i{-r4,x-} =
+    _/\_ t{-amO-} ->
+       IOBase.error{-87,p-}
+           _@_ t{-amO-} _string_ "foo"
+h{-r5,x-}  :: 
+    _forall_ [t{-amW-}] => t{-amW-}
+{-# L #-}
+h{-r5,x-} =
+    _/\_ t{-amW-} ->
+       let { ds_dpe  :: 
+                 [PrelBase.Char{-38,p-}]
+             {-# L #-}
+             ds_dpe =
+         let {
+           ds_dpp  :: 
+               PrelBase.Char{-38,p-}
+           {-# L #-}
+           ds_dpp =
+               PrelBase.C#{-54,p-}{i}
+                   {'"'} } in
+         let {
+           ds_dpt  :: 
+               [PrelBase.Char{-38,p-}]
+           {-# L #-}
+           ds_dpt =
+               PrelBase.[]{-5i,p-}{i}
+                   {_@_ PrelBase.Char{-38,p-}}
+         } in 
+           PrelBase.:{-55,p-}{i}
+               {_@_ PrelBase.Char{-38,p-} ds_dpp ds_dpt}
+       } in
+       IOBase.error{-87,p-}
+           _@_ t{-amW-} ds_dpe
+g{-r6,x-}  :: 
+    _forall_ [t{-an4-}] => t{-an4-}
+{-# L #-}
+g{-r6,x-} =
+    _/\_ t{-an4-} ->
+       let {
+         ds_dpW  :: 
+             [PrelBase.Char{-38,p-}]
+         {-# L #-}
+         ds_dpW =
+             PrelBase.[]{-5i,p-}{i}
+                 {_@_ PrelBase.Char{-38,p-}}
+       } in 
+         IOBase.error{-87,p-}
+             _@_ t{-an4-} ds_dpW
+f{-r7,x-}  :: 
+    _forall_ [t{-and-}] => t{-and-}
+{-# L #-}
+f{-r7,x-} =
+    _/\_ t{-and-} ->
+       let {
+         ds_dqm  :: 
+             [PrelBase.Char{-38,p-}]
+         {-# L #-}
+         ds_dqm =
+             PrelBase.[]{-5i,p-}{i}
+                 _@_ PrelBase.Char{-38,p-}
+       } in 
+         IOBase.error{-87,p-}
+             _@_ t{-and-} ds_dqm
diff --git a/ghc/tests/deSugar/should_compile/ds012.hs b/ghc/tests/deSugar/should_compile/ds012.hs
new file mode 100644 (file)
index 0000000..390db58
--- /dev/null
@@ -0,0 +1,10 @@
+--!!! ds012 -- simple Integer arithmetic
+--
+module Tests where
+
+f x = 1 + 2 - 3 + 4 * 5
+
+g x = x + (f x)
+
+h x = 111111111111111111111111111111111111111111111111111111111111
+    + 222222222222222222222222222222222222222222222222222222222222
diff --git a/ghc/tests/deSugar/should_compile/ds012.stderr b/ghc/tests/deSugar/should_compile/ds012.stderr
new file mode 100644 (file)
index 0000000..a562b3d
--- /dev/null
@@ -0,0 +1,299 @@
+
+
+================================================================================
+Desugared:
+h{-r3l,x-}  :: 
+    _forall_
+    [t{-aHu-} t{-aHz-}]
+    =>
+    {PrelBase.Num{-2c,p-} t{-aHu-}} -> t{-aHz-} -> t{-aHu-}
+{-# L #-}
+h{-r3l,x-} =
+    _/\_ t{-aHu-} t{-aHz-} -> \ d.Num_aHB  :: 
+                                   {PrelBase.Num{-2c,p-} t{-aHu-}}
+                               {-# L #-}
+                               d.Num_aHB ->
+       let {
+         +_aP0  :: 
+             t{-aHu-} -> t{-aHu-} -> t{-aHu-}
+         {-# L #-}
+         +_aP0 =
+             PrelBase.+{-r3k,p-}
+                 _@_ t{-aHu-} d.Num_aHB } in
+       let {
+         d.Num_aHE  :: 
+             {PrelBase.Num{-2c,p-} t{-aHu-}}
+         {-# L #-}
+         d.Num_aHE =
+             d.Num_aHB } in
+       let {
+         fromInteger_aOZ  :: 
+             PrelBase.Integer{-3h,p-} -> t{-aHu-}
+         {-# L #-}
+         fromInteger_aOZ =
+             PrelBase.fromInteger{-8S,p-}
+                 _@_ t{-aHu-} d.Num_aHE } in
+       let {
+         lit_aOY  :: 
+             t{-aHu-}
+         {-# L #-}
+         lit_aOY =
+             fromInteger_aOZ
+                 _integer_  111111111111111111111111111111111111111111111111111111111111 } in
+       let {
+         fromInteger_aOX  :: 
+             PrelBase.Integer{-3h,p-} -> t{-aHu-}
+         {-# L #-}
+         fromInteger_aOX =
+             fromInteger_aOZ } in
+       let {
+         lit_aOW  :: 
+             t{-aHu-}
+         {-# L #-}
+         lit_aOW =
+             fromInteger_aOX
+                 _integer_  222222222222222222222222222222222222222222222222222222222222
+       } in 
+         \ x_r3j  :: 
+               t{-aHz-}
+           {-# L #-}
+           x_r3j ->
+             +_aP0
+                 lit_aOY lit_aOW
+f{-r3n,x-}  :: 
+    _forall_
+    [t{-aI9-} t{-aIe-}]
+    =>
+    {PrelBase.Num{-2c,p-} t{-aI9-}} -> t{-aIe-} -> t{-aI9-}
+{-# L #-}
+f{-r3n,x-} =
+    _/\_ t{-aI9-} t{-aIe-} -> \ d.Num_aIg  :: 
+                                   {PrelBase.Num{-2c,p-} t{-aI9-}}
+                               {-# L #-}
+                               d.Num_aIg ->
+       let {
+         +_aNl  :: 
+             t{-aI9-} -> t{-aI9-} -> t{-aI9-}
+         {-# L #-}
+         +_aNl =
+             PrelBase.+{-r3k,p-}
+                 _@_ t{-aI9-} d.Num_aIg } in
+       let {
+         d.Num_aIi  :: 
+             {PrelBase.Num{-2c,p-} t{-aI9-}}
+         {-# L #-}
+         d.Num_aIi =
+             d.Num_aIg } in
+       let {
+         -_aNk  :: 
+             t{-aI9-} -> t{-aI9-} -> t{-aI9-}
+         {-# L #-}
+         -_aNk =
+             PrelBase.-{-817,p-}
+                 _@_ t{-aI9-} d.Num_aIi } in
+       let {
+         +_aN8  :: 
+             t{-aI9-} -> t{-aI9-} -> t{-aI9-}
+         {-# L #-}
+         +_aN8 =
+             +_aNl } in
+       let {
+         d.Num_aIl  :: 
+             {PrelBase.Num{-2c,p-} t{-aI9-}}
+         {-# L #-}
+         d.Num_aIl =
+             d.Num_aIg } in
+       let {
+         fromInt_aNj  :: 
+             PrelBase.Int{-3g,p-} -> t{-aI9-}
+         {-# L #-}
+         fromInt_aNj =
+             PrelBase.fromInt{-8R,p-}
+                 _@_ t{-aI9-} d.Num_aIl } in
+       let { lit_aNi  :: 
+                 t{-aI9-}
+             {-# L #-}
+             lit_aNi =
+         let {
+           ds_dQX  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_dQX =
+               PrelBase.I#{-5b,p-}{i}
+                   1
+         } in 
+           fromInt_aNj
+               ds_dQX
+       } in
+       let {
+         fromInt_aNh  :: 
+             PrelBase.Int{-3g,p-} -> t{-aI9-}
+         {-# L #-}
+         fromInt_aNh =
+             fromInt_aNj } in
+       let { lit_aNg  :: 
+                 t{-aI9-}
+             {-# L #-}
+             lit_aNg =
+         let {
+           ds_dRc  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_dRc =
+               PrelBase.I#{-5b,p-}{i}
+                   2
+         } in 
+           fromInt_aNh
+               ds_dRc
+       } in
+       let {
+         fromInt_aNf  :: 
+             PrelBase.Int{-3g,p-} -> t{-aI9-}
+         {-# L #-}
+         fromInt_aNf =
+             fromInt_aNj } in
+       let { lit_aNe  :: 
+                 t{-aI9-}
+             {-# L #-}
+             lit_aNe =
+         let {
+           ds_dRr  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_dRr =
+               PrelBase.I#{-5b,p-}{i}
+                   3
+         } in 
+           fromInt_aNf
+               ds_dRr
+       } in
+       let {
+         d.Num_aIp  :: 
+             {PrelBase.Num{-2c,p-} t{-aI9-}}
+         {-# L #-}
+         d.Num_aIp =
+             d.Num_aIg } in
+       let {
+         *_aNd  :: 
+             t{-aI9-} -> t{-aI9-} -> t{-aI9-}
+         {-# L #-}
+         *_aNd =
+             PrelBase.*{-rcJ,p-}
+                 _@_ t{-aI9-} d.Num_aIp } in
+       let {
+         fromInt_aNc  :: 
+             PrelBase.Int{-3g,p-} -> t{-aI9-}
+         {-# L #-}
+         fromInt_aNc =
+             fromInt_aNj } in
+       let { lit_aNb  :: 
+                 t{-aI9-}
+             {-# L #-}
+             lit_aNb =
+         let {
+           ds_dRP  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_dRP =
+               PrelBase.I#{-5b,p-}{i}
+                   4
+         } in 
+           fromInt_aNc
+               ds_dRP
+       } in
+       let {
+         fromInt_aNa  :: 
+             PrelBase.Int{-3g,p-} -> t{-aI9-}
+         {-# L #-}
+         fromInt_aNa =
+             fromInt_aNj } in
+       let { lit_aN9  :: 
+                 t{-aI9-}
+             {-# L #-}
+             lit_aN9 =
+         let {
+           ds_dS4  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_dS4 =
+               PrelBase.I#{-5b,p-}{i}
+                   5
+         } in 
+           fromInt_aNa
+               ds_dS4
+       } in
+       \ x_r3f  :: 
+             t{-aIe-}
+         {-# L #-}
+         x_r3f ->
+           let { ds_dSk  :: 
+                     t{-aI9-}
+                 {-# L #-}
+                 ds_dSk =
+             let {
+               ds_dSw  :: 
+                   t{-aI9-}
+               {-# L #-}
+               ds_dSw =
+                   +_aN8
+                       lit_aNi lit_aNg
+             } in 
+               -_aNk
+                   ds_dSw lit_aNe
+           } in
+           let {
+             ds_dSo  :: 
+                 t{-aI9-}
+             {-# L #-}
+             ds_dSo =
+                 *_aNd
+                     lit_aNb lit_aN9
+           } in 
+             +_aNl
+                 ds_dSk ds_dSo
+g{-r3m,x-}  :: 
+    _forall_
+    [t{-aID-}]
+    =>
+    {PrelBase.Num{-2c,p-} t{-aID-}} -> t{-aID-} -> t{-aID-}
+{-# L #-}
+g{-r3m,x-} =
+    _/\_ t{-aID-} -> \ d.Num_aIH  :: 
+                          {PrelBase.Num{-2c,p-} t{-aID-}}
+                      {-# L #-}
+                      d.Num_aIH ->
+       let {
+         +_aTf  :: 
+             t{-aID-} -> t{-aID-} -> t{-aID-}
+         {-# L #-}
+         +_aTf =
+             PrelBase.+{-r3k,p-}
+                 _@_ t{-aID-} d.Num_aIH } in
+       let {
+         d.Num_aIJ  :: 
+             {PrelBase.Num{-2c,p-} t{-aID-}}
+         {-# L #-}
+         d.Num_aIJ =
+             d.Num_aIH } in
+       let {
+         f_aTe  :: 
+             t{-aID-} -> t{-aID-}
+         {-# L #-}
+         f_aTe =
+             f{-r3n,x-}
+                 _@_ t{-aID-} _@_ t{-aID-} d.Num_aIJ
+       } in 
+         \ x_r3h  :: 
+               t{-aID-}
+           {-# L #-}
+           x_r3h ->
+             let {
+               ds_dTJ  :: 
+                   t{-aID-}
+               {-# L #-}
+               ds_dTJ =
+                   f_aTe
+                       x_r3h
+             } in 
+               +_aTf
+                   x_r3h ds_dTJ
diff --git a/ghc/tests/deSugar/should_compile/ds013.hs b/ghc/tests/deSugar/should_compile/ds013.hs
new file mode 100644 (file)
index 0000000..9b5b4b3
--- /dev/null
@@ -0,0 +1,23 @@
+--!!! ds013 -- simple Rational arithmetic
+
+module Tests where
+
+f = 1.5 + 2.0 - 3.14159265 + 4.2 * 5.111111111111111111111111111
+
+g :: Float
+g = 1.5 + 2.0 - 3.14159265 + 4.2 * 5.111111111111111111111111111
+
+h :: Double
+h = 1.5 + 2.0 - 3.14159265 + 4.2 * 5.111111111111111111111111111
+
+{- later
+g x = x + (f x)
+
+h x = 1.0e1000000000 + 1.0e1000000000
+
+i x = 1.0e-1000000000 + 1.0e-1000000000
+
+j x = 1111111111.222222222222222e333333333333333
+    * 4444444444.555555555555555e-66666666666666
+-}
+
diff --git a/ghc/tests/deSugar/should_compile/ds013.stderr b/ghc/tests/deSugar/should_compile/ds013.stderr
new file mode 100644 (file)
index 0000000..6238e97
--- /dev/null
@@ -0,0 +1,375 @@
+
+
+================================================================================
+Desugared:
+Rec {
+d.Num_a12Q  :: 
+    {PrelBase.Num{-2c,p-} PrelBase.Double{-3a,p-}}
+{-# L #-}
+d.Num_a12Q =
+    PrelNum.$d16{-rrq,p-}
++_a19S  :: 
+    PrelBase.Double{-3a,p-}
+    -> PrelBase.Double{-3a,p-}
+    -> PrelBase.Double{-3a,p-}
+{-# L #-}
++_a19S =
+    PrelBase.+{-rcF,p-}
+       _@_ PrelBase.Double{-3a,p-} d.Num_a12Q
+d.Num_a12T  :: 
+    {PrelBase.Num{-2c,p-} PrelBase.Double{-3a,p-}}
+{-# L #-}
+d.Num_a12T =
+    d.Num_a12Q
+-_a19R  :: 
+    PrelBase.Double{-3a,p-}
+    -> PrelBase.Double{-3a,p-}
+    -> PrelBase.Double{-3a,p-}
+{-# L #-}
+-_a19R =
+    PrelBase.-{-817,p-}
+       _@_ PrelBase.Double{-3a,p-} d.Num_a12T
+d.Fractional_a12W  :: 
+    {PrelNum.Fractional{-26,p-} PrelBase.Double{-3a,p-}}
+{-# L #-}
+d.Fractional_a12W =
+    PrelNum.$d14{-rro,p-}
+fromRational_a19Q  :: 
+    PrelNum.Rational{-3r,p-} -> PrelBase.Double{-3a,p-}
+{-# L #-}
+fromRational_a19Q =
+    PrelNum.fromRational{-8T,p-}
+       _@_ PrelBase.Double{-3a,p-} d.Fractional_a12W
+lit_a19P  :: 
+    PrelBase.Double{-3a,p-}
+{-# L #-}
+lit_a19P =
+    fromRational_a19Q
+       _rational_  3 2
+fromRational_a19O  :: 
+    PrelNum.Rational{-3r,p-} -> PrelBase.Double{-3a,p-}
+{-# L #-}
+fromRational_a19O =
+    fromRational_a19Q
+lit_a19N  :: 
+    PrelBase.Double{-3a,p-}
+{-# L #-}
+lit_a19N =
+    fromRational_a19O
+       _rational_  2 1
+fromRational_a19M  :: 
+    PrelNum.Rational{-3r,p-} -> PrelBase.Double{-3a,p-}
+{-# L #-}
+fromRational_a19M =
+    fromRational_a19Q
+lit_a19L  :: 
+    PrelBase.Double{-3a,p-}
+{-# L #-}
+lit_a19L =
+    fromRational_a19M
+       _rational_  62831853 20000000
+d.Num_a131  :: 
+    {PrelBase.Num{-2c,p-} PrelBase.Double{-3a,p-}}
+{-# L #-}
+d.Num_a131 =
+    d.Num_a12Q
+*_a19K  :: 
+    PrelBase.Double{-3a,p-}
+    -> PrelBase.Double{-3a,p-}
+    -> PrelBase.Double{-3a,p-}
+{-# L #-}
+*_a19K =
+    PrelBase.*{-rU,p-}
+       _@_ PrelBase.Double{-3a,p-} d.Num_a131
+fromRational_a19J  :: 
+    PrelNum.Rational{-3r,p-} -> PrelBase.Double{-3a,p-}
+{-# L #-}
+fromRational_a19J =
+    fromRational_a19Q
+lit_a19I  :: 
+    PrelBase.Double{-3a,p-}
+{-# L #-}
+lit_a19I =
+    fromRational_a19J
+       _rational_  21 5
+fromRational_a19H  :: 
+    PrelNum.Rational{-3r,p-} -> PrelBase.Double{-3a,p-}
+{-# L #-}
+fromRational_a19H =
+    fromRational_a19Q
+lit_a19G  :: 
+    PrelBase.Double{-3a,p-}
+{-# L #-}
+lit_a19G =
+    fromRational_a19H
+       _rational_  5111111111111111111111111111 1000000000000000000000000000
+d.Num_a135  :: 
+    {PrelBase.Num{-2c,p-} PrelBase.Float{-3c,p-}}
+{-# L #-}
+d.Num_a135 =
+    PrelNum.$d25{-rrA,p-}
++_a19F  :: 
+    PrelBase.Float{-3c,p-}
+    -> PrelBase.Float{-3c,p-}
+    -> PrelBase.Float{-3c,p-}
+{-# L #-}
++_a19F =
+    PrelBase.+{-rcF,p-}
+       _@_ PrelBase.Float{-3c,p-} d.Num_a135
+d.Num_a138  :: 
+    {PrelBase.Num{-2c,p-} PrelBase.Float{-3c,p-}}
+{-# L #-}
+d.Num_a138 =
+    d.Num_a135
+-_a19E  :: 
+    PrelBase.Float{-3c,p-}
+    -> PrelBase.Float{-3c,p-}
+    -> PrelBase.Float{-3c,p-}
+{-# L #-}
+-_a19E =
+    PrelBase.-{-817,p-}
+       _@_ PrelBase.Float{-3c,p-} d.Num_a138
+d.Fractional_a13b  :: 
+    {PrelNum.Fractional{-26,p-} PrelBase.Float{-3c,p-}}
+{-# L #-}
+d.Fractional_a13b =
+    PrelNum.$d23{-rry,p-}
+fromRational_a19D  :: 
+    PrelNum.Rational{-3r,p-} -> PrelBase.Float{-3c,p-}
+{-# L #-}
+fromRational_a19D =
+    PrelNum.fromRational{-8T,p-}
+       _@_ PrelBase.Float{-3c,p-} d.Fractional_a13b
+lit_a19C  :: 
+    PrelBase.Float{-3c,p-}
+{-# L #-}
+lit_a19C =
+    fromRational_a19D
+       _rational_  3 2
+fromRational_a19B  :: 
+    PrelNum.Rational{-3r,p-} -> PrelBase.Float{-3c,p-}
+{-# L #-}
+fromRational_a19B =
+    fromRational_a19D
+lit_a19A  :: 
+    PrelBase.Float{-3c,p-}
+{-# L #-}
+lit_a19A =
+    fromRational_a19B
+       _rational_  2 1
+fromRational_a19z  :: 
+    PrelNum.Rational{-3r,p-} -> PrelBase.Float{-3c,p-}
+{-# L #-}
+fromRational_a19z =
+    fromRational_a19D
+lit_a19y  :: 
+    PrelBase.Float{-3c,p-}
+{-# L #-}
+lit_a19y =
+    fromRational_a19z
+       _rational_  62831853 20000000
+d.Num_a13g  :: 
+    {PrelBase.Num{-2c,p-} PrelBase.Float{-3c,p-}}
+{-# L #-}
+d.Num_a13g =
+    d.Num_a135
+*_a19x  :: 
+    PrelBase.Float{-3c,p-}
+    -> PrelBase.Float{-3c,p-}
+    -> PrelBase.Float{-3c,p-}
+{-# L #-}
+*_a19x =
+    PrelBase.*{-rU,p-}
+       _@_ PrelBase.Float{-3c,p-} d.Num_a13g
+fromRational_a19w  :: 
+    PrelNum.Rational{-3r,p-} -> PrelBase.Float{-3c,p-}
+{-# L #-}
+fromRational_a19w =
+    fromRational_a19D
+lit_a19v  :: 
+    PrelBase.Float{-3c,p-}
+{-# L #-}
+lit_a19v =
+    fromRational_a19w
+       _rational_  21 5
+fromRational_a19u  :: 
+    PrelNum.Rational{-3r,p-} -> PrelBase.Float{-3c,p-}
+{-# L #-}
+fromRational_a19u =
+    fromRational_a19D
+lit_a19r  :: 
+    PrelBase.Float{-3c,p-}
+{-# L #-}
+lit_a19r =
+    fromRational_a19u
+       _rational_  5111111111111111111111111111 1000000000000000000000000000
++_a19q  :: 
+    PrelBase.Double{-3a,p-}
+    -> PrelBase.Double{-3a,p-}
+    -> PrelBase.Double{-3a,p-}
+{-# L #-}
++_a19q =
+    +_a19S
+-_a19p  :: 
+    PrelBase.Double{-3a,p-}
+    -> PrelBase.Double{-3a,p-}
+    -> PrelBase.Double{-3a,p-}
+{-# L #-}
+-_a19p =
+    -_a19R
+lit_a19o  :: 
+    PrelBase.Double{-3a,p-}
+{-# L #-}
+lit_a19o =
+    lit_a19P
+lit_a19n  :: 
+    PrelBase.Double{-3a,p-}
+{-# L #-}
+lit_a19n =
+    lit_a19N
+lit_a19m  :: 
+    PrelBase.Double{-3a,p-}
+{-# L #-}
+lit_a19m =
+    lit_a19L
+*_a19l  :: 
+    PrelBase.Double{-3a,p-}
+    -> PrelBase.Double{-3a,p-}
+    -> PrelBase.Double{-3a,p-}
+{-# L #-}
+*_a19l =
+    *_a19K
+lit_a19k  :: 
+    PrelBase.Double{-3a,p-}
+{-# L #-}
+lit_a19k =
+    lit_a19I
+lit_a19j  :: 
+    PrelBase.Double{-3a,p-}
+{-# L #-}
+lit_a19j =
+    lit_a19G
++_a19i  :: 
+    PrelBase.Double{-3a,p-}
+    -> PrelBase.Double{-3a,p-}
+    -> PrelBase.Double{-3a,p-}
+{-# L #-}
++_a19i =
+    +_a19q
+h_a106  :: 
+    PrelBase.Double{-3a,p-}
+{-# L #-}
+h_a106 =
+    let { ds_d1hq  :: 
+             PrelBase.Double{-3a,p-}
+         {-# L #-}
+         ds_d1hq =
+      let {
+       ds_d1hC  :: 
+           PrelBase.Double{-3a,p-}
+       {-# L #-}
+       ds_d1hC =
+           +_a19i
+               lit_a19o lit_a19n
+      } in 
+       -_a19p
+           ds_d1hC lit_a19m
+    } in
+    let {
+      ds_d1hu  :: 
+         PrelBase.Double{-3a,p-}
+      {-# L #-}
+      ds_d1hu =
+         *_a19l
+             lit_a19k lit_a19j
+    } in 
+      +_a19q
+         ds_d1hq ds_d1hu
+h{-r4,x-}  :: 
+    PrelBase.Double{-3a,p-}
+{-# L #-}
+h{-r4,x-} =
+    h_a106
++_a1aJ  :: 
+    PrelBase.Float{-3c,p-}
+    -> PrelBase.Float{-3c,p-}
+    -> PrelBase.Float{-3c,p-}
+{-# L #-}
++_a1aJ =
+    +_a19F
+g_a10L  :: 
+    PrelBase.Float{-3c,p-}
+{-# L #-}
+g_a10L =
+    let { ds_d1ib  :: 
+             PrelBase.Float{-3c,p-}
+         {-# L #-}
+         ds_d1ib =
+      let {
+       ds_d1in  :: 
+           PrelBase.Float{-3c,p-}
+       {-# L #-}
+       ds_d1in =
+           +_a1aJ
+               lit_a19C lit_a19A
+      } in 
+       -_a19E
+           ds_d1in lit_a19y
+    } in
+    let {
+      ds_d1if  :: 
+         PrelBase.Float{-3c,p-}
+      {-# L #-}
+      ds_d1if =
+         *_a19x
+             lit_a19v lit_a19r
+    } in 
+      +_a19F
+         ds_d1ib ds_d1if
+g{-r2,x-}  :: 
+    PrelBase.Float{-3c,p-}
+{-# L #-}
+g{-r2,x-} =
+    g_a10L
++_a1bs  :: 
+    PrelBase.Double{-3a,p-}
+    -> PrelBase.Double{-3a,p-}
+    -> PrelBase.Double{-3a,p-}
+{-# L #-}
++_a1bs =
+    +_a19S
+f_a11q  :: 
+    PrelBase.Double{-3a,p-}
+{-# L #-}
+f_a11q =
+    let { ds_d1iW  :: 
+             PrelBase.Double{-3a,p-}
+         {-# L #-}
+         ds_d1iW =
+      let {
+       ds_d1j8  :: 
+           PrelBase.Double{-3a,p-}
+       {-# L #-}
+       ds_d1j8 =
+           +_a1bs
+               lit_a19P lit_a19N
+      } in 
+       -_a19R
+           ds_d1j8 lit_a19L
+    } in
+    let {
+      ds_d1j0  :: 
+         PrelBase.Double{-3a,p-}
+      {-# L #-}
+      ds_d1j0 =
+         *_a19K
+             lit_a19I lit_a19G
+    } in 
+      +_a19S
+         ds_d1iW ds_d1j0
+f{-r5,x-}  :: 
+    PrelBase.Double{-3a,p-}
+{-# L #-}
+f{-r5,x-} =
+    f_a11q
+end Rec }
diff --git a/ghc/tests/deSugar/should_compile/ds014.hs b/ghc/tests/deSugar/should_compile/ds014.hs
new file mode 100644 (file)
index 0000000..cf1ccb1
--- /dev/null
@@ -0,0 +1,76 @@
+--!!! ds014 -- character and string literals
+--!!!   really should add ALL weird forms...
+
+module Tests where
+
+a = 'a'
+b = "b"
+c = a:b
+d = b ++ b
+
+b1 = ""                -- examples from the Haskell report
+b2 = "\&"      -- the same thing
+b3 = "\SO\&H" ++ "\137\&9"
+
+a000 = '\NUL'
+a001 = '\SOH'
+a002 = '\STX'
+a003 = '\ETX'
+a004 = '\EOT'
+a005 = '\ENQ'
+a006 = '\ACK'
+a007 = '\BEL'
+a010 = '\BS'
+a011 = '\HT'
+a012 = '\LF'
+a013 = '\VT'
+a014 = '\FF'
+a015 = '\CR'
+a016 = '\SO'
+a017 = '\SI'
+a020 = '\DLE'
+a021 = '\DC1'
+a022 = '\DC2'
+a023 = '\DC3'
+a024 = '\DC4'
+a025 = '\NAK'
+a026 = '\SYN'
+a027 = '\ETB'
+a030 = '\CAN'
+a031 = '\EM'
+a032 = '\SUB'
+a033 = '\ESC'
+a034 = '\FS'
+a035 = '\GS'
+a036 = '\RS'
+a037 = '\US'
+a040 = '\SP'
+a042 = '"'
+a047 = '\''
+a134 = '\\'
+a177 = '\DEL'
+
+ascii = "\NUL\SOH\STX\ETX\EOT\ENQ\ACK\BEL\
+       \\BS\HT\LF\VT\FF\CR\SO\SI\
+       \\DLE\DC1\DC2\DC3\DC4\NAK\SYN\ETB\
+       \\CAN\EM\SUB\ESC\FS\GS\RS\US\
+       \\SP!\"#$%&'\
+       \()*+,-./\
+       \01234567\
+       \89:;<=>?\
+       \@ABCDEFG\
+       \HIJKLMNO\
+       \PQRSTUVW\
+       \XYZ[\\]^_\
+       \`abcdefg\
+       \hijklmno\
+       \pqrstuvw\
+       \xyz{|}~\DEL"
+
+na200 = '\o200'
+na250 = '\o250'
+na300 = '\o300'
+na350 = '\o350'
+na377 = '\o377'
+
+eightbit = "\o200\o250\o300\o350\o377"
diff --git a/ghc/tests/deSugar/should_compile/ds014.stderr b/ghc/tests/deSugar/should_compile/ds014.stderr
new file mode 100644 (file)
index 0000000..724fd2c
--- /dev/null
@@ -0,0 +1,603 @@
+
+
+================================================================================
+Desugared:
+Rec {
+d.MonadPlus_aMn  :: 
+    {PrelBase.MonadPlus{-2a,p-} PrelBase.[]{-3j,p-}}
+{-# L #-}
+d.MonadPlus_aMn =
+    PrelBase.$d22{-rcv,p-}
+++_aYd  :: 
+    _forall_
+    [rjy{-aM3-}]
+    =>
+    [rjy{-aM3-}] -> [rjy{-aM3-}] -> [rjy{-aM3-}]
+{-# L #-}
+++_aYd =
+    PrelBase.++{-rc4,p-}
+       _@_ PrelBase.[]{-3j,p-} d.MonadPlus_aMn
+++_aYk  :: 
+    _forall_
+    [rjy{-aLC-}]
+    =>
+    [rjy{-aLC-}] -> [rjy{-aLC-}] -> [rjy{-aLC-}]
+{-# L #-}
+++_aYk =
+    ++_aYd
+eightbit_aIH  :: 
+    [PrelBase.Char{-38,p-}]
+{-# L #-}
+eightbit_aIH =
+    _string_ "\128\168\192\232\255"
+eightbit{-rP,x-}  :: 
+    [PrelBase.Char{-38,p-}]
+{-# L #-}
+eightbit{-rP,x-} =
+    eightbit_aIH
+na377_aIL  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+na377_aIL =
+    PrelBase.C#{-54,p-}{i}
+       {'ÿ'}
+na377{-rQ,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+na377{-rQ,x-} =
+    na377_aIL
+na350_aIP  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+na350_aIP =
+    PrelBase.C#{-54,p-}{i}
+       {'è'}
+na350{-rR,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+na350{-rR,x-} =
+    na350_aIP
+na300_aIT  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+na300_aIT =
+    PrelBase.C#{-54,p-}{i}
+       {'À'}
+na300{-rS,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+na300{-rS,x-} =
+    na300_aIT
+na250_aIX  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+na250_aIX =
+    PrelBase.C#{-54,p-}{i}
+       {'¨'}
+na250{-rT,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+na250{-rT,x-} =
+    na250_aIX
+na200_aJ1  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+na200_aJ1 =
+    PrelBase.C#{-54,p-}{i}
+       {'\80'}
+na200{-rU,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+na200{-rU,x-} =
+    na200_aJ1
+ascii_aJ5  :: 
+    [PrelBase.Char{-38,p-}]
+{-# L #-}
+ascii_aJ5 =
+    _string_ "\NUL\SOH\STX\ETX\EOT\ENQ\ACK\a\b\t\n\v\f\r\SO\SI\DLE\DC1\DC2\DC3\DC4\NAK\SYN\ETB\CAN\EM\SUB\ESC\FS\GS\RS\US !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\DEL"
+ascii{-rV,x-}  :: 
+    [PrelBase.Char{-38,p-}]
+{-# L #-}
+ascii{-rV,x-} =
+    ascii_aJ5
+a177_aJ9  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a177_aJ9 =
+    PrelBase.C#{-54,p-}{i}
+       {'\7f'}
+a177{-rW,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a177{-rW,x-} =
+    a177_aJ9
+a134_aJd  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a134_aJd =
+    PrelBase.C#{-54,p-}{i}
+       {'\'}
+a134{-rX,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a134{-rX,x-} =
+    a134_aJd
+a047_aJh  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a047_aJh =
+    PrelBase.C#{-54,p-}{i}
+       {'''}
+a047{-rY,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a047{-rY,x-} =
+    a047_aJh
+a042_aJl  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a042_aJl =
+    PrelBase.C#{-54,p-}{i}
+       {'"'}
+a042{-rZ,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a042{-rZ,x-} =
+    a042_aJl
+a040_aJp  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a040_aJp =
+    PrelBase.C#{-54,p-}{i}
+       {' '}
+a040{-r10,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a040{-r10,x-} =
+    a040_aJp
+a037_aJt  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a037_aJt =
+    PrelBase.C#{-54,p-}{i}
+       {'\1f'}
+a037{-r11,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a037{-r11,x-} =
+    a037_aJt
+a036_aJx  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a036_aJx =
+    PrelBase.C#{-54,p-}{i}
+       {'\1e'}
+a036{-r12,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a036{-r12,x-} =
+    a036_aJx
+a035_aJB  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a035_aJB =
+    PrelBase.C#{-54,p-}{i}
+       {'\1d'}
+a035{-r13,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a035{-r13,x-} =
+    a035_aJB
+a034_aJF  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a034_aJF =
+    PrelBase.C#{-54,p-}{i}
+       {'\1c'}
+a034{-r14,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a034{-r14,x-} =
+    a034_aJF
+a033_aJJ  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a033_aJJ =
+    PrelBase.C#{-54,p-}{i}
+       {'\e'}
+a033{-r15,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a033{-r15,x-} =
+    a033_aJJ
+a032_aJN  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a032_aJN =
+    PrelBase.C#{-54,p-}{i}
+       {'\1a'}
+a032{-r16,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a032{-r16,x-} =
+    a032_aJN
+a031_aJR  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a031_aJR =
+    PrelBase.C#{-54,p-}{i}
+       {'\19'}
+a031{-r17,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a031{-r17,x-} =
+    a031_aJR
+a030_aJV  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a030_aJV =
+    PrelBase.C#{-54,p-}{i}
+       {'\18'}
+a030{-r18,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a030{-r18,x-} =
+    a030_aJV
+a027_aJZ  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a027_aJZ =
+    PrelBase.C#{-54,p-}{i}
+       {'\17'}
+a027{-r19,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a027{-r19,x-} =
+    a027_aJZ
+a026_aK3  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a026_aK3 =
+    PrelBase.C#{-54,p-}{i}
+       {'\16'}
+a026{-r1a,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a026{-r1a,x-} =
+    a026_aK3
+a025_aK7  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a025_aK7 =
+    PrelBase.C#{-54,p-}{i}
+       {'\15'}
+a025{-r1b,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a025{-r1b,x-} =
+    a025_aK7
+a024_aKb  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a024_aKb =
+    PrelBase.C#{-54,p-}{i}
+       {'\14'}
+a024{-r1c,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a024{-r1c,x-} =
+    a024_aKb
+a023_aKf  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a023_aKf =
+    PrelBase.C#{-54,p-}{i}
+       {'\13'}
+a023{-r1d,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a023{-r1d,x-} =
+    a023_aKf
+a022_aKj  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a022_aKj =
+    PrelBase.C#{-54,p-}{i}
+       {'\12'}
+a022{-r1e,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a022{-r1e,x-} =
+    a022_aKj
+a021_aKn  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a021_aKn =
+    PrelBase.C#{-54,p-}{i}
+       {'\11'}
+a021{-r1f,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a021{-r1f,x-} =
+    a021_aKn
+a020_aKr  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a020_aKr =
+    PrelBase.C#{-54,p-}{i}
+       {'\10'}
+a020{-r1g,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a020{-r1g,x-} =
+    a020_aKr
+a017_aKv  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a017_aKv =
+    PrelBase.C#{-54,p-}{i}
+       {'\ f'}
+a017{-r1h,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a017{-r1h,x-} =
+    a017_aKv
+a016_aKz  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a016_aKz =
+    PrelBase.C#{-54,p-}{i}
+       {'\ e'}
+a016{-r1i,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a016{-r1i,x-} =
+    a016_aKz
+a015_aKD  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a015_aKD =
+    PrelBase.C#{-54,p-}{i}
+       {'\r'}
+a015{-r1j,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a015{-r1j,x-} =
+    a015_aKD
+a014_aKH  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a014_aKH =
+    PrelBase.C#{-54,p-}{i}
+       {'\f'}
+a014{-r1k,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a014{-r1k,x-} =
+    a014_aKH
+a013_aKL  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a013_aKL =
+    PrelBase.C#{-54,p-}{i}
+       {'\v'}
+a013{-r1l,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a013{-r1l,x-} =
+    a013_aKL
+a012_aKP  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a012_aKP =
+    PrelBase.C#{-54,p-}{i}
+       {'
+'}
+a012{-r1m,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a012{-r1m,x-} =
+    a012_aKP
+a011_aKT  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a011_aKT =
+    PrelBase.C#{-54,p-}{i}
+       {'      '}
+a011{-r1n,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a011{-r1n,x-} =
+    a011_aKT
+a010_aKX  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a010_aKX =
+    PrelBase.C#{-54,p-}{i}
+       {'\b'}
+a010{-r1o,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a010{-r1o,x-} =
+    a010_aKX
+a007_aL1  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a007_aL1 =
+    PrelBase.C#{-54,p-}{i}
+       {'\a'}
+a007{-r1p,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a007{-r1p,x-} =
+    a007_aL1
+a006_aL5  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a006_aL5 =
+    PrelBase.C#{-54,p-}{i}
+       {'\ 6'}
+a006{-r1q,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a006{-r1q,x-} =
+    a006_aL5
+a005_aL9  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a005_aL9 =
+    PrelBase.C#{-54,p-}{i}
+       {'\ 5'}
+a005{-r1r,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a005{-r1r,x-} =
+    a005_aL9
+a004_aLd  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a004_aLd =
+    PrelBase.C#{-54,p-}{i}
+       {'\ 4'}
+a004{-r1s,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a004{-r1s,x-} =
+    a004_aLd
+a003_aLh  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a003_aLh =
+    PrelBase.C#{-54,p-}{i}
+       {'\ 3'}
+a003{-r1t,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a003{-r1t,x-} =
+    a003_aLh
+a002_aLl  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a002_aLl =
+    PrelBase.C#{-54,p-}{i}
+       {'\ 2'}
+a002{-r1u,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a002{-r1u,x-} =
+    a002_aLl
+a001_aLp  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a001_aLp =
+    PrelBase.C#{-54,p-}{i}
+       {'\ 1'}
+a001{-r1v,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a001{-r1v,x-} =
+    a001_aLp
+a000_aLt  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a000_aLt =
+    PrelBase.C#{-54,p-}{i}
+       {'\0'}
+a000{-r1w,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a000{-r1w,x-} =
+    a000_aLt
+b3_aLx  :: 
+    [PrelBase.Char{-38,p-}]
+{-# L #-}
+b3_aLx =
+    ++_aYk
+       _@_ PrelBase.Char{-38,p-} _string_ "\SO\&H" _string_ "\137\&9"
+b3{-r1x,x-}  :: 
+    [PrelBase.Char{-38,p-}]
+{-# L #-}
+b3{-r1x,x-} =
+    b3_aLx
+b2_aLM  :: 
+    [PrelBase.Char{-38,p-}]
+{-# L #-}
+b2_aLM =
+    PrelBase.[]{-5i,p-}{i}
+       {_@_ PrelBase.Char{-38,p-}}
+b2{-r1y,x-}  :: 
+    [PrelBase.Char{-38,p-}]
+{-# L #-}
+b2{-r1y,x-} =
+    b2_aLM
+b1_aLQ  :: 
+    [PrelBase.Char{-38,p-}]
+{-# L #-}
+b1_aLQ =
+    PrelBase.[]{-5i,p-}{i}
+       {_@_ PrelBase.Char{-38,p-}}
+b1{-r1z,x-}  :: 
+    [PrelBase.Char{-38,p-}]
+{-# L #-}
+b1{-r1z,x-} =
+    b1_aLQ
+b_aLU  :: 
+    [PrelBase.Char{-38,p-}]
+{-# L #-}
+b_aLU =
+    let {
+      ds_d18d  :: 
+         PrelBase.Char{-38,p-}
+      {-# L #-}
+      ds_d18d =
+         PrelBase.C#{-54,p-}{i}
+             {'b'} } in
+    let {
+      ds_d18h  :: 
+         [PrelBase.Char{-38,p-}]
+      {-# L #-}
+      ds_d18h =
+         PrelBase.[]{-5i,p-}{i}
+             {_@_ PrelBase.Char{-38,p-}}
+    } in 
+      PrelBase.:{-55,p-}{i}
+         {_@_ PrelBase.Char{-38,p-} ds_d18d ds_d18h}
+b{-r1C,x-}  :: 
+    [PrelBase.Char{-38,p-}]
+{-# L #-}
+b{-r1C,x-} =
+    b_aLU
+d_aLY  :: 
+    [PrelBase.Char{-38,p-}]
+{-# L #-}
+d_aLY =
+    ++_aYd
+       _@_ PrelBase.Char{-38,p-} b{-r1C,x-} b{-r1C,x-}
+d{-r1A,x-}  :: 
+    [PrelBase.Char{-38,p-}]
+{-# L #-}
+d{-r1A,x-} =
+    d_aLY
+a_aMd  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a_aMd =
+    PrelBase.C#{-54,p-}{i}
+       {'a'}
+a{-r1D,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a{-r1D,x-} =
+    a_aMd
+c_aMh  :: 
+    [PrelBase.Char{-38,p-}]
+{-# L #-}
+c_aMh =
+    PrelBase.:{-55,p-}{i}
+       _@_ PrelBase.Char{-38,p-} a{-r1D,x-} b{-r1C,x-}
+c{-r1B,x-}  :: 
+    [PrelBase.Char{-38,p-}]
+{-# L #-}
+c{-r1B,x-} =
+    c_aMh
+end Rec }
diff --git a/ghc/tests/deSugar/should_compile/ds014a.hs b/ghc/tests/deSugar/should_compile/ds014a.hs
new file mode 100644 (file)
index 0000000..8ed88c0
--- /dev/null
@@ -0,0 +1,4 @@
+module Tests where
+
+-- this char is forbidden
+c = '\&'
diff --git a/ghc/tests/deSugar/should_compile/ds014a.stderr b/ghc/tests/deSugar/should_compile/ds014a.stderr
new file mode 100644 (file)
index 0000000..e845ab9
--- /dev/null
@@ -0,0 +1,2 @@
+ds014a.hs:4:7: Illegal character escape: `\&'
+ds014a.hs:4:7:  on input: "&"
diff --git a/ghc/tests/deSugar/should_compile/ds015.hs b/ghc/tests/deSugar/should_compile/ds015.hs
new file mode 100644 (file)
index 0000000..5c2164e
--- /dev/null
@@ -0,0 +1,9 @@
+--!!! ds015 -- lambdas
+--
+module Tests where
+
+f x = ( \ x -> x ) x
+
+g x y = ( \ x y -> y x ) ( \ x -> x ) x
+
+h x y = ( \ (x:xs) -> x ) x
diff --git a/ghc/tests/deSugar/should_compile/ds015.stderr b/ghc/tests/deSugar/should_compile/ds015.stderr
new file mode 100644 (file)
index 0000000..c389126
--- /dev/null
@@ -0,0 +1,87 @@
+ds015.hs:9: 
+    Warning: Possibly incomplete patterns
+       in a lambda abstraction:
+           `(x PrelBase.: xs) -> ...'
+
+
+================================================================================
+Desugared:
+h{-r3z,x-}  :: 
+    _forall_ [t{-an8-} t{-anf-}] => [t{-an8-}] -> t{-anf-} -> t{-an8-}
+{-# L #-}
+h{-r3z,x-} =
+    _/\_ t{-an8-} t{-anf-} -> \ x_r3t  :: 
+                                   [t{-an8-}]
+                               {-# L #-}
+                               x_r3t y_r3v  :: 
+                                         t{-anf-}
+                                     {-# L #-}
+                                     y_r3v ->
+       (\ ds_drl  :: 
+              [t{-an8-}]
+          {-# L #-}
+          ds_drl ->
+            let {
+              fail_drm  :: 
+                  t{-an8-}
+              {-# L #-}
+              fail_drm =
+                  GHCerr.patError{-8r,p-}
+                      _@_ t{-an8-} _string_ "ds015.hs:9|lambda"
+            } in 
+              case ds_drl of {
+                PrelBase.[]{-5i,p-}{i} ->
+                    fail_drm;
+                PrelBase.:{-55,p-}{i} x_r3x xs_r3y ->
+                    x_r3x;
+              })
+           x_r3t
+g{-r3A,x-}  :: 
+    _forall_
+    [t{-any-} t{-anA-} t{-anC-}]
+    =>
+    ((t{-any-} -> t{-any-}) -> t{-anA-}) -> t{-anC-} -> t{-anA-}
+{-# L #-}
+g{-r3A,x-} =
+    _/\_ t{-any-} t{-anA-} t{-anC-} -> \ x_r3j  :: 
+                                            (t{-any-} -> t{-any-}) -> t{-anA-}
+                                        {-# L #-}
+                                        x_r3j y_r3l  :: 
+                                                  t{-anC-}
+                                              {-# L #-}
+                                              y_r3l ->
+       let {
+         ds_drT  :: 
+             t{-any-} -> t{-any-}
+         {-# L #-}
+         ds_drT =
+             \ x_r3r  :: 
+                   t{-any-}
+               {-# L #-}
+               x_r3r ->
+                 x_r3r
+       } in 
+         (\ x_r3n  :: 
+                t{-any-} -> t{-any-}
+            {-# L #-}
+            x_r3n y_r3p  :: 
+                      (t{-any-} -> t{-any-}) -> t{-anA-}
+                  {-# L #-}
+                  y_r3p ->
+              y_r3p
+                  x_r3n)
+             ds_drT x_r3j
+f{-r3B,x-}  :: 
+    _forall_ [t{-anM-}] => t{-anM-} -> t{-anM-}
+{-# L #-}
+f{-r3B,x-} =
+    _/\_ t{-anM-} -> \ x_r3f  :: 
+                          t{-anM-}
+                      {-# L #-}
+                      x_r3f ->
+       (\ x_r3h  :: 
+              t{-anM-}
+          {-# L #-}
+          x_r3h ->
+            x_r3h)
+           x_r3f
diff --git a/ghc/tests/deSugar/should_compile/ds016.hs b/ghc/tests/deSugar/should_compile/ds016.hs
new file mode 100644 (file)
index 0000000..57e0053
--- /dev/null
@@ -0,0 +1,15 @@
+--!!! ds016 -- case expressions
+--
+module Tests where
+
+f x y z =
+    case ( x ++ x ++ x ++ x ++ x ) of
+       []      -> []
+       [a]     -> error "2"
+       [a,b,c] ->
+                   case ( (y,z,y,z) ) of
+--                   (True, _, False, _) | True == False -> z
+--                   (True, _, False, _) | True == False -> z
+                     _ -> z
+
+       (a:bs)  -> error "4"
diff --git a/ghc/tests/deSugar/should_compile/ds016.stderr b/ghc/tests/deSugar/should_compile/ds016.stderr
new file mode 100644 (file)
index 0000000..7cddfe4
--- /dev/null
@@ -0,0 +1,202 @@
+
+
+================================================================================
+Desugared:
+Rec {
+d.MonadPlus_aXs  :: 
+    {PrelBase.MonadPlus{-2a,p-} PrelBase.[]{-3j,p-}}
+{-# L #-}
+d.MonadPlus_aXs =
+    PrelBase.$d22{-rp7,p-}
+++_aYK  :: 
+    _forall_
+    [rjy{-aWo-}]
+    =>
+    [rjy{-aWo-}] -> [rjy{-aWo-}] -> [rjy{-aWo-}]
+{-# L #-}
+++_aYK =
+    PrelBase.++{-roG,p-}
+       _@_ PrelBase.[]{-3j,p-} d.MonadPlus_aXs
+f{-r3t,x-}  :: 
+    _forall_
+    [rjy{-aWN-} t{-aWT-} t{-aXo-}]
+    =>
+    [rjy{-aWN-}] -> t{-aXo-} -> [t{-aWT-}] -> [t{-aWT-}]
+{-# L #-}
+f{-r3t,x-} =
+    _/\_ rjy{-aWN-} t{-aWT-} t{-aXo-} ->
+       let {
+         ++_aYM  :: 
+             _forall_
+             [rjy{-aWw-}]
+             =>
+             [rjy{-aWw-}] -> [rjy{-aWw-}] -> [rjy{-aWw-}]
+         {-# L #-}
+         ++_aYM =
+             ++_aYK } in
+       let {
+         ++_aYL  :: 
+             _forall_
+             [rjy{-aWD-}]
+             =>
+             [rjy{-aWD-}] -> [rjy{-aWD-}] -> [rjy{-aWD-}]
+         {-# L #-}
+         ++_aYL =
+             ++_aYK } in
+       let {
+         ++_aYJ  :: 
+             _forall_
+             [rjy{-aWK-}]
+             =>
+             [rjy{-aWK-}] -> [rjy{-aWK-}] -> [rjy{-aWK-}]
+         {-# L #-}
+         ++_aYJ =
+             ++_aYK
+       } in 
+         \ x_r3d  :: 
+               [rjy{-aWN-}]
+           {-# L #-}
+           x_r3d y_r3f  :: 
+                     t{-aXo-}
+                 {-# L #-}
+                 y_r3f z_r3h  :: 
+                           [t{-aWT-}]
+                       {-# L #-}
+                       z_r3h ->
+             let { ds_d13I  :: 
+                       [rjy{-aWN-}]
+                   {-# L #-}
+                   ds_d13I =
+               let { ds_d131  :: 
+                         [rjy{-aWN-}]
+                     {-# L #-}
+                     ds_d131 =
+                 let { ds_d13e  :: 
+                           [rjy{-aWN-}]
+                       {-# L #-}
+                       ds_d13e =
+                   let {
+                     ds_d13r  :: 
+                         [rjy{-aWN-}]
+                     {-# L #-}
+                     ds_d13r =
+                         ++_aYJ
+                             _@_ rjy{-aWN-} x_r3d x_r3d
+                   } in 
+                     ++_aYL
+                         _@_ rjy{-aWN-} x_r3d ds_d13r
+                 } in
+                 ++_aYM
+                     _@_ rjy{-aWN-} x_r3d ds_d13e
+               } in
+               ++_aYK
+                   _@_ rjy{-aWN-} x_r3d ds_d131
+             } in
+             case ds_d13I of {
+               PrelBase.[]{-5i,p-}{i} ->
+                   PrelBase.[]{-5i,p-}{i}
+                       _@_ t{-aWT-};
+               PrelBase.:{-55,p-}{i} a_r3k ds_d140 ->
+                   let { fail_d14E  :: 
+                             [t{-aWT-}]
+                         {-# L #-}
+                         fail_d14E =
+                     let {
+                       bs_r3s  :: 
+                           [rjy{-aWN-}]
+                       {-# L #-}
+                       bs_r3s =
+                           ds_d140 } in
+                     let {
+                       a_r3r  :: 
+                           rjy{-aWN-}
+                       {-# L #-}
+                       a_r3r =
+                           a_r3k } in
+                     let { ds_d14d  :: 
+                               [PrelBase.Char{-38,p-}]
+                           {-# L #-}
+                           ds_d14d =
+                       let {
+                         ds_d14q  :: 
+                             PrelBase.Char{-38,p-}
+                         {-# L #-}
+                         ds_d14q =
+                             PrelBase.C#{-54,p-}{i}
+                                 {'4'} } in
+                       let {
+                         ds_d14u  :: 
+                             [PrelBase.Char{-38,p-}]
+                         {-# L #-}
+                         ds_d14u =
+                             PrelBase.[]{-5i,p-}{i}
+                                 {_@_ PrelBase.Char{-38,p-}}
+                       } in 
+                         PrelBase.:{-55,p-}{i}
+                             {_@_ PrelBase.Char{-38,p-} ds_d14q ds_d14u}
+                     } in
+                     IOBase.error{-87,p-}
+                         _@_ [t{-aWT-}] ds_d14d
+                   } in
+                   case ds_d140 of {
+                     PrelBase.[]{-5i,p-}{i} ->
+                         let { ds_d14S  :: 
+                                   [PrelBase.Char{-38,p-}]
+                               {-# L #-}
+                               ds_d14S =
+                           let {
+                             ds_d153  :: 
+                                 PrelBase.Char{-38,p-}
+                             {-# L #-}
+                             ds_d153 =
+                                 PrelBase.C#{-54,p-}{i}
+                                     {'2'} } in
+                           let {
+                             ds_d157  :: 
+                                 [PrelBase.Char{-38,p-}]
+                             {-# L #-}
+                             ds_d157 =
+                                 PrelBase.[]{-5i,p-}{i}
+                                     {_@_ PrelBase.Char{-38,p-}}
+                           } in 
+                             PrelBase.:{-55,p-}{i}
+                                 {_@_ PrelBase.Char{-38,p-} ds_d153 ds_d157}
+                         } in
+                         IOBase.error{-87,p-}
+                             _@_ [t{-aWT-}] ds_d14S;
+                     PrelBase.:{-55,p-}{i} b_r3n ds_d15m ->
+                         case ds_d15m of {
+                           PrelBase.[]{-5i,p-}{i} ->
+                               fail_d14E;
+                           PrelBase.:{-55,p-}{i} c_r3o ds_d15z ->
+                               case ds_d15z of {
+                                 PrelBase.:{-55,p-}{i} ds_d15H ds_d15G ->
+                                     fail_d14E;
+                                 PrelBase.[]{-5i,p-}{i} ->
+                                     let {
+                                       a_r3m  :: 
+                                           rjy{-aWN-}
+                                       {-# L #-}
+                                       a_r3m =
+                                           a_r3k } in
+                                     let {
+                                       ds_d15Q  :: 
+                                           (t{-aXo-}, [t{-aWT-}], t{-aXo-}, [t{-aWT-}])
+                                       {-# L #-}
+                                       ds_d15Q =
+                                           PrelTup.(,,,){-64,p-}{i}
+                                               {_@_ t{-aXo-}
+                                                _@_ [t{-aWT-}]
+                                                _@_ t{-aXo-}
+                                                _@_ [t{-aWT-}]
+                                                y_r3f
+                                                z_r3h
+                                                y_r3f
+                                                z_r3h}
+                                     } in 
+                                       z_r3h;
+                               };
+                         };
+                   };
+             }
+end Rec }
diff --git a/ghc/tests/deSugar/should_compile/ds017.hs b/ghc/tests/deSugar/should_compile/ds017.hs
new file mode 100644 (file)
index 0000000..00f9884
--- /dev/null
@@ -0,0 +1,12 @@
+--!!! ds017 -- let expressions
+--
+module Tests where
+
+f x y z
+  = let
+       a = x : []
+       b = x : a
+       c = y (let d = (z, z) in d)
+       result = (c, b)
+    in
+       result
diff --git a/ghc/tests/deSugar/should_compile/ds017.stderr b/ghc/tests/deSugar/should_compile/ds017.stderr
new file mode 100644 (file)
index 0000000..bbeb820
--- /dev/null
@@ -0,0 +1,82 @@
+
+
+================================================================================
+Desugared:
+f{-r3p,x-}  :: 
+    _forall_
+    [t{-aBq-} t{-aBs-} t{-aBd-}]
+    =>
+    t{-aBd-}
+    -> ((t{-aBq-}, t{-aBq-}) -> t{-aBs-})
+    -> t{-aBq-}
+    -> (t{-aBs-}, [t{-aBd-}])
+{-# L #-}
+f{-r3p,x-} =
+    _/\_ t{-aBq-} t{-aBs-} t{-aBd-} -> \ x_r3d  :: 
+                                            t{-aBd-}
+                                        {-# L #-}
+                                        x_r3d y_r3f  :: 
+                                                  (t{-aBq-}, t{-aBq-}) -> t{-aBs-}
+                                              {-# L #-}
+                                              y_r3f z_r3h  :: 
+                                                        t{-aBq-}
+                                                    {-# L #-}
+                                                    z_r3h ->
+       let { c_aAS  :: 
+                 t{-aBs-}
+             {-# L #-}
+             c_aAS =
+         let {
+           ds_dEz  :: 
+               (t{-aBq-}, t{-aBq-})
+           {-# L #-}
+           ds_dEz =
+               PrelTup.(,){-62,p-}{i}
+                   {_@_ t{-aBq-} _@_ t{-aBq-} z_r3h z_r3h}
+         } in 
+           y_r3f
+               ds_dEz
+       } in
+       let {
+         c_r3l  :: 
+             t{-aBs-}
+         {-# L #-}
+         c_r3l =
+             c_aAS } in
+       let { a_aB8  :: 
+                 [t{-aBd-}]
+             {-# L #-}
+             a_aB8 =
+         let {
+           ds_dF5  :: 
+               [t{-aBd-}]
+           {-# L #-}
+           ds_dF5 =
+               PrelBase.[]{-5i,p-}{i}
+                   _@_ t{-aBd-}
+         } in 
+           PrelBase.:{-55,p-}{i}
+               _@_ t{-aBd-} x_r3d ds_dF5
+       } in
+       let {
+         a_r3j  :: 
+             [t{-aBd-}]
+         {-# L #-}
+         a_r3j =
+             a_aB8 } in
+       let {
+         b_aBg  :: 
+             [t{-aBd-}]
+         {-# L #-}
+         b_aBg =
+             PrelBase.:{-55,p-}{i}
+                 _@_ t{-aBd-} x_r3d a_r3j } in
+       let {
+         b_r3k  :: 
+             [t{-aBd-}]
+         {-# L #-}
+         b_r3k =
+             b_aBg
+       } in 
+         PrelTup.(,){-62,p-}{i}
+             {_@_ t{-aBs-} _@_ [t{-aBd-}] c_r3l b_r3k}
diff --git a/ghc/tests/deSugar/should_compile/ds018.hs b/ghc/tests/deSugar/should_compile/ds018.hs
new file mode 100644 (file)
index 0000000..b5c4280
--- /dev/null
@@ -0,0 +1,50 @@
+--!!! ds018 -- explicit lists and tuples
+--
+module Tests where
+
+-- exprs
+
+f x y z = [x,y,z,x,y,z]
+f2 x y = []
+
+g1 x y  = ()
+g x y z = (x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z,
+          x,y,z,x,y,z) -- hey, we love big tuples
+
+-- pats
+
+fa [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z] = x
+
+fb [] = []
+
+ga (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,
+    aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,
+    an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az) = x
+
+gb () x = x
+gb2 ()  = ()
+
+-- need to think of some better ones...
diff --git a/ghc/tests/deSugar/should_compile/ds018.stderr b/ghc/tests/deSugar/should_compile/ds018.stderr
new file mode 100644 (file)
index 0000000..c74c3bd
--- /dev/null
@@ -0,0 +1,671 @@
+ds018.hs:41: 
+    Warning: Possibly incomplete patterns
+       in the definition of function `fb'
+ds018.hs:39: 
+    Warning: Possibly incomplete patterns
+       in the definition of function `fa'
+
+
+================================================================================
+Desugared:
+gb2_aCw  :: 
+    PrelBase.(){-40,p-} -> PrelBase.(){-40,p-}
+{-# L #-}
+gb2_aCw =
+    \ ds_d18I  :: 
+         PrelBase.(){-40,p-}
+      {-# L #-}
+      ds_d18I ->
+       case ds_d18I of { PrelBase.(){-60,p-}{i}  ->
+       PrelBase.(){-60,p-}{i};}
+gb2{-r50,x-}  :: 
+    PrelBase.(){-40,p-} -> PrelBase.(){-40,p-}
+{-# L #-}
+gb2{-r50,x-} =
+    gb2_aCw
+gb{-r51,x-}  :: 
+    _forall_ [t{-aCG-}] => PrelBase.(){-40,p-} -> t{-aCG-} -> t{-aCG-}
+{-# L #-}
+gb{-r51,x-} =
+    _/\_ t{-aCG-} -> \ ds_d19f  :: 
+                          PrelBase.(){-40,p-}
+                      {-# L #-}
+                      ds_d19f x_r4Z  :: 
+                                  t{-aCG-}
+                              {-# L #-}
+                              x_r4Z ->
+       case ds_d19f of { PrelBase.(){-60,p-}{i}  -> x_r4Z;}
+ga{-r52,x-}  :: 
+    _forall_
+    [t{-aDB-} t{-aDE-} t{-aDH-} t{-aDK-} t{-aDN-} t{-aDQ-} t{-aDT-} t{-aDW-} t{-aDZ-} t{-aE2-} t{-aE5-} t{-aE8-} t{-aEb-} t{-aEe-} t{-aEh-} t{-aEk-} t{-aEn-} t{-aEq-} t{-aEt-} t{-aEw-} t{-aEz-} t{-aEC-} t{-aEF-} t{-aEI-} t{-aEL-} t{-aEO-} t{-aER-} t{-aEU-} t{-aEX-} t{-aF0-} t{-aF3-} t{-aF6-} t{-aF9-} t{-aFc-} t{-aFf-} t{-aFi-} t{-aFl-} t{-aFo-} t{-aFr-} t{-aFu-} t{-aFx-} t{-aFA-} t{-aFD-} t{-aFG-} t{-aFJ-} t{-aFM-} t{-aFP-} t{-aFS-} t{-aFV-} t{-aFY-} t{-aG1-} t{-aG4-}]
+    =>
+    (t{-aDB-}, t{-aDE-}, t{-aDH-}, t{-aDK-}, t{-aDN-}, t{-aDQ-}, t{-aDT-}, t{-aDW-}, t{-aDZ-}, t{-aE2-}, t{-aE5-}, t{-aE8-}, t{-aEb-}, t{-aEe-}, t{-aEh-}, t{-aEk-}, t{-aEn-}, t{-aEq-}, t{-aEt-}, t{-aEw-}, t{-aEz-}, t{-aEC-}, t{-aEF-}, t{-aEI-}, t{-aEL-}, t{-aEO-}, t{-aER-}, t{-aEU-}, t{-aEX-}, t{-aF0-}, t{-aF3-}, t{-aF6-}, t{-aF9-}, t{-aFc-}, t{-aFf-}, t{-aFi-}, t{-aFl-}, t{-aFo-}, t{-aFr-}, t{-aFu-}, t{-aFx-}, t{-aFA-}, t{-aFD-}, t{-aFG-}, t{-aFJ-}, t{-aFM-}, t{-aFP-}, t{-aFS-}, t{-aFV-}, t{-aFY-}, t{-aG1-}, t{-aG4-})
+    -> t{-aEI-}
+{-# L #-}
+ga{-r52,x-} =
+    _/\_ t{-aDB-} t{-aDE-} t{-aDH-} t{-aDK-} t{-aDN-} t{-aDQ-} t{-aDT-} t{-aDW-} t{-aDZ-} t{-aE2-} t{-aE5-} t{-aE8-} t{-aEb-} t{-aEe-} t{-aEh-} t{-aEk-} t{-aEn-} t{-aEq-} t{-aEt-} t{-aEw-} t{-aEz-} t{-aEC-} t{-aEF-} t{-aEI-} t{-aEL-} t{-aEO-} t{-aER-} t{-aEU-} t{-aEX-} t{-aF0-} t{-aF3-} t{-aF6-} t{-aF9-} t{-aFc-} t{-aFf-} t{-aFi-} t{-aFl-} t{-aFo-} t{-aFr-} t{-aFu-} t{-aFx-} t{-aFA-} t{-aFD-} t{-aFG-} t{-aFJ-} t{-aFM-} t{-aFP-} t{-aFS-} t{-aFV-} t{-aFY-} t{-aG1-} t{-aG4-} -> \ ds_d1ar  :: 
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     (t{-aDB-}, t{-aDE-}, t{-aDH-}, t{-aDK-}, t{-aDN-}, t{-aDQ-}, t{-aDT-}, t{-aDW-}, t{-aDZ-}, t{-aE2-}, t{-aE5-}, t{-aE8-}, t{-aEb-}, t{-aEe-}, t{-aEh-}, t{-aEk-}, t{-aEn-}, t{-aEq-}, t{-aEt-}, t{-aEw-}, t{-aEz-}, t{-aEC-}, t{-aEF-}, t{-aEI-}, t{-aEL-}, t{-aEO-}, t{-aER-}, t{-aEU-}, t{-aEX-}, t{-aF0-}, t{-aF3-}, t{-aF6-}, t{-aF9-}, t{-aFc-}, t{-aFf-}, t{-aFi-}, t{-aFl-}, t{-aFo-}, t{-aFr-}, t{-aFu-}, t{-aFx-}, t{-aFA-}, t{-aFD-}, t{-aFG-}, t{-aFJ-}, t{-aFM-}, t{-aFP-}, t{-aFS-}, t{-aFV-}, t{-aFY-}, t{-aG1-}, t{-aG4-})
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 {-# L #-}
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ds_d1ar ->
+       case
+           ds_d1ar
+       of {
+       PrelTup.(,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,){-6Q,p-}{i} a_r47 b_r48 c_r49 d_r4a e_r4b f_r4c g_r4d h_r4e i_r4f j_r4g k_r4h l_r4i m_r4j n_r4k o_r4l p_r4m q_r4n r_r4o s_r4p t_r4q u_r4r v_r4s w_r4t x_r4u y_r4v z_r4w aa_r4x ab_r4y ac_r4z ad_r4A ae_r4B af_r4C ag_r4D ah_r4E ai_r4F aj_r4G ak_r4H al_r4I am_r4J an_r4K ao_r4L ap_r4M aq_r4N ar_r4O as_r4P at_r4Q au_r4R av_r4S aw_r4T ax_r4U ay_r4V az_r4W  ->
+       x_r4u;}
+fb{-r53,x-}  :: 
+    _forall_ [t{-aGc-} t{-aGe-}] => [t{-aGc-}] -> [t{-aGe-}]
+{-# L #-}
+fb{-r53,x-} =
+    _/\_ t{-aGc-} t{-aGe-} -> \ ds_d1aY  :: 
+                                   [t{-aGc-}]
+                               {-# L #-}
+                               ds_d1aY ->
+       let {
+         fail_d1aZ  :: 
+             [t{-aGe-}]
+         {-# L #-}
+         fail_d1aZ =
+             GHCerr.patError{-8r,p-}
+                 _@_ [t{-aGe-}] _string_ "ds018.hs:41|function `fb'"
+       } in 
+         case ds_d1aY of {
+           PrelBase.:{-55,p-}{i} ds_d1b7 ds_d1b6 ->
+               fail_d1aZ;
+           PrelBase.[]{-5i,p-}{i} ->
+               PrelBase.[]{-5i,p-}{i}
+                   _@_ t{-aGe-};
+         }
+fa{-r54,x-}  :: 
+    _forall_ [t{-aGJ-}] => [t{-aGJ-}] -> t{-aGJ-}
+{-# L #-}
+fa{-r54,x-} =
+    _/\_ t{-aGJ-} -> \ ds_d1bF  :: 
+                          [t{-aGJ-}]
+                      {-# L #-}
+                      ds_d1bF ->
+       let {
+         fail_d1bG  :: 
+             t{-aGJ-}
+         {-# L #-}
+         fail_d1bG =
+             GHCerr.patError{-8r,p-}
+                 _@_ t{-aGJ-} _string_ "ds018.hs:39|function `fa'"
+       } in 
+         case ds_d1bF of {
+           PrelBase.[]{-5i,p-}{i} ->
+               fail_d1bG;
+           PrelBase.:{-55,p-}{i} a_r3F ds_d1bT ->
+               case ds_d1bT of {
+                 PrelBase.[]{-5i,p-}{i} ->
+                     fail_d1bG;
+                 PrelBase.:{-55,p-}{i} b_r3G ds_d1c6 ->
+                     case ds_d1c6 of {
+                       PrelBase.[]{-5i,p-}{i} ->
+                           fail_d1bG;
+                       PrelBase.:{-55,p-}{i} c_r3H ds_d1cj ->
+                           case ds_d1cj of {
+                             PrelBase.[]{-5i,p-}{i} ->
+                                 fail_d1bG;
+                             PrelBase.:{-55,p-}{i} d_r3I ds_d1cw ->
+                                 case ds_d1cw of {
+                                   PrelBase.[]{-5i,p-}{i} ->
+                                       fail_d1bG;
+                                   PrelBase.:{-55,p-}{i} e_r3J ds_d1cJ ->
+                                       case ds_d1cJ of {
+                                         PrelBase.[]{-5i,p-}{i} ->
+                                             fail_d1bG;
+                                         PrelBase.:{-55,p-}{i} f_r3K ds_d1cW ->
+                                             case ds_d1cW of {
+                                               PrelBase.[]{-5i,p-}{i} ->
+                                                   fail_d1bG;
+                                               PrelBase.:{-55,p-}{i} g_r3L ds_d1d9 ->
+                                                   case ds_d1d9 of {
+                                                     PrelBase.[]{-5i,p-}{i} ->
+                                                         fail_d1bG;
+                                                     PrelBase.:{-55,p-}{i} h_r3M ds_d1dm ->
+                                                         case ds_d1dm of {
+                                                           PrelBase.[]{-5i,p-}{i} ->
+                                                               fail_d1bG;
+                                                           PrelBase.:{-55,p-}{i} i_r3N ds_d1dz ->
+                                                               case ds_d1dz of {
+                                                                 PrelBase.[]{-5i,p-}{i} ->
+                                                                     fail_d1bG;
+                                                                 PrelBase.:{-55,p-}{i} j_r3O ds_d1dM ->
+                                                                     case ds_d1dM of {
+                                                                       PrelBase.[]{-5i,p-}{i} ->
+                                                                           fail_d1bG;
+                                                                       PrelBase.:{-55,p-}{i} k_r3P ds_d1dZ ->
+                                                                           case ds_d1dZ of {
+                                                                             PrelBase.[]{-5i,p-}{i} ->
+                                                                                 fail_d1bG;
+                                                                             PrelBase.:{-55,p-}{i} l_r3Q ds_d1ec ->
+                                                                                 case ds_d1ec of {
+                                                                                   PrelBase.[]{-5i,p-}{i} ->
+                                                                                       fail_d1bG;
+                                                                                   PrelBase.:{-55,p-}{i} m_r3R ds_d1ep ->
+                                                                                       case
+                                                                                           ds_d1ep
+                                                                                       of {
+                                                                                         PrelBase.[]{-5i,p-}{i} ->
+                                                                                             fail_d1bG;
+                                                                                         PrelBase.:{-55,p-}{i} n_r3S ds_d1eC ->
+                                                                                             case
+                                                                                                 ds_d1eC
+                                                                                             of {
+                                                                                               PrelBase.[]{-5i,p-}{i} ->
+                                                                                                   fail_d1bG;
+                                                                                               PrelBase.:{-55,p-}{i} o_r3T ds_d1eP ->
+                                                                                                   case
+                                                                                                       ds_d1eP
+                                                                                                   of {
+                                                                                                     PrelBase.[]{-5i,p-}{i} ->
+                                                                                                         fail_d1bG;
+                                                                                                     PrelBase.:{-55,p-}{i} p_r3U ds_d1f2 ->
+                                                                                                         case
+                                                                                                             ds_d1f2
+                                                                                                         of {
+                                                                                                           PrelBase.[]{-5i,p-}{i} ->
+                                                                                                               fail_d1bG;
+                                                                                                           PrelBase.:{-55,p-}{i} q_r3V ds_d1ff ->
+                                                                                                               case
+                                                                                                                   ds_d1ff
+                                                                                                               of {
+                                                                                                                 PrelBase.[]{-5i,p-}{i} ->
+                                                                                                                     fail_d1bG;
+                                                                                                                 PrelBase.:{-55,p-}{i} r_r3W ds_d1fs ->
+                                                                                                                     case
+                                                                                                                         ds_d1fs
+                                                                                                                     of {
+                                                                                                                       PrelBase.[]{-5i,p-}{i} ->
+                                                                                                                           fail_d1bG;
+                                                                                                                       PrelBase.:{-55,p-}{i} s_r3X ds_d1fF ->
+                                                                                                                           case
+                                                                                                                               ds_d1fF
+                                                                                                                           of {
+                                                                                                                             PrelBase.[]{-5i,p-}{i} ->
+                                                                                                                                 fail_d1bG;
+                                                                                                                             PrelBase.:{-55,p-}{i} t_r3Y ds_d1fS ->
+                                                                                                                                 case
+                                                                                                                                     ds_d1fS
+                                                                                                                                 of {
+                                                                                                                                   PrelBase.[]{-5i,p-}{i} ->
+                                                                                                                                       fail_d1bG;
+                                                                                                                                   PrelBase.:{-55,p-}{i} u_r3Z ds_d1g5 ->
+                                                                                                                                       case
+                                                                                                                                           ds_d1g5
+                                                                                                                                       of {
+                                                                                                                                         PrelBase.[]{-5i,p-}{i} ->
+                                                                                                                                             fail_d1bG;
+                                                                                                                                         PrelBase.:{-55,p-}{i} v_r40 ds_d1gi ->
+                                                                                                                                             case
+                                                                                                                                                 ds_d1gi
+                                                                                                                                             of {
+                                                                                                                                               PrelBase.[]{-5i,p-}{i} ->
+                                                                                                                                                   fail_d1bG;
+                                                                                                                                               PrelBase.:{-55,p-}{i} w_r41 ds_d1gv ->
+                                                                                                                                                   case
+                                                                                                                                                       ds_d1gv
+                                                                                                                                                   of {
+                                                                                                                                                     PrelBase.[]{-5i,p-}{i} ->
+                                                                                                                                                         fail_d1bG;
+                                                                                                                                                     PrelBase.:{-55,p-}{i} x_r42 ds_d1gI ->
+                                                                                                                                                         case
+                                                                                                                                                             ds_d1gI
+                                                                                                                                                         of {
+                                                                                                                                                           PrelBase.[]{-5i,p-}{i} ->
+                                                                                                                                                               fail_d1bG;
+                                                                                                                                                           PrelBase.:{-55,p-}{i} y_r43 ds_d1gV ->
+                                                                                                                                                               case
+                                                                                                                                                                   ds_d1gV
+                                                                                                                                                               of {
+                                                                                                                                                                 PrelBase.[]{-5i,p-}{i} ->
+                                                                                                                                                                     fail_d1bG;
+                                                                                                                                                                 PrelBase.:{-55,p-}{i} z_r44 ds_d1h8 ->
+                                                                                                                                                                     case
+                                                                                                                                                                         ds_d1h8
+                                                                                                                                                                     of {
+                                                                                                                                                                       PrelBase.:{-55,p-}{i} ds_d1hg ds_d1hf ->
+                                                                                                                                                                           fail_d1bG;
+                                                                                                                                                                       PrelBase.[]{-5i,p-}{i} ->
+                                                                                                                                                                           x_r42;
+                                                                                                                                                                     };
+                                                                                                                                                               };
+                                                                                                                                                         };
+                                                                                                                                                   };
+                                                                                                                                             };
+                                                                                                                                       };
+                                                                                                                                 };
+                                                                                                                           };
+                                                                                                                     };
+                                                                                                               };
+                                                                                                         };
+                                                                                                   };
+                                                                                             };
+                                                                                       };
+                                                                                 };
+                                                                           };
+                                                                     };
+                                                               };
+                                                         };
+                                                   };
+                                             };
+                                       };
+                                 };
+                           };
+                     };
+               };
+         }
+g{-r55,x-}  :: 
+    _forall_
+    [t{-aHm-} t{-aHo-} t{-aHq-}]
+    =>
+    t{-aHm-}
+    -> t{-aHo-}
+    -> t{-aHq-}
+    -> (t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-}, t{-aHm-}, t{-aHo-}, t{-aHq-})
+{-# L #-}
+g{-r55,x-} =
+    _/\_ t{-aHm-} t{-aHo-} t{-aHq-} -> \ x_r3z  :: 
+                                            t{-aHm-}
+                                        {-# L #-}
+                                        x_r3z y_r3B  :: 
+                                                  t{-aHo-}
+                                              {-# L #-}
+                                              y_r3B z_r3D  :: 
+                                                        t{-aHq-}
+                                                    {-# L #-}
+                                                    z_r3D ->
+       PrelTup.(,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,){-62q,p-}{i}
+           {_@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            _@_ t{-aHm-}
+            _@_ t{-aHo-}
+            _@_ t{-aHq-}
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D
+            x_r3z
+            y_r3B
+            z_r3D}
+g1{-r56,x-}  :: 
+    _forall_
+    [t{-aHA-} t{-aHC-}]
+    =>
+    t{-aHA-} -> t{-aHC-} -> PrelBase.(){-40,p-}
+{-# L #-}
+g1{-r56,x-} =
+    _/\_ t{-aHA-} t{-aHC-} -> \ x_r3v  :: 
+                                   t{-aHA-}
+                               {-# L #-}
+                               x_r3v y_r3x  :: 
+                                         t{-aHC-}
+                                     {-# L #-}
+                                     y_r3x ->
+       PrelBase.(){-60,p-}{i}
+f2{-r57,x-}  :: 
+    _forall_
+    [t{-aHO-} t{-aHQ-} t{-aHM-}]
+    =>
+    t{-aHO-} -> t{-aHQ-} -> [t{-aHM-}]
+{-# L #-}
+f2{-r57,x-} =
+    _/\_ t{-aHO-} t{-aHQ-} t{-aHM-} -> \ x_r3r  :: 
+                                            t{-aHO-}
+                                        {-# L #-}
+                                        x_r3r y_r3t  :: 
+                                                  t{-aHQ-}
+                                              {-# L #-}
+                                              y_r3t ->
+       PrelBase.[]{-5i,p-}{i}
+           _@_ t{-aHM-}
+f{-r58,x-}  :: 
+    _forall_
+    [t{-aI2-}]
+    =>
+    t{-aI2-} -> t{-aI2-} -> t{-aI2-} -> [t{-aI2-}]
+{-# L #-}
+f{-r58,x-} =
+    _/\_ t{-aI2-} -> \ x_r3l  :: 
+                          t{-aI2-}
+                      {-# L #-}
+                      x_r3l y_r3n  :: 
+                                t{-aI2-}
+                            {-# L #-}
+                            y_r3n z_r3p  :: 
+                                      t{-aI2-}
+                                  {-# L #-}
+                                  z_r3p ->
+       let { ds_d1uJ  :: 
+                 [t{-aI2-}]
+             {-# L #-}
+             ds_d1uJ =
+         let { ds_d1uV  :: 
+                   [t{-aI2-}]
+               {-# L #-}
+               ds_d1uV =
+           let { ds_d1v7  :: 
+                     [t{-aI2-}]
+                 {-# L #-}
+                 ds_d1v7 =
+             let { ds_d1vj  :: 
+                       [t{-aI2-}]
+                   {-# L #-}
+                   ds_d1vj =
+               let { ds_d1vv  :: 
+                         [t{-aI2-}]
+                     {-# L #-}
+                     ds_d1vv =
+                 let {
+                   ds_d1vH  :: 
+                       [t{-aI2-}]
+                   {-# L #-}
+                   ds_d1vH =
+                       PrelBase.[]{-5i,p-}{i}
+                           {_@_ t{-aI2-}}
+                 } in 
+                   PrelBase.:{-55,p-}{i}
+                       {_@_ t{-aI2-} z_r3p ds_d1vH}
+               } in
+               PrelBase.:{-55,p-}{i}
+                   {_@_ t{-aI2-} y_r3n ds_d1vv}
+             } in
+             PrelBase.:{-55,p-}{i}
+                 {_@_ t{-aI2-} x_r3l ds_d1vj}
+           } in
+           PrelBase.:{-55,p-}{i}
+               {_@_ t{-aI2-} z_r3p ds_d1v7}
+         } in
+         PrelBase.:{-55,p-}{i}
+             {_@_ t{-aI2-} y_r3n ds_d1uV}
+       } in
+       PrelBase.:{-55,p-}{i}
+           {_@_ t{-aI2-} x_r3l ds_d1uJ}
diff --git a/ghc/tests/deSugar/should_compile/ds019.hs b/ghc/tests/deSugar/should_compile/ds019.hs
new file mode 100644 (file)
index 0000000..32400dd
--- /dev/null
@@ -0,0 +1,8 @@
+--!!! ds019 -- mixed var and uni-constructor pats
+
+module Test where
+
+f (a,b,c) i     o = []
+f d       (j,k) p = []
+f (e,f,g) l     q = []
+f h       (m,n) r = []
diff --git a/ghc/tests/deSugar/should_compile/ds019.stderr b/ghc/tests/deSugar/should_compile/ds019.stderr
new file mode 100644 (file)
index 0000000..e064f37
--- /dev/null
@@ -0,0 +1,33 @@
+ds019.hs:7: 
+    Warning: Pattern match(es) completely overlapped
+       in the definition of function `f'
+ds019.hs:8: 
+    Warning: Pattern match(es) completely overlapped
+       in the definition of function `f'
+
+
+================================================================================
+Desugared:
+f{-r3G,x-}  :: 
+    _forall_
+    [t{-aBG-} t{-aBJ-} t{-aBM-} t{-aBY-} t{-aC1-} t{-aC9-} t{-aC7-}]
+    =>
+    (t{-aBG-}, t{-aBJ-}, t{-aBM-})
+    -> (t{-aBY-}, t{-aC1-})
+    -> t{-aC9-}
+    -> [t{-aC7-}]
+{-# L #-}
+f{-r3G,x-} =
+    _/\_ t{-aBG-} t{-aBJ-} t{-aBM-} t{-aBY-} t{-aC1-} t{-aC9-} t{-aC7-} -> \ ds_dGA  :: 
+                                                                                (t{-aBG-}, t{-aBJ-}, t{-aBM-})
+                                                                            {-# L #-}
+                                                                            ds_dGA i_r3h  :: 
+                                                                                       (t{-aBY-}, t{-aC1-})
+                                                                                   {-# L #-}
+                                                                                   i_r3h o_r3j  :: 
+                                                                                             t{-aC9-}
+                                                                                         {-# L #-}
+                                                                                         o_r3j ->
+       case ds_dGA of { PrelTup.(,,){-63,p-}{i} a_r3d b_r3e c_r3f  ->
+       PrelBase.[]{-5i,p-}{i}
+           _@_ t{-aC7-};}
diff --git a/ghc/tests/deSugar/should_compile/ds020.hs b/ghc/tests/deSugar/should_compile/ds020.hs
new file mode 100644 (file)
index 0000000..ac6ea8d
--- /dev/null
@@ -0,0 +1,52 @@
+--!!! ds020 -- lazy patterns (in detail)
+--
+module Test where
+
+a ~([],[],[])    = []
+a ~(~[],~[],~[]) = []
+
+b ~(x:xs:ys)      = []
+b ~(~x: ~xs: ~ys) = []
+
+c ~x ~ _ ~11111 ~3.14159265 = x
+
+d 11       = 4
+d 12       = 3
+d ~(n+4)    = 2
+d ~(n+43)   = 1
+d ~(n+999)  = 0
+
+f ~(x@[]) = []
+f x@(~[]) = []
+
+g ~(~(~(~([])))) = []
+
+-- pattern bindings (implicitly lazy)
+
+([],[],[])    = ([],[],[])
+(~[],~[],~[]) = ([],[],[])
+
+(x1: xs1: ys1) = []
+(~x: ~xs: ~ys) = []
+
+(x2 : xs2: ys2) | eq2  = []
+               | eq3  = [x2]
+               | eq4  = [x2]
+               | True = []
+               where
+                 eq2 = (2::Int) == (4::Int)
+                 eq3 = (3::Int) == (3::Int)
+                 eq4 = (4::Int) == (2::Int)
+
+(x3,y3) | x3 >  3 = (4, 5)
+        | x3 <= 3 = (2, 3)
+-- above: x & y should both be \bottom.
+
+(x4,(y4,(z4,a4))) | eq2  = ('a',('a',('a','a')))
+                 | eq3  = ('b',('b',('b','b')))
+                 | eq4  = ('c',('c',('c','c')))
+                 | True = ('d',('d',('d','d')))
+                 where
+                    eq2 = (2::Int) == (4::Int)
+                    eq3 = (3::Int) == (3::Int)
+                    eq4 = (4::Int) == (2::Int)
diff --git a/ghc/tests/deSugar/should_compile/ds020.stderr b/ghc/tests/deSugar/should_compile/ds020.stderr
new file mode 100644 (file)
index 0000000..fc6973c
--- /dev/null
@@ -0,0 +1,1969 @@
+ds020.hs:20: 
+    Warning: Pattern match(es) completely overlapped
+       in the definition of function `f'
+ds020.hs:16: 
+    Warning: Pattern match(es) completely overlapped
+       in the definition of function `d'
+ds020.hs:17: 
+    Warning: Pattern match(es) completely overlapped
+       in the definition of function `d'
+ds020.hs:9: 
+    Warning: Pattern match(es) completely overlapped
+       in the definition of function `b'
+ds020.hs:6: 
+    Warning: Pattern match(es) completely overlapped
+       in the definition of function `a'
+
+
+================================================================================
+Desugared:
+Rec {
+d.Eq_a1aR  :: 
+    {PrelBase.Eq{-23,p-} PrelBase.Int{-3g,p-}}
+{-# L #-}
+d.Eq_a1aR =
+    PrelBase.$d7{-rqT,p-}
+==_a1h7  :: 
+    PrelBase.Int{-3g,p-}
+    -> PrelBase.Int{-3g,p-}
+    -> PrelBase.Bool{-34,p-}
+{-# L #-}
+==_a1h7 =
+    PrelBase.=={-8Y,p-}
+       _@_ PrelBase.Int{-3g,p-} d.Eq_a1aR
+d.Num_a1aV  :: 
+    {PrelBase.Num{-2c,p-} PrelBase.Int{-3g,p-}}
+{-# L #-}
+d.Num_a1aV =
+    PrelBase.$d3{-rqn,p-}
+fromInt_a1h6  :: 
+    PrelBase.Int{-3g,p-} -> PrelBase.Int{-3g,p-}
+{-# L #-}
+fromInt_a1h6 =
+    PrelBase.fromInt{-8R,p-}
+       _@_ PrelBase.Int{-3g,p-} d.Num_a1aV
+lit_a1h5  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+lit_a1h5 =
+    let {
+      ds_d1SI  :: 
+         PrelBase.Int{-3g,p-}
+      {-# L #-}
+      ds_d1SI =
+         PrelBase.I#{-5b,p-}{i}
+             2
+    } in 
+      fromInt_a1h6
+         ds_d1SI
+fromInt_a1h4  :: 
+    PrelBase.Int{-3g,p-} -> PrelBase.Int{-3g,p-}
+{-# L #-}
+fromInt_a1h4 =
+    fromInt_a1h6
+lit_a1h3  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+lit_a1h3 =
+    let {
+      ds_d1SX  :: 
+         PrelBase.Int{-3g,p-}
+      {-# L #-}
+      ds_d1SX =
+         PrelBase.I#{-5b,p-}{i}
+             4
+    } in 
+      fromInt_a1h4
+         ds_d1SX
+fromInt_a1h2  :: 
+    PrelBase.Int{-3g,p-} -> PrelBase.Int{-3g,p-}
+{-# L #-}
+fromInt_a1h2 =
+    fromInt_a1h6
+lit_a1h1  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+lit_a1h1 =
+    let {
+      ds_d1Tc  :: 
+         PrelBase.Int{-3g,p-}
+      {-# L #-}
+      ds_d1Tc =
+         PrelBase.I#{-5b,p-}{i}
+             3
+    } in 
+      fromInt_a1h2
+         ds_d1Tc
+d.Ord_a1b0  :: 
+    {PrelBase.Ord{-2d,p-} PrelBase.Int{-3g,p-}}
+{-# L #-}
+d.Ord_a1b0 =
+    PrelBase.$d6{-rqS,p-}
+>_a1h0  :: 
+    PrelBase.Int{-3g,p-}
+    -> PrelBase.Int{-3g,p-}
+    -> PrelBase.Bool{-34,p-}
+{-# L #-}
+>_a1h0 =
+    PrelBase.>{-rs3,p-}
+       _@_ PrelBase.Int{-3g,p-} d.Ord_a1b0
+lit_a1gZ  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+lit_a1gZ =
+    lit_a1h1
+lit_a1gY  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+lit_a1gY =
+    lit_a1h3
+fromInt_a1gX  :: 
+    PrelBase.Int{-3g,p-} -> PrelBase.Int{-3g,p-}
+{-# L #-}
+fromInt_a1gX =
+    fromInt_a1h6
+lit_a1gW  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+lit_a1gW =
+    let {
+      ds_d1TC  :: 
+         PrelBase.Int{-3g,p-}
+      {-# L #-}
+      ds_d1TC =
+         PrelBase.I#{-5b,p-}{i}
+             5
+    } in 
+      fromInt_a1gX
+         ds_d1TC
+d.Ord_a1b4  :: 
+    {PrelBase.Ord{-2d,p-} PrelBase.Int{-3g,p-}}
+{-# L #-}
+d.Ord_a1b4 =
+    d.Ord_a1b0
+<=_a1gV  :: 
+    PrelBase.Int{-3g,p-}
+    -> PrelBase.Int{-3g,p-}
+    -> PrelBase.Bool{-34,p-}
+{-# L #-}
+<=_a1gV =
+    PrelBase.<={-rs2,p-}
+       _@_ PrelBase.Int{-3g,p-} d.Ord_a1b4
+lit_a1gU  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+lit_a1gU =
+    lit_a1h5
+lit_a1gT  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+lit_a1gT =
+    lit_a1h1
+==_a1gS  :: 
+    PrelBase.Int{-3g,p-}
+    -> PrelBase.Int{-3g,p-}
+    -> PrelBase.Bool{-34,p-}
+{-# L #-}
+==_a1gS =
+    ==_a1h7
+lit_a1gR  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+lit_a1gR =
+    lit_a1h5
+lit_a1gQ  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+lit_a1gQ =
+    lit_a1h3
+lit_a1gP  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+lit_a1gP =
+    lit_a1h1
+==_a1hb  :: 
+    PrelBase.Int{-3g,p-}
+    -> PrelBase.Int{-3g,p-}
+    -> PrelBase.Bool{-34,p-}
+{-# L #-}
+==_a1hb =
+    ==_a1gS
+==_a1ha  :: 
+    PrelBase.Int{-3g,p-}
+    -> PrelBase.Int{-3g,p-}
+    -> PrelBase.Bool{-34,p-}
+{-# L #-}
+==_a1ha =
+    ==_a1gS
+lit_a1h9  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+lit_a1h9 =
+    lit_a1gQ
+lit_a1h8  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+lit_a1h8 =
+    lit_a1gR
+ds_d1Q9  :: 
+    (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})
+{-# L #-}
+ds_d1Q9 =
+    let { ds_d1Zt  :: 
+             (PrelBase.Char{-38,p-}, (PrelBase.Char{-38,p-}, (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})))
+         {-# L #-}
+         ds_d1Zt =
+      let {
+       eq4_a12Q  :: 
+           PrelBase.Bool{-34,p-}
+       {-# L #-}
+       eq4_a12Q =
+           ==_a1ha
+               lit_a1h9 lit_a1h8 } in
+      let {
+       eq4_r4b  :: 
+           PrelBase.Bool{-34,p-}
+       {-# L #-}
+       eq4_r4b =
+           eq4_a12Q } in
+      let {
+       lit_a1Uy  :: 
+           PrelBase.Int{-3g,p-}
+       {-# L #-}
+       lit_a1Uy =
+           lit_a1gP } in
+      let {
+       eq3_a13e  :: 
+           PrelBase.Bool{-34,p-}
+       {-# L #-}
+       eq3_a13e =
+           ==_a1hb
+               lit_a1gP lit_a1Uy } in
+      let {
+       eq3_r4a  :: 
+           PrelBase.Bool{-34,p-}
+       {-# L #-}
+       eq3_r4a =
+           eq3_a13e } in
+      let {
+       eq2_a13A  :: 
+           PrelBase.Bool{-34,p-}
+       {-# L #-}
+       eq2_a13A =
+           ==_a1gS
+               lit_a1gR lit_a1gQ } in
+      let {
+       eq2_r49  :: 
+           PrelBase.Bool{-34,p-}
+       {-# L #-}
+       eq2_r49 =
+           eq2_a13A
+      } in 
+       case eq2_r49 of {
+         PrelBase.True{-5E,p-}{i} ->
+             let {
+               ds_d1Va  :: 
+                   PrelBase.Char{-38,p-}
+               {-# L #-}
+               ds_d1Va =
+                   PrelBase.C#{-54,p-}{i}
+                       {'a'} } in
+             let { ds_d1Ve  :: 
+                       (PrelBase.Char{-38,p-}, (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}))
+                   {-# L #-}
+                   ds_d1Ve =
+               let {
+                 ds_d1Vu  :: 
+                     PrelBase.Char{-38,p-}
+                 {-# L #-}
+                 ds_d1Vu =
+                     PrelBase.C#{-54,p-}{i}
+                         {'a'} } in
+               let { ds_d1Vy  :: 
+                         (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})
+                     {-# L #-}
+                     ds_d1Vy =
+                 let {
+                   ds_d1VO  :: 
+                       PrelBase.Char{-38,p-}
+                   {-# L #-}
+                   ds_d1VO =
+                       PrelBase.C#{-54,p-}{i}
+                           {'a'} } in
+                 let {
+                   ds_d1VS  :: 
+                       PrelBase.Char{-38,p-}
+                   {-# L #-}
+                   ds_d1VS =
+                       PrelBase.C#{-54,p-}{i}
+                           {'a'}
+                 } in 
+                   PrelTup.(,){-62,p-}{i}
+                       {_@_ PrelBase.Char{-38,p-}
+                        _@_ PrelBase.Char{-38,p-}
+                        ds_d1VO
+                        ds_d1VS}
+               } in
+               PrelTup.(,){-62,p-}{i}
+                   {_@_ PrelBase.Char{-38,p-}
+                    _@_ (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})
+                    ds_d1Vu
+                    ds_d1Vy}
+             } in
+             PrelTup.(,){-62,p-}{i}
+                 {_@_ PrelBase.Char{-38,p-}
+                  _@_ (PrelBase.Char{-38,p-}, (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}))
+                  ds_d1Va
+                  ds_d1Ve};
+         PrelBase.False{-58,p-}{i} ->
+             case eq3_r4a of {
+               PrelBase.True{-5E,p-}{i} ->
+                   let {
+                     ds_d1Wm  :: 
+                         PrelBase.Char{-38,p-}
+                     {-# L #-}
+                     ds_d1Wm =
+                         PrelBase.C#{-54,p-}{i}
+                             {'b'} } in
+                   let { ds_d1Wq  :: 
+                             (PrelBase.Char{-38,p-}, (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}))
+                         {-# L #-}
+                         ds_d1Wq =
+                     let {
+                       ds_d1WG  :: 
+                           PrelBase.Char{-38,p-}
+                       {-# L #-}
+                       ds_d1WG =
+                           PrelBase.C#{-54,p-}{i}
+                               {'b'} } in
+                     let { ds_d1WK  :: 
+                               (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})
+                           {-# L #-}
+                           ds_d1WK =
+                       let {
+                         ds_d1X0  :: 
+                             PrelBase.Char{-38,p-}
+                         {-# L #-}
+                         ds_d1X0 =
+                             PrelBase.C#{-54,p-}{i}
+                                 {'b'} } in
+                       let {
+                         ds_d1X4  :: 
+                             PrelBase.Char{-38,p-}
+                         {-# L #-}
+                         ds_d1X4 =
+                             PrelBase.C#{-54,p-}{i}
+                                 {'b'}
+                       } in 
+                         PrelTup.(,){-62,p-}{i}
+                             {_@_ PrelBase.Char{-38,p-}
+                              _@_ PrelBase.Char{-38,p-}
+                              ds_d1X0
+                              ds_d1X4}
+                     } in
+                     PrelTup.(,){-62,p-}{i}
+                         {_@_ PrelBase.Char{-38,p-}
+                          _@_ (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})
+                          ds_d1WG
+                          ds_d1WK}
+                   } in
+                   PrelTup.(,){-62,p-}{i}
+                       {_@_ PrelBase.Char{-38,p-}
+                        _@_ (PrelBase.Char{-38,p-}, (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}))
+                        ds_d1Wm
+                        ds_d1Wq};
+               PrelBase.False{-58,p-}{i} ->
+                   case eq4_r4b of {
+                     PrelBase.True{-5E,p-}{i} ->
+                         let {
+                           ds_d1Xy  :: 
+                               PrelBase.Char{-38,p-}
+                           {-# L #-}
+                           ds_d1Xy =
+                               PrelBase.C#{-54,p-}{i}
+                                   {'c'} } in
+                         let { ds_d1XC  :: 
+                                   (PrelBase.Char{-38,p-}, (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}))
+                               {-# L #-}
+                               ds_d1XC =
+                           let {
+                             ds_d1XS  :: 
+                                 PrelBase.Char{-38,p-}
+                             {-# L #-}
+                             ds_d1XS =
+                                 PrelBase.C#{-54,p-}{i}
+                                     {'c'} } in
+                           let { ds_d1XW  :: 
+                                     (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})
+                                 {-# L #-}
+                                 ds_d1XW =
+                             let {
+                               ds_d1Yc  :: 
+                                   PrelBase.Char{-38,p-}
+                               {-# L #-}
+                               ds_d1Yc =
+                                   PrelBase.C#{-54,p-}{i}
+                                       {'c'} } in
+                             let {
+                               ds_d1Yg  :: 
+                                   PrelBase.Char{-38,p-}
+                               {-# L #-}
+                               ds_d1Yg =
+                                   PrelBase.C#{-54,p-}{i}
+                                       {'c'}
+                             } in 
+                               PrelTup.(,){-62,p-}{i}
+                                   {_@_ PrelBase.Char{-38,p-}
+                                    _@_ PrelBase.Char{-38,p-}
+                                    ds_d1Yc
+                                    ds_d1Yg}
+                           } in
+                           PrelTup.(,){-62,p-}{i}
+                               {_@_ PrelBase.Char{-38,p-}
+                                _@_ (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})
+                                ds_d1XS
+                                ds_d1XW}
+                         } in
+                         PrelTup.(,){-62,p-}{i}
+                             {_@_ PrelBase.Char{-38,p-}
+                              _@_ (PrelBase.Char{-38,p-}, (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}))
+                              ds_d1Xy
+                              ds_d1XC};
+                     PrelBase.False{-58,p-}{i} ->
+                         let {
+                           ds_d1YC  :: 
+                               PrelBase.Char{-38,p-}
+                           {-# L #-}
+                           ds_d1YC =
+                               PrelBase.C#{-54,p-}{i}
+                                   {'d'} } in
+                         let { ds_d1YG  :: 
+                                   (PrelBase.Char{-38,p-}, (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}))
+                               {-# L #-}
+                               ds_d1YG =
+                           let {
+                             ds_d1YW  :: 
+                                 PrelBase.Char{-38,p-}
+                             {-# L #-}
+                             ds_d1YW =
+                                 PrelBase.C#{-54,p-}{i}
+                                     {'d'} } in
+                           let { ds_d1Z0  :: 
+                                     (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})
+                                 {-# L #-}
+                                 ds_d1Z0 =
+                             let {
+                               ds_d1Zg  :: 
+                                   PrelBase.Char{-38,p-}
+                               {-# L #-}
+                               ds_d1Zg =
+                                   PrelBase.C#{-54,p-}{i}
+                                       {'d'} } in
+                             let {
+                               ds_d1Zk  :: 
+                                   PrelBase.Char{-38,p-}
+                               {-# L #-}
+                               ds_d1Zk =
+                                   PrelBase.C#{-54,p-}{i}
+                                       {'d'}
+                             } in 
+                               PrelTup.(,){-62,p-}{i}
+                                   {_@_ PrelBase.Char{-38,p-}
+                                    _@_ PrelBase.Char{-38,p-}
+                                    ds_d1Zg
+                                    ds_d1Zk}
+                           } in
+                           PrelTup.(,){-62,p-}{i}
+                               {_@_ PrelBase.Char{-38,p-}
+                                _@_ (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-})
+                                ds_d1YW
+                                ds_d1Z0}
+                         } in
+                         PrelTup.(,){-62,p-}{i}
+                             {_@_ PrelBase.Char{-38,p-}
+                              _@_ (PrelBase.Char{-38,p-}, (PrelBase.Char{-38,p-}, PrelBase.Char{-38,p-}))
+                              ds_d1YC
+                              ds_d1YG};
+                   };
+             };
+       }
+    } in
+    case ds_d1Zt of { PrelTup.(,){-62,p-}{i} x4_a12r ds_d1ZC  ->
+    case ds_d1ZC of { PrelTup.(,){-62,p-}{i} y4_a12s ds_d1ZL  ->
+    case ds_d1ZL of { PrelTup.(,){-62,p-}{i} z4_a12t a4_a12u  ->
+    PrelTup.(,,,){-64,p-}{i}
+       {_@_ PrelBase.Char{-38,p-}
+        _@_ PrelBase.Char{-38,p-}
+        _@_ PrelBase.Char{-38,p-}
+        _@_ PrelBase.Char{-38,p-}
+        x4_a12r
+        y4_a12s
+        z4_a12t
+        a4_a12u};};};}
+x4_a12r  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+x4_a12r =
+    case
+       ds_d1Q9
+    of {
+    PrelTup.(,,,){-64,p-}{i} x4_a12r y4_a12s z4_a12t a4_a12u  ->
+    x4_a12r;}
+y4_a12s  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+y4_a12s =
+    case
+       ds_d1Q9
+    of {
+    PrelTup.(,,,){-64,p-}{i} x4_a12r y4_a12s z4_a12t a4_a12u  ->
+    y4_a12s;}
+z4_a12t  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+z4_a12t =
+    case
+       ds_d1Q9
+    of {
+    PrelTup.(,,,){-64,p-}{i} x4_a12r y4_a12s z4_a12t a4_a12u  ->
+    z4_a12t;}
+a4_a12u  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a4_a12u =
+    case
+       ds_d1Q9
+    of {
+    PrelTup.(,,,){-64,p-}{i} x4_a12r y4_a12s z4_a12t a4_a12u  ->
+    a4_a12u;}
+x4{-r4f,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+x4{-r4f,x-} =
+    x4_a12r
+y4{-r4e,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+y4{-r4e,x-} =
+    y4_a12s
+z4{-r4d,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+z4{-r4d,x-} =
+    z4_a12t
+a4{-r4c,x-}  :: 
+    PrelBase.Char{-38,p-}
+{-# L #-}
+a4{-r4c,x-} =
+    a4_a12u
+lit_a1QK  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+lit_a1QK =
+    lit_a1gZ
+ds_d1QP  :: 
+    (PrelBase.Int{-3g,p-}, PrelBase.Int{-3g,p-})
+{-# L #-}
+ds_d1QP =
+    case
+       >_a1h0
+           x3_a148 lit_a1gZ
+    of {
+      PrelBase.True{-5E,p-}{i} ->
+         PrelTup.(,){-62,p-}{i}
+             {_@_ PrelBase.Int{-3g,p-}
+              _@_ PrelBase.Int{-3g,p-}
+              lit_a1gY
+              lit_a1gW};
+      PrelBase.False{-58,p-}{i} ->
+         case
+             <=_a1gV
+                 x3_a148 lit_a1QK
+         of {
+           PrelBase.True{-5E,p-}{i} ->
+               PrelTup.(,){-62,p-}{i}
+                   {_@_ PrelBase.Int{-3g,p-}
+                    _@_ PrelBase.Int{-3g,p-}
+                    lit_a1gU
+                    lit_a1gT};
+           PrelBase.False{-58,p-}{i} ->
+               GHCerr.nonExhaustiveGuardsError{-8l,p-}
+                   _@_ (PrelBase.Int{-3g,p-}, PrelBase.Int{-3g,p-})
+                   _string_ "ds020.hs:42|";
+         };
+    }
+x3_a148  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+x3_a148 =
+    case ds_d1QP of { PrelTup.(,){-62,p-}{i} x3_a148 y3_a149  ->
+    x3_a148;}
+y3_a149  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+y3_a149 =
+    case ds_d1QP of { PrelTup.(,){-62,p-}{i} x3_a148 y3_a149  ->
+    y3_a149;}
+x3{-r4h,x-}  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+x3{-r4h,x-} =
+    x3_a148
+y3{-r4g,x-}  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+y3{-r4g,x-} =
+    y3_a149
+ds_d1Ra  :: 
+    _forall_ [t{-a16h-}] => (t{-a16h-}, t{-a16h-}, [t{-a16h-}])
+{-# L #-}
+ds_d1Ra =
+    _/\_ t{-a16h-} ->
+       _letrec_ {
+         ==_a1mv  :: 
+             PrelBase.Int{-3g,p-}
+             -> PrelBase.Int{-3g,p-}
+             -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1mv =
+             ==_a1h7;
+         ==_a1mu  :: 
+             PrelBase.Int{-3g,p-}
+             -> PrelBase.Int{-3g,p-}
+             -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1mu =
+             ==_a1h7;
+         lit_a1mt  :: 
+             PrelBase.Int{-3g,p-}
+         {-# L #-}
+         lit_a1mt =
+             lit_a1h3;
+         lit_a1ms  :: 
+             PrelBase.Int{-3g,p-}
+         {-# L #-}
+         lit_a1ms =
+             lit_a1h5;
+         ds_d22I  :: 
+             (t{-a16h-}, t{-a16h-}, [t{-a16h-}])
+         {-# L #-}
+         ds_d22I =
+             let { ds_d257  :: 
+                       [t{-a16h-}]
+                   {-# L #-}
+                   ds_d257 =
+               let {
+                 eq4_a158  :: 
+                     PrelBase.Bool{-34,p-}
+                 {-# L #-}
+                 eq4_a158 =
+                     ==_a1mu
+                         lit_a1mt lit_a1ms } in
+               let {
+                 eq4_r41  :: 
+                     PrelBase.Bool{-34,p-}
+                 {-# L #-}
+                 eq4_r41 =
+                     eq4_a158 } in
+               let {
+                 lit_a23v  :: 
+                     PrelBase.Int{-3g,p-}
+                 {-# L #-}
+                 lit_a23v =
+                     lit_a1h1 } in
+               let {
+                 eq3_a15w  :: 
+                     PrelBase.Bool{-34,p-}
+                 {-# L #-}
+                 eq3_a15w =
+                     ==_a1mv
+                         lit_a1h1 lit_a23v } in
+               let {
+                 eq3_r40  :: 
+                     PrelBase.Bool{-34,p-}
+                 {-# L #-}
+                 eq3_r40 =
+                     eq3_a15w } in
+               let {
+                 eq2_a15S  :: 
+                     PrelBase.Bool{-34,p-}
+                 {-# L #-}
+                 eq2_a15S =
+                     ==_a1h7
+                         lit_a1h5 lit_a1h3 } in
+               let {
+                 eq2_r3Z  :: 
+                     PrelBase.Bool{-34,p-}
+                 {-# L #-}
+                 eq2_r3Z =
+                     eq2_a15S
+               } in 
+                 case eq2_r3Z of {
+                   PrelBase.True{-5E,p-}{i} ->
+                       PrelBase.[]{-5i,p-}{i}
+                           _@_ t{-a16h-};
+                   PrelBase.False{-58,p-}{i} ->
+                       case eq3_r40 of {
+                         PrelBase.True{-5E,p-}{i} ->
+                             let {
+                               ds_d24m  :: 
+                                   [t{-a16h-}]
+                               {-# L #-}
+                               ds_d24m =
+                                   PrelBase.[]{-5i,p-}{i}
+                                       {_@_ t{-a16h-}}
+                             } in 
+                               PrelBase.:{-55,p-}{i}
+                                   {_@_ t{-a16h-} x2_a14U ds_d24m};
+                         PrelBase.False{-58,p-}{i} ->
+                             case eq4_r41 of {
+                               PrelBase.True{-5E,p-}{i} ->
+                                   let {
+                                     ds_d24M  :: 
+                                         [t{-a16h-}]
+                                     {-# L #-}
+                                     ds_d24M =
+                                         PrelBase.[]{-5i,p-}{i}
+                                             {_@_ t{-a16h-}}
+                                   } in 
+                                     PrelBase.:{-55,p-}{i}
+                                         {_@_ t{-a16h-} x2_a14U ds_d24M};
+                               PrelBase.False{-58,p-}{i} ->
+                                   PrelBase.[]{-5i,p-}{i}
+                                       _@_ t{-a16h-};
+                             };
+                       };
+                 }
+             } in
+             let {
+               fail_d258  :: 
+                   (t{-a16h-}, t{-a16h-}, [t{-a16h-}])
+               {-# L #-}
+               fail_d258 =
+                   GHCerr.irrefutPatError{-8g,p-}
+                       _@_ (t{-a16h-}, t{-a16h-}, [t{-a16h-}])
+                       _string_ "ds020.hs:39|(x2 PrelBase.: (xs2 PrelBase.: ys2))"
+             } in 
+               case ds_d257 of {
+                 PrelBase.[]{-5i,p-}{i} ->
+                     fail_d258;
+                 PrelBase.:{-55,p-}{i} x2_a14U ds_d25l ->
+                     case ds_d25l of {
+                       PrelBase.[]{-5i,p-}{i} ->
+                           fail_d258;
+                       PrelBase.:{-55,p-}{i} xs2_a14V ys2_a14W ->
+                           PrelTup.(,,){-63,p-}{i}
+                               {_@_ t{-a16h-}
+                                _@_ t{-a16h-}
+                                _@_ [t{-a16h-}]
+                                x2_a14U
+                                xs2_a14V
+                                ys2_a14W};
+                     };
+               };
+         x2_a14U  :: 
+             t{-a16h-}
+         {-# L #-}
+         x2_a14U =
+             case
+                 ds_d22I
+             of {
+             PrelTup.(,,){-63,p-}{i} x2_a14U xs2_a14V ys2_a14W  ->
+             x2_a14U;};
+         xs2_a14V  :: 
+             t{-a16h-}
+         {-# L #-}
+         xs2_a14V =
+             case
+                 ds_d22I
+             of {
+             PrelTup.(,,){-63,p-}{i} x2_a14U xs2_a14V ys2_a14W  ->
+             xs2_a14V;};
+         ys2_a14W  :: 
+             [t{-a16h-}]
+         {-# L #-}
+         ys2_a14W =
+             case
+                 ds_d22I
+             of {
+             PrelTup.(,,){-63,p-}{i} x2_a14U xs2_a14V ys2_a14W  ->
+             ys2_a14W;};
+       } in 
+         PrelTup.(,,){-63,p-}{i}
+             {_@_ t{-a16h-}
+              _@_ t{-a16h-}
+              _@_ [t{-a16h-}]
+              x2_a14U
+              xs2_a14V
+              ys2_a14W}
+x2{-r4k,x-}  :: 
+    _forall_ [t{-a16h-}] => t{-a16h-}
+{-# L #-}
+x2{-r4k,x-} =
+    _/\_ t{-a16h-} ->
+       case
+           ds_d1Ra
+               _@_ t{-a16h-}
+       of {
+       PrelTup.(,,){-63,p-}{i} ds_d26G ds_d26I ds_d26H  ->
+       ds_d26G;}
+xs2{-r4j,x-}  :: 
+    _forall_ [t{-a16h-}] => t{-a16h-}
+{-# L #-}
+xs2{-r4j,x-} =
+    _/\_ t{-a16h-} ->
+       case
+           ds_d1Ra
+               _@_ t{-a16h-}
+       of {
+       PrelTup.(,,){-63,p-}{i} ds_d26Z ds_d26X ds_d26Y  ->
+       ds_d26X;}
+ys2{-r4i,x-}  :: 
+    _forall_ [t{-a16h-}] => [t{-a16h-}]
+{-# L #-}
+ys2{-r4i,x-} =
+    _/\_ t{-a16h-} ->
+       case
+           ds_d1Ra
+               _@_ t{-a16h-}
+       of {
+       PrelTup.(,,){-63,p-}{i} ds_d27g ds_d27f ds_d27e  ->
+       ds_d27e;}
+ds_d1Rr  :: 
+    _forall_ [t{-a16I-}] => (t{-a16I-}, t{-a16I-}, [t{-a16I-}])
+{-# L #-}
+ds_d1Rr =
+    _/\_ t{-a16I-} ->
+       let { ds_d28P  :: 
+                 (t{-a16I-}, t{-a16I-}, [t{-a16I-}])
+             {-# L #-}
+             ds_d28P =
+         let {
+           ds_d27Z  :: 
+               [t{-a16I-}]
+           {-# L #-}
+           ds_d27Z =
+               PrelBase.[]{-5i,p-}{i}
+                   _@_ t{-a16I-} } in
+         let {
+           fail_d280  :: 
+               (t{-a16I-}, t{-a16I-}, [t{-a16I-}])
+           {-# L #-}
+           fail_d280 =
+               GHCerr.irrefutPatError{-8g,p-}
+                   _@_ (t{-a16I-}, t{-a16I-}, [t{-a16I-}])
+                   _string_ "ds020.hs:30|(~x PrelBase.: (~xs PrelBase.: ~ys))"
+         } in 
+           case ds_d27Z of {
+             PrelBase.[]{-5i,p-}{i} ->
+                 fail_d280;
+             PrelBase.:{-55,p-}{i} x_a16u ds_d28d ->
+                 case ds_d28d of {
+                   PrelBase.[]{-5i,p-}{i} ->
+                       fail_d280;
+                   PrelBase.:{-55,p-}{i} xs_a16v ys_a16w ->
+                       let {
+                         ys_a16w  :: 
+                             [t{-a16I-}]
+                         {-# L #-}
+                         ys_a16w =
+                             ys_a16w } in
+                       let {
+                         xs_a16v  :: 
+                             t{-a16I-}
+                         {-# L #-}
+                         xs_a16v =
+                             xs_a16v } in
+                       let {
+                         x_a16u  :: 
+                             t{-a16I-}
+                         {-# L #-}
+                         x_a16u =
+                             x_a16u
+                       } in 
+                         PrelTup.(,,){-63,p-}{i}
+                             {_@_ t{-a16I-}
+                              _@_ t{-a16I-}
+                              _@_ [t{-a16I-}]
+                              x_a16u
+                              xs_a16v
+                              ys_a16w};
+                 };
+           }
+       } in
+       let {
+         x_a16u  :: 
+             t{-a16I-}
+         {-# L #-}
+         x_a16u =
+             case
+                 ds_d28P
+             of {
+             PrelTup.(,,){-63,p-}{i} x_a16u xs_a16v ys_a16w  ->
+             x_a16u;} } in
+       let {
+         xs_a16v  :: 
+             t{-a16I-}
+         {-# L #-}
+         xs_a16v =
+             case
+                 ds_d28P
+             of {
+             PrelTup.(,,){-63,p-}{i} x_a16u xs_a16v ys_a16w  ->
+             xs_a16v;} } in
+       let {
+         ys_a16w  :: 
+             [t{-a16I-}]
+         {-# L #-}
+         ys_a16w =
+             case
+                 ds_d28P
+             of {
+             PrelTup.(,,){-63,p-}{i} x_a16u xs_a16v ys_a16w  ->
+             ys_a16w;}
+       } in 
+         PrelTup.(,,){-63,p-}{i}
+             {_@_ t{-a16I-}
+              _@_ t{-a16I-}
+              _@_ [t{-a16I-}]
+              x_a16u
+              xs_a16v
+              ys_a16w}
+x{-r4n,x-}  :: 
+    _forall_ [t{-a16I-}] => t{-a16I-}
+{-# L #-}
+x{-r4n,x-} =
+    _/\_ t{-a16I-} ->
+       case
+           ds_d1Rr
+               _@_ t{-a16I-}
+       of {
+       PrelTup.(,,){-63,p-}{i} ds_d29s ds_d29u ds_d29t  ->
+       ds_d29s;}
+xs{-r4m,x-}  :: 
+    _forall_ [t{-a16I-}] => t{-a16I-}
+{-# L #-}
+xs{-r4m,x-} =
+    _/\_ t{-a16I-} ->
+       case
+           ds_d1Rr
+               _@_ t{-a16I-}
+       of {
+       PrelTup.(,,){-63,p-}{i} ds_d29L ds_d29J ds_d29K  ->
+       ds_d29J;}
+ys{-r4l,x-}  :: 
+    _forall_ [t{-a16I-}] => [t{-a16I-}]
+{-# L #-}
+ys{-r4l,x-} =
+    _/\_ t{-a16I-} ->
+       case
+           ds_d1Rr
+               _@_ t{-a16I-}
+       of {
+       PrelTup.(,,){-63,p-}{i} ds_d2a2 ds_d2a1 ds_d2a0  ->
+       ds_d2a0;}
+ds_d1RI  :: 
+    _forall_ [t{-a16Y-}] => (t{-a16Y-}, t{-a16Y-}, [t{-a16Y-}])
+{-# L #-}
+ds_d1RI =
+    _/\_ t{-a16Y-} ->
+       let { ds_d2bs  :: 
+                 (t{-a16Y-}, t{-a16Y-}, [t{-a16Y-}])
+             {-# L #-}
+             ds_d2bs =
+         let {
+           ds_d2aL  :: 
+               [t{-a16Y-}]
+           {-# L #-}
+           ds_d2aL =
+               PrelBase.[]{-5i,p-}{i}
+                   _@_ t{-a16Y-} } in
+         let {
+           fail_d2aM  :: 
+               (t{-a16Y-}, t{-a16Y-}, [t{-a16Y-}])
+           {-# L #-}
+           fail_d2aM =
+               GHCerr.irrefutPatError{-8g,p-}
+                   _@_ (t{-a16Y-}, t{-a16Y-}, [t{-a16Y-}])
+                   _string_ "ds020.hs:29|(x1 PrelBase.: (xs1 PrelBase.: ys1))"
+         } in 
+           case ds_d2aL of {
+             PrelBase.[]{-5i,p-}{i} ->
+                 fail_d2aM;
+             PrelBase.:{-55,p-}{i} x1_a16K ds_d2aZ ->
+                 case ds_d2aZ of {
+                   PrelBase.[]{-5i,p-}{i} ->
+                       fail_d2aM;
+                   PrelBase.:{-55,p-}{i} xs1_a16L ys1_a16M ->
+                       PrelTup.(,,){-63,p-}{i}
+                           {_@_ t{-a16Y-}
+                            _@_ t{-a16Y-}
+                            _@_ [t{-a16Y-}]
+                            x1_a16K
+                            xs1_a16L
+                            ys1_a16M};
+                 };
+           }
+       } in
+       let {
+         x1_a16K  :: 
+             t{-a16Y-}
+         {-# L #-}
+         x1_a16K =
+             case
+                 ds_d2bs
+             of {
+             PrelTup.(,,){-63,p-}{i} x1_a16K xs1_a16L ys1_a16M  ->
+             x1_a16K;} } in
+       let {
+         xs1_a16L  :: 
+             t{-a16Y-}
+         {-# L #-}
+         xs1_a16L =
+             case
+                 ds_d2bs
+             of {
+             PrelTup.(,,){-63,p-}{i} x1_a16K xs1_a16L ys1_a16M  ->
+             xs1_a16L;} } in
+       let {
+         ys1_a16M  :: 
+             [t{-a16Y-}]
+         {-# L #-}
+         ys1_a16M =
+             case
+                 ds_d2bs
+             of {
+             PrelTup.(,,){-63,p-}{i} x1_a16K xs1_a16L ys1_a16M  ->
+             ys1_a16M;}
+       } in 
+         PrelTup.(,,){-63,p-}{i}
+             {_@_ t{-a16Y-}
+              _@_ t{-a16Y-}
+              _@_ [t{-a16Y-}]
+              x1_a16K
+              xs1_a16L
+              ys1_a16M}
+x1{-r4q,x-}  :: 
+    _forall_ [t{-a16Y-}] => t{-a16Y-}
+{-# L #-}
+x1{-r4q,x-} =
+    _/\_ t{-a16Y-} ->
+       case
+           ds_d1RI
+               _@_ t{-a16Y-}
+       of {
+       PrelTup.(,,){-63,p-}{i} ds_d2c5 ds_d2c7 ds_d2c6  ->
+       ds_d2c5;}
+xs1{-r4p,x-}  :: 
+    _forall_ [t{-a16Y-}] => t{-a16Y-}
+{-# L #-}
+xs1{-r4p,x-} =
+    _/\_ t{-a16Y-} ->
+       case
+           ds_d1RI
+               _@_ t{-a16Y-}
+       of {
+       PrelTup.(,,){-63,p-}{i} ds_d2co ds_d2cm ds_d2cn  ->
+       ds_d2cm;}
+ys1{-r4o,x-}  :: 
+    _forall_ [t{-a16Y-}] => [t{-a16Y-}]
+{-# L #-}
+ys1{-r4o,x-} =
+    _/\_ t{-a16Y-} ->
+       case
+           ds_d1RI
+               _@_ t{-a16Y-}
+       of {
+       PrelTup.(,,){-63,p-}{i} ds_d2cF ds_d2cE ds_d2cD  ->
+       ds_d2cD;}
+ds_d1RZ  :: 
+    PrelBase.(){-40,p-}
+{-# L #-}
+ds_d1RZ =
+    let { ds_d2dp  :: 
+             ([GHC.Void{-3T,p-}], [GHC.Void{-3T,p-}], [GHC.Void{-3T,p-}])
+         {-# L #-}
+         ds_d2dp =
+      let {
+       ds_d2cZ  :: 
+           [GHC.Void{-3T,p-}]
+       {-# L #-}
+       ds_d2cZ =
+           PrelBase.[]{-5i,p-}{i}
+               _@_ GHC.Void{-3T,p-} } in
+      let {
+       ds_d2d3  :: 
+           [GHC.Void{-3T,p-}]
+       {-# L #-}
+       ds_d2d3 =
+           PrelBase.[]{-5i,p-}{i}
+               _@_ GHC.Void{-3T,p-} } in
+      let {
+       ds_d2d7  :: 
+           [GHC.Void{-3T,p-}]
+       {-# L #-}
+       ds_d2d7 =
+           PrelBase.[]{-5i,p-}{i}
+               _@_ GHC.Void{-3T,p-}
+      } in 
+       PrelTup.(,,){-63,p-}{i}
+           {_@_ [GHC.Void{-3T,p-}]
+            _@_ [GHC.Void{-3T,p-}]
+            _@_ [GHC.Void{-3T,p-}]
+            ds_d2cZ
+            ds_d2d3
+            ds_d2d7}
+    } in
+    case
+       ds_d2dp
+    of {
+    PrelTup.(,,){-63,p-}{i} ds_d2dQ ds_d2dP ds_d2dO  ->
+    let { ds_d2eg  :: 
+             PrelBase.(){-40,p-}
+         {-# L #-}
+         ds_d2eg =
+      let {
+       fail_d2dR  :: 
+           PrelBase.(){-40,p-}
+       {-# L #-}
+       fail_d2dR =
+           GHCerr.irrefutPatError{-8g,p-}
+               _@_ PrelBase.(){-40,p-} _string_ "ds020.hs:27|PrelBase.[]"
+      } in 
+       case ds_d2dO of {
+         PrelBase.:{-55,p-}{i} ds_d2dZ ds_d2dY ->
+             fail_d2dR;
+         PrelBase.[]{-5i,p-}{i} ->
+             PrelBase.(){-60,p-}{i}
+                 {};
+       }
+    } in
+    let { ds_d2eG  :: 
+             PrelBase.(){-40,p-}
+         {-# L #-}
+         ds_d2eG =
+      let {
+       fail_d2eh  :: 
+           PrelBase.(){-40,p-}
+       {-# L #-}
+       fail_d2eh =
+           GHCerr.irrefutPatError{-8g,p-}
+               _@_ PrelBase.(){-40,p-} _string_ "ds020.hs:27|PrelBase.[]"
+      } in 
+       case ds_d2dP of {
+         PrelBase.:{-55,p-}{i} ds_d2ep ds_d2eo ->
+             fail_d2eh;
+         PrelBase.[]{-5i,p-}{i} ->
+             PrelBase.(){-60,p-}{i}
+                 {};
+       }
+    } in
+    let { ds_d2uC  :: 
+             PrelBase.(){-40,p-}
+         {-# L #-}
+         ds_d2uC =
+      let {
+       fail_d2eH  :: 
+           PrelBase.(){-40,p-}
+       {-# L #-}
+       fail_d2eH =
+           GHCerr.irrefutPatError{-8g,p-}
+               _@_ PrelBase.(){-40,p-} _string_ "ds020.hs:27|PrelBase.[]"
+      } in 
+       case ds_d2dQ of {
+         PrelBase.:{-55,p-}{i} ds_d2eP ds_d2eO ->
+             fail_d2eH;
+         PrelBase.[]{-5i,p-}{i} ->
+             PrelBase.(){-60,p-}{i}
+                 {};
+       }
+    } in
+    PrelBase.(){-60,p-}{i}
+       {};}
+ds_d1S4  :: 
+    PrelBase.(){-40,p-}
+{-# L #-}
+ds_d1S4 =
+    let { ds_d2fM  :: 
+             ([GHC.Void{-3T,p-}], [GHC.Void{-3T,p-}], [GHC.Void{-3T,p-}])
+         {-# L #-}
+         ds_d2fM =
+      let {
+       ds_d2ff  :: 
+           [GHC.Void{-3T,p-}]
+       {-# L #-}
+       ds_d2ff =
+           PrelBase.[]{-5i,p-}{i}
+               _@_ GHC.Void{-3T,p-} } in
+      let {
+       ds_d2fj  :: 
+           [GHC.Void{-3T,p-}]
+       {-# L #-}
+       ds_d2fj =
+           PrelBase.[]{-5i,p-}{i}
+               _@_ GHC.Void{-3T,p-} } in
+      let {
+       ds_d2fn  :: 
+           [GHC.Void{-3T,p-}]
+       {-# L #-}
+       ds_d2fn =
+           PrelBase.[]{-5i,p-}{i}
+               _@_ GHC.Void{-3T,p-}
+      } in 
+       PrelTup.(,,){-63,p-}{i}
+           {_@_ [GHC.Void{-3T,p-}]
+            _@_ [GHC.Void{-3T,p-}]
+            _@_ [GHC.Void{-3T,p-}]
+            ds_d2ff
+            ds_d2fj
+            ds_d2fn}
+    } in
+    let {
+      fail_d2fN  :: 
+         PrelBase.(){-40,p-}
+      {-# L #-}
+      fail_d2fN =
+         GHCerr.irrefutPatError{-8g,p-}
+             _@_ PrelBase.(){-40,p-}
+             _string_ "ds020.hs:26|(PrelBase.[], PrelBase.[], PrelBase.[])"
+    } in 
+      case
+         ds_d2fM
+      of {
+      PrelTup.(,,){-63,p-}{i} ds_d2fW ds_d2fY ds_d2fX  ->
+      case ds_d2fW of {
+       PrelBase.:{-55,p-}{i} ds_d2g6 ds_d2g5 ->
+           fail_d2fN;
+       PrelBase.[]{-5i,p-}{i} ->
+           case ds_d2fY of {
+             PrelBase.:{-55,p-}{i} ds_d2gk ds_d2gj ->
+                 fail_d2fN;
+             PrelBase.[]{-5i,p-}{i} ->
+                 case ds_d2fX of {
+                   PrelBase.:{-55,p-}{i} ds_d2gy ds_d2gx ->
+                       fail_d2fN;
+                   PrelBase.[]{-5i,p-}{i} ->
+                       PrelBase.(){-60,p-}{i}
+                           {};
+                 };
+           };
+      };}
+g{-r4r,x-}  :: 
+    _forall_ [t{-a17G-} t{-a17I-}] => [t{-a17G-}] -> [t{-a17I-}]
+{-# L #-}
+g{-r4r,x-} =
+    _/\_ t{-a17G-} t{-a17I-} -> \ ds_d2ha  :: 
+                                     [t{-a17G-}]
+                                 {-# L #-}
+                                 ds_d2ha ->
+       let { ds_d2uD  :: 
+                 PrelBase.(){-40,p-}
+             {-# L #-}
+             ds_d2uD =
+         let { ds_d2uE  :: 
+                   PrelBase.(){-40,p-}
+               {-# L #-}
+               ds_d2uE =
+           let { ds_d2uF  :: 
+                     PrelBase.(){-40,p-}
+                 {-# L #-}
+                 ds_d2uF =
+             let { ds_d2uG  :: 
+                       PrelBase.(){-40,p-}
+                   {-# L #-}
+                   ds_d2uG =
+               let {
+                 fail_d2hb  :: 
+                     PrelBase.(){-40,p-}
+                 {-# L #-}
+                 fail_d2hb =
+                     GHCerr.irrefutPatError{-8g,p-}
+                         _@_ PrelBase.(){-40,p-} _string_ "ds020.hs:22|PrelBase.[]"
+               } in 
+                 case ds_d2ha of {
+                   PrelBase.:{-55,p-}{i} ds_d2hj ds_d2hi ->
+                       fail_d2hb;
+                   PrelBase.[]{-5i,p-}{i} ->
+                       PrelBase.(){-60,p-}{i}
+                           {};
+                 }
+             } in
+             PrelBase.(){-60,p-}{i}
+                 {}
+           } in
+           PrelBase.(){-60,p-}{i}
+               {}
+         } in
+         PrelBase.(){-60,p-}{i}
+             {}
+       } in
+       PrelBase.[]{-5i,p-}{i}
+           _@_ t{-a17I-}
+f{-r4s,x-}  :: 
+    _forall_ [t{-a17W-} t{-a17Y-}] => [t{-a17W-}] -> [t{-a17Y-}]
+{-# L #-}
+f{-r4s,x-} =
+    _/\_ t{-a17W-} t{-a17Y-} -> \ x_r3U  :: 
+                                     [t{-a17W-}]
+                                 {-# L #-}
+                                 x_r3U ->
+       let { x_r3U  :: 
+                 [t{-a17W-}]
+             {-# L #-}
+             x_r3U =
+         let {
+           fail_d2hN  :: 
+               [t{-a17W-}]
+           {-# L #-}
+           fail_d2hN =
+               GHCerr.irrefutPatError{-8g,p-}
+                   _@_ [t{-a17W-}] _string_ "ds020.hs:19|(x@PrelBase.[])"
+         } in 
+           case x_r3U of {
+             PrelBase.:{-55,p-}{i} ds_d2hV ds_d2hU ->
+                 fail_d2hN;
+             PrelBase.[]{-5i,p-}{i} ->
+                 x_r3U;
+           }
+       } in
+       PrelBase.[]{-5i,p-}{i}
+           _@_ t{-a17Y-}
+d{-r4t,x-}  :: 
+    _forall_
+    [t{-a18b-} t{-a18D-}]
+    =>
+    {PrelBase.Num{-2c,p-} t{-a18b-}}
+    -> {PrelBase.Num{-2c,p-} t{-a18D-}}
+    -> {PrelBase.Ord{-2d,p-} t{-a18b-}}
+    -> t{-a18b-}
+    -> t{-a18D-}
+{-# L #-}
+d{-r4t,x-} =
+    _/\_ t{-a18b-} t{-a18D-} -> \ d.Num_a18H  :: 
+                                     {PrelBase.Num{-2c,p-} t{-a18b-}}
+                                 {-# L #-}
+                                 d.Num_a18H d.Num_a18M  :: 
+                                                {PrelBase.Num{-2c,p-} t{-a18D-}}
+                                            {-# L #-}
+                                            d.Num_a18M d.Ord_a18R  :: 
+                                                           {PrelBase.Ord{-2d,p-} t{-a18b-}}
+                                                       {-# L #-}
+                                                       d.Ord_a18R ->
+       let {
+         d.Eq_a18J  :: 
+             {PrelBase.Eq{-23,p-} t{-a18b-}}
+         {-# L #-}
+         d.Eq_a18J =
+             PrelBase.scsel_OrdPrelBaseEq{-a2jI,p-}
+                 _@_ t{-a18b-} d.Ord_a18R } in
+       let {
+         fromInt_a2jy  :: 
+             PrelBase.Int{-3g,p-} -> t{-a18b-}
+         {-# L #-}
+         fromInt_a2jy =
+             PrelBase.fromInt{-8R,p-}
+                 _@_ t{-a18b-} d.Num_a18H } in
+       let { lit_a2jx  :: 
+                 t{-a18b-}
+             {-# L #-}
+             lit_a2jx =
+         let {
+           ds_d2jX  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d2jX =
+               PrelBase.I#{-5b,p-}{i}
+                   11
+         } in 
+           fromInt_a2jy
+               ds_d2jX
+       } in
+       let {
+         ==_a2jw  :: 
+             t{-a18b-} -> t{-a18b-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a2jw =
+             PrelBase.=={-8Y,p-}
+                 _@_ t{-a18b-} d.Eq_a18J } in
+       let {
+         fromInt_a2jv  :: 
+             PrelBase.Int{-3g,p-} -> t{-a18D-}
+         {-# L #-}
+         fromInt_a2jv =
+             PrelBase.fromInt{-8R,p-}
+                 _@_ t{-a18D-} d.Num_a18M } in
+       let { lit_a2ju  :: 
+                 t{-a18D-}
+             {-# L #-}
+             lit_a2ju =
+         let {
+           ds_d2kr  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d2kr =
+               PrelBase.I#{-5b,p-}{i}
+                   4
+         } in 
+           fromInt_a2jv
+               ds_d2kr
+       } in
+       let {
+         fromInt_a2jt  :: 
+             PrelBase.Int{-3g,p-} -> t{-a18b-}
+         {-# L #-}
+         fromInt_a2jt =
+             fromInt_a2jy } in
+       let { lit_a2js  :: 
+                 t{-a18b-}
+             {-# L #-}
+             lit_a2js =
+         let {
+           ds_d2kG  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d2kG =
+               PrelBase.I#{-5b,p-}{i}
+                   12
+         } in 
+           fromInt_a2jt
+               ds_d2kG
+       } in
+       let {
+         ==_a2jr  :: 
+             t{-a18b-} -> t{-a18b-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a2jr =
+             ==_a2jw } in
+       let {
+         fromInt_a2jq  :: 
+             PrelBase.Int{-3g,p-} -> t{-a18D-}
+         {-# L #-}
+         fromInt_a2jq =
+             fromInt_a2jv } in
+       let { lit_a2jp  :: 
+                 t{-a18D-}
+             {-# L #-}
+             lit_a2jp =
+         let {
+           ds_d2kW  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d2kW =
+               PrelBase.I#{-5b,p-}{i}
+                   3
+         } in 
+           fromInt_a2jq
+               ds_d2kW
+       } in
+       let {
+         fromInt_a2jo  :: 
+             PrelBase.Int{-3g,p-} -> t{-a18b-}
+         {-# L #-}
+         fromInt_a2jo =
+             fromInt_a2jy } in
+       let { lit_a2jn  :: 
+                 t{-a18b-}
+             {-# L #-}
+             lit_a2jn =
+         let {
+           ds_d2lb  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d2lb =
+               PrelBase.I#{-5b,p-}{i}
+                   4
+         } in 
+           fromInt_a2jo
+               ds_d2lb
+       } in
+       let {
+         >=_a2jm  :: 
+             t{-a18b-} -> t{-a18b-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         >=_a2jm =
+             PrelBase.>={-8Z,p-}
+                 _@_ t{-a18b-} d.Ord_a18R } in
+       let {
+         d.Num_a18T  :: 
+             {PrelBase.Num{-2c,p-} t{-a18b-}}
+         {-# L #-}
+         d.Num_a18T =
+             d.Num_a18H } in
+       let {
+         -_a2jl  :: 
+             t{-a18b-} -> t{-a18b-} -> t{-a18b-}
+         {-# L #-}
+         -_a2jl =
+             PrelBase.-{-817,p-}
+                 _@_ t{-a18b-} d.Num_a18T } in
+       let {
+         fromInt_a2jk  :: 
+             PrelBase.Int{-3g,p-} -> t{-a18D-}
+         {-# L #-}
+         fromInt_a2jk =
+             fromInt_a2jv } in
+       let { lit_a2jj  :: 
+                 t{-a18D-}
+             {-# L #-}
+             lit_a2jj =
+         let {
+           ds_d2lH  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d2lH =
+               PrelBase.I#{-5b,p-}{i}
+                   2
+         } in 
+           fromInt_a2jk
+               ds_d2lH
+       } in
+       let {
+         fromInt_a2ji  :: 
+             PrelBase.Int{-3g,p-} -> t{-a18b-}
+         {-# L #-}
+         fromInt_a2ji =
+             fromInt_a2jy } in
+       let { lit_a2jh  :: 
+                 t{-a18b-}
+             {-# L #-}
+             lit_a2jh =
+         let {
+           ds_d2lW  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d2lW =
+               PrelBase.I#{-5b,p-}{i}
+                   43
+         } in 
+           fromInt_a2ji
+               ds_d2lW
+       } in
+       let {
+         >=_a2jg  :: 
+             t{-a18b-} -> t{-a18b-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         >=_a2jg =
+             >=_a2jm } in
+       let {
+         -_a2jf  :: 
+             t{-a18b-} -> t{-a18b-} -> t{-a18b-}
+         {-# L #-}
+         -_a2jf =
+             -_a2jl } in
+       let {
+         fromInt_a2je  :: 
+             PrelBase.Int{-3g,p-} -> t{-a18D-}
+         {-# L #-}
+         fromInt_a2je =
+             fromInt_a2jv } in
+       let { lit_a2jd  :: 
+                 t{-a18D-}
+             {-# L #-}
+             lit_a2jd =
+         let {
+           ds_d2md  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d2md =
+               PrelBase.I#{-5b,p-}{i}
+                   1
+         } in 
+           fromInt_a2je
+               ds_d2md
+       } in
+       let {
+         fromInt_a2jc  :: 
+             PrelBase.Int{-3g,p-} -> t{-a18b-}
+         {-# L #-}
+         fromInt_a2jc =
+             fromInt_a2jy } in
+       let { lit_a2jb  :: 
+                 t{-a18b-}
+             {-# L #-}
+             lit_a2jb =
+         let {
+           ds_d2ms  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d2ms =
+               PrelBase.I#{-5b,p-}{i}
+                   999
+         } in 
+           fromInt_a2jc
+               ds_d2ms
+       } in
+       let {
+         >=_a2ja  :: 
+             t{-a18b-} -> t{-a18b-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         >=_a2ja =
+             >=_a2jm } in
+       let {
+         -_a2j9  :: 
+             t{-a18b-} -> t{-a18b-} -> t{-a18b-}
+         {-# L #-}
+         -_a2j9 =
+             -_a2jl } in
+       let {
+         fromInt_a2j8  :: 
+             PrelBase.Int{-3g,p-} -> t{-a18D-}
+         {-# L #-}
+         fromInt_a2j8 =
+             fromInt_a2jv } in
+       let { lit_a2j7  :: 
+                 t{-a18D-}
+             {-# L #-}
+             lit_a2j7 =
+         let {
+           ds_d2mJ  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d2mJ =
+               PrelBase.I#{-5b,p-}{i}
+                   0
+         } in 
+           fromInt_a2j8
+               ds_d2mJ
+       } in
+       \ ds_d2ng  :: 
+             t{-a18b-}
+         {-# L #-}
+         ds_d2ng ->
+           let { fail_d2o7  :: 
+                     t{-a18D-}
+                 {-# L #-}
+                 fail_d2o7 =
+             let { ds_d2n0  :: 
+                       PrelBase.(){-40,p-}
+                   {-# L #-}
+                   ds_d2n0 =
+               let {
+                 fail_d2nt  :: 
+                     PrelBase.(){-40,p-}
+                 {-# L #-}
+                 fail_d2nt =
+                     GHCerr.irrefutPatError{-8g,p-}
+                         _@_ PrelBase.(){-40,p-} _string_ "ds020.hs:13|(n+4)"
+               } in 
+                 case
+                     (\ ds_d2nn  :: 
+                            t{-a18b-}
+                        {-# L #-}
+                        ds_d2nn ->
+                          >=_a2jm
+                              ds_d2nn lit_a2jn)
+                         ds_d2ng
+                 of {
+                   PrelBase.True{-5E,p-}{i} ->
+                       let {
+                         n_r3O  :: 
+                             t{-a18b-}
+                         {-# L #-}
+                         n_r3O =
+                             (\ ds_d2nM  :: 
+                                    t{-a18b-}
+                                {-# L #-}
+                                ds_d2nM ->
+                                  -_a2jl
+                                      ds_d2nM lit_a2jn)
+                                 ds_d2ng
+                       } in 
+                         PrelBase.(){-60,p-}{i}
+                             {};
+                   PrelBase.False{-58,p-}{i} ->
+                       fail_d2nt;
+                 }
+             } in
+             lit_a2jj
+           } in
+           let {
+             fail_d2or  :: 
+                 t{-a18D-}
+             {-# L #-}
+             fail_d2or =
+                 case
+                     ==_a2jr
+                         lit_a2js ds_d2ng
+                 of {
+                   PrelBase.True{-5E,p-}{i} ->
+                       lit_a2jp;
+                   PrelBase.False{-58,p-}{i} ->
+                       fail_d2o7;
+                 }
+           } in 
+             case
+                 ==_a2jw
+                     lit_a2jx ds_d2ng
+             of {
+               PrelBase.True{-5E,p-}{i} ->
+                   lit_a2ju;
+               PrelBase.False{-58,p-}{i} ->
+                   fail_d2or;
+             }
+c{-r4u,x-}  :: 
+    _forall_
+    [t{-a19h-} t{-a19j-} t{-a199-} t{-a19d-}]
+    =>
+    {PrelNum.Fractional{-26,p-} t{-a19d-}}
+    -> {PrelBase.Num{-2c,p-} t{-a199-}}
+    -> t{-a19h-}
+    -> t{-a19j-}
+    -> t{-a199-}
+    -> t{-a19d-}
+    -> t{-a19h-}
+{-# L #-}
+c{-r4u,x-} =
+    _/\_ t{-a19h-} t{-a19j-} t{-a199-} t{-a19d-} -> \ d.Fractional_a19r  :: 
+                                                         {PrelNum.Fractional{-26,p-} t{-a19d-}}
+                                                     {-# L #-}
+                                                     d.Fractional_a19r d.Num_a19m  :: 
+                                                                           {PrelBase.Num{-2c,p-} t{-a199-}}
+                                                                       {-# L #-}
+                                                                       d.Num_a19m ->
+       let {
+         d.Eq_a19o  :: 
+             {PrelBase.Eq{-23,p-} t{-a199-}}
+         {-# L #-}
+         d.Eq_a19o =
+             PrelBase.scsel_NumPrelBaseEq{-a2pi,p-}
+                 _@_ t{-a199-} d.Num_a19m } in
+       let {
+         d.Num_a1b5  :: 
+             {PrelBase.Num{-2c,p-} t{-a19d-}}
+         {-# L #-}
+         d.Num_a1b5 =
+             PrelNum.scsel_FractionalPrelBaseNum{-a2pr,p-}
+                 _@_ t{-a19d-} d.Fractional_a19r } in
+       let {
+         d.Eq_a19t  :: 
+             {PrelBase.Eq{-23,p-} t{-a19d-}}
+         {-# L #-}
+         d.Eq_a19t =
+             PrelBase.scsel_NumPrelBaseEq{-a2pi,p-}
+                 _@_ t{-a19d-} d.Num_a1b5 } in
+       let {
+         fromInt_a2p8  :: 
+             PrelBase.Int{-3g,p-} -> t{-a199-}
+         {-# L #-}
+         fromInt_a2p8 =
+             PrelBase.fromInt{-8R,p-}
+                 _@_ t{-a199-} d.Num_a19m } in
+       let { lit_a2p7  :: 
+                 t{-a199-}
+             {-# L #-}
+             lit_a2p7 =
+         let {
+           ds_d2pO  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d2pO =
+               PrelBase.I#{-5b,p-}{i}
+                   11111
+         } in 
+           fromInt_a2p8
+               ds_d2pO
+       } in
+       let {
+         ==_a2p6  :: 
+             t{-a199-} -> t{-a199-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a2p6 =
+             PrelBase.=={-8Y,p-}
+                 _@_ t{-a199-} d.Eq_a19o } in
+       let {
+         fromRational_a2p5  :: 
+             PrelNum.Rational{-3r,p-} -> t{-a19d-}
+         {-# L #-}
+         fromRational_a2p5 =
+             PrelNum.fromRational{-8T,p-}
+                 _@_ t{-a19d-} d.Fractional_a19r } in
+       let {
+         lit_a2p4  :: 
+             t{-a19d-}
+         {-# L #-}
+         lit_a2p4 =
+             fromRational_a2p5
+                 _rational_  62831853 20000000 } in
+       let {
+         ==_a2p3  :: 
+             t{-a19d-} -> t{-a19d-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a2p3 =
+             PrelBase.=={-8Y,p-}
+                 _@_ t{-a19d-} d.Eq_a19t
+       } in 
+         \ x_r3H  :: 
+               t{-a19h-}
+           {-# L #-}
+           x_r3H ds_d2qY  :: 
+                     t{-a19j-}
+                 {-# L #-}
+                 ds_d2qY ds_d2qZ  :: 
+                             t{-a199-}
+                         {-# L #-}
+                         ds_d2qZ ds_d2qV  :: 
+                                     t{-a19d-}
+                                 {-# L #-}
+                                 ds_d2qV ->
+             let { ds_d2rv  :: 
+                       PrelBase.(){-40,p-}
+                   {-# L #-}
+                   ds_d2rv =
+               let {
+                 fail_d2r0  :: 
+                     PrelBase.(){-40,p-}
+                 {-# L #-}
+                 fail_d2r0 =
+                     GHCerr.irrefutPatError{-8g,p-}
+                         _@_ PrelBase.(){-40,p-} _string_ "ds020.hs:11|3.1415926500000002"
+               } in 
+                 case
+                     ==_a2p3
+                         lit_a2p4 ds_d2qV
+                 of {
+                   PrelBase.True{-5E,p-}{i} ->
+                       PrelBase.(){-60,p-}{i}
+                           {};
+                   PrelBase.False{-58,p-}{i} ->
+                       fail_d2r0;
+                 }
+             } in
+             let { ds_d2rI  :: 
+                       PrelBase.(){-40,p-}
+                   {-# L #-}
+                   ds_d2rI =
+               let {
+                 fail_d2rw  :: 
+                     PrelBase.(){-40,p-}
+                 {-# L #-}
+                 fail_d2rw =
+                     GHCerr.irrefutPatError{-8g,p-}
+                         _@_ PrelBase.(){-40,p-} _string_ "ds020.hs:11|11111"
+               } in 
+                 case
+                     ==_a2p6
+                         lit_a2p7 ds_d2qZ
+                 of {
+                   PrelBase.True{-5E,p-}{i} ->
+                       PrelBase.(){-60,p-}{i}
+                           {};
+                   PrelBase.False{-58,p-}{i} ->
+                       fail_d2rw;
+                 }
+             } in
+             let {
+               ds_d2qC  :: 
+                   PrelBase.(){-40,p-}
+               {-# L #-}
+               ds_d2qC =
+                   PrelBase.(){-60,p-}{i}
+                       {}
+             } in 
+               x_r3H
+b{-r4v,x-}  :: 
+    _forall_ [t{-a19Q-} t{-a19X-}] => [t{-a19Q-}] -> [t{-a19X-}]
+{-# L #-}
+b{-r4v,x-} =
+    _/\_ t{-a19Q-} t{-a19X-} -> \ ds_d2sd  :: 
+                                     [t{-a19Q-}]
+                                 {-# L #-}
+                                 ds_d2sd ->
+       let { ds_d2sU  :: 
+                 (t{-a19Q-}, t{-a19Q-}, [t{-a19Q-}])
+             {-# L #-}
+             ds_d2sU =
+         let {
+           fail_d2se  :: 
+               (t{-a19Q-}, t{-a19Q-}, [t{-a19Q-}])
+           {-# L #-}
+           fail_d2se =
+               GHCerr.irrefutPatError{-8g,p-}
+                   _@_ (t{-a19Q-}, t{-a19Q-}, [t{-a19Q-}])
+                   _string_ "ds020.hs:8|(x PrelBase.: (xs PrelBase.: ys))"
+         } in 
+           case ds_d2sd of {
+             PrelBase.[]{-5i,p-}{i} ->
+                 fail_d2se;
+             PrelBase.:{-55,p-}{i} x_r3z ds_d2sr ->
+                 case ds_d2sr of {
+                   PrelBase.[]{-5i,p-}{i} ->
+                       fail_d2se;
+                   PrelBase.:{-55,p-}{i} xs_r3A ys_r3B ->
+                       PrelTup.(,,){-63,p-}{i}
+                           {_@_ t{-a19Q-} _@_ t{-a19Q-} _@_ [t{-a19Q-}] x_r3z xs_r3A ys_r3B};
+                 };
+           }
+       } in
+       let {
+         x_r3z  :: 
+             t{-a19Q-}
+         {-# L #-}
+         x_r3z =
+             case ds_d2sU of { PrelTup.(,,){-63,p-}{i} x_r3z xs_r3A ys_r3B  ->
+             x_r3z;} } in
+       let {
+         xs_r3A  :: 
+             t{-a19Q-}
+         {-# L #-}
+         xs_r3A =
+             case ds_d2sU of { PrelTup.(,,){-63,p-}{i} x_r3z xs_r3A ys_r3B  ->
+             xs_r3A;} } in
+       let {
+         ys_r3B  :: 
+             [t{-a19Q-}]
+         {-# L #-}
+         ys_r3B =
+             case ds_d2sU of { PrelTup.(,,){-63,p-}{i} x_r3z xs_r3A ys_r3B  ->
+             ys_r3B;}
+       } in 
+         PrelBase.[]{-5i,p-}{i}
+             _@_ t{-a19X-}
+a{-r4w,x-}  :: 
+    _forall_
+    [t{-a1al-} t{-a1ao-} t{-a1ar-} t{-a1at-}]
+    =>
+    ([t{-a1al-}], [t{-a1ao-}], [t{-a1ar-}]) -> [t{-a1at-}]
+{-# L #-}
+a{-r4w,x-} =
+    _/\_ t{-a1al-} t{-a1ao-} t{-a1ar-} t{-a1at-} -> \ ds_d2tK  :: 
+                                                         ([t{-a1al-}], [t{-a1ao-}], [t{-a1ar-}])
+                                                     {-# L #-}
+                                                     ds_d2tK ->
+       let { ds_d2uH  :: 
+                 PrelBase.(){-40,p-}
+             {-# L #-}
+             ds_d2uH =
+         let {
+           fail_d2tL  :: 
+               PrelBase.(){-40,p-}
+           {-# L #-}
+           fail_d2tL =
+               GHCerr.irrefutPatError{-8g,p-}
+                   _@_ PrelBase.(){-40,p-}
+                   _string_ "ds020.hs:5|(PrelBase.[], PrelBase.[], PrelBase.[])"
+         } in 
+           case
+               ds_d2tK
+           of {
+           PrelTup.(,,){-63,p-}{i} ds_d2tU ds_d2tW ds_d2tV  ->
+           case ds_d2tU of {
+             PrelBase.:{-55,p-}{i} ds_d2u4 ds_d2u3 ->
+                 fail_d2tL;
+             PrelBase.[]{-5i,p-}{i} ->
+                 case ds_d2tW of {
+                   PrelBase.:{-55,p-}{i} ds_d2ui ds_d2uh ->
+                       fail_d2tL;
+                   PrelBase.[]{-5i,p-}{i} ->
+                       case ds_d2tV of {
+                         PrelBase.:{-55,p-}{i} ds_d2uw ds_d2uv ->
+                             fail_d2tL;
+                         PrelBase.[]{-5i,p-}{i} ->
+                             PrelBase.(){-60,p-}{i}
+                                 {};
+                       };
+                 };
+           };}
+       } in
+       PrelBase.[]{-5i,p-}{i}
+           _@_ t{-a1at-}
+end Rec }
diff --git a/ghc/tests/deSugar/should_compile/ds021.hs b/ghc/tests/deSugar/should_compile/ds021.hs
new file mode 100644 (file)
index 0000000..f7e9392
--- /dev/null
@@ -0,0 +1,8 @@
+--!!! ds021 -- hairier uses of guards
+
+module Test where
+
+f x y z | x == y     = []
+       | x /= z     = []
+       | True       = []
+       | False      = []
diff --git a/ghc/tests/deSugar/should_compile/ds021.stderr b/ghc/tests/deSugar/should_compile/ds021.stderr
new file mode 100644 (file)
index 0000000..2d6f67a
--- /dev/null
@@ -0,0 +1,81 @@
+ds021.hs:8: 
+    Warning: Possibly incomplete patterns
+       in the definition of function `f'
+
+
+================================================================================
+Desugared:
+f{-r3i,x-}  :: 
+    _forall_
+    [rlg{-aG9-} t{-aGm-}]
+    =>
+    {PrelBase.Eq{-23,p-} rlg{-aG9-}}
+    -> rlg{-aG9-}
+    -> rlg{-aG9-}
+    -> rlg{-aG9-}
+    -> [t{-aGm-}]
+{-# L #-}
+f{-r3i,x-} =
+    _/\_ rlg{-aG9-} t{-aGm-} -> \ d.Eq_aGr  :: 
+                                     {PrelBase.Eq{-23,p-} rlg{-aG9-}}
+                                 {-# L #-}
+                                 d.Eq_aGr ->
+       let {
+         ==_aIv  :: 
+             rlg{-aG9-} -> rlg{-aG9-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_aIv =
+             PrelBase.=={-8Y,p-}
+                 _@_ rlg{-aG9-} d.Eq_aGr } in
+       let {
+         d.Eq_aGt  :: 
+             {PrelBase.Eq{-23,p-} rlg{-aG9-}}
+         {-# L #-}
+         d.Eq_aGt =
+             d.Eq_aGr } in
+       let {
+         /=_aIu  :: 
+             rlg{-aG9-} -> rlg{-aG9-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         /=_aIu =
+             PrelBase./={-ray,p-}
+                 _@_ rlg{-aG9-} d.Eq_aGt
+       } in 
+         \ x_r3d  :: 
+               rlg{-aG9-}
+           {-# L #-}
+           x_r3d y_r3f  :: 
+                     rlg{-aG9-}
+                 {-# L #-}
+                 y_r3f z_r3h  :: 
+                           rlg{-aG9-}
+                       {-# L #-}
+                       z_r3h ->
+             let {
+               fail_dJa  :: 
+                   [t{-aGm-}]
+               {-# L #-}
+               fail_dJa =
+                   GHCerr.patError{-8r,p-}
+                       _@_ [t{-aGm-}] _string_ "ds021.hs:5|function `f'"
+             } in 
+               case
+                   ==_aIv
+                       x_r3d y_r3f
+               of {
+                 PrelBase.True{-5E,p-}{i} ->
+                     PrelBase.[]{-5i,p-}{i}
+                         _@_ t{-aGm-};
+                 PrelBase.False{-58,p-}{i} ->
+                     case
+                         /=_aIu
+                             x_r3d z_r3h
+                     of {
+                       PrelBase.True{-5E,p-}{i} ->
+                           PrelBase.[]{-5i,p-}{i}
+                               _@_ t{-aGm-};
+                       PrelBase.False{-58,p-}{i} ->
+                           PrelBase.[]{-5i,p-}{i}
+                               _@_ t{-aGm-};
+                     };
+               }
diff --git a/ghc/tests/deSugar/should_compile/ds022.hs b/ghc/tests/deSugar/should_compile/ds022.hs
new file mode 100644 (file)
index 0000000..ce07e19
--- /dev/null
@@ -0,0 +1,32 @@
+--!!! ds022 -- literal patterns (wimp version)
+--
+module Tests where
+
+f 1 1.1 = []
+f 2 2.2 = []
+f 3 3.3 = []
+f 4 4.4 = []
+
+g 11111111111111111111111 1.11111111111111111 = []
+g 22222222222222222222222 2.22222222222222222 = []
+g 33333333333333333333333 3.33333333333333333 = []
+g 44444444444444444444444 4.44444444444444444 = []
+
+h 'a'      ""                  = []
+h '\''     "foo"               = []
+h '"'      ('b':'a':'r':[])    = []
+h '\o250'   blob               = []
+
+i 1 1.1     = []
+i 2 2.2     = []
+i 1 0.011e2 = []
+i 2 2.20000 = []
+
+{-
+j one@1 oneone@1.1
+  | ((fromFloat oneone) - (fromIntegral (fromInt one)))
+       /= (fromIntegral (fromInt 0)) = []
+j two@2 twotwo@2.2
+  | ((fromFloat twotwo) * (fromIntegral (fromInt 2)))
+       == (fromIntegral (fromInt 4.4)) = []
+-}
diff --git a/ghc/tests/deSugar/should_compile/ds022.stderr b/ghc/tests/deSugar/should_compile/ds022.stderr
new file mode 100644 (file)
index 0000000..98f3a06
--- /dev/null
@@ -0,0 +1,1021 @@
+ds022.hs:22: 
+    Warning: Pattern match(es) completely overlapped
+       in the definition of function `i'
+ds022.hs:23: 
+    Warning: Pattern match(es) completely overlapped
+       in the definition of function `i'
+ds022.hs:20: 
+    Warning: Possibly incomplete patterns
+       in the definition of function `i'
+ds022.hs:15: 
+    Warning: Possibly incomplete patterns
+       in the definition of function `h'
+ds022.hs:10: 
+    Warning: Possibly incomplete patterns
+       in the definition of function `g'
+ds022.hs:5: 
+    Warning: Possibly incomplete patterns
+       in the definition of function `f'
+
+
+================================================================================
+Desugared:
+Rec {
+d.Eq_a13W  :: 
+    {PrelBase.Eq{-23,p-} PrelBase.Char{-38,p-}}
+{-# L #-}
+d.Eq_a13W =
+    PrelBase.$d33{-rbH,p-}
+d.Eq_a13U  :: 
+    {PrelBase.Eq{-23,p-} [PrelBase.Char{-38,p-}]}
+{-# L #-}
+d.Eq_a13U =
+    PrelBase.$d27{-rbA,p-}
+       _@_ PrelBase.Char{-38,p-} d.Eq_a13W
+==_a1pN  :: 
+    [PrelBase.Char{-38,p-}]
+    -> [PrelBase.Char{-38,p-}]
+    -> PrelBase.Bool{-34,p-}
+{-# L #-}
+==_a1pN =
+    PrelBase.=={-8Y,p-}
+       _@_ [PrelBase.Char{-38,p-}] d.Eq_a13U
+i{-r3E,x-}  :: 
+    _forall_
+    [t{-a11b-} t{-a11f-} t{-a11j-}]
+    =>
+    {PrelNum.Fractional{-26,p-} t{-a11f-}}
+    -> {PrelBase.Num{-2c,p-} t{-a11b-}}
+    -> t{-a11b-}
+    -> t{-a11f-}
+    -> [t{-a11j-}]
+{-# L #-}
+i{-r3E,x-} =
+    _/\_ t{-a11b-} t{-a11f-} t{-a11j-} -> \ d.Fractional_a11r  :: 
+                                               {PrelNum.Fractional{-26,p-} t{-a11f-}}
+                                           {-# L #-}
+                                           d.Fractional_a11r d.Num_a11m  :: 
+                                                                 {PrelBase.Num{-2c,p-} t{-a11b-}}
+                                                             {-# L #-}
+                                                             d.Num_a11m ->
+       let {
+         d.Eq_a11o  :: 
+             {PrelBase.Eq{-23,p-} t{-a11b-}}
+         {-# L #-}
+         d.Eq_a11o =
+             PrelBase.scsel_NumPrelBaseEq{-a1rD,p-}
+                 _@_ t{-a11b-} d.Num_a11m } in
+       let {
+         d.Num_a13X  :: 
+             {PrelBase.Num{-2c,p-} t{-a11f-}}
+         {-# L #-}
+         d.Num_a13X =
+             PrelNum.scsel_FractionalPrelBaseNum{-a1rM,p-}
+                 _@_ t{-a11f-} d.Fractional_a11r } in
+       let {
+         d.Eq_a11t  :: 
+             {PrelBase.Eq{-23,p-} t{-a11f-}}
+         {-# L #-}
+         d.Eq_a11t =
+             PrelBase.scsel_NumPrelBaseEq{-a1rD,p-}
+                 _@_ t{-a11f-} d.Num_a13X } in
+       let {
+         fromInt_a1rt  :: 
+             PrelBase.Int{-3g,p-} -> t{-a11b-}
+         {-# L #-}
+         fromInt_a1rt =
+             PrelBase.fromInt{-8R,p-}
+                 _@_ t{-a11b-} d.Num_a11m } in
+       let { lit_a1rs  :: 
+                 t{-a11b-}
+             {-# L #-}
+             lit_a1rs =
+         let {
+           ds_d1s9  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d1s9 =
+               PrelBase.I#{-5b,p-}{i}
+                   1
+         } in 
+           fromInt_a1rt
+               ds_d1s9
+       } in
+       let {
+         ==_a1rr  :: 
+             t{-a11b-} -> t{-a11b-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1rr =
+             PrelBase.=={-8Y,p-}
+                 _@_ t{-a11b-} d.Eq_a11o } in
+       let {
+         fromRational_a1rq  :: 
+             PrelNum.Rational{-3r,p-} -> t{-a11f-}
+         {-# L #-}
+         fromRational_a1rq =
+             PrelNum.fromRational{-8T,p-}
+                 _@_ t{-a11f-} d.Fractional_a11r } in
+       let {
+         lit_a1rp  :: 
+             t{-a11f-}
+         {-# L #-}
+         lit_a1rp =
+             fromRational_a1rq
+                 _rational_  11 10 } in
+       let {
+         ==_a1ro  :: 
+             t{-a11f-} -> t{-a11f-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1ro =
+             PrelBase.=={-8Y,p-}
+                 _@_ t{-a11f-} d.Eq_a11t } in
+       let {
+         fromInt_a1rn  :: 
+             PrelBase.Int{-3g,p-} -> t{-a11b-}
+         {-# L #-}
+         fromInt_a1rn =
+             fromInt_a1rt } in
+       let { lit_a1rm  :: 
+                 t{-a11b-}
+             {-# L #-}
+             lit_a1rm =
+         let {
+           ds_d1sR  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d1sR =
+               PrelBase.I#{-5b,p-}{i}
+                   2
+         } in 
+           fromInt_a1rn
+               ds_d1sR
+       } in
+       let {
+         ==_a1rl  :: 
+             t{-a11b-} -> t{-a11b-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1rl =
+             ==_a1rr } in
+       let {
+         fromRational_a1rk  :: 
+             PrelNum.Rational{-3r,p-} -> t{-a11f-}
+         {-# L #-}
+         fromRational_a1rk =
+             fromRational_a1rq } in
+       let {
+         lit_a1rj  :: 
+             t{-a11f-}
+         {-# L #-}
+         lit_a1rj =
+             fromRational_a1rk
+                 _rational_  11 5 } in
+       let {
+         ==_a1ri  :: 
+             t{-a11f-} -> t{-a11f-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1ri =
+             ==_a1ro } in
+       let {
+         lit_a1rh  :: 
+             t{-a11b-}
+         {-# L #-}
+         lit_a1rh =
+             lit_a1rs } in
+       let {
+         ==_a1rg  :: 
+             t{-a11b-} -> t{-a11b-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1rg =
+             ==_a1rr } in
+       let {
+         lit_a1rf  :: 
+             t{-a11f-}
+         {-# L #-}
+         lit_a1rf =
+             lit_a1rp } in
+       let {
+         ==_a1re  :: 
+             t{-a11f-} -> t{-a11f-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1re =
+             ==_a1ro } in
+       let {
+         lit_a1rd  :: 
+             t{-a11b-}
+         {-# L #-}
+         lit_a1rd =
+             lit_a1rm } in
+       let {
+         ==_a1rc  :: 
+             t{-a11b-} -> t{-a11b-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1rc =
+             ==_a1rr } in
+       let {
+         lit_a1rb  :: 
+             t{-a11f-}
+         {-# L #-}
+         lit_a1rb =
+             lit_a1rj } in
+       let {
+         ==_a1ra  :: 
+             t{-a11f-} -> t{-a11f-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1ra =
+             ==_a1ro
+       } in 
+         \ ds_d1tC  :: 
+               t{-a11b-}
+           {-# L #-}
+           ds_d1tC ds_d1tF  :: 
+                       t{-a11f-}
+                   {-# L #-}
+                   ds_d1tF ->
+             let {
+               fail_d1tG  :: 
+                   [t{-a11j-}]
+               {-# L #-}
+               fail_d1tG =
+                   GHCerr.patError{-8r,p-}
+                       _@_ [t{-a11j-}] _string_ "ds022.hs:20|function `i'" } in
+             let {
+               fail_d1uo  :: 
+                   [t{-a11j-}]
+               {-# L #-}
+               fail_d1uo =
+                   case
+                       ==_a1rl
+                           lit_a1rm ds_d1tC
+                   of {
+                     PrelBase.True{-5E,p-}{i} ->
+                         case
+                             ==_a1ri
+                                 lit_a1rj ds_d1tF
+                         of {
+                           PrelBase.True{-5E,p-}{i} ->
+                               PrelBase.[]{-5i,p-}{i}
+                                   _@_ t{-a11j-};
+                           PrelBase.False{-58,p-}{i} ->
+                               fail_d1tG;
+                         };
+                     PrelBase.False{-58,p-}{i} ->
+                         fail_d1tG;
+                   }
+             } in 
+               case
+                   ==_a1rr
+                       lit_a1rs ds_d1tC
+               of {
+                 PrelBase.True{-5E,p-}{i} ->
+                     case
+                         ==_a1ro
+                             lit_a1rp ds_d1tF
+                     of {
+                       PrelBase.True{-5E,p-}{i} ->
+                           PrelBase.[]{-5i,p-}{i}
+                               _@_ t{-a11j-};
+                       PrelBase.False{-58,p-}{i} ->
+                           fail_d1uo;
+                     };
+                 PrelBase.False{-58,p-}{i} ->
+                     fail_d1uo;
+               }
+h{-r3F,x-}  :: 
+    _forall_
+    [t{-a11Q-}]
+    =>
+    PrelBase.Char{-38,p-} -> [PrelBase.Char{-38,p-}] -> [t{-a11Q-}]
+{-# L #-}
+h{-r3F,x-} =
+    _/\_ t{-a11Q-} ->
+       let {
+         ==_a1v3  :: 
+             [PrelBase.Char{-38,p-}]
+             -> [PrelBase.Char{-38,p-}]
+             -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1v3 =
+             ==_a1pN
+       } in 
+         \ ds_d1vj  :: 
+               PrelBase.Char{-38,p-}
+           {-# L #-}
+           ds_d1vj ds_d1vk  :: 
+                       [PrelBase.Char{-38,p-}]
+                   {-# L #-}
+                   ds_d1vk ->
+             let {
+               fail_d1vl  :: 
+                   [t{-a11Q-}]
+               {-# L #-}
+               fail_d1vl =
+                   GHCerr.patError{-8r,p-}
+                       _@_ [t{-a11Q-}] _string_ "ds022.hs:15|function `h'"
+             } in 
+               case ds_d1vj of { PrelBase.C#{-54,p-}{i} ds_d1vu  ->
+               case# ds_d1vu of {
+                 'a' ->
+                     case ds_d1vk of {
+                       PrelBase.:{-55,p-}{i} ds_d1vK ds_d1vJ ->
+                           fail_d1vl;
+                       PrelBase.[]{-5i,p-}{i} ->
+                           PrelBase.[]{-5i,p-}{i}
+                               _@_ t{-a11Q-};
+                     };
+                 ''' ->
+                     case
+                         ==_a1v3
+                             _string_ "foo" ds_d1vk
+                     of {
+                       PrelBase.True{-5E,p-}{i} ->
+                           PrelBase.[]{-5i,p-}{i}
+                               _@_ t{-a11Q-};
+                       PrelBase.False{-58,p-}{i} ->
+                           fail_d1vl;
+                     };
+                 '"' ->
+                     case ds_d1vk of {
+                       PrelBase.[]{-5i,p-}{i} ->
+                           fail_d1vl;
+                       PrelBase.:{-55,p-}{i} ds_d1wC ds_d1wD ->
+                           case ds_d1wC of { PrelBase.C#{-54,p-}{i} ds_d1wM  ->
+                           case# ds_d1wM of {
+                             'b' ->
+                                 case ds_d1wD of {
+                                   PrelBase.[]{-5i,p-}{i} ->
+                                       fail_d1vl;
+                                   PrelBase.:{-55,p-}{i} ds_d1x7 ds_d1x8 ->
+                                       case ds_d1x7 of { PrelBase.C#{-54,p-}{i} ds_d1xh  ->
+                                       case# ds_d1xh of {
+                                         'a' ->
+                                             case ds_d1x8 of {
+                                               PrelBase.[]{-5i,p-}{i} ->
+                                                   fail_d1vl;
+                                               PrelBase.:{-55,p-}{i} ds_d1xC ds_d1xD ->
+                                                   case
+                                                       ds_d1xC
+                                                   of {
+                                                   PrelBase.C#{-54,p-}{i} ds_d1xM  ->
+                                                   case# ds_d1xM of {
+                                                     'r' ->
+                                                         case ds_d1xD of {
+                                                           PrelBase.:{-55,p-}{i} ds_d1y2 ds_d1y1 ->
+                                                               fail_d1vl;
+                                                           PrelBase.[]{-5i,p-}{i} ->
+                                                               PrelBase.[]{-5i,p-}{i}
+                                                                   _@_ t{-a11Q-};
+                                                         };
+                                                     ds_d1yd ->
+                                                         fail_d1vl;
+                                                   };};
+                                             };
+                                         ds_d1yg ->
+                                             fail_d1vl;
+                                       };};
+                                 };
+                             ds_d1yj ->
+                                 fail_d1vl;
+                           };};
+                     };
+                 '¨' ->
+                     let {
+                       blob_r3D  :: 
+                           [PrelBase.Char{-38,p-}]
+                       {-# L #-}
+                       blob_r3D =
+                           ds_d1vk
+                     } in 
+                       PrelBase.[]{-5i,p-}{i}
+                           _@_ t{-a11Q-};
+                 ds_d1yx ->
+                     fail_d1vl;
+               };}
+g{-r3G,x-}  :: 
+    _forall_
+    [t{-a12s-} t{-a12w-} t{-a12A-}]
+    =>
+    {PrelNum.Fractional{-26,p-} t{-a12w-}}
+    -> {PrelBase.Num{-2c,p-} t{-a12s-}}
+    -> t{-a12s-}
+    -> t{-a12w-}
+    -> [t{-a12A-}]
+{-# L #-}
+g{-r3G,x-} =
+    _/\_ t{-a12s-} t{-a12w-} t{-a12A-} -> \ d.Fractional_a12I  :: 
+                                               {PrelNum.Fractional{-26,p-} t{-a12w-}}
+                                           {-# L #-}
+                                           d.Fractional_a12I d.Num_a12D  :: 
+                                                                 {PrelBase.Num{-2c,p-} t{-a12s-}}
+                                                             {-# L #-}
+                                                             d.Num_a12D ->
+       let {
+         d.Eq_a12F  :: 
+             {PrelBase.Eq{-23,p-} t{-a12s-}}
+         {-# L #-}
+         d.Eq_a12F =
+             PrelBase.scsel_NumPrelBaseEq{-a1rD,p-}
+                 _@_ t{-a12s-} d.Num_a12D } in
+       let {
+         d.Num_a13Y  :: 
+             {PrelBase.Num{-2c,p-} t{-a12w-}}
+         {-# L #-}
+         d.Num_a13Y =
+             PrelNum.scsel_FractionalPrelBaseNum{-a1rM,p-}
+                 _@_ t{-a12w-} d.Fractional_a12I } in
+       let {
+         d.Eq_a12K  :: 
+             {PrelBase.Eq{-23,p-} t{-a12w-}}
+         {-# L #-}
+         d.Eq_a12K =
+             PrelBase.scsel_NumPrelBaseEq{-a1rD,p-}
+                 _@_ t{-a12w-} d.Num_a13Y } in
+       let {
+         fromInteger_a1zV  :: 
+             PrelBase.Integer{-3h,p-} -> t{-a12s-}
+         {-# L #-}
+         fromInteger_a1zV =
+             PrelBase.fromInteger{-8S,p-}
+                 _@_ t{-a12s-} d.Num_a12D } in
+       let {
+         lit_a1zU  :: 
+             t{-a12s-}
+         {-# L #-}
+         lit_a1zU =
+             fromInteger_a1zV
+                 _integer_  11111111111111111111111 } in
+       let {
+         ==_a1zT  :: 
+             t{-a12s-} -> t{-a12s-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1zT =
+             PrelBase.=={-8Y,p-}
+                 _@_ t{-a12s-} d.Eq_a12F } in
+       let {
+         fromRational_a1zS  :: 
+             PrelNum.Rational{-3r,p-} -> t{-a12w-}
+         {-# L #-}
+         fromRational_a1zS =
+             PrelNum.fromRational{-8T,p-}
+                 _@_ t{-a12w-} d.Fractional_a12I } in
+       let {
+         lit_a1zR  :: 
+             t{-a12w-}
+         {-# L #-}
+         lit_a1zR =
+             fromRational_a1zS
+                 _rational_  111111111111111111 100000000000000000 } in
+       let {
+         ==_a1zQ  :: 
+             t{-a12w-} -> t{-a12w-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1zQ =
+             PrelBase.=={-8Y,p-}
+                 _@_ t{-a12w-} d.Eq_a12K } in
+       let {
+         fromInteger_a1zP  :: 
+             PrelBase.Integer{-3h,p-} -> t{-a12s-}
+         {-# L #-}
+         fromInteger_a1zP =
+             fromInteger_a1zV } in
+       let {
+         lit_a1zO  :: 
+             t{-a12s-}
+         {-# L #-}
+         lit_a1zO =
+             fromInteger_a1zP
+                 _integer_  22222222222222222222222 } in
+       let {
+         ==_a1zN  :: 
+             t{-a12s-} -> t{-a12s-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1zN =
+             ==_a1zT } in
+       let {
+         fromRational_a1zM  :: 
+             PrelNum.Rational{-3r,p-} -> t{-a12w-}
+         {-# L #-}
+         fromRational_a1zM =
+             fromRational_a1zS } in
+       let {
+         lit_a1zL  :: 
+             t{-a12w-}
+         {-# L #-}
+         lit_a1zL =
+             fromRational_a1zM
+                 _rational_  111111111111111111 50000000000000000 } in
+       let {
+         ==_a1zK  :: 
+             t{-a12w-} -> t{-a12w-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1zK =
+             ==_a1zQ } in
+       let {
+         fromInteger_a1zJ  :: 
+             PrelBase.Integer{-3h,p-} -> t{-a12s-}
+         {-# L #-}
+         fromInteger_a1zJ =
+             fromInteger_a1zV } in
+       let {
+         lit_a1zI  :: 
+             t{-a12s-}
+         {-# L #-}
+         lit_a1zI =
+             fromInteger_a1zJ
+                 _integer_  33333333333333333333333 } in
+       let {
+         ==_a1zH  :: 
+             t{-a12s-} -> t{-a12s-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1zH =
+             ==_a1zT } in
+       let {
+         fromRational_a1zG  :: 
+             PrelNum.Rational{-3r,p-} -> t{-a12w-}
+         {-# L #-}
+         fromRational_a1zG =
+             fromRational_a1zS } in
+       let {
+         lit_a1zF  :: 
+             t{-a12w-}
+         {-# L #-}
+         lit_a1zF =
+             fromRational_a1zG
+                 _rational_  333333333333333333 100000000000000000 } in
+       let {
+         ==_a1zE  :: 
+             t{-a12w-} -> t{-a12w-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1zE =
+             ==_a1zQ } in
+       let {
+         fromInteger_a1zD  :: 
+             PrelBase.Integer{-3h,p-} -> t{-a12s-}
+         {-# L #-}
+         fromInteger_a1zD =
+             fromInteger_a1zV } in
+       let {
+         lit_a1zC  :: 
+             t{-a12s-}
+         {-# L #-}
+         lit_a1zC =
+             fromInteger_a1zD
+                 _integer_  44444444444444444444444 } in
+       let {
+         ==_a1zB  :: 
+             t{-a12s-} -> t{-a12s-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1zB =
+             ==_a1zT } in
+       let {
+         fromRational_a1zA  :: 
+             PrelNum.Rational{-3r,p-} -> t{-a12w-}
+         {-# L #-}
+         fromRational_a1zA =
+             fromRational_a1zS } in
+       let {
+         lit_a1zz  :: 
+             t{-a12w-}
+         {-# L #-}
+         lit_a1zz =
+             fromRational_a1zA
+                 _rational_  111111111111111111 25000000000000000 } in
+       let {
+         ==_a1zy  :: 
+             t{-a12w-} -> t{-a12w-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1zy =
+             ==_a1zQ
+       } in 
+         \ ds_d1Cc  :: 
+               t{-a12s-}
+           {-# L #-}
+           ds_d1Cc ds_d1Cf  :: 
+                       t{-a12w-}
+                   {-# L #-}
+                   ds_d1Cf ->
+             let {
+               fail_d1Cg  :: 
+                   [t{-a12A-}]
+               {-# L #-}
+               fail_d1Cg =
+                   GHCerr.patError{-8r,p-}
+                       _@_ [t{-a12A-}] _string_ "ds022.hs:10|function `g'" } in
+             let { fail_d1Eo  :: 
+                       [t{-a12A-}]
+                   {-# L #-}
+                   fail_d1Eo =
+               let { fail_d1DG  :: 
+                         [t{-a12A-}]
+                     {-# L #-}
+                     fail_d1DG =
+                 let {
+                   fail_d1CY  :: 
+                       [t{-a12A-}]
+                   {-# L #-}
+                   fail_d1CY =
+                       case
+                           ==_a1zB
+                               lit_a1zC ds_d1Cc
+                       of {
+                         PrelBase.True{-5E,p-}{i} ->
+                             case
+                                 ==_a1zy
+                                     lit_a1zz ds_d1Cf
+                             of {
+                               PrelBase.True{-5E,p-}{i} ->
+                                   PrelBase.[]{-5i,p-}{i}
+                                       _@_ t{-a12A-};
+                               PrelBase.False{-58,p-}{i} ->
+                                   fail_d1Cg;
+                             };
+                         PrelBase.False{-58,p-}{i} ->
+                             fail_d1Cg;
+                       }
+                 } in 
+                   case
+                       ==_a1zH
+                           lit_a1zI ds_d1Cc
+                   of {
+                     PrelBase.True{-5E,p-}{i} ->
+                         case
+                             ==_a1zE
+                                 lit_a1zF ds_d1Cf
+                         of {
+                           PrelBase.True{-5E,p-}{i} ->
+                               PrelBase.[]{-5i,p-}{i}
+                                   _@_ t{-a12A-};
+                           PrelBase.False{-58,p-}{i} ->
+                               fail_d1CY;
+                         };
+                     PrelBase.False{-58,p-}{i} ->
+                         fail_d1CY;
+                   }
+               } in
+               case
+                   ==_a1zN
+                       lit_a1zO ds_d1Cc
+               of {
+                 PrelBase.True{-5E,p-}{i} ->
+                     case
+                         ==_a1zK
+                             lit_a1zL ds_d1Cf
+                     of {
+                       PrelBase.True{-5E,p-}{i} ->
+                           PrelBase.[]{-5i,p-}{i}
+                               _@_ t{-a12A-};
+                       PrelBase.False{-58,p-}{i} ->
+                           fail_d1DG;
+                     };
+                 PrelBase.False{-58,p-}{i} ->
+                     fail_d1DG;
+               }
+             } in
+             case
+                 ==_a1zT
+                     lit_a1zU ds_d1Cc
+             of {
+               PrelBase.True{-5E,p-}{i} ->
+                   case
+                       ==_a1zQ
+                           lit_a1zR ds_d1Cf
+                   of {
+                     PrelBase.True{-5E,p-}{i} ->
+                         PrelBase.[]{-5i,p-}{i}
+                             _@_ t{-a12A-};
+                     PrelBase.False{-58,p-}{i} ->
+                         fail_d1Eo;
+                   };
+               PrelBase.False{-58,p-}{i} ->
+                   fail_d1Eo;
+             }
+f{-r3H,x-}  :: 
+    _forall_
+    [t{-a13s-} t{-a13w-} t{-a13A-}]
+    =>
+    {PrelNum.Fractional{-26,p-} t{-a13w-}}
+    -> {PrelBase.Num{-2c,p-} t{-a13s-}}
+    -> t{-a13s-}
+    -> t{-a13w-}
+    -> [t{-a13A-}]
+{-# L #-}
+f{-r3H,x-} =
+    _/\_ t{-a13s-} t{-a13w-} t{-a13A-} -> \ d.Fractional_a13I  :: 
+                                               {PrelNum.Fractional{-26,p-} t{-a13w-}}
+                                           {-# L #-}
+                                           d.Fractional_a13I d.Num_a13D  :: 
+                                                                 {PrelBase.Num{-2c,p-} t{-a13s-}}
+                                                             {-# L #-}
+                                                             d.Num_a13D ->
+       let {
+         d.Eq_a13F  :: 
+             {PrelBase.Eq{-23,p-} t{-a13s-}}
+         {-# L #-}
+         d.Eq_a13F =
+             PrelBase.scsel_NumPrelBaseEq{-a1rD,p-}
+                 _@_ t{-a13s-} d.Num_a13D } in
+       let {
+         d.Num_a13Z  :: 
+             {PrelBase.Num{-2c,p-} t{-a13w-}}
+         {-# L #-}
+         d.Num_a13Z =
+             PrelNum.scsel_FractionalPrelBaseNum{-a1rM,p-}
+                 _@_ t{-a13w-} d.Fractional_a13I } in
+       let {
+         d.Eq_a13K  :: 
+             {PrelBase.Eq{-23,p-} t{-a13w-}}
+         {-# L #-}
+         d.Eq_a13K =
+             PrelBase.scsel_NumPrelBaseEq{-a1rD,p-}
+                 _@_ t{-a13w-} d.Num_a13Z } in
+       let {
+         fromInt_a1Gk  :: 
+             PrelBase.Int{-3g,p-} -> t{-a13s-}
+         {-# L #-}
+         fromInt_a1Gk =
+             PrelBase.fromInt{-8R,p-}
+                 _@_ t{-a13s-} d.Num_a13D } in
+       let { lit_a1Gj  :: 
+                 t{-a13s-}
+             {-# L #-}
+             lit_a1Gj =
+         let {
+           ds_d1GY  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d1GY =
+               PrelBase.I#{-5b,p-}{i}
+                   1
+         } in 
+           fromInt_a1Gk
+               ds_d1GY
+       } in
+       let {
+         ==_a1Gi  :: 
+             t{-a13s-} -> t{-a13s-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1Gi =
+             PrelBase.=={-8Y,p-}
+                 _@_ t{-a13s-} d.Eq_a13F } in
+       let {
+         fromRational_a1Gh  :: 
+             PrelNum.Rational{-3r,p-} -> t{-a13w-}
+         {-# L #-}
+         fromRational_a1Gh =
+             PrelNum.fromRational{-8T,p-}
+                 _@_ t{-a13w-} d.Fractional_a13I } in
+       let {
+         lit_a1Gg  :: 
+             t{-a13w-}
+         {-# L #-}
+         lit_a1Gg =
+             fromRational_a1Gh
+                 _rational_  11 10 } in
+       let {
+         ==_a1Gf  :: 
+             t{-a13w-} -> t{-a13w-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1Gf =
+             PrelBase.=={-8Y,p-}
+                 _@_ t{-a13w-} d.Eq_a13K } in
+       let {
+         fromInt_a1Ge  :: 
+             PrelBase.Int{-3g,p-} -> t{-a13s-}
+         {-# L #-}
+         fromInt_a1Ge =
+             fromInt_a1Gk } in
+       let { lit_a1Gd  :: 
+                 t{-a13s-}
+             {-# L #-}
+             lit_a1Gd =
+         let {
+           ds_d1HG  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d1HG =
+               PrelBase.I#{-5b,p-}{i}
+                   2
+         } in 
+           fromInt_a1Ge
+               ds_d1HG
+       } in
+       let {
+         ==_a1Gc  :: 
+             t{-a13s-} -> t{-a13s-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1Gc =
+             ==_a1Gi } in
+       let {
+         fromRational_a1Gb  :: 
+             PrelNum.Rational{-3r,p-} -> t{-a13w-}
+         {-# L #-}
+         fromRational_a1Gb =
+             fromRational_a1Gh } in
+       let {
+         lit_a1Ga  :: 
+             t{-a13w-}
+         {-# L #-}
+         lit_a1Ga =
+             fromRational_a1Gb
+                 _rational_  11 5 } in
+       let {
+         ==_a1G9  :: 
+             t{-a13w-} -> t{-a13w-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1G9 =
+             ==_a1Gf } in
+       let {
+         fromInt_a1G8  :: 
+             PrelBase.Int{-3g,p-} -> t{-a13s-}
+         {-# L #-}
+         fromInt_a1G8 =
+             fromInt_a1Gk } in
+       let { lit_a1G7  :: 
+                 t{-a13s-}
+             {-# L #-}
+             lit_a1G7 =
+         let {
+           ds_d1I3  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d1I3 =
+               PrelBase.I#{-5b,p-}{i}
+                   3
+         } in 
+           fromInt_a1G8
+               ds_d1I3
+       } in
+       let {
+         ==_a1G6  :: 
+             t{-a13s-} -> t{-a13s-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1G6 =
+             ==_a1Gi } in
+       let {
+         fromRational_a1G5  :: 
+             PrelNum.Rational{-3r,p-} -> t{-a13w-}
+         {-# L #-}
+         fromRational_a1G5 =
+             fromRational_a1Gh } in
+       let {
+         lit_a1G4  :: 
+             t{-a13w-}
+         {-# L #-}
+         lit_a1G4 =
+             fromRational_a1G5
+                 _rational_  33 10 } in
+       let {
+         ==_a1G3  :: 
+             t{-a13w-} -> t{-a13w-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1G3 =
+             ==_a1Gf } in
+       let {
+         fromInt_a1G2  :: 
+             PrelBase.Int{-3g,p-} -> t{-a13s-}
+         {-# L #-}
+         fromInt_a1G2 =
+             fromInt_a1Gk } in
+       let { lit_a1G1  :: 
+                 t{-a13s-}
+             {-# L #-}
+             lit_a1G1 =
+         let {
+           ds_d1Iq  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d1Iq =
+               PrelBase.I#{-5b,p-}{i}
+                   4
+         } in 
+           fromInt_a1G2
+               ds_d1Iq
+       } in
+       let {
+         ==_a1G0  :: 
+             t{-a13s-} -> t{-a13s-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1G0 =
+             ==_a1Gi } in
+       let {
+         fromRational_a1FZ  :: 
+             PrelNum.Rational{-3r,p-} -> t{-a13w-}
+         {-# L #-}
+         fromRational_a1FZ =
+             fromRational_a1Gh } in
+       let {
+         lit_a1FY  :: 
+             t{-a13w-}
+         {-# L #-}
+         lit_a1FY =
+             fromRational_a1FZ
+                 _rational_  22 5 } in
+       let {
+         ==_a1FX  :: 
+             t{-a13w-} -> t{-a13w-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1FX =
+             ==_a1Gf
+       } in 
+         \ ds_d1Jb  :: 
+               t{-a13s-}
+           {-# L #-}
+           ds_d1Jb ds_d1Je  :: 
+                       t{-a13w-}
+                   {-# L #-}
+                   ds_d1Je ->
+             let {
+               fail_d1Jf  :: 
+                   [t{-a13A-}]
+               {-# L #-}
+               fail_d1Jf =
+                   GHCerr.patError{-8r,p-}
+                       _@_ [t{-a13A-}] _string_ "ds022.hs:5|function `f'" } in
+             let { fail_d1Ln  :: 
+                       [t{-a13A-}]
+                   {-# L #-}
+                   fail_d1Ln =
+               let { fail_d1KF  :: 
+                         [t{-a13A-}]
+                     {-# L #-}
+                     fail_d1KF =
+                 let {
+                   fail_d1JX  :: 
+                       [t{-a13A-}]
+                   {-# L #-}
+                   fail_d1JX =
+                       case
+                           ==_a1G0
+                               lit_a1G1 ds_d1Jb
+                       of {
+                         PrelBase.True{-5E,p-}{i} ->
+                             case
+                                 ==_a1FX
+                                     lit_a1FY ds_d1Je
+                             of {
+                               PrelBase.True{-5E,p-}{i} ->
+                                   PrelBase.[]{-5i,p-}{i}
+                                       _@_ t{-a13A-};
+                               PrelBase.False{-58,p-}{i} ->
+                                   fail_d1Jf;
+                             };
+                         PrelBase.False{-58,p-}{i} ->
+                             fail_d1Jf;
+                       }
+                 } in 
+                   case
+                       ==_a1G6
+                           lit_a1G7 ds_d1Jb
+                   of {
+                     PrelBase.True{-5E,p-}{i} ->
+                         case
+                             ==_a1G3
+                                 lit_a1G4 ds_d1Je
+                         of {
+                           PrelBase.True{-5E,p-}{i} ->
+                               PrelBase.[]{-5i,p-}{i}
+                                   _@_ t{-a13A-};
+                           PrelBase.False{-58,p-}{i} ->
+                               fail_d1JX;
+                         };
+                     PrelBase.False{-58,p-}{i} ->
+                         fail_d1JX;
+                   }
+               } in
+               case
+                   ==_a1Gc
+                       lit_a1Gd ds_d1Jb
+               of {
+                 PrelBase.True{-5E,p-}{i} ->
+                     case
+                         ==_a1G9
+                             lit_a1Ga ds_d1Je
+                     of {
+                       PrelBase.True{-5E,p-}{i} ->
+                           PrelBase.[]{-5i,p-}{i}
+                               _@_ t{-a13A-};
+                       PrelBase.False{-58,p-}{i} ->
+                           fail_d1KF;
+                     };
+                 PrelBase.False{-58,p-}{i} ->
+                     fail_d1KF;
+               }
+             } in
+             case
+                 ==_a1Gi
+                     lit_a1Gj ds_d1Jb
+             of {
+               PrelBase.True{-5E,p-}{i} ->
+                   case
+                       ==_a1Gf
+                           lit_a1Gg ds_d1Je
+                   of {
+                     PrelBase.True{-5E,p-}{i} ->
+                         PrelBase.[]{-5i,p-}{i}
+                             _@_ t{-a13A-};
+                     PrelBase.False{-58,p-}{i} ->
+                         fail_d1Ln;
+                   };
+               PrelBase.False{-58,p-}{i} ->
+                   fail_d1Ln;
+             }
+end Rec }
diff --git a/ghc/tests/deSugar/should_compile/ds023.hs b/ghc/tests/deSugar/should_compile/ds023.hs
new file mode 100644 (file)
index 0000000..ecd6e13
--- /dev/null
@@ -0,0 +1,7 @@
+--!!! ds023 -- overloading eg from section 9.2
+--
+module Tests where
+
+f x    = g (x == x) x
+g b x  = abs (f x)
+--g b x        = (f x) + (f x)
diff --git a/ghc/tests/deSugar/should_compile/ds023.stderr b/ghc/tests/deSugar/should_compile/ds023.stderr
new file mode 100644 (file)
index 0000000..a34fcde
--- /dev/null
@@ -0,0 +1,131 @@
+
+
+================================================================================
+Desugared:
+Rec {
+ds_dK5  :: 
+    _forall_
+    [rlg{-aHq-} riC{-aHC-}]
+    =>
+    {PrelBase.Num{-2c,p-} riC{-aHC-}}
+    -> {PrelBase.Eq{-23,p-} rlg{-aHq-}}
+    -> (rlg{-aHq-} -> riC{-aHC-}, PrelBase.Bool{-34,p-}
+                                 -> rlg{-aHq-}
+                                 -> riC{-aHC-})
+{-# L #-}
+ds_dK5 =
+    _/\_ rlg{-aHq-} riC{-aHC-} -> \ d.Num_aHI  :: 
+                                       {PrelBase.Num{-2c,p-} riC{-aHC-}}
+                                   {-# L #-}
+                                   d.Num_aHI d.Eq_aHG  :: 
+                                                 {PrelBase.Eq{-23,p-} rlg{-aHq-}}
+                                             {-# L #-}
+                                             d.Eq_aHG ->
+       _letrec_ {
+         ==_aKk  :: 
+             rlg{-aHq-} -> rlg{-aHq-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_aKk =
+             PrelBase.=={-8Y,p-}
+                 _@_ rlg{-aHq-} d.Eq_aHG;
+         abs_aKr  :: 
+             riC{-aHC-} -> riC{-aHC-}
+         {-# L #-}
+         abs_aKr =
+             PrelBase.abs{-r3j,p-}
+                 _@_ riC{-aHC-} d.Num_aHI;
+         f_aHi  :: 
+             rlg{-aHq-} -> riC{-aHC-}
+         {-# L #-}
+         f_aHi =
+             \ x_r3e  :: 
+                   rlg{-aHq-}
+               {-# L #-}
+               x_r3e ->
+                 let {
+                   ds_dL3  :: 
+                       PrelBase.Bool{-34,p-}
+                   {-# L #-}
+                   ds_dL3 =
+                       ==_aKk
+                           x_r3e x_r3e
+                 } in 
+                   g_aHj
+                       ds_dL3 x_r3e;
+         g_aHj  :: 
+             PrelBase.Bool{-34,p-} -> rlg{-aHq-} -> riC{-aHC-}
+         {-# L #-}
+         g_aHj =
+             \ b_r3g  :: 
+                   PrelBase.Bool{-34,p-}
+               {-# L #-}
+               b_r3g x_r3i  :: 
+                         rlg{-aHq-}
+                     {-# L #-}
+                     x_r3i ->
+                 let {
+                   ds_dLq  :: 
+                       riC{-aHC-}
+                   {-# L #-}
+                   ds_dLq =
+                       f_aHi
+                           x_r3i
+                 } in 
+                   abs_aKr
+                       ds_dLq;
+       } in 
+         PrelTup.(,){-62,p-}{i}
+             {_@_ (rlg{-aHq-} -> riC{-aHC-})
+              _@_ (PrelBase.Bool{-34,p-} -> rlg{-aHq-} -> riC{-aHC-})
+              f_aHi
+              g_aHj}
+f{-r3l,x-}  :: 
+    _forall_
+    [rlg{-aHq-} riC{-aHC-}]
+    =>
+    {PrelBase.Num{-2c,p-} riC{-aHC-}}
+    -> {PrelBase.Eq{-23,p-} rlg{-aHq-}}
+    -> rlg{-aHq-}
+    -> riC{-aHC-}
+{-# L #-}
+f{-r3l,x-} =
+    _/\_ rlg{-aHq-} riC{-aHC-} -> \ d.Num_aHI  :: 
+                                       {PrelBase.Num{-2c,p-} riC{-aHC-}}
+                                   {-# L #-}
+                                   d.Num_aHI d.Eq_aHG  :: 
+                                                 {PrelBase.Eq{-23,p-} rlg{-aHq-}}
+                                             {-# L #-}
+                                             d.Eq_aHG ->
+       case
+           ds_dK5
+               _@_ rlg{-aHq-} _@_ riC{-aHC-} d.Num_aHI d.Eq_aHG
+       of {
+       PrelTup.(,){-62,p-}{i} ds_dM9 ds_dMa  ->
+       ds_dM9;}
+g{-r3k,x-}  :: 
+    _forall_
+    [rlg{-aHq-} riC{-aHC-}]
+    =>
+    {PrelBase.Num{-2c,p-} riC{-aHC-}}
+    -> {PrelBase.Eq{-23,p-} rlg{-aHq-}}
+    -> PrelBase.Bool{-34,p-}
+    -> rlg{-aHq-}
+    -> riC{-aHC-}
+{-# L #-}
+g{-r3k,x-} =
+    _/\_ rlg{-aHq-} riC{-aHC-} -> \ d.Num_aHI  :: 
+                                       {PrelBase.Num{-2c,p-} riC{-aHC-}}
+                                   {-# L #-}
+                                   d.Num_aHI d.Eq_aHG  :: 
+                                                 {PrelBase.Eq{-23,p-} rlg{-aHq-}}
+                                             {-# L #-}
+                                             d.Eq_aHG ->
+       case
+           ds_dK5
+               _@_ rlg{-aHq-} _@_ riC{-aHC-} d.Num_aHI d.Eq_aHG
+       of {
+       PrelTup.(,){-62,p-}{i} ds_dMB ds_dMA  ->
+       ds_dMA;}
+end Rec }
+
+NOTE: Simplifier still going after 4 iterations; bailing out.
diff --git a/ghc/tests/deSugar/should_compile/ds024.hs b/ghc/tests/deSugar/should_compile/ds024.hs
new file mode 100644 (file)
index 0000000..6f0b27a
--- /dev/null
@@ -0,0 +1,11 @@
+--!!! ds024 -- correct types on ConPatOuts
+
+-- do all the right types get stuck on all the
+-- Nils and Conses?
+
+module ShouldSucceed where
+
+
+f x = [[], []]
+
+g x = ([], [], [])
diff --git a/ghc/tests/deSugar/should_compile/ds024.stderr b/ghc/tests/deSugar/should_compile/ds024.stderr
new file mode 100644 (file)
index 0000000..b377760
--- /dev/null
@@ -0,0 +1,78 @@
+
+
+================================================================================
+Desugared:
+g{-r3h,x-}  :: 
+    _forall_
+    [t{-aAR-} t{-aAL-} t{-aAN-} t{-aAP-}]
+    =>
+    t{-aAR-} -> ([t{-aAL-}], [t{-aAN-}], [t{-aAP-}])
+{-# L #-}
+g{-r3h,x-} =
+    _/\_ t{-aAR-} t{-aAL-} t{-aAN-} t{-aAP-} -> \ x_r3g  :: 
+                                                     t{-aAR-}
+                                                 {-# L #-}
+                                                 x_r3g ->
+       let {
+         ds_dD1  :: 
+             [t{-aAL-}]
+         {-# L #-}
+         ds_dD1 =
+             PrelBase.[]{-5i,p-}{i}
+                 _@_ t{-aAL-} } in
+       let {
+         ds_dD5  :: 
+             [t{-aAN-}]
+         {-# L #-}
+         ds_dD5 =
+             PrelBase.[]{-5i,p-}{i}
+                 _@_ t{-aAN-} } in
+       let {
+         ds_dD9  :: 
+             [t{-aAP-}]
+         {-# L #-}
+         ds_dD9 =
+             PrelBase.[]{-5i,p-}{i}
+                 _@_ t{-aAP-}
+       } in 
+         PrelTup.(,,){-63,p-}{i}
+             {_@_ [t{-aAL-}] _@_ [t{-aAN-}] _@_ [t{-aAP-}] ds_dD1 ds_dD5 ds_dD9}
+f{-r3i,x-}  :: 
+    _forall_ [t{-aAZ-} t{-aB3-}] => t{-aB3-} -> [[t{-aAZ-}]]
+{-# L #-}
+f{-r3i,x-} =
+    _/\_ t{-aAZ-} t{-aB3-} -> \ x_r3e  :: 
+                                   t{-aB3-}
+                               {-# L #-}
+                               x_r3e ->
+       let {
+         ds_dDN  :: 
+             [t{-aAZ-}]
+         {-# L #-}
+         ds_dDN =
+             PrelBase.[]{-5i,p-}{i}
+                 _@_ t{-aAZ-} } in
+       let { ds_dDR  :: 
+                 [[t{-aAZ-}]]
+             {-# L #-}
+             ds_dDR =
+         let {
+           ds_dE7  :: 
+               [t{-aAZ-}]
+           {-# L #-}
+           ds_dE7 =
+               PrelBase.[]{-5i,p-}{i}
+                   _@_ t{-aAZ-} } in
+         let {
+           ds_dEb  :: 
+               [[t{-aAZ-}]]
+           {-# L #-}
+           ds_dEb =
+               PrelBase.[]{-5i,p-}{i}
+                   {_@_ [t{-aAZ-}]}
+         } in 
+           PrelBase.:{-55,p-}{i}
+               {_@_ [t{-aAZ-}] ds_dE7 ds_dEb}
+       } in
+       PrelBase.:{-55,p-}{i}
+           {_@_ [t{-aAZ-}] ds_dDN ds_dDR}
diff --git a/ghc/tests/deSugar/should_compile/ds025.hs b/ghc/tests/deSugar/should_compile/ds025.hs
new file mode 100644 (file)
index 0000000..c28b16d
--- /dev/null
@@ -0,0 +1,18 @@
+--!!! ds025 -- overloaded assoc -- AbsBinds
+
+module Util where
+
+ehead xs loc | null xs = error ("4"++loc)
+             | True = head xs
+
+assoc key lst loc
+   = if (null res) then error ("1"++loc++"2"++(show key))
+                   else (ehead res "3")
+     where res = [ val | (key',val) <- lst, key==key']
+
+assocMaybe :: (Eq a) => a -> [(a,b)] -> Maybe b
+assocMaybe key lst
+ = if (null res) then Nothing else (Just (head res))
+   where res =  [ val | (key',val) <- lst, key==key']
+
+data Maybe a = Just a | Nothing deriving ()
diff --git a/ghc/tests/deSugar/should_compile/ds025.stderr b/ghc/tests/deSugar/should_compile/ds025.stderr
new file mode 100644 (file)
index 0000000..4e6ad93
--- /dev/null
@@ -0,0 +1,18 @@
+ds025.hs:3:
+    Conflicting definitions for: `Just'
+       Defined at ds025.hs:18
+       Imported from Prelude at ds025.hs:3
+ds025.hs:3:
+    Conflicting definitions for: `Nothing'
+       Defined at ds025.hs:18
+       Imported from Prelude at ds025.hs:3
+ds025.hs:3:
+    Conflicting definitions for: `Maybe'
+       Defined at ds025.hs:18
+       Imported from Prelude at ds025.hs:3
+
+
+Compilation had errors
diff --git a/ghc/tests/deSugar/should_compile/ds026.hs b/ghc/tests/deSugar/should_compile/ds026.hs
new file mode 100644 (file)
index 0000000..ff1f0be
--- /dev/null
@@ -0,0 +1,14 @@
+--!!! ds026 -- classes -- incl. polymorphic method
+
+module ShouldSucceed where
+
+class Foo a where
+  op :: a -> a
+
+class Foo a => Boo a where
+  op1 :: a -> a
+
+class Boo a => Noo a where
+  op2 :: (Eq b) => a -> b -> a
+
+f x y = op (op2 x y)
diff --git a/ghc/tests/deSugar/should_compile/ds026.stderr b/ghc/tests/deSugar/should_compile/ds026.stderr
new file mode 100644 (file)
index 0000000..914cc16
--- /dev/null
@@ -0,0 +1,192 @@
+
+
+================================================================================
+Desugared:
+Rec {
+scsel_NooShouldSucceedBoo{-aKl,x-}  :: 
+    _forall_
+    [a{-r3n-}]
+    =>
+    {Noo{-r3B,x-} a{-r3n-}} -> {Boo{-r3o,x-} a{-r3n-}}
+{-# L #-}
+scsel_NooShouldSucceedBoo{-aKl,x-} =
+    _/\_ a{-r3n-} -> \ tpl_B1  :: 
+                          {Noo{-r3B,x-} a{-r3n-}}
+                      {-# L #-}
+                      tpl_B1 ->
+       case tpl_B1 of { PrelTup.(,){-62,p-}{i} tpl_B1 tpl_B2  -> tpl_B1;}
+op2{-r3A,x-}  :: 
+    _forall_
+    [a{-r3n-}]
+    =>
+    {Noo{-r3B,x-} a{-r3n-}}
+    -> (_forall_
+       [b{-r3q-}]
+       =>
+       {PrelBase.Eq{-23,p-} b{-r3q-}} -> a{-r3n-} -> b{-r3q-} -> a{-r3n-})
+{-# L #-}
+op2{-r3A,x-} =
+    _/\_ a{-r3n-} -> \ tpl_B1  :: 
+                          {Noo{-r3B,x-} a{-r3n-}}
+                      {-# L #-}
+                      tpl_B1 ->
+       case tpl_B1 of { PrelTup.(,){-62,p-}{i} tpl_B1 tpl_B2  -> tpl_B2;}
+$mop2{-rGB,x-}  :: 
+    _forall_
+    [a{-r3n-}]
+    =>
+    {Noo{-r3B,x-} a{-r3n-}}
+    -> (_forall_
+       [b{-r3q-}]
+       =>
+       {PrelBase.Eq{-23,p-} b{-r3q-}} -> a{-r3n-} -> b{-r3q-} -> a{-r3n-})
+{-# L #-}
+$mop2{-rGB,x-} =
+    _/\_ a{-aHc-} -> \ d.Noo_aH5  :: 
+                          {Noo{-r3B,x-} a{-aHc-}}
+                      {-# L #-}
+                      d.Noo_aH5 ->
+       _/\_ b{-aHg-} -> \ d.Eq_aHi  :: 
+                              {PrelBase.Eq{-23,p-} b{-aHg-}}
+                          {-# L #-}
+                          d.Eq_aHi ->
+           GHCerr.noDefaultMethodError{-8k,p-}
+               _@_ (a{-aHc-} -> b{-aHg-} -> a{-aHc-})
+               _string_ "Class Noo Method op2"
+scsel_BooShouldSucceedFoo{-aKD,x-}  :: 
+    _forall_
+    [a{-r3t-}]
+    =>
+    {Boo{-r3o,x-} a{-r3t-}} -> {Foo{-r3u,x-} a{-r3t-}}
+{-# L #-}
+scsel_BooShouldSucceedFoo{-aKD,x-} =
+    _/\_ a{-r3t-} -> \ tpl_B1  :: 
+                          {Boo{-r3o,x-} a{-r3t-}}
+                      {-# L #-}
+                      tpl_B1 ->
+       case tpl_B1 of { PrelTup.(,){-62,p-}{i} tpl_B1 tpl_B2  -> tpl_B1;}
+op1{-r3C,x-}  :: 
+    _forall_
+    [a{-r3t-}]
+    =>
+    {Boo{-r3o,x-} a{-r3t-}} -> a{-r3t-} -> a{-r3t-}
+{-# L #-}
+op1{-r3C,x-} =
+    _/\_ a{-r3t-} -> \ tpl_B1  :: 
+                          {Boo{-r3o,x-} a{-r3t-}}
+                      {-# L #-}
+                      tpl_B1 ->
+       case tpl_B1 of { PrelTup.(,){-62,p-}{i} tpl_B1 tpl_B2  -> tpl_B2;}
+$mop1{-rGD,x-}  :: 
+    _forall_
+    [a{-r3t-}]
+    =>
+    {Boo{-r3o,x-} a{-r3t-}} -> a{-r3t-} -> a{-r3t-}
+{-# L #-}
+$mop1{-rGD,x-} =
+    _/\_ a{-aHs-} -> \ d.Boo_aHl  :: 
+                          {Boo{-r3o,x-} a{-aHs-}}
+                      {-# L #-}
+                      d.Boo_aHl ->
+       GHCerr.noDefaultMethodError{-8k,p-}
+           _@_ (a{-aHs-} -> a{-aHs-}) _string_ "Class Boo Method op1"
+op{-r3D,x-}  :: 
+    _forall_
+    [a{-r3y-}]
+    =>
+    {Foo{-r3u,x-} a{-r3y-}} -> a{-r3y-} -> a{-r3y-}
+{-# L #-}
+op{-r3D,x-} =
+    _/\_ a{-r3y-} -> \ tpl_B1  :: 
+                          {Foo{-r3u,x-} a{-r3y-}}
+                      {-# L #-}
+                      tpl_B1 ->
+       tpl_B1
+$mop{-rGC,x-}  :: 
+    _forall_
+    [a{-r3y-}]
+    =>
+    {Foo{-r3u,x-} a{-r3y-}} -> a{-r3y-} -> a{-r3y-}
+{-# L #-}
+$mop{-rGC,x-} =
+    _/\_ a{-aHD-} -> \ d.Foo_aHw  :: 
+                          {Foo{-r3u,x-} a{-aHD-}}
+                      {-# L #-}
+                      d.Foo_aHw ->
+       GHCerr.noDefaultMethodError{-8k,p-}
+           _@_ (a{-aHD-} -> a{-aHD-}) _string_ "Class Foo Method op"
+f{-r3z,x-}  :: 
+    _forall_
+    [a{-aGK-} b{-aGQ-}]
+    =>
+    {Noo{-r3B,x-} a{-aGK-}}
+    -> {PrelBase.Eq{-23,p-} b{-aGQ-}}
+    -> a{-aGK-}
+    -> b{-aGQ-}
+    -> a{-aGK-}
+{-# L #-}
+f{-r3z,x-} =
+    _/\_ a{-aGK-} b{-aGQ-} -> \ d.Noo_aGY  :: 
+                                   {Noo{-r3B,x-} a{-aGK-}}
+                               {-# L #-}
+                               d.Noo_aGY d.Eq_aH0  :: 
+                                             {PrelBase.Eq{-23,p-} b{-aGQ-}}
+                                         {-# L #-}
+                                         d.Eq_aH0 ->
+       let {
+         d.Boo_aH2  :: 
+             {Boo{-r3o,x-} a{-aGK-}}
+         {-# L #-}
+         d.Boo_aH2 =
+             scsel_NooShouldSucceedBoo{-aKl,x-}
+                 _@_ a{-aGK-} d.Noo_aGY } in
+       let {
+         d.Foo_aGW  :: 
+             {Foo{-r3u,x-} a{-aGK-}}
+         {-# L #-}
+         d.Foo_aGW =
+             scsel_BooShouldSucceedFoo{-aKD,x-}
+                 _@_ a{-aGK-} d.Boo_aH2 } in
+       let {
+         op_aMI  :: 
+             a{-aGK-} -> a{-aGK-}
+         {-# L #-}
+         op_aMI =
+             op{-r3D,x-}
+                 _@_ a{-aGK-} d.Foo_aGW } in
+       let {
+         op2_aMH  :: 
+             _forall_
+             [b{-aGM-}]
+             =>
+             {PrelBase.Eq{-23,p-} b{-aGM-}} -> a{-aGK-} -> b{-aGM-} -> a{-aGK-}
+         {-# L #-}
+         op2_aMH =
+             op2{-r3A,x-}
+                 _@_ a{-aGK-} d.Noo_aGY } in
+       let {
+         op2_aMG  :: 
+             a{-aGK-} -> b{-aGQ-} -> a{-aGK-}
+         {-# L #-}
+         op2_aMG =
+             op2_aMH
+                 _@_ b{-aGQ-} d.Eq_aH0
+       } in 
+         \ x_r3j  :: 
+               a{-aGK-}
+           {-# L #-}
+           x_r3j y_r3l  :: 
+                     b{-aGQ-}
+                 {-# L #-}
+                 y_r3l ->
+             let {
+               ds_dNv  :: 
+                   a{-aGK-}
+               {-# L #-}
+               ds_dNv =
+                   op2_aMG
+                       x_r3j y_r3l
+             } in 
+               op_aMI
+                   ds_dNv
+end Rec }
diff --git a/ghc/tests/deSugar/should_compile/ds027.hs b/ghc/tests/deSugar/should_compile/ds027.hs
new file mode 100644 (file)
index 0000000..99a4d93
--- /dev/null
@@ -0,0 +1,9 @@
+--!!! ds027 -- simple instances
+--
+module Test where
+
+data Foo = Bar | Baz
+
+instance Eq Foo where
+  Bar == Baz = True
+  Bar /= Baz = False
diff --git a/ghc/tests/deSugar/should_compile/ds027.stderr b/ghc/tests/deSugar/should_compile/ds027.stderr
new file mode 100644 (file)
index 0000000..3d500d9
--- /dev/null
@@ -0,0 +1,118 @@
+ds027.hs:8: 
+    Warning: Possibly incomplete patterns
+       in the definition of function `=='
+ds027.hs:9: 
+    Warning: Possibly incomplete patterns
+       in the definition of function `/='
+
+
+================================================================================
+Desugared:
+Rec {
+d.Eval_aGg  :: 
+    {PrelBase.Eval{-24,p-} Foo{-r3n,x-}}
+{-# L #-}
+d.Eval_aGg =
+    PrelBase.void{-8G,p-}
+$d2{-rIX,x-}  :: 
+    {PrelBase.Eval{-24,p-} Foo{-r3n,x-}}
+{-# L #-}
+$d2{-rIX,x-} =
+    d.Eval_aGg
+==_aGo  :: 
+    Foo{-r3n,x-} -> Foo{-r3n,x-} -> PrelBase.Bool{-34,p-}
+{-# L #-}
+==_aGo =
+    \ ds_dJM  :: 
+         Foo{-r3n,x-}
+      {-# L #-}
+      ds_dJM ds_dJN  :: 
+                Foo{-r3n,x-}
+            {-# L #-}
+            ds_dJN ->
+       let {
+         fail_dJO  :: 
+             PrelBase.Bool{-34,p-}
+         {-# L #-}
+         fail_dJO =
+             GHCerr.patError{-8r,p-}
+                 _@_ PrelBase.Bool{-34,p-} _string_ "ds027.hs:8|function `=='"
+       } in 
+         case ds_dJM of {
+           Baz{-r3,x-}{i} ->
+               fail_dJO;
+           Bar{-r4,x-}{i} ->
+               case ds_dJN of {
+                 Bar{-r4,x-}{i} ->
+                     fail_dJO;
+                 Baz{-r3,x-}{i} ->
+                     PrelBase.True{-5E,p-}{i};
+               };
+         }
+==_aJ7  :: 
+    Foo{-r3n,x-} -> Foo{-r3n,x-} -> PrelBase.Bool{-34,p-}
+{-# L #-}
+==_aJ7 =
+    ==_aGo
+/=_aGs  :: 
+    Foo{-r3n,x-} -> Foo{-r3n,x-} -> PrelBase.Bool{-34,p-}
+{-# L #-}
+/=_aGs =
+    \ ds_dKq  :: 
+         Foo{-r3n,x-}
+      {-# L #-}
+      ds_dKq ds_dKr  :: 
+                Foo{-r3n,x-}
+            {-# L #-}
+            ds_dKr ->
+       let {
+         fail_dKs  :: 
+             PrelBase.Bool{-34,p-}
+         {-# L #-}
+         fail_dKs =
+             GHCerr.patError{-8r,p-}
+                 _@_ PrelBase.Bool{-34,p-} _string_ "ds027.hs:9|function `/='"
+       } in 
+         case ds_dKq of {
+           Baz{-r3,x-}{i} ->
+               fail_dKs;
+           Bar{-r4,x-}{i} ->
+               case ds_dKr of {
+                 Bar{-r4,x-}{i} ->
+                     fail_dKs;
+                 Baz{-r3,x-}{i} ->
+                     PrelBase.False{-58,p-}{i};
+               };
+         }
+/=_aJg  :: 
+    Foo{-r3n,x-} -> Foo{-r3n,x-} -> PrelBase.Bool{-34,p-}
+{-# L #-}
+/=_aJg =
+    /=_aGs
+d.Eq_aGl  :: 
+    {PrelBase.Eq{-23,p-} Foo{-r3n,x-}}
+{-# L #-}
+d.Eq_aGl =
+    PrelTup.(,){-62,p-}{i}
+       {_@_ (Foo{-r3n,x-} -> Foo{-r3n,x-} -> PrelBase.Bool{-34,p-})
+        _@_ (Foo{-r3n,x-} -> Foo{-r3n,x-} -> PrelBase.Bool{-34,p-})
+        ==_aJ7
+        /=_aJg}
+$d1{-rJp,x-}  :: 
+    {PrelBase.Eq{-23,p-} Foo{-r3n,x-}}
+{-# L #-}
+$d1{-rJp,x-} =
+    d.Eq_aGl
+Bar{-r4,x-}{i}  :: 
+    Foo{-r3n,x-}
+_A_ 0 {-# L #-}
+Bar{-r4,x-}{i} =
+    Bar{-r4,x-}{i}
+       {}
+Baz{-r3,x-}{i}  :: 
+    Foo{-r3n,x-}
+_A_ 0 {-# L #-}
+Baz{-r3,x-}{i} =
+    Baz{-r3,x-}{i}
+       {}
+end Rec }
diff --git a/ghc/tests/deSugar/should_compile/ds028.hs b/ghc/tests/deSugar/should_compile/ds028.hs
new file mode 100644 (file)
index 0000000..18c0b7d
--- /dev/null
@@ -0,0 +1,13 @@
+--!!! ds028: failable pats in top row
+
+module ShouldSucceed where
+
+
+-- when the first row of pats doesn't have convenient
+-- variables to grab...
+
+mAp f []       = []
+mAp f (x:xs)   = f x : mAp f xs
+
+True  |||| _   =  True
+False |||| x   =  x
diff --git a/ghc/tests/deSugar/should_compile/ds028.stderr b/ghc/tests/deSugar/should_compile/ds028.stderr
new file mode 100644 (file)
index 0000000..99e83c8
--- /dev/null
@@ -0,0 +1,83 @@
+
+
+================================================================================
+Desugared:
+||||_amR  :: 
+    PrelBase.Bool{-34,p-}
+    -> PrelBase.Bool{-34,p-}
+    -> PrelBase.Bool{-34,p-}
+{-# L #-}
+||||_amR =
+    \ ds_dq6  :: 
+         PrelBase.Bool{-34,p-}
+      {-# L #-}
+      ds_dq6 ds_dq7  :: 
+                PrelBase.Bool{-34,p-}
+            {-# L #-}
+            ds_dq7 ->
+       case ds_dq6 of {
+         PrelBase.True{-5E,p-}{i} ->
+             PrelBase.True{-5E,p-}{i};
+         PrelBase.False{-58,p-}{i} ->
+             ds_dq7;
+       }
+||||{-r3q,x-}  :: 
+    PrelBase.Bool{-34,p-}
+    -> PrelBase.Bool{-34,p-}
+    -> PrelBase.Bool{-34,p-}
+{-# L #-}
+||||{-r3q,x-} =
+    ||||_amR
+Rec {
+mAp{-r3r,x-}  :: 
+    _forall_
+    [t{-an5-} t{-an7-}]
+    =>
+    (t{-an5-} -> t{-an7-}) -> [t{-an5-}] -> [t{-an7-}]
+{-# L #-}
+mAp{-r3r,x-} =
+    _/\_ t{-an5-} t{-an7-} ->
+       _letrec_ {
+         mAp_amZ  :: 
+             (t{-an5-} -> t{-an7-}) -> [t{-an5-}] -> [t{-an7-}]
+         {-# L #-}
+         mAp_amZ =
+             \ f_r3e  :: 
+                   t{-an5-} -> t{-an7-}
+               {-# L #-}
+               f_r3e ds_dqV  :: 
+                         [t{-an5-}]
+                     {-# L #-}
+                     ds_dqV ->
+                 case ds_dqV of {
+                   PrelBase.[]{-5i,p-}{i} ->
+                       PrelBase.[]{-5i,p-}{i}
+                           _@_ t{-an7-};
+                   PrelBase.:{-55,p-}{i} x_r3j xs_r3k ->
+                       let {
+                         f_r3h  :: 
+                             t{-an5-} -> t{-an7-}
+                         {-# L #-}
+                         f_r3h =
+                             f_r3e } in
+                       let {
+                         ds_drl  :: 
+                             t{-an7-}
+                         {-# L #-}
+                         ds_drl =
+                             f_r3h
+                                 x_r3j } in
+                       let {
+                         ds_drp  :: 
+                             [t{-an7-}]
+                         {-# L #-}
+                         ds_drp =
+                             mAp_amZ
+                                 f_r3h xs_r3k
+                       } in 
+                         PrelBase.:{-55,p-}{i}
+                             _@_ t{-an7-} ds_drl ds_drp;
+                 };
+       } in 
+         mAp_amZ
+end Rec }
diff --git a/ghc/tests/deSugar/should_compile/ds029.hs b/ghc/tests/deSugar/should_compile/ds029.hs
new file mode 100644 (file)
index 0000000..fd9f583
--- /dev/null
@@ -0,0 +1,9 @@
+--!!! ds029: pattern binding with guards (dubious but valid)
+--
+
+module Test where
+
+f x = y
+    where (y,z) | y < z     = (0,1)
+               | y > z     = (1,2)
+               | True      = (2,3)
diff --git a/ghc/tests/deSugar/should_compile/ds029.stderr b/ghc/tests/deSugar/should_compile/ds029.stderr
new file mode 100644 (file)
index 0000000..f3230a1
--- /dev/null
@@ -0,0 +1,187 @@
+
+
+================================================================================
+Desugared:
+f{-r3h,x-}  :: 
+    _forall_
+    [t{-aY1-} t{-aYi-}]
+    =>
+    {PrelBase.Ord{-2d,p-} t{-aY1-}}
+    -> {PrelBase.Num{-2c,p-} t{-aY1-}}
+    -> t{-aYi-}
+    -> t{-aY1-}
+{-# L #-}
+f{-r3h,x-} =
+    _/\_ t{-aY1-} t{-aYi-} -> \ d.Ord_aYk  :: 
+                                   {PrelBase.Ord{-2d,p-} t{-aY1-}}
+                               {-# L #-}
+                               d.Ord_aYk d.Num_aYn  :: 
+                                             {PrelBase.Num{-2c,p-} t{-aY1-}}
+                                         {-# L #-}
+                                         d.Num_aYn ->
+       let {
+         <_a137  :: 
+             t{-aY1-} -> t{-aY1-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         <_a137 =
+             PrelBase.<{-rcJ,p-}
+                 _@_ t{-aY1-} d.Ord_aYk } in
+       let {
+         fromInt_a136  :: 
+             PrelBase.Int{-3g,p-} -> t{-aY1-}
+         {-# L #-}
+         fromInt_a136 =
+             PrelBase.fromInt{-8R,p-}
+                 _@_ t{-aY1-} d.Num_aYn } in
+       let { lit_a135  :: 
+                 t{-aY1-}
+             {-# L #-}
+             lit_a135 =
+         let {
+           ds_d13v  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d13v =
+               PrelBase.I#{-5b,p-}{i}
+                   0
+         } in 
+           fromInt_a136
+               ds_d13v
+       } in
+       let {
+         fromInt_a134  :: 
+             PrelBase.Int{-3g,p-} -> t{-aY1-}
+         {-# L #-}
+         fromInt_a134 =
+             fromInt_a136 } in
+       let { lit_a133  :: 
+                 t{-aY1-}
+             {-# L #-}
+             lit_a133 =
+         let {
+           ds_d13K  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d13K =
+               PrelBase.I#{-5b,p-}{i}
+                   1
+         } in 
+           fromInt_a134
+               ds_d13K
+       } in
+       let {
+         d.Ord_aYq  :: 
+             {PrelBase.Ord{-2d,p-} t{-aY1-}}
+         {-# L #-}
+         d.Ord_aYq =
+             d.Ord_aYk } in
+       let {
+         >_a132  :: 
+             t{-aY1-} -> t{-aY1-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         >_a132 =
+             PrelBase.>{-rcL,p-}
+                 _@_ t{-aY1-} d.Ord_aYq } in
+       let {
+         fromInt_a131  :: 
+             PrelBase.Int{-3g,p-} -> t{-aY1-}
+         {-# L #-}
+         fromInt_a131 =
+             fromInt_a136 } in
+       let { lit_a130  :: 
+                 t{-aY1-}
+             {-# L #-}
+             lit_a130 =
+         let {
+           ds_d148  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d148 =
+               PrelBase.I#{-5b,p-}{i}
+                   2
+         } in 
+           fromInt_a131
+               ds_d148
+       } in
+       let {
+         fromInt_a12Z  :: 
+             PrelBase.Int{-3g,p-} -> t{-aY1-}
+         {-# L #-}
+         fromInt_a12Z =
+             fromInt_a136 } in
+       let { lit_a12W  :: 
+                 t{-aY1-}
+             {-# L #-}
+             lit_a12W =
+         let {
+           ds_d14n  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d14n =
+               PrelBase.I#{-5b,p-}{i}
+                   3
+         } in 
+           fromInt_a12Z
+               ds_d14n
+       } in
+       \ x_r3d  :: 
+             t{-aYi-}
+         {-# L #-}
+         x_r3d ->
+           _letrec_ {
+             lit_a14F  :: 
+                 t{-aY1-}
+             {-# L #-}
+             lit_a14F =
+                 lit_a133;
+             lit_a14H  :: 
+                 t{-aY1-}
+             {-# L #-}
+             lit_a14H =
+                 lit_a130;
+             ds_d14Q  :: 
+                 (t{-aY1-}, t{-aY1-})
+             {-# L #-}
+             ds_d14Q =
+                 case
+                     <_a137
+                         y_aXx z_aXy
+                 of {
+                   PrelBase.True{-5E,p-}{i} ->
+                       PrelTup.(,){-62,p-}{i}
+                           {_@_ t{-aY1-} _@_ t{-aY1-} lit_a135 lit_a133};
+                   PrelBase.False{-58,p-}{i} ->
+                       case
+                           >_a132
+                               y_aXx z_aXy
+                       of {
+                         PrelBase.True{-5E,p-}{i} ->
+                             PrelTup.(,){-62,p-}{i}
+                                 {_@_ t{-aY1-} _@_ t{-aY1-} lit_a14F lit_a130};
+                         PrelBase.False{-58,p-}{i} ->
+                             PrelTup.(,){-62,p-}{i}
+                                 {_@_ t{-aY1-} _@_ t{-aY1-} lit_a14H lit_a12W};
+                       };
+                 };
+             y_aXx  :: 
+                 t{-aY1-}
+             {-# L #-}
+             y_aXx =
+                 case ds_d14Q of { PrelTup.(,){-62,p-}{i} y_aXx z_aXy  -> y_aXx;};
+             z_aXy  :: 
+                 t{-aY1-}
+             {-# L #-}
+             z_aXy =
+                 case ds_d14Q of { PrelTup.(,){-62,p-}{i} y_aXx z_aXy  -> z_aXy;};
+             y_r3f  :: 
+                 t{-aY1-}
+             {-# L #-}
+             y_r3f =
+                 y_aXx;
+             z_r3g  :: 
+                 t{-aY1-}
+             {-# L #-}
+             z_r3g =
+                 z_aXy;
+           } in 
+             y_r3f
diff --git a/ghc/tests/deSugar/should_compile/ds030.hs b/ghc/tests/deSugar/should_compile/ds030.hs
new file mode 100644 (file)
index 0000000..7abc4d8
--- /dev/null
@@ -0,0 +1,5 @@
+--!!! ds030: checks that types substituted into binders
+--
+module Test where
+
+f x = case x of [] -> (3::Int) ; _ -> (4::Int)
diff --git a/ghc/tests/deSugar/should_compile/ds030.stderr b/ghc/tests/deSugar/should_compile/ds030.stderr
new file mode 100644 (file)
index 0000000..beecd0f
--- /dev/null
@@ -0,0 +1,54 @@
+
+
+================================================================================
+Desugared:
+Rec {
+{-# L #-}
+d.Num_aHE =
+    PrelBase.$d3
+{-# L #-}
+fromInt_aKm =
+    PrelBase.fromInt
+       _@_ PrelBase.Int d.Num_aHE
+{-# L #-}
+lit_aKx =
+    let {
+      {-# L #-}
+      ds_dKW =
+         PrelBase.I#
+             3
+    } in 
+      fromInt_aKm
+         ds_dKW
+{-# L #-}
+fromInt_aKw =
+    fromInt_aKm
+{-# L #-}
+lit_aKt =
+    let {
+      {-# L #-}
+      ds_dLb =
+         PrelBase.I#
+             4
+    } in 
+      fromInt_aKw
+         ds_dLb
+{-# L #-}
+f = _/\_ t{-aHm-} -> \ {-# L #-}
+                      x_r3d ->
+       let {
+         {-# L #-}
+         ds_dLw =
+             x_r3d } in
+       let {
+         {-# L #-}
+         fail_dLy =
+             lit_aKt
+       } in 
+         case ds_dLw of {
+           PrelBase.: ds_dLG ds_dLF ->
+               fail_dLy;
+           PrelBase.[] ->
+               lit_aKx;
+         }
+end Rec }
diff --git a/ghc/tests/deSugar/should_compile/ds031.hs b/ghc/tests/deSugar/should_compile/ds031.hs
new file mode 100644 (file)
index 0000000..3378800
--- /dev/null
@@ -0,0 +1,7 @@
+module ShouldSucceed where
+
+foldPair :: (a->a->a,b->b->b) -> (a,b) -> [(a,b)] -> (a,b)
+foldPair fg       ab [] = ab
+foldPair fg@(f,g) ab ((a,b):abs) = (f a u,g b v)
+                       where (u,v) = foldPair fg ab abs
+
diff --git a/ghc/tests/deSugar/should_compile/ds031.stderr b/ghc/tests/deSugar/should_compile/ds031.stderr
new file mode 100644 (file)
index 0000000..c59f652
--- /dev/null
@@ -0,0 +1,137 @@
+ds031.hs:4: 
+    Warning: Possibly incomplete patterns
+       in the definition of function `foldPair'
+
+
+================================================================================
+Desugared:
+Rec {
+foldPair{-r3f,x-}  :: 
+    _forall_
+    [a{-aB1-} b{-aB2-}]
+    =>
+    (a{-aB1-} -> a{-aB1-} -> a{-aB1-}, b{-aB2-}
+                                      -> b{-aB2-}
+                                      -> b{-aB2-})
+    -> (a{-aB1-}, b{-aB2-})
+    -> [(a{-aB1-}, b{-aB2-})]
+    -> (a{-aB1-}, b{-aB2-})
+{-# L #-}
+foldPair{-r3f,x-} =
+    _/\_ a{-aB1-} b{-aB2-} ->
+       _letrec_ {
+         foldPair_aAY  :: 
+             (a{-aB1-} -> a{-aB1-} -> a{-aB1-}, b{-aB2-}
+                                                -> b{-aB2-}
+                                                -> b{-aB2-})
+             -> (a{-aB1-}, b{-aB2-})
+             -> [(a{-aB1-}, b{-aB2-})]
+             -> (a{-aB1-}, b{-aB2-})
+         {-# L #-}
+         foldPair_aAY =
+             \ fg_r3h  :: 
+                   (a{-aB1-} -> a{-aB1-} -> a{-aB1-}, b{-aB2-}
+                                                      -> b{-aB2-}
+                                                      -> b{-aB2-})
+               {-# L #-}
+               fg_r3h ab_r3j  :: 
+                          (a{-aB1-}, b{-aB2-})
+                      {-# L #-}
+                      ab_r3j ds_dFz  :: 
+                                 [(a{-aB1-}, b{-aB2-})]
+                             {-# L #-}
+                             ds_dFz ->
+                 let {
+                   fail_dFA  :: 
+                       (a{-aB1-}, b{-aB2-})
+                   {-# L #-}
+                   fail_dFA =
+                       GHCerr.patError{-8r,p-}
+                           _@_ (a{-aB1-}, b{-aB2-})
+                           _string_ "ds031.hs:4|function `foldPair'" } in
+                 let {
+                   fail_dHs  :: 
+                       (a{-aB1-}, b{-aB2-})
+                   {-# L #-}
+                   fail_dHs =
+                       case fg_r3h of { PrelTup.(,){-62,p-}{i} f_r3n g_r3o  ->
+                       case ds_dFz of {
+                         PrelBase.[]{-5i,p-}{i} ->
+                             fail_dFA;
+                         PrelBase.:{-55,p-}{i} ds_dFV abs_r3u ->
+                             case ds_dFV of { PrelTup.(,){-62,p-}{i} a_r3s b_r3t  ->
+                             let {
+                               ab_r3q  :: 
+                                   (a{-aB1-}, b{-aB2-})
+                               {-# L #-}
+                               ab_r3q =
+                                   ab_r3j } in
+                             let {
+                               fg_r3m  :: 
+                                   (a{-aB1-} -> a{-aB1-} -> a{-aB1-}, b{-aB2-}
+                                                                      -> b{-aB2-}
+                                                                      -> b{-aB2-})
+                               {-# L #-}
+                               fg_r3m =
+                                   fg_r3h } in
+                             let {
+                               ds_dGR  :: 
+                                   (a{-aB1-}, b{-aB2-})
+                               {-# L #-}
+                               ds_dGR =
+                                   foldPair{-r3f,x-}
+                                       _@_ a{-aB1-} _@_ b{-aB2-} fg_r3m ab_r3q abs_r3u } in
+                             let {
+                               u_aBw  :: 
+                                   a{-aB1-}
+                               {-# L #-}
+                               u_aBw =
+                                   case ds_dGR of { PrelTup.(,){-62,p-}{i} u_aBw v_aBx  ->
+                                   u_aBw;} } in
+                             let {
+                               v_aBx  :: 
+                                   b{-aB2-}
+                               {-# L #-}
+                               v_aBx =
+                                   case ds_dGR of { PrelTup.(,){-62,p-}{i} u_aBw v_aBx  ->
+                                   v_aBx;} } in
+                             let {
+                               u_r3w  :: 
+                                   a{-aB1-}
+                               {-# L #-}
+                               u_r3w =
+                                   u_aBw } in
+                             let {
+                               v_r3x  :: 
+                                   b{-aB2-}
+                               {-# L #-}
+                               v_r3x =
+                                   v_aBx } in
+                             let {
+                               ds_dGq  :: 
+                                   a{-aB1-}
+                               {-# L #-}
+                               ds_dGq =
+                                   f_r3n
+                                       a_r3s u_r3w } in
+                             let {
+                               ds_dGu  :: 
+                                   b{-aB2-}
+                               {-# L #-}
+                               ds_dGu =
+                                   g_r3o
+                                       b_r3t v_r3x
+                             } in 
+                               PrelTup.(,){-62,p-}{i}
+                                   {_@_ a{-aB1-} _@_ b{-aB2-} ds_dGq ds_dGu};};
+                       };}
+                 } in 
+                   case ds_dFz of {
+                     PrelBase.:{-55,p-}{i} ds_dHA ds_dHz ->
+                         fail_dHs;
+                     PrelBase.[]{-5i,p-}{i} ->
+                         ab_r3j;
+                   };
+       } in 
+         foldPair_aAY
+end Rec }
diff --git a/ghc/tests/deSugar/should_compile/ds032.hs b/ghc/tests/deSugar/should_compile/ds032.hs
new file mode 100644 (file)
index 0000000..31bc07e
--- /dev/null
@@ -0,0 +1,17 @@
+--!!! recursive funs tangled in an AbsBind
+
+module ShouldSucceed where
+
+
+flatten :: Int         -- Indentation
+        -> Bool                -- True => just had a newline
+        -> Float       -- Current seq to flatten
+        -> [(Int,Float)]-- Work list with indentation
+        -> String
+
+flatten n nlp 0.0 seqs = flattenS nlp seqs
+flatten n nlp 1.0 seqs = flatten n nlp 1.1 ((n,1.2) : seqs)
+
+flattenS :: Bool -> [(Int, Float)] -> String
+flattenS nlp [] = ""
+flattenS nlp ((col,seq):seqs) = flatten col nlp seq seqs
diff --git a/ghc/tests/deSugar/should_compile/ds032.stderr b/ghc/tests/deSugar/should_compile/ds032.stderr
new file mode 100644 (file)
index 0000000..1276b4e
--- /dev/null
@@ -0,0 +1,201 @@
+ds032.hs:12: 
+    Warning: Possibly incomplete patterns
+       in the definition of function `flatten'
+
+
+================================================================================
+Desugared:
+Rec {
+d.Fractional_a11b  :: 
+    {PrelNum.Fractional{-26,p-} PrelBase.Float{-3c,p-}}
+{-# L #-}
+d.Fractional_a11b =
+    PrelNum.$d23{-rGg,p-}
+fromRational_a17D  :: 
+    PrelNum.Rational{-3r,p-} -> PrelBase.Float{-3c,p-}
+{-# L #-}
+fromRational_a17D =
+    PrelNum.fromRational{-8T,p-}
+       _@_ PrelBase.Float{-3c,p-} d.Fractional_a11b
+lit_a17V  :: 
+    PrelBase.Float{-3c,p-}
+{-# L #-}
+lit_a17V =
+    fromRational_a17D
+       _rational_  0 1
+d.Eq_a11e  :: 
+    {PrelBase.Eq{-23,p-} PrelBase.Float{-3c,p-}}
+{-# L #-}
+d.Eq_a11e =
+    PrelNum.$d27{-rGk,p-}
+==_a17U  :: 
+    PrelBase.Float{-3c,p-}
+    -> PrelBase.Float{-3c,p-}
+    -> PrelBase.Bool{-34,p-}
+{-# L #-}
+==_a17U =
+    PrelBase.=={-8Y,p-}
+       _@_ PrelBase.Float{-3c,p-} d.Eq_a11e
+fromRational_a17T  :: 
+    PrelNum.Rational{-3r,p-} -> PrelBase.Float{-3c,p-}
+{-# L #-}
+fromRational_a17T =
+    fromRational_a17D
+lit_a17S  :: 
+    PrelBase.Float{-3c,p-}
+{-# L #-}
+lit_a17S =
+    fromRational_a17T
+       _rational_  1 1
+fromRational_a17R  :: 
+    PrelNum.Rational{-3r,p-} -> PrelBase.Float{-3c,p-}
+{-# L #-}
+fromRational_a17R =
+    fromRational_a17D
+lit_a17Q  :: 
+    PrelBase.Float{-3c,p-}
+{-# L #-}
+lit_a17Q =
+    fromRational_a17R
+       _rational_  11 10
+fromRational_a17P  :: 
+    PrelNum.Rational{-3r,p-} -> PrelBase.Float{-3c,p-}
+{-# L #-}
+fromRational_a17P =
+    fromRational_a17D
+lit_a17K  :: 
+    PrelBase.Float{-3c,p-}
+{-# L #-}
+lit_a17K =
+    fromRational_a17P
+       _rational_  6 5
+==_a18C  :: 
+    PrelBase.Float{-3c,p-}
+    -> PrelBase.Float{-3c,p-}
+    -> PrelBase.Bool{-34,p-}
+{-# L #-}
+==_a18C =
+    ==_a17U
+flatten_a10r  :: 
+    PrelBase.Int{-3g,p-}
+    -> PrelBase.Bool{-34,p-}
+    -> PrelBase.Float{-3c,p-}
+    -> [(PrelBase.Int{-3g,p-}, PrelBase.Float{-3c,p-})]
+    -> PrelBase.String{-rzM,p-}
+{-# L #-}
+flatten_a10r =
+    \ n_r3i  :: 
+         PrelBase.Int{-3g,p-}
+      {-# L #-}
+      n_r3i nlp_r3k  :: 
+               PrelBase.Bool{-34,p-}
+           {-# L #-}
+           nlp_r3k ds_d19G  :: 
+                       PrelBase.Float{-3c,p-}
+                   {-# L #-}
+                   ds_d19G seqs_r3n  :: 
+                               [(PrelBase.Int{-3g,p-}, PrelBase.Float{-3c,p-})]
+                           {-# L #-}
+                           seqs_r3n ->
+       let {
+         fail_d19H  :: 
+             PrelBase.String{-rzM,p-}
+         {-# L #-}
+         fail_d19H =
+             GHCerr.patError{-8r,p-}
+                 _@_ PrelBase.String{-rzM,p-}
+                 _string_ "ds032.hs:12|function `flatten'"
+       } in 
+         case ds_d19G of { PrelBase.F#{-59,p-}{i} ds_d19Q  ->
+         case# ds_d19Q of {
+           _float_ 0.0000000000000000 ->
+               flattenS{-r3,x-}
+                   nlp_r3k seqs_r3n;
+           _float_ 1.0000000000000000 ->
+               let {
+                 seqs_r3u  :: 
+                     [(PrelBase.Int{-3g,p-}, PrelBase.Float{-3c,p-})]
+                 {-# L #-}
+                 seqs_r3u =
+                     seqs_r3n } in
+               let {
+                 nlp_r3r  :: 
+                     PrelBase.Bool{-34,p-}
+                 {-# L #-}
+                 nlp_r3r =
+                     nlp_r3k } in
+               let {
+                 n_r3p  :: 
+                     PrelBase.Int{-3g,p-}
+                 {-# L #-}
+                 n_r3p =
+                     n_r3i } in
+               let { ds_d1at  :: 
+                         [(PrelBase.Int{-3g,p-}, PrelBase.Float{-3c,p-})]
+                     {-# L #-}
+                     ds_d1at =
+                 let {
+                   ds_d1aG  :: 
+                       (PrelBase.Int{-3g,p-}, PrelBase.Float{-3c,p-})
+                   {-# L #-}
+                   ds_d1aG =
+                       PrelTup.(,){-62,p-}{i}
+                           {_@_ PrelBase.Int{-3g,p-}
+                            _@_ PrelBase.Float{-3c,p-}
+                            n_r3p
+                            lit_a17K}
+                 } in 
+                   PrelBase.:{-55,p-}{i}
+                       _@_ (PrelBase.Int{-3g,p-}, PrelBase.Float{-3c,p-}) ds_d1aG seqs_r3u
+               } in
+               flatten{-r1,x-}
+                   n_r3p nlp_r3r lit_a17Q ds_d1at;
+           ds_d1b0 ->
+               fail_d19H;
+         };}
+flattenS_a10s  :: 
+    PrelBase.Bool{-34,p-}
+    -> [(PrelBase.Int{-3g,p-}, PrelBase.Float{-3c,p-})]
+    -> PrelBase.String{-rzM,p-}
+{-# L #-}
+flattenS_a10s =
+    \ nlp_r3w  :: 
+         PrelBase.Bool{-34,p-}
+      {-# L #-}
+      nlp_r3w ds_d1b6  :: 
+                 [(PrelBase.Int{-3g,p-}, PrelBase.Float{-3c,p-})]
+             {-# L #-}
+             ds_d1b6 ->
+       case ds_d1b6 of {
+         PrelBase.[]{-5i,p-}{i} ->
+             PrelBase.[]{-5i,p-}{i}
+                 {_@_ PrelBase.Char{-38,p-}};
+         PrelBase.:{-55,p-}{i} ds_d1bl seqs_r3D ->
+             case ds_d1bl of { PrelTup.(,){-62,p-}{i} col_r3B seq_r3C  ->
+             let {
+               nlp_r3z  :: 
+                   PrelBase.Bool{-34,p-}
+               {-# L #-}
+               nlp_r3z =
+                   nlp_r3w
+             } in 
+               flatten{-r1,x-}
+                   col_r3B nlp_r3z seq_r3C seqs_r3D;};
+       }
+flatten{-r1,x-}  :: 
+    PrelBase.Int{-3g,p-}
+    -> PrelBase.Bool{-34,p-}
+    -> PrelBase.Float{-3c,p-}
+    -> [(PrelBase.Int{-3g,p-}, PrelBase.Float{-3c,p-})]
+    -> PrelBase.String{-rzM,p-}
+{-# L #-}
+flatten{-r1,x-} =
+    flatten_a10r
+flattenS{-r3,x-}  :: 
+    PrelBase.Bool{-34,p-}
+    -> [(PrelBase.Int{-3g,p-}, PrelBase.Float{-3c,p-})]
+    -> PrelBase.String{-rzM,p-}
+{-# L #-}
+flattenS{-r3,x-} =
+    flattenS_a10s
+end Rec }
diff --git a/ghc/tests/deSugar/should_compile/ds033.hs b/ghc/tests/deSugar/should_compile/ds033.hs
new file mode 100644 (file)
index 0000000..bdadb58
--- /dev/null
@@ -0,0 +1,15 @@
+--!!! getting top-level dependencies right
+--
+module Test where
+
+f1 x = g1 x
+g1 y = y
+
+g2 y = y
+f2 x = g2 x
+
+f3 x = g3 x
+g3 y = f3 y
+
+g4 y = f4 y
+f4 x = g4 x
diff --git a/ghc/tests/deSugar/should_compile/ds033.stderr b/ghc/tests/deSugar/should_compile/ds033.stderr
new file mode 100644 (file)
index 0000000..d6dd38f
--- /dev/null
@@ -0,0 +1,162 @@
+
+
+================================================================================
+Desugared:
+Rec {
+ds_dsc  :: 
+    _forall_
+    [t{-anl-} t{-ann-}]
+    =>
+    (t{-anl-} -> t{-ann-}, t{-anl-} -> t{-ann-})
+{-# L #-}
+ds_dsc =
+    _/\_ t{-anl-} t{-ann-} ->
+       _letrec_ {
+         g4_an6  :: 
+             t{-anl-} -> t{-ann-}
+         {-# L #-}
+         g4_an6 =
+             \ y_r3w  :: 
+                   t{-anl-}
+               {-# L #-}
+               y_r3w ->
+                 f4_an7
+                     y_r3w;
+         f4_an7  :: 
+             t{-anl-} -> t{-ann-}
+         {-# L #-}
+         f4_an7 =
+             \ x_r3y  :: 
+                   t{-anl-}
+               {-# L #-}
+               x_r3y ->
+                 g4_an6
+                     x_r3y;
+       } in 
+         PrelTup.(,){-62,p-}{i}
+             {_@_ (t{-anl-} -> t{-ann-})
+              _@_ (t{-anl-} -> t{-ann-})
+              g4_an6
+              f4_an7}
+g4{-r3A,x-}  :: 
+    _forall_ [t{-anl-} t{-ann-}] => t{-anl-} -> t{-ann-}
+{-# L #-}
+g4{-r3A,x-} =
+    _/\_ t{-anl-} t{-ann-} ->
+       case
+           ds_dsc
+               _@_ t{-anl-} _@_ t{-ann-}
+       of {
+       PrelTup.(,){-62,p-}{i} ds_dth ds_dti  ->
+       ds_dth;}
+f4{-r3z,x-}  :: 
+    _forall_ [t{-anl-} t{-ann-}] => t{-anl-} -> t{-ann-}
+{-# L #-}
+f4{-r3z,x-} =
+    _/\_ t{-anl-} t{-ann-} ->
+       case
+           ds_dsc
+               _@_ t{-anl-} _@_ t{-ann-}
+       of {
+       PrelTup.(,){-62,p-}{i} ds_dtB ds_dtA  ->
+       ds_dtA;}
+end Rec }
+Rec {
+ds_dtM  :: 
+    _forall_
+    [t{-anE-} t{-anG-}]
+    =>
+    (t{-anE-} -> t{-anG-}, t{-anE-} -> t{-anG-})
+{-# L #-}
+ds_dtM =
+    _/\_ t{-anE-} t{-anG-} ->
+       _letrec_ {
+         f3_anp  :: 
+             t{-anE-} -> t{-anG-}
+         {-# L #-}
+         f3_anp =
+             \ x_r3s  :: 
+                   t{-anE-}
+               {-# L #-}
+               x_r3s ->
+                 g3_anq
+                     x_r3s;
+         g3_anq  :: 
+             t{-anE-} -> t{-anG-}
+         {-# L #-}
+         g3_anq =
+             \ y_r3u  :: 
+                   t{-anE-}
+               {-# L #-}
+               y_r3u ->
+                 f3_anp
+                     y_r3u;
+       } in 
+         PrelTup.(,){-62,p-}{i}
+             {_@_ (t{-anE-} -> t{-anG-})
+              _@_ (t{-anE-} -> t{-anG-})
+              f3_anp
+              g3_anq}
+f3{-r3C,x-}  :: 
+    _forall_ [t{-anE-} t{-anG-}] => t{-anE-} -> t{-anG-}
+{-# L #-}
+f3{-r3C,x-} =
+    _/\_ t{-anE-} t{-anG-} ->
+       case
+           ds_dtM
+               _@_ t{-anE-} _@_ t{-anG-}
+       of {
+       PrelTup.(,){-62,p-}{i} ds_duR ds_duS  ->
+       ds_duR;}
+g3{-r3B,x-}  :: 
+    _forall_ [t{-anE-} t{-anG-}] => t{-anE-} -> t{-anG-}
+{-# L #-}
+g3{-r3B,x-} =
+    _/\_ t{-anE-} t{-anG-} ->
+       case
+           ds_dtM
+               _@_ t{-anE-} _@_ t{-anG-}
+       of {
+       PrelTup.(,){-62,p-}{i} ds_dvb ds_dva  ->
+       ds_dva;}
+end Rec }
+g2{-r3E,x-}  :: 
+    _forall_ [t{-anO-}] => t{-anO-} -> t{-anO-}
+{-# L #-}
+g2{-r3E,x-} =
+    _/\_ t{-anO-} -> \ y_r3o  :: 
+                          t{-anO-}
+                      {-# L #-}
+                      y_r3o ->
+       y_r3o
+f2{-r3D,x-}  :: 
+    _forall_ [t{-anU-}] => t{-anU-} -> t{-anU-}
+{-# L #-}
+f2{-r3D,x-} =
+    _/\_ t{-anU-} -> \ x_r3q  :: 
+                          t{-anU-}
+                      {-# L #-}
+                      x_r3q ->
+       g2{-r3E,x-}
+           _@_ t{-anU-} x_r3q
+g1{-r3F,x-}  :: 
+    _forall_ [t{-ao4-}] => t{-ao4-} -> t{-ao4-}
+{-# L #-}
+g1{-r3F,x-} =
+    _/\_ t{-ao4-} -> \ y_r3m  :: 
+                          t{-ao4-}
+                      {-# L #-}
+                      y_r3m ->
+       y_r3m
+f1{-r3G,x-}  :: 
+    _forall_ [t{-aoa-}] => t{-aoa-} -> t{-aoa-}
+{-# L #-}
+f1{-r3G,x-} =
+    _/\_ t{-aoa-} -> \ x_r3k  :: 
+                          t{-aoa-}
+                      {-# L #-}
+                      x_r3k ->
+       g1{-r3F,x-}
+           _@_ t{-aoa-} x_r3k
+
+NOTE: Simplifier still going after 4 iterations; bailing out.
diff --git a/ghc/tests/deSugar/should_compile/ds034.hs b/ghc/tests/deSugar/should_compile/ds034.hs
new file mode 100644 (file)
index 0000000..d1f2786
--- /dev/null
@@ -0,0 +1,11 @@
+--!!! mutually-recursive methods in an instance declaration
+--
+module Test where
+
+class Foo a where
+    op1 :: a -> a 
+    op2 :: a -> a 
+
+instance Foo Int where
+    op1 x = op2 x
+    op2 y = op1 y
diff --git a/ghc/tests/deSugar/should_compile/ds034.stderr b/ghc/tests/deSugar/should_compile/ds034.stderr
new file mode 100644 (file)
index 0000000..9a2659f
--- /dev/null
@@ -0,0 +1,110 @@
+
+
+================================================================================
+Desugared:
+Rec {
+op1{-r3r,x-}  :: 
+    _forall_
+    [a{-r3p-}]
+    =>
+    {Foo{-r3s,x-} a{-r3p-}} -> a{-r3p-} -> a{-r3p-}
+{-# L #-}
+op1{-r3r,x-} =
+    _/\_ a{-r3p-} -> \ tpl_B1  :: 
+                          {Foo{-r3s,x-} a{-r3p-}}
+                      {-# L #-}
+                      tpl_B1 ->
+       case tpl_B1 of { PrelTup.(,){-62,p-}{i} tpl_B1 tpl_B2  -> tpl_B1;}
+op2{-r3q,x-}  :: 
+    _forall_
+    [a{-r3p-}]
+    =>
+    {Foo{-r3s,x-} a{-r3p-}} -> a{-r3p-} -> a{-r3p-}
+{-# L #-}
+op2{-r3q,x-} =
+    _/\_ a{-r3p-} -> \ tpl_B1  :: 
+                          {Foo{-r3s,x-} a{-r3p-}}
+                      {-# L #-}
+                      tpl_B1 ->
+       case tpl_B1 of { PrelTup.(,){-62,p-}{i} tpl_B1 tpl_B2  -> tpl_B2;}
+$mop1{-rn8,x-}  :: 
+    _forall_
+    [a{-r3p-}]
+    =>
+    {Foo{-r3s,x-} a{-r3p-}} -> a{-r3p-} -> a{-r3p-}
+{-# L #-}
+$mop1{-rn8,x-} =
+    _/\_ a{-anB-} -> \ d.Foo_anu  :: 
+                          {Foo{-r3s,x-} a{-anB-}}
+                      {-# L #-}
+                      d.Foo_anu ->
+       GHCerr.noDefaultMethodError{-8k,p-}
+           _@_ (a{-anB-} -> a{-anB-}) _string_ "Class Foo Method op1"
+$mop2{-rn7,x-}  :: 
+    _forall_
+    [a{-r3p-}]
+    =>
+    {Foo{-r3s,x-} a{-r3p-}} -> a{-r3p-} -> a{-r3p-}
+{-# L #-}
+$mop2{-rn7,x-} =
+    _/\_ a{-anB-} -> \ d.Foo_anE  :: 
+                          {Foo{-r3s,x-} a{-anB-}}
+                      {-# L #-}
+                      d.Foo_anE ->
+       GHCerr.noDefaultMethodError{-8k,p-}
+           _@_ (a{-anB-} -> a{-anB-}) _string_ "Class Foo Method op2"
+op2_aq8  :: 
+    PrelBase.Int{-3g,p-} -> PrelBase.Int{-3g,p-}
+{-# L #-}
+op2_aq8 =
+    op2_aqv
+op1_aqd  :: 
+    PrelBase.Int{-3g,p-} -> PrelBase.Int{-3g,p-}
+{-# L #-}
+op1_aqd =
+    op1_aqm
+op1_an6  :: 
+    PrelBase.Int{-3g,p-} -> PrelBase.Int{-3g,p-}
+{-# L #-}
+op1_an6 =
+    \ x_r3i  :: 
+         PrelBase.Int{-3g,p-}
+      {-# L #-}
+      x_r3i ->
+       op2_aq8
+           x_r3i
+op1_aqm  :: 
+    PrelBase.Int{-3g,p-} -> PrelBase.Int{-3g,p-}
+{-# L #-}
+op1_aqm =
+    op1_an6
+op2_anj  :: 
+    PrelBase.Int{-3g,p-} -> PrelBase.Int{-3g,p-}
+{-# L #-}
+op2_anj =
+    \ y_r3m  :: 
+         PrelBase.Int{-3g,p-}
+      {-# L #-}
+      y_r3m ->
+       op1_aqd
+           y_r3m
+op2_aqv  :: 
+    PrelBase.Int{-3g,p-} -> PrelBase.Int{-3g,p-}
+{-# L #-}
+op2_aqv =
+    op2_anj
+d.Foo_an3  :: 
+    {Foo{-r3s,x-} PrelBase.Int{-3g,p-}}
+{-# L #-}
+d.Foo_an3 =
+    PrelTup.(,){-62,p-}{i}
+       {_@_ (PrelBase.Int{-3g,p-} -> PrelBase.Int{-3g,p-})
+        _@_ (PrelBase.Int{-3g,p-} -> PrelBase.Int{-3g,p-})
+        op1_aqm
+        op2_aqv}
+$d1{-rqE,x-}  :: 
+    {Foo{-r3s,x-} PrelBase.Int{-3g,p-}}
+{-# L #-}
+$d1{-rqE,x-} =
+    d.Foo_an3
+end Rec }
diff --git a/ghc/tests/deSugar/should_compile/ds035.hs b/ghc/tests/deSugar/should_compile/ds035.hs
new file mode 100644 (file)
index 0000000..5a29a0e
--- /dev/null
@@ -0,0 +1,18 @@
+data CList = CNil | CCons Int# CList
+
+mk :: Int# -> CList
+mk n = case (n ==# 0#) of
+       0# -> CNil
+       _  -> CCons 1# (mk (n `minusInt#` 1#))
+
+clen :: CList -> Int#
+clen CNil = 0#
+clen (CCons _ cl) = 1# +# (clen cl)
+
+main = case len4_twice of
+           8# -> "bingo\n"
+           _  -> "oops\n"
+  where
+    list4      = mk 4#
+    len4       = clen list4
+    len4_twice = len4 +# len4
diff --git a/ghc/tests/deSugar/should_compile/ds035.stderr b/ghc/tests/deSugar/should_compile/ds035.stderr
new file mode 100644 (file)
index 0000000..1aa6581
--- /dev/null
@@ -0,0 +1,24 @@
+ds035.hs:3:
+    Type constructor or class not in scope: `Int#'
+ds035.hs:8:
+    Type constructor or class not in scope: `Int#'
+ds035.hs:4:
+    Value not in scope: `==#'
+ds035.hs:6:
+    Value not in scope: `minusInt#'
+ds035.hs:10:
+    Value not in scope: `+#'
+ds035.hs:18:
+    Value not in scope: `+#'
+ds035.hs:3:
+    Type constructor or class not in scope: `Int#'
+
+
+Compilation had errors
diff --git a/ghc/tests/deSugar/should_compile/ds036.hs b/ghc/tests/deSugar/should_compile/ds036.hs
new file mode 100644 (file)
index 0000000..fc30c07
--- /dev/null
@@ -0,0 +1,45 @@
+{-
+From dmc@minster.york.ac.uk Tue Mar 10 17:15:20 1992
+Via: uk.ac.york.minster; Tue, 10 Mar 92 17:15:14 GMT
+Message-Id: <swordfish.700247842@minster.york.ac.uk>
+From: dmc@minster.york.ac.uk
+To: partain
+Date:       10 Mar 1992 17:17:21 GMT
+
+Will,
+
+I have just started using Haskell at York and have found a compilation 
+error in the code below which disappears when the last line is 
+commented out
+-}
+
+module Test2 where
+
+--brack :: (Eq a) => a -> a -> [a] -> ([a],[a])
+--brack open close = brack' open close (1 :: Int)
+
+brack' :: (Eq a) => a -> a -> Int -> [a] -> ([a],[a])
+brack' open close 0 xs = ([],xs)
+brack' open close (n+1) [] = ([],[])
+brack' open close (n+1) (h:t) | h == open = ([],[])
+
+{-
+Is this something I have done wrong or a fault with the compiler?
+
+Cheers
+Dave
+
+
+-----------------------------------------------------------------------
+David Cattrall                 Telephone +44 904 432777
+Department of Computer Science 
+University of York             JANET:  dmc@uk.ac.york.minster
+YORK Y01 5DD
+United Kingdom                 UUNET:  uucp!ukc!minster!dmc
+-----------------------------------------------------------------------
+-}
+
+-- and this was Kevin's idea, subsequently...
+
+kh (n+2) x | x > n = x * 2
+kh (x+1) (m+1) = m
diff --git a/ghc/tests/deSugar/should_compile/ds036.stderr b/ghc/tests/deSugar/should_compile/ds036.stderr
new file mode 100644 (file)
index 0000000..615b7df
--- /dev/null
@@ -0,0 +1,539 @@
+ds036.hs:44: 
+    Warning: Possibly incomplete patterns
+       in the definition of function `kh'
+ds036.hs:22: 
+    Warning: Possibly incomplete patterns
+       in the definition of function `brack''
+
+
+================================================================================
+Desugared:
+Rec {
+d.Num_aZF  :: 
+    {PrelBase.Num{-2c,p-} PrelBase.Int{-3g,p-}}
+{-# L #-}
+d.Num_aZF =
+    PrelBase.$d3{-rbz,p-}
+fromInt_a19P  :: 
+    PrelBase.Int{-3g,p-} -> PrelBase.Int{-3g,p-}
+{-# L #-}
+fromInt_a19P =
+    PrelBase.fromInt{-8R,p-}
+       _@_ PrelBase.Int{-3g,p-} d.Num_aZF
+lit_a1a1  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+lit_a1a1 =
+    let {
+      ds_d1aS  :: 
+         PrelBase.Int{-3g,p-}
+      {-# L #-}
+      ds_d1aS =
+         PrelBase.I#{-5b,p-}{i}
+             0
+    } in 
+      fromInt_a19P
+         ds_d1aS
+d.Eq_aZI  :: 
+    {PrelBase.Eq{-23,p-} PrelBase.Int{-3g,p-}}
+{-# L #-}
+d.Eq_aZI =
+    PrelBase.$d7{-rc5,p-}
+==_a1a0  :: 
+    PrelBase.Int{-3g,p-}
+    -> PrelBase.Int{-3g,p-}
+    -> PrelBase.Bool{-34,p-}
+{-# L #-}
+==_a1a0 =
+    PrelBase.=={-8Y,p-}
+       _@_ PrelBase.Int{-3g,p-} d.Eq_aZI
+fromInt_a19Z  :: 
+    PrelBase.Int{-3g,p-} -> PrelBase.Int{-3g,p-}
+{-# L #-}
+fromInt_a19Z =
+    fromInt_a19P
+lit_a19Y  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+lit_a19Y =
+    let {
+      ds_d1bg  :: 
+         PrelBase.Int{-3g,p-}
+      {-# L #-}
+      ds_d1bg =
+         PrelBase.I#{-5b,p-}{i}
+             1
+    } in 
+      fromInt_a19Z
+         ds_d1bg
+d.Ord_aZM  :: 
+    {PrelBase.Ord{-2d,p-} PrelBase.Int{-3g,p-}}
+{-# L #-}
+d.Ord_aZM =
+    PrelBase.$d6{-rc4,p-}
+>=_a19X  :: 
+    PrelBase.Int{-3g,p-}
+    -> PrelBase.Int{-3g,p-}
+    -> PrelBase.Bool{-34,p-}
+{-# L #-}
+>=_a19X =
+    PrelBase.>={-8Z,p-}
+       _@_ PrelBase.Int{-3g,p-} d.Ord_aZM
+d.Num_aZP  :: 
+    {PrelBase.Num{-2c,p-} PrelBase.Int{-3g,p-}}
+{-# L #-}
+d.Num_aZP =
+    d.Num_aZF
+-_a19W  :: 
+    PrelBase.Int{-3g,p-}
+    -> PrelBase.Int{-3g,p-}
+    -> PrelBase.Int{-3g,p-}
+{-# L #-}
+-_a19W =
+    PrelBase.-{-817,p-}
+       _@_ PrelBase.Int{-3g,p-} d.Num_aZP
+kh{-r3g,x-}  :: 
+    _forall_
+    [t{-aYd-}]
+    =>
+    {PrelBase.Num{-2c,p-} t{-aYd-}}
+    -> {PrelBase.Ord{-2d,p-} t{-aYd-}}
+    -> t{-aYd-}
+    -> t{-aYd-}
+    -> t{-aYd-}
+{-# L #-}
+kh{-r3g,x-} =
+    _/\_ t{-aYd-} -> \ d.Num_aYs  :: 
+                          {PrelBase.Num{-2c,p-} t{-aYd-}}
+                      {-# L #-}
+                      d.Num_aYs d.Ord_aYu  :: 
+                                    {PrelBase.Ord{-2d,p-} t{-aYd-}}
+                                {-# L #-}
+                                d.Ord_aYu ->
+       let {
+         fromInt_a1cx  :: 
+             PrelBase.Int{-3g,p-} -> t{-aYd-}
+         {-# L #-}
+         fromInt_a1cx =
+             PrelBase.fromInt{-8R,p-}
+                 _@_ t{-aYd-} d.Num_aYs } in
+       let { lit_a1cw  :: 
+                 t{-aYd-}
+             {-# L #-}
+             lit_a1cw =
+         let {
+           ds_d1cN  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d1cN =
+               PrelBase.I#{-5b,p-}{i}
+                   2
+         } in 
+           fromInt_a1cx
+               ds_d1cN
+       } in
+       let {
+         >=_a1cv  :: 
+             t{-aYd-} -> t{-aYd-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         >=_a1cv =
+             PrelBase.>={-8Z,p-}
+                 _@_ t{-aYd-} d.Ord_aYu } in
+       let {
+         d.Num_aYw  :: 
+             {PrelBase.Num{-2c,p-} t{-aYd-}}
+         {-# L #-}
+         d.Num_aYw =
+             d.Num_aYs } in
+       let {
+         -_a1cu  :: 
+             t{-aYd-} -> t{-aYd-} -> t{-aYd-}
+         {-# L #-}
+         -_a1cu =
+             PrelBase.-{-817,p-}
+                 _@_ t{-aYd-} d.Num_aYw } in
+       let {
+         d.Ord_aYy  :: 
+             {PrelBase.Ord{-2d,p-} t{-aYd-}}
+         {-# L #-}
+         d.Ord_aYy =
+             d.Ord_aYu } in
+       let {
+         >_a1ct  :: 
+             t{-aYd-} -> t{-aYd-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         >_a1ct =
+             PrelBase.>{-rdf,p-}
+                 _@_ t{-aYd-} d.Ord_aYy } in
+       let {
+         d.Num_aYA  :: 
+             {PrelBase.Num{-2c,p-} t{-aYd-}}
+         {-# L #-}
+         d.Num_aYA =
+             d.Num_aYs } in
+       let {
+         *_a1cs  :: 
+             t{-aYd-} -> t{-aYd-} -> t{-aYd-}
+         {-# L #-}
+         *_a1cs =
+             PrelBase.*{-rd8,p-}
+                 _@_ t{-aYd-} d.Num_aYA } in
+       let {
+         lit_a1cr  :: 
+             t{-aYd-}
+         {-# L #-}
+         lit_a1cr =
+             lit_a1cw } in
+       let {
+         fromInt_a1cq  :: 
+             PrelBase.Int{-3g,p-} -> t{-aYd-}
+         {-# L #-}
+         fromInt_a1cq =
+             fromInt_a1cx } in
+       let { lit_a1cp  :: 
+                 t{-aYd-}
+             {-# L #-}
+             lit_a1cp =
+         let {
+           ds_d1dC  :: 
+               PrelBase.Int{-3g,p-}
+           {-# L #-}
+           ds_d1dC =
+               PrelBase.I#{-5b,p-}{i}
+                   1
+         } in 
+           fromInt_a1cq
+               ds_d1dC
+       } in
+       let {
+         >=_a1co  :: 
+             t{-aYd-} -> t{-aYd-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         >=_a1co =
+             >=_a1cv } in
+       let {
+         -_a1cn  :: 
+             t{-aYd-} -> t{-aYd-} -> t{-aYd-}
+         {-# L #-}
+         -_a1cn =
+             -_a1cu } in
+       let {
+         lit_a1cm  :: 
+             t{-aYd-}
+         {-# L #-}
+         lit_a1cm =
+             lit_a1cp } in
+       let {
+         >=_a1cl  :: 
+             t{-aYd-} -> t{-aYd-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         >=_a1cl =
+             >=_a1cv } in
+       let {
+         -_a1ck  :: 
+             t{-aYd-} -> t{-aYd-} -> t{-aYd-}
+         {-# L #-}
+         -_a1ck =
+             -_a1cu
+       } in 
+         \ ds_d1e9  :: 
+               t{-aYd-}
+           {-# L #-}
+           ds_d1e9 x_r3H  :: 
+                       t{-aYd-}
+                   {-# L #-}
+                   x_r3H ->
+             let {
+               fail_d1em  :: 
+                   t{-aYd-}
+               {-# L #-}
+               fail_d1em =
+                   GHCerr.patError{-8r,p-}
+                       _@_ t{-aYd-} _string_ "ds036.hs:44|function `kh'" } in
+             let {
+               fail_d1fO  :: 
+                   t{-aYd-}
+               {-# L #-}
+               fail_d1fO =
+                   case
+                       (\ ds_d1eg  :: 
+                              t{-aYd-}
+                          {-# L #-}
+                          ds_d1eg ->
+                            >=_a1co
+                                ds_d1eg lit_a1cp)
+                           ds_d1e9
+                   of {
+                     PrelBase.True{-5E,p-}{i} ->
+                         let {
+                           x_r3J  :: 
+                               t{-aYd-}
+                           {-# L #-}
+                           x_r3J =
+                               (\ ds_d1eG  :: 
+                                      t{-aYd-}
+                                  {-# L #-}
+                                  ds_d1eG ->
+                                    -_a1cn
+                                        ds_d1eG lit_a1cp)
+                                   ds_d1e9
+                         } in 
+                           case
+                               (\ ds_d1eW  :: 
+                                      t{-aYd-}
+                                  {-# L #-}
+                                  ds_d1eW ->
+                                    >=_a1cl
+                                        ds_d1eW lit_a1cm)
+                                   x_r3H
+                           of {
+                             PrelBase.True{-5E,p-}{i} ->
+                                 (\ ds_d1fk  :: 
+                                        t{-aYd-}
+                                    {-# L #-}
+                                    ds_d1fk ->
+                                      -_a1ck
+                                          ds_d1fk lit_a1cm)
+                                     x_r3H;
+                             PrelBase.False{-58,p-}{i} ->
+                                 fail_d1em;
+                           };
+                     PrelBase.False{-58,p-}{i} ->
+                         fail_d1em;
+                   }
+             } in 
+               case
+                   (\ ds_d1fI  :: 
+                          t{-aYd-}
+                      {-# L #-}
+                      ds_d1fI ->
+                        >=_a1cv
+                            ds_d1fI lit_a1cw)
+                       ds_d1e9
+               of {
+                 PrelBase.True{-5E,p-}{i} ->
+                     let {
+                       n_r3F  :: 
+                           t{-aYd-}
+                       {-# L #-}
+                       n_r3F =
+                           (\ ds_d1g8  :: 
+                                  t{-aYd-}
+                              {-# L #-}
+                              ds_d1g8 ->
+                                -_a1cu
+                                    ds_d1g8 lit_a1cw)
+                               ds_d1e9
+                     } in 
+                       case
+                           >_a1ct
+                               x_r3H n_r3F
+                       of {
+                         PrelBase.True{-5E,p-}{i} ->
+                             *_a1cs
+                                 x_r3H lit_a1cr;
+                         PrelBase.False{-58,p-}{i} ->
+                             fail_d1fO;
+                       };
+                 PrelBase.False{-58,p-}{i} ->
+                     fail_d1fO;
+               }
+brack'{-r3f,x-}  :: 
+    _forall_
+    [a{-aYI-}]
+    =>
+    {PrelBase.Eq{-23,p-} a{-aYI-}}
+    -> a{-aYI-}
+    -> a{-aYI-}
+    -> PrelBase.Int{-3g,p-}
+    -> [a{-aYI-}]
+    -> ([a{-aYI-}], [a{-aYI-}])
+{-# L #-}
+brack'{-r3f,x-} =
+    _/\_ a{-aYI-} -> \ d.Eq_aZs  :: 
+                          {PrelBase.Eq{-23,p-} a{-aYI-}}
+                      {-# L #-}
+                      d.Eq_aZs ->
+       let {
+         lit_a1h1  :: 
+             PrelBase.Int{-3g,p-}
+         {-# L #-}
+         lit_a1h1 =
+             lit_a19Y } in
+       let {
+         >=_a1h0  :: 
+             PrelBase.Int{-3g,p-}
+             -> PrelBase.Int{-3g,p-}
+             -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         >=_a1h0 =
+             >=_a19X } in
+       let {
+         -_a1gZ  :: 
+             PrelBase.Int{-3g,p-}
+             -> PrelBase.Int{-3g,p-}
+             -> PrelBase.Int{-3g,p-}
+         {-# L #-}
+         -_a1gZ =
+             -_a19W } in
+       let {
+         d.Eq_aZC  :: 
+             {PrelBase.Eq{-23,p-} a{-aYI-}}
+         {-# L #-}
+         d.Eq_aZC =
+             d.Eq_aZs } in
+       let {
+         ==_a1gY  :: 
+             a{-aYI-} -> a{-aYI-} -> PrelBase.Bool{-34,p-}
+         {-# L #-}
+         ==_a1gY =
+             PrelBase.=={-8Y,p-}
+                 _@_ a{-aYI-} d.Eq_aZC
+       } in 
+         \ open_r3i  :: 
+               a{-aYI-}
+           {-# L #-}
+           open_r3i close_r3k  :: 
+                        a{-aYI-}
+                    {-# L #-}
+                    close_r3k ds_d1hB  :: 
+                                  PrelBase.Int{-3g,p-}
+                              {-# L #-}
+                              ds_d1hB xs_r3n  :: 
+                                          [a{-aYI-}]
+                                      {-# L #-}
+                                      xs_r3n ->
+             let {
+               fail_d1hO  :: 
+                   ([a{-aYI-}], [a{-aYI-}])
+               {-# L #-}
+               fail_d1hO =
+                   GHCerr.patError{-8r,p-}
+                       _@_ ([a{-aYI-}], [a{-aYI-}])
+                       _string_ "ds036.hs:22|function `brack''" } in
+             let {
+               fail_d1jT  :: 
+                   ([a{-aYI-}], [a{-aYI-}])
+               {-# L #-}
+               fail_d1jT =
+                   case
+                       (\ ds_d1hI  :: 
+                              PrelBase.Int{-3g,p-}
+                          {-# L #-}
+                          ds_d1hI ->
+                            >=_a19X
+                                ds_d1hI lit_a19Y)
+                           ds_d1hB
+                   of {
+                     PrelBase.True{-5E,p-}{i} ->
+                         let {
+                           n_r3t  :: 
+                               PrelBase.Int{-3g,p-}
+                           {-# L #-}
+                           n_r3t =
+                               (\ ds_d1i8  :: 
+                                      PrelBase.Int{-3g,p-}
+                                  {-# L #-}
+                                  ds_d1i8 ->
+                                    -_a19W
+                                        ds_d1i8 lit_a19Y)
+                                   ds_d1hB
+                         } in 
+                           case xs_r3n of {
+                             PrelBase.[]{-5i,p-}{i} ->
+                                 let {
+                                   close_r3r  :: 
+                                       a{-aYI-}
+                                   {-# L #-}
+                                   close_r3r =
+                                       close_r3k } in
+                                 let {
+                                   open_r3p  :: 
+                                       a{-aYI-}
+                                   {-# L #-}
+                                   open_r3p =
+                                       open_r3i } in
+                                 let {
+                                   ds_d1iz  :: 
+                                       [a{-aYI-}]
+                                   {-# L #-}
+                                   ds_d1iz =
+                                       PrelBase.[]{-5i,p-}{i}
+                                           _@_ a{-aYI-} } in
+                                 let {
+                                   ds_d1iD  :: 
+                                       [a{-aYI-}]
+                                   {-# L #-}
+                                   ds_d1iD =
+                                       PrelBase.[]{-5i,p-}{i}
+                                           _@_ a{-aYI-}
+                                 } in 
+                                   PrelTup.(,){-62,p-}{i}
+                                       {_@_ [a{-aYI-}] _@_ [a{-aYI-}] ds_d1iz ds_d1iD};
+                             PrelBase.:{-55,p-}{i} h_r3C t_r3D ->
+                                 let {
+                                   n_r3A  :: 
+                                       PrelBase.Int{-3g,p-}
+                                   {-# L #-}
+                                   n_r3A =
+                                       n_r3t } in
+                                 let {
+                                   close_r3y  :: 
+                                       a{-aYI-}
+                                   {-# L #-}
+                                   close_r3y =
+                                       close_r3k } in
+                                 let {
+                                   open_r3w  :: 
+                                       a{-aYI-}
+                                   {-# L #-}
+                                   open_r3w =
+                                       open_r3i
+                                 } in 
+                                   case
+                                       ==_a1gY
+                                           h_r3C open_r3w
+                                   of {
+                                     PrelBase.True{-5E,p-}{i} ->
+                                         let {
+                                           ds_d1ju  :: 
+                                               [a{-aYI-}]
+                                           {-# L #-}
+                                           ds_d1ju =
+                                               PrelBase.[]{-5i,p-}{i}
+                                                   _@_ a{-aYI-} } in
+                                         let {
+                                           ds_d1jy  :: 
+                                               [a{-aYI-}]
+                                           {-# L #-}
+                                           ds_d1jy =
+                                               PrelBase.[]{-5i,p-}{i}
+                                                   _@_ a{-aYI-}
+                                         } in 
+                                           PrelTup.(,){-62,p-}{i}
+                                               {_@_ [a{-aYI-}] _@_ [a{-aYI-}] ds_d1ju ds_d1jy};
+                                     PrelBase.False{-58,p-}{i} ->
+                                         fail_d1hO;
+                                   };
+                           };
+                     PrelBase.False{-58,p-}{i} ->
+                         fail_d1hO;
+                   }
+             } in 
+               case ds_d1hB of { PrelBase.I#{-5b,p-}{i} ds_d1k2  ->
+               case# ds_d1k2 of {
+                 0 ->
+                     let {
+                       ds_d1kh  :: 
+                           [a{-aYI-}]
+                       {-# L #-}
+                       ds_d1kh =
+                           PrelBase.[]{-5i,p-}{i}
+                               _@_ a{-aYI-}
+                     } in 
+                       PrelTup.(,){-62,p-}{i}
+                           {_@_ [a{-aYI-}] _@_ [a{-aYI-}] ds_d1kh xs_r3n};
+                 ds_d1kt ->
+                     fail_d1jT;
+               };}
+end Rec }
diff --git a/ghc/tests/deSugar/should_compile/ds037.hs b/ghc/tests/deSugar/should_compile/ds037.hs
new file mode 100644 (file)
index 0000000..6485341
--- /dev/null
@@ -0,0 +1,6 @@
+--!!! AbsBinds with tyvars, no dictvars, but some dict binds
+--
+module ShouldSucceed where
+
+f x y = (fst (g y x), x+(1::Int))
+g x y = (fst (f x y), y+(1::Int))
diff --git a/ghc/tests/deSugar/should_compile/ds037.stderr b/ghc/tests/deSugar/should_compile/ds037.stderr
new file mode 100644 (file)
index 0000000..cb76a7e
--- /dev/null
@@ -0,0 +1,189 @@
+
+
+================================================================================
+Desugared:
+Rec {
+d.Num_aXF  :: 
+    {PrelBase.Num{-2c,p-} PrelBase.Int{-3g,p-}}
+{-# L #-}
+d.Num_aXF =
+    PrelBase.$d3{-rbd,p-}
++_aZO  :: 
+    PrelBase.Int{-3g,p-}
+    -> PrelBase.Int{-3g,p-}
+    -> PrelBase.Int{-3g,p-}
+{-# L #-}
++_aZO =
+    PrelBase.+{-r3m,p-}
+       _@_ PrelBase.Int{-3g,p-} d.Num_aXF
+d.Num_aXJ  :: 
+    {PrelBase.Num{-2c,p-} PrelBase.Int{-3g,p-}}
+{-# L #-}
+d.Num_aXJ =
+    d.Num_aXF
+fromInt_aZN  :: 
+    PrelBase.Int{-3g,p-} -> PrelBase.Int{-3g,p-}
+{-# L #-}
+fromInt_aZN =
+    PrelBase.fromInt{-8R,p-}
+       _@_ PrelBase.Int{-3g,p-} d.Num_aXJ
+lit_aZM  :: 
+    PrelBase.Int{-3g,p-}
+{-# L #-}
+lit_aZM =
+    let {
+      ds_d123  :: 
+         PrelBase.Int{-3g,p-}
+      {-# L #-}
+      ds_d123 =
+         PrelBase.I#{-5b,p-}{i}
+             1
+    } in 
+      fromInt_aZN
+         ds_d123
+ds_d11F  :: 
+    _forall_
+    [b{-aXa-}]
+    =>
+    (PrelBase.Int{-3g,p-}
+     -> PrelBase.Int{-3g,p-}
+     -> (b{-aXa-}, PrelBase.Int{-3g,p-}), PrelBase.Int{-3g,p-}
+                                         -> PrelBase.Int{-3g,p-}
+                                         -> (b{-aXa-}, PrelBase.Int{-3g,p-}))
+{-# L #-}
+ds_d11F =
+    _/\_ b{-aXa-} ->
+       _letrec_ {
+         +_aZQ  :: 
+             PrelBase.Int{-3g,p-}
+             -> PrelBase.Int{-3g,p-}
+             -> PrelBase.Int{-3g,p-}
+         {-# L #-}
+         +_aZQ =
+             +_aZO;
+         lit_aZP  :: 
+             PrelBase.Int{-3g,p-}
+         {-# L #-}
+         lit_aZP =
+             lit_aZM;
+         f_aWT  :: 
+             PrelBase.Int{-3g,p-}
+             -> PrelBase.Int{-3g,p-}
+             -> (b{-aXa-}, PrelBase.Int{-3g,p-})
+         {-# L #-}
+         f_aWT =
+             \ x_r3e  :: 
+                   PrelBase.Int{-3g,p-}
+               {-# L #-}
+               x_r3e y_r3g  :: 
+                         PrelBase.Int{-3g,p-}
+                     {-# L #-}
+                     y_r3g ->
+                 let { ds_d12N  :: 
+                           b{-aXa-}
+                       {-# L #-}
+                       ds_d12N =
+                   let {
+                     ds_d133  :: 
+                         (b{-aXa-}, PrelBase.Int{-3g,p-})
+                     {-# L #-}
+                     ds_d133 =
+                         g_aWU
+                             y_r3g x_r3e
+                   } in 
+                     PrelTup.fst{-riN,p-}
+                         _@_ PrelBase.Int{-3g,p-} _@_ b{-aXa-} ds_d133
+                 } in
+                 let {
+                   ds_d12R  :: 
+                       PrelBase.Int{-3g,p-}
+                   {-# L #-}
+                   ds_d12R =
+                       +_aZO
+                           x_r3e lit_aZM
+                 } in 
+                   PrelTup.(,){-62,p-}{i}
+                       {_@_ b{-aXa-} _@_ PrelBase.Int{-3g,p-} ds_d12N ds_d12R};
+         g_aWU  :: 
+             PrelBase.Int{-3g,p-}
+             -> PrelBase.Int{-3g,p-}
+             -> (b{-aXa-}, PrelBase.Int{-3g,p-})
+         {-# L #-}
+         g_aWU =
+             \ x_r3j  :: 
+                   PrelBase.Int{-3g,p-}
+               {-# L #-}
+               x_r3j y_r3l  :: 
+                         PrelBase.Int{-3g,p-}
+                     {-# L #-}
+                     y_r3l ->
+                 let { ds_d13B  :: 
+                           b{-aXa-}
+                       {-# L #-}
+                       ds_d13B =
+                   let {
+                     ds_d13R  :: 
+                         (b{-aXa-}, PrelBase.Int{-3g,p-})
+                     {-# L #-}
+                     ds_d13R =
+                         f_aWT
+                             x_r3j y_r3l
+                   } in 
+                     PrelTup.fst{-riN,p-}
+                         _@_ PrelBase.Int{-3g,p-} _@_ b{-aXa-} ds_d13R
+                 } in
+                 let {
+                   ds_d13F  :: 
+                       PrelBase.Int{-3g,p-}
+                   {-# L #-}
+                   ds_d13F =
+                       +_aZQ
+                           y_r3l lit_aZP
+                 } in 
+                   PrelTup.(,){-62,p-}{i}
+                       {_@_ b{-aXa-} _@_ PrelBase.Int{-3g,p-} ds_d13B ds_d13F};
+       } in 
+         PrelTup.(,){-62,p-}{i}
+             {_@_ (PrelBase.Int{-3g,p-}
+                   -> PrelBase.Int{-3g,p-}
+                   -> (b{-aXa-}, PrelBase.Int{-3g,p-}))
+              _@_ (PrelBase.Int{-3g,p-}
+                   -> PrelBase.Int{-3g,p-}
+                   -> (b{-aXa-}, PrelBase.Int{-3g,p-}))
+              f_aWT
+              g_aWU}
+f{-r3o,x-}  :: 
+    _forall_
+    [b{-aXa-}]
+    =>
+    PrelBase.Int{-3g,p-}
+    -> PrelBase.Int{-3g,p-}
+    -> (b{-aXa-}, PrelBase.Int{-3g,p-})
+{-# L #-}
+f{-r3o,x-} =
+    _/\_ b{-aXa-} ->
+       case
+           ds_d11F
+               _@_ b{-aXa-}
+       of {
+       PrelTup.(,){-62,p-}{i} ds_d14B ds_d14C  ->
+       ds_d14B;}
+g{-r3n,x-}  :: 
+    _forall_
+    [b{-aXa-}]
+    =>
+    PrelBase.Int{-3g,p-}
+    -> PrelBase.Int{-3g,p-}
+    -> (b{-aXa-}, PrelBase.Int{-3g,p-})
+{-# L #-}
+g{-r3n,x-} =
+    _/\_ b{-aXa-} ->
+       case
+           ds_d11F
+               _@_ b{-aXa-}
+       of {
+       PrelTup.(,){-62,p-}{i} ds_d14S ds_d14R  ->
+       ds_d14R;}
+end Rec }
+
+NOTE: Simplifier still going after 4 iterations; bailing out.
diff --git a/ghc/tests/deSugar/should_compile/ds038.hs b/ghc/tests/deSugar/should_compile/ds038.hs
new file mode 100644 (file)
index 0000000..ceffab1
--- /dev/null
@@ -0,0 +1,7 @@
+--!!! Jon Hill reported a bug in desugaring this in 0.09
+--!!! (recursive with n+k patts)
+--
+takeList :: Int -> [a] -> [a]
+takeList 0     _      = []
+takeList (n+1) []     = []
+takeList (n+1) (x:xs) = x : takeList n xs
diff --git a/ghc/tests/deSugar/should_compile/ds038.stderr b/ghc/tests/deSugar/should_compile/ds038.stderr
new file mode 100644 (file)
index 0000000..a45cd41
--- /dev/null
@@ -0,0 +1,5 @@
+ds038.hs:4: Module Main must include a definition for `Main.main'
+
+
+Compilation had errors
diff --git a/ghc/tests/deSugar/should_compile/ds039.hs b/ghc/tests/deSugar/should_compile/ds039.hs
new file mode 100644 (file)
index 0000000..e153bfa
--- /dev/null
@@ -0,0 +1,7 @@
+--!!! make sure correct type applications get put in
+--!!!   when (:) is saturated.
+
+module ShouldSucceed where
+
+
+f = (:)
diff --git a/ghc/tests/deSugar/should_compile/ds039.stderr b/ghc/tests/deSugar/should_compile/ds039.stderr
new file mode 100644 (file)
index 0000000..1ff3f31
--- /dev/null
@@ -0,0 +1,8 @@
+
+
+================================================================================
+Desugared:
+{-# L #-}
+f = _/\_ t{-amG-} ->
+       PrelBase.:
+           _@_ t{-amG-}
diff --git a/ghc/tests/deSugar/should_compile/ds040.hs b/ghc/tests/deSugar/should_compile/ds040.hs
new file mode 100644 (file)
index 0000000..d7fb621
--- /dev/null
@@ -0,0 +1,13 @@
+--!!! Another bug in overloaded n+k patts
+--
+
+main _ = [AppendChan stdout (shows ((4::Int) ^^^^ (6::Int)) "\n")]
+
+(^^^^)         :: (Num a, Integral b) => a -> b -> a
+x ^^^^ 0               =  1
+x ^^^^ (n+1)   =  f x n x
+                  where f _ 0 y = y
+                        f x n y = g x n  where
+                                  g x n | even n  = g (x*x) (n `quot` 2)
+                                        | otherwise = f x (n-1) (x*y)
+_ ^^^^ _               = error "(^^^^){Prelude}: negative exponent"
diff --git a/ghc/tests/deSugar/should_compile/ds040.stderr b/ghc/tests/deSugar/should_compile/ds040.stderr
new file mode 100644 (file)
index 0000000..0fe36a3
--- /dev/null
@@ -0,0 +1,9 @@
+ds040.hs:4:
+    Data constructor not in scope: `AppendChan'
+ds040.hs:4:
+    Value not in scope: `stdout'
+
+
+Compilation had errors
diff --git a/ghc/tests/deSugar/should_run/Makefile b/ghc/tests/deSugar/should_run/Makefile
new file mode 100644 (file)
index 0000000..ca6251d
--- /dev/null
@@ -0,0 +1,18 @@
+TOP = ../../../..
+include $(TOP)/mk/boilerplate.mk
+
+HS_SRCS = $(wildcard *.hs)
+BINS = $(patsubst %.o,%,$(HS_OBJS))
+
+SRC_RUNTEST_OPTS += -o1 $*.stdout -o2 $*.stderr -x 0
+HC_OPTS += -noC -dcore-lint
+
+all :: $(BINS)
+
+%.o : %
+       $(HC) $(HC_OPTS) $< -o $@
+
+
+include $(TOP)/mk/target.mk
+
+
diff --git a/ghc/tests/deSugar/should_run/ds003.hs b/ghc/tests/deSugar/should_run/ds003.hs
new file mode 100644 (file)
index 0000000..7b92ed2
--- /dev/null
@@ -0,0 +1,13 @@
+-- Tests match on empty field lists 
+
+module Main where
+
+data Person    =  Female {firstName, lastName :: String}
+               |  Male   {firstName, lastName :: String}
+               deriving (Show)
+
+isFemale (Female{})   =  True
+isFemale (Male{})     =  False
+
+main = print (isFemale (Female {firstName = "Jane"}))
+
diff --git a/ghc/tests/deSugar/should_run/ds004.hs b/ghc/tests/deSugar/should_run/ds004.hs
new file mode 100644 (file)
index 0000000..c70dd44
--- /dev/null
@@ -0,0 +1,11 @@
+-- Test n+k patterns
+
+module Main where
+
+f (n+1) = n
+
+g :: Int -> Int
+g (n+4) = n
+
+main = print (f 3)     >>
+       print (g 9)
diff --git a/ghc/tests/deSugar/should_run/ds005.hs b/ghc/tests/deSugar/should_run/ds005.hs
new file mode 100644 (file)
index 0000000..238a2c3
--- /dev/null
@@ -0,0 +1,46 @@
+{- 
+
+From: Olaf Chitil <chitil@Informatik.RWTH-Aachen.DE>
+
+It is a problem with 0.29 (which we use for compiling 2.01), it is gone
+in 2.01.
+
+       f :: Eq a => a -> [b] -> [b] -> Bool
+       f a [] [] = (a==a)
+       main = print (f True "" "Hallo")
+
+
+when run after compilation with 0.29 you get:
+Fail: "test.hs", line 6: incomplete pattern(s) to match in function "ds.d5b4"
+
+while 2.01 gives you as desired
+Fail: In pattern-matching: function f{-aYw-}; at test.hs, line 6
+
+The problem is the dictionary, because for the program
+
+       f :: a -> [b] -> [b] -> Bool
+       f a [] [] = True
+       main = print (f True "" "Hallo")
+
+0.29 gives the function name "f" as well.
+
+So it's ok in 2.01, but why did you change the form of the error messages?
+"incomplete pattern(s) to match" is more informative then "In pattern-matching"!
+I even prefer the order of information in the 0.29 error messages.
+
+May I finally repeat that in my opinion the compiler should warn about
+incomplete patterns during compilation. However, I suppose the
+incomplete patterns are just recognised by the desugarer which does
+not produce error messages any more.
+
+-}
+
+
+module Main where
+
+f :: Eq a => a -> [b] -> [b] -> Bool
+f a [] [] = (a==a)
+
+main = print (f True "" "Hallo")
+
+
diff --git a/ghc/tests/deSugar/should_run/ds006.hs b/ghc/tests/deSugar/should_run/ds006.hs
new file mode 100644 (file)
index 0000000..0bcda96
--- /dev/null
@@ -0,0 +1,33 @@
+{- 
+Date: Tue, 20 May 1997 05:10:04 GMT
+From: Tomasz Cholewo <tjchol01@mecca.spd.louisville.edu>
+
+ghc-2.03 cannot compile the following code, which I think is correct
+according to the Report
+
+       data X = A {a :: Int} | B {a :: Int}
+
+The error message is: 
+
+    Conflicting definitions for:  a
+       Defined at bug4.lhs:2
+       Defined at bug4.lhs:2
+
+In addition the following snippet
+
+       data X = A {a :: Int}
+       y = let A {a} = x
+           in a
+
+fails with:
+
+    bug4.lhs:4:5: Not a valid LHS on input: "in"
+-}
+--module Main(main) where
+
+data X = A {a :: Int} | B {a :: Int}
+
+f x = let A {a} = x
+      in a
+
+main = print (f (A {a = 3}))
diff --git a/ghc/tests/deSugar/should_run/dsrun001.hs b/ghc/tests/deSugar/should_run/dsrun001.hs
new file mode 100644 (file)
index 0000000..e40ea2a
--- /dev/null
@@ -0,0 +1,12 @@
+{-     Check that list comprehensions can be written
+       in do-notation. This actually broke 2.02, with
+       a pattern match failure in dsListComp!
+-}
+
+module Main where
+
+main = putStrLn (show theList)
+theList = do x <- [1..3]
+             y <- [1..3]
+             return (x,y)
+
diff --git a/ghc/tests/deSugar/should_run/dsrun002.hs b/ghc/tests/deSugar/should_run/dsrun002.hs
new file mode 100644 (file)
index 0000000..acad275
--- /dev/null
@@ -0,0 +1,14 @@
+{- Tests let-expressions in do-statments -}
+
+module Main( main ) where
+
+foo = do
+       putStr "a"
+       let x = "b" in putStr x
+       putStr "c"
+
+main = do
+        putStr "a"
+        foo
+        let x = "b" in putStrLn x
+