1
0
forked from GitHub/gf-core

Compute/ConcreteNew.hs: adding a Prawitz rewrite

(table { p_i => t_i } ! x).l ==> table { p_i => t_i.l } ! x

This was used in the old partial evaluator and can significantly reduce term
sizes in some cases.
This commit is contained in:
hallgren
2014-05-16 21:27:20 +00:00
parent f78570dabd
commit 861a3fa805

View File

@@ -180,6 +180,7 @@ proj l v =
VFV vs -> liftM vfv (mapM (proj l) vs)
VRec rs -> lookup l rs
VExtR v1 v2 -> proj l v2 `mplus` proj l v1 -- hmm
VS (VV pty pvs rs) v2 -> flip VS v2 . VV pty pvs # mapM (proj l) rs
_ -> return (ok1 VP v l)
ok1 f v1@(VError {}) _ = v1