1
0
forked from GitHub/gf-core

fixed bugs in optimization of multiple application

This commit is contained in:
aarne
2008-01-06 21:27:26 +00:00
parent fc65b10e0f
commit e1dda4b5d8

View File

@@ -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')