psg-mit/smooth

Sharing

Opened this issue · 1 comments

let x = pi in x + x doesn't reuse work in the shared computation of pi. It reduces to pi + pi, which is

proc () -> do
  x1 <- pi -< ()
  x2 <- pi -< ()
  (+) -< (x1, x2)

whereas we would prefer

proc () -> do
  x <- pi -< ()
  (+) -< (x, x)

I'm not sure how we can do that.