Deforestation (1)
A priori compose HAbs, HApp & HSym with PE
(Instead of first constructing an hexp by HAbs, HApp & HSym and then destructing it by PE)
fun habs'(f) = HAbs(fn x => f x)
fun happ'(e1, e2) =
let val e1' = e1
val e2' = e2
in (case e1' of HAbs(f) => f e2'
| _ => HApp(e1', e2'))
end
fun hsym'(s) = HSym(s)
Previous slide
Next slide
Back to first slide
View graphic version