
19 Sep
2003
19 Sep
'03
5:49 a.m.
On Fri, Sep 19, 2003 at 02:36:55AM -0700, Ashley Yakeley wrote:
In article <20030919000856.GA1240@soi.city.ac.uk>, Ross Paterson
wrote: How does Hugs do fixIO?
It's nothing deep:
Oh, you've just moved the cleverness to unsafePerformIO, presumably:
newtype IO a = IO ((a -> IOResult) -> IOResult) unsafePerformIO :: IO a -> a unsafePerformIO (IO f) = unsafeCast (f unsafeCast)
"cleverness" isn't the word I'd have used, but there's more to it than this (because Hugs supports cooperative concurrency). See Hugs.{Prelude,IO,IOExts,Conc} under hugs98/libraries on cvs.haskell.org for the gory details.