mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
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:
@@ -378,7 +378,7 @@ vapply v vs =
|
|||||||
VError {} -> v
|
VError {} -> v
|
||||||
-- VClosure env (Abs b x t) -> beta gr env b x t vs
|
-- VClosure env (Abs b x t) -> beta gr env b x t vs
|
||||||
VAbs bt _ (Bind f) -> vbeta bt f 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
|
where
|
||||||
--msg = const (VApp pre (vs1++vs))
|
--msg = const (VApp pre (vs1++vs))
|
||||||
msg = bug . (("Applying Predef."++showIdent (predefName pre)++": ")++)
|
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 (VFV avs) = vfv [vapply (f v) vs|v<-avs]
|
||||||
ap v = vapply (f v) vs
|
ap v = vapply (f v) vs
|
||||||
|
|
||||||
|
vary (VFV vs) = vs
|
||||||
|
vary v = [v]
|
||||||
|
varyList = mapM vary
|
||||||
|
|
||||||
{-
|
{-
|
||||||
beta env b x t (v:vs) =
|
beta env b x t (v:vs) =
|
||||||
case (b,v) of
|
case (b,v) of
|
||||||
|
|||||||
Reference in New Issue
Block a user