summaryrefslogtreecommitdiff
path: root/src/GF/Grammar/AbsCompute.hs
diff options
context:
space:
mode:
authoraarne <unknown>2005-10-02 19:50:19 +0000
committeraarne <unknown>2005-10-02 19:50:19 +0000
commit1ea059cdcbce96d4198c42eee16be151549606cc (patch)
treecaa48299605c3ace4b76fe58679aa57d51ede768 /src/GF/Grammar/AbsCompute.hs
parent1db8b90811b280a61acb3dc2961fe1ef45c6a2fb (diff)
def and List
Diffstat (limited to 'src/GF/Grammar/AbsCompute.hs')
-rw-r--r--src/GF/Grammar/AbsCompute.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/GF/Grammar/AbsCompute.hs b/src/GF/Grammar/AbsCompute.hs
index 35be020fa..b2139f90a 100644
--- a/src/GF/Grammar/AbsCompute.hs
+++ b/src/GF/Grammar/AbsCompute.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/04/21 16:22:18 $
--- > CVS $Author: bringert $
--- > CVS $Revision: 1.7 $
+-- > CVS $Date: 2005/10/02 20:50:19 $
+-- > CVS $Author: aarne $
+-- > CVS $Revision: 1.8 $
--
-- computation in abstract syntax w.r.t. explicit definitions.
--
@@ -72,12 +72,15 @@ computeAbsTermIn lookd xs e = errIn ("computing" +++ prt e) $ compt xs e where
Ok (Just EData) -> Nothing -- canonical --- should always be QC
Ok md -> md
_ -> Nothing
+ Eqs _ -> return t ---- for nested fn
_ -> Nothing
beta :: [Ident] -> Exp -> Exp
beta vv c = case c of
App (Abs x b) a -> beta vv $ substTerm vv [xvv] (beta (x:vv) b)
where xvv = (x,beta vv a)
+ Let (x,(_,a)) b -> beta vv $ substTerm vv [xvv] (beta (x:vv) b)
+ where xvv = (x,beta vv a)
App f a -> let (a',f') = (beta vv a, beta vv f) in
(if a'==a && f'==f then id else beta vv) $ App f' a'
Prod x a b -> Prod x (beta vv a) (beta (x:vv) b)