[in E.ToHs, support negative literals, make simpler decisions about whether to insert unsafeCoerce's due to boxing. collect constructors in patterns as well as expressions
John Meacham <john@repetae.net>**20061115044736] hunk ./E/ToHs.hs 159
-showCon c [] | c == rt_int = text "Int#"
-showCon c [] | c == rt_HsChar = text "Char#"
-showCon c [] | c == rt_HsPtr = text "Addr#"
hunk ./E/ToHs.hs 161
---showCon c [x,xs] | c == dc_Cons = parens $ x <> text ":" <> xs
---showCon c [] | c == dc_EmptyList = text "[]"
-
hunk ./E/ToHs.hs 196
+transE (ELit (LitInt num _)) | num < 0 = mparen $ return $ text (show num) <> text "#"
hunk ./E/ToHs.hs 208
-    env <- asks envCoerce
+    --env <- asks envCoerce
hunk ./E/ToHs.hs 210
-    case tvrIdent tvr `member` env of
+    --case tvrIdent tvr `member` env of
+    case hasBoxes (tvrType tvr) of
hunk ./E/ToHs.hs 219
-    local (\e -> e { envCoerce = envCoerce e `mappend` fromList [ tvrIdent t | (t,_) <- ds, hasBoxes (tvrType t)] }) $ do
-    ds' <- flip mapM ds $ \ (t,e) -> do
+    --local (\e -> e { envCoerce = envCoerce e `mappend` fromList [ tvrIdent t | (t,_) <- ds, hasBoxes (tvrType t)] }) $ do
+    ds' <- flip mapM ds $ \ (tvr,e) -> do
hunk ./E/ToHs.hs 222
-        tt <- noParens $ transType (tvrType t)
-        t <- transTVr t
+        tt <- noParens $ transType (tvrType tvr)
+        t <- transTVr tvr
hunk ./E/ToHs.hs 225
-        e <- noParens $ transE b
+        e <- case hasBoxes (tvrType tvr) of
+            False -> noParens $ transE b
+            True -> do
+                t <- transE b
+                return $ text "unsafeCoerce#" <+> t
hunk ./E/ToHs.hs 333
+    tell mempty { collNames = Set.singleton (c,length ts,False) }  -- XXX this shouldn't be needed