[Haskell] Injecting stateful computations into pure Haskell code.

Bulat Ziganshin bulat.ziganshin at gmail.com
Thu Sep 21 06:23:17 EDT 2006

Hello szefirov,

Thursday, September 21, 2006, 2:04:38 PM, you wrote:

> Is it possible to represent a result of several impure calculation as a
> pure list?

list = repeat (runST my_impure_calculation)

> The only way I can think of is the use of unsafePerformIO.

runST is really a safe variant of unsafePerformIO :) - it limits
operations allowed inside computation to ones what don't affect
external world

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell mailing list