RealWorld

Ross Paterson ross at soi.city.ac.uk
Fri Sep 19 11:49:07 EDT 2003


On Fri, Sep 19, 2003 at 02:36:55AM -0700, Ashley Yakeley wrote:
> In article <20030919000856.GA1240 at soi.city.ac.uk>,
>  Ross Paterson <ross at soi.city.ac.uk> 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.


More information about the Libraries mailing list