<div dir="ltr"><div>What I want to be able to do is something like this:</div><div><br></div><div>do</div><div>x <- newSTRef 2</div><div>y <- newSTRef 3</div><div>z <- letSTRef (x + y)</div><div>r1 <- readSTRef z</div><div>writeSTRef x 5</div><div>r2 <- readSTRef z</div><div>return (r1, r2)</div><div><br></div><div>This should return (6,15)</div><div><br></div><div>The "letSTRef" is what's new. The value it returns can change based on the parts that make up it's function changing.</div><div><br></div><div>I understand this syntax above isn't going to work (I'd have to use applicative at least I'd imagine) but my main question is that does something like this exist? Is it functional reactive programming or is it something else?</div><div><br></div><div>I don't want to be reinventing the wheel if this type of idea is already implemented but I haven't recognised it.</div><div><br></div></div>