Am Mittwoch, 3. August 2005 19:07 schrieb Srinivas Nedunuri:
> [...]

> I have a bunch of ST code, and then somewhere in there I had the misfortune
> of needing to insert a file copy and bam I'm now stuck with the dang IO
> monad which goes and "infects" the entire program.

You can use something like

        myPureComputation :: String -> ST s Int

where the parameter denotes the file content.  Then you do something like 
this:

        do
                fileContent <- readFile "myFile"
                print $ runST $ myPureComputation fileContent

So you don't need to infect your ST computation with I/O the same way you 
often don't need to infect an ordinary pure calculation with I/O.

Or did you mean something different?

> [...]

Regards,
Wolfgang
_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to