[perform case hoisting when only a single alternative is not in whnf
John Meacham <john@repetae.net>**20051025153459] hunk ./Grin/EvalInline.hs 8
+import List
hunk ./Grin/EvalInline.hs 16
+mapExp f (b :-> e) = b :-> f e
+
hunk ./Grin/EvalInline.hs 44
+    | SwitchingUpdate sts <- shared, [ot] <- ofts = p1 :->
+        Fetch p1 :>>= n2 :->
+        Case n2 (mapExp (:>>= sup p1 sts) (f ot):map f whnfts)
+
hunk ./Grin/EvalInline.hs 55
-        in (p1 :-> (Return p1 :>>= lf) :>>= n3 :-> Case n3 (concatMap cu sts) :>>= unit :-> Return n3)
+        in (p1 :-> (Return p1 :>>= lf) :>>= sup p1 sts) --  n3 :-> Case n3 (concatMap cu sts) :>>= unit :-> Return n3)
hunk ./Grin/EvalInline.hs 57
+    sup p sts = let
+            cu t | tagIsTag t && tagIsWHNF t = return ans where
+                (ts,_) = runIdentity $ findArgsType te t
+                vs = [ Var v ty |  v <- [V 4 .. ] | ty <- ts]
+                ans = NodeC t vs :-> Update p1 (NodeC t vs)
+            cu t = error $ "not updatable:" ++ show t
+        in (n3 :-> Case n3 (concatMap cu sts) :>>= unit :-> Return n3)
hunk ./Grin/EvalInline.hs 67
+    (whnfts,ofts) = partition tagIsWHNF (filter tagIsTag ts)