summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-01-06 21:27:26 +0000
committeraarne <aarne@cs.chalmers.se>2008-01-06 21:27:26 +0000
commite1dda4b5d82d99bffd4045865700597f07e74299 (patch)
treedcd8e0c1a73c756f561d72835dc1c30539ae375b /src
parentfc65b10e0f689a51f2f856b43abfb6d266889a9b (diff)
fixed bugs in optimization of multiple application
Diffstat (limited to 'src')
-rw-r--r--src/GF/Grammar/Compute.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/GF/Grammar/Compute.hs b/src/GF/Grammar/Compute.hs
index e43cb5b8c..f2377f12e 100644
--- a/src/GF/Grammar/Compute.hs
+++ b/src/GF/Grammar/Compute.hs
@@ -81,7 +81,7 @@ computeTermOpt rec gr = comp where
h' <- comp g h
as' <- mapM (comp g) as
case h' of
-
+ _ | not (null [() | FV _ <- as']) -> compApp g (mkApp h' as')
c@(QC _ _) -> do
return $ mkApp c as'
Q (IC "Predef") f -> do
@@ -92,7 +92,8 @@ computeTermOpt rec gr = comp where
let (xs,b) = termFormCnc h'
let g' = (zip xs as') ++ g
let as2 = drop (length xs) as'
- b' <- comp g' b
+ let xs2 = drop (length as') xs
+ b' <- comp g' (mkAbs xs2 b)
if null as2 then return b' else comp g (mkApp b' as2)
_ -> compApp g (mkApp h' as')