<div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>is it possible to prevent an STRef passed to one ST action from being passed further on to another ST action?<br><br></div>I am trying to prevent these usages:<br>invalid :: STRef s a -> STRef s b -> ST s ()<br>invalid x y=action1 x y >>=action2 x y<br><br>invalid1 :: STRef s a -> STRef s b -> ST s ()<br>invalid1 x y=action1 x y >>=action2 y<br></div><br>while still being able to do this:<br><br>valid :: STRef s a -> STRef s b -> ST s ()<br>valid x y=action1 x y >>=action2 x<br><br>where action1 will modify x and y inplace, but in the end only x will hold the useful information.<br></div>In other words I am trying to make it impossible for any action after action1 to have a same argument as action1's second argument.<br><br></div>timo<br></div>