1
0
forked from GitHub/gf-core

Fix an eta expansion bug in the grammar compiler

Eta expansion is applied between partial evaluation and PMCFG generation.
The buggy version generated type incorrect terms, but PMCFG generation
apparently worked anyway.
This commit is contained in:
hallgren
2014-05-16 14:10:07 +00:00
parent e9b5b8b094
commit 307795f385

View File

@@ -154,9 +154,7 @@ convert opts gr cenv loc term ty@(_,val) pargs =
then-} normalForm cenv loc (expand ty term) -- new evaluator
--else term -- old evaluator is invoked from GF.Compile.Optimize
expand ty@(context,val) = recordExpand val . etaExpand ty
etaExpand (context,val) = mkAbs pars . flip mkApp args
expand (context,val) = mkAbs pars . recordExpand val . flip mkApp args
where pars = [(Explicit,v) | v <- vars]
args = map Vr vars
vars = map (\(bt,x,t) -> x) context