[fix hoisted updates of non unary nodes
John Meacham <john@repetae.net>**20051025023945] hunk ./Grin/EvalInline.hs 13
-data UpdateType = NoUpdate | TrailingUpdate | HoistedUpdate Val
+data UpdateType = NoUpdate | TrailingUpdate | HoistedUpdate Val | SwitchingUpdate [Atom]
hunk ./Grin/EvalInline.hs 30
-    | otherwise = p1 :->
+    | HoistedUpdate (NodeC t []) <- shared = p1 :->
hunk ./Grin/EvalInline.hs 32
+        Case n2 cs :>>= Tup [] :->
+        Return (NodeC t [])
+    | HoistedUpdate (NodeC t vs) <- shared = p1 :->
+        Fetch p1 :>>= n2 :->
+        Case n2 cs :>>= Tup vs :->
+        Return (NodeC t vs)
+    | NoUpdate <- shared = p1 :->
+        Fetch p1 :>>= n2 :->
hunk ./Grin/EvalInline.hs 49
+        | tagIsWHNF t, HoistedUpdate (NodeC t' []) <- shared  = case vs of
+            [] -> Return (Tup [])
+            _ -> error "createEval: bad thing"
+        | tagIsWHNF t, HoistedUpdate (NodeC t' vars) <- shared  = Return (Tup vs)
hunk ./Grin/EvalInline.hs 62
-        | HoistedUpdate udp@(NodeC t [v]) <- shared = App fname vs ty :>>= n3 :-> Return n3 :>>= udp :-> Update p1 udp :>>= unit :-> Return v
-        | HoistedUpdate udp <- shared = App fname vs ty :>>= n3 :-> (Return n3 :>>= udp :-> Update p1 udp) :>>= unit :-> Return n3
+        | HoistedUpdate udp@(NodeC t []) <- shared = App fname vs ty :>>= n3 :-> Update p1 udp
+        | HoistedUpdate udp@(NodeC t [v]) <- shared = App fname vs ty :>>= n3 :-> Return n3 :>>= udp :-> (Update p1 udp :>>= unit :-> Return v)
+        | HoistedUpdate udp@(NodeC t vars) <- shared = App fname vs ty :>>= n3 :-> (Return n3 :>>= udp :-> (Update p1 udp) :>>= unit :-> Return (Tup vars))
hunk ./Grin/PointsToAnalysis.hs 302
+        g (App a [vr@(Var v _)] _ :>>= node@(NodeC {}) :-> e) | a == funcEval = do
+                mtick "Grin.eval.hoisted2"
+                e' <- g e
+                return $ (Return vr :>>= createEval (HoistedUpdate node) typeEnv (tagsp v)) :>>= node :-> e'