On Feb 24, 2011, at 3:45 PM, Andrew Coppin wrote:

OK, so I had a function that looks like

 transform :: [Word8] -> [Word16]

It works nicely, but I'd like to use mutable state inside. No problem! Use the ST monad. Something like

 transform :: [Word8] -> [Word16]
 transform xs = runST (work xs)
   where
     work :: [Word8] -> ST s [Word16]

Ah, yes, well there is one *small* problem... If you do that, the function becomes too strict.

unsafeInterleaveST?

http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad-ST.html#v:unsafeInterleaveST

--Sterl