1
0
forked from GitHub/gf-core

partial evaluator: push predefined functions inside variants

This should prevent errors like

Internal error in Compute.ConcreteNew:
    Applying Predef.drop: Expected a value of type String, got VFV [VString "gewandt",VString "gewendet"]
This commit is contained in:
hallgren
2013-03-12 16:36:58 +00:00
parent c5d03231d8
commit 7710dc42db

View File

@@ -378,7 +378,7 @@ vapply v vs =
VError {} -> v
-- VClosure env (Abs b x t) -> beta gr env b x t vs
VAbs bt _ (Bind f) -> vbeta bt f vs
VApp pre vs1 -> err msg id $ delta pre (vs1++vs)
VApp pre vs1 -> err msg vfv $ mapM (delta pre) (varyList (vs1++vs))
where
--msg = const (VApp pre (vs1++vs))
msg = bug . (("Applying Predef."++showIdent (predefName pre)++": ")++)
@@ -394,6 +394,10 @@ vbeta bt f (v:vs) =
ap (VFV avs) = vfv [vapply (f v) vs|v<-avs]
ap v = vapply (f v) vs
vary (VFV vs) = vs
vary v = [v]
varyList = mapM vary
{-
beta env b x t (v:vs) =
case (b,v) of