Wearing the hair shirt Wearing the hair shirt - Microsoft Research
Wearing the hair shirt Wearing the hair shirt - Microsoft Research
Wearing the hair shirt Wearing the hair shirt - Microsoft Research
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Encapsulating it all<br />
data ST s a -- Abstract<br />
newRef :: a -> ST s (STRef s a)<br />
read :: STRef s a -> ST s a<br />
write :: STRef s a -> a -> ST s ()<br />
runST :: (forall s. ST s a) -> a<br />
Stateful<br />
computation<br />
Pure result<br />
sort :: Ord a => [a] -> [a]<br />
sort xs = runST (do { ..in-place sort.. })