ekmett / machines

Networks of composable stream transducers
Other
339 stars 46 forks source link

Consider hand-simplifying `<*>` #67

Closed treeowl closed 8 years ago

treeowl commented 9 years ago

Currently, <*> is defined as ap. After inlining and beta reduction, this becomes

ps <*> qs = PlanT $ \ret yi aw st ->
  runPlanT ps
    (\p -> (runPlanT qs (ret . p) yi aw st)) yi aw st

My guess is that the inliner would treat this simplified form better, but my intuition in these matters is only partially developed. Any thoughts?