[project @ 1997-09-05 14:11:05 by simonm]
[ghc-hetmet.git] / ghc / tests / deSugar / should_compile / ds035.hs
index 5a29a0e..e6383bc 100644 (file)
@@ -1,17 +1,19 @@
+import GlaExts
+
 data CList = CNil | CCons Int# CList
 
 mk :: Int# -> CList
 mk n = case (n ==# 0#) of
-       0# -> CNil
-       _  -> CCons 1# (mk (n `minusInt#` 1#))
+       False -> CNil
+       _     -> CCons 1# (mk (n -# 1#))
 
 clen :: CList -> Int#
 clen CNil = 0#
 clen (CCons _ cl) = 1# +# (clen cl)
 
-main = case len4_twice of
+main = putStr (case len4_twice of
            8# -> "bingo\n"
-           _  -> "oops\n"
+           _  -> "oops\n")
   where
     list4      = mk 4#
     len4       = clen list4