FixIO/ Tackling Awkward Squad

Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl
16 Feb 2001 19:19:45 GMT


Fri, 16 Feb 2001 10:49:14 -0800, Levent Erkok <erkok@cse.ogi.edu> pisze:

> > fixIO m = let
> >     x = unsafePerformIO (liftM Box (m (unbox x)))
> >     in return (unbox $! x)
> 
> But that doesn't do the effects either..

Sorry, this one should be OK:

fixIO m = let
    x = unsafePerformIO (liftM Box (m (unbox x)))
    in return . unbox $! x

> By the way, the original version that Simon PJ wrote (with mvar's)
> didn't have any of these problems.

But used a heavy concept of concurrency to express something which
is more fundamental and doesn't need concurrency.

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK