Module Initialisation? (was Re: [Haskell] (no subject))
rturk at science.uva.nl
Sun Oct 17 12:53:00 EDT 2004
On Sun, Oct 17, 2004 at 05:11:02PM +0100, Ben Rudiak-Gould wrote:
> Remi Turk wrote:
> >It definitely sounds nice, but is it actually possible to generalize e.g.
> >MVar from "RealWorld" to "forall s" or are we always going to have to say:
> >v <- unsafeIOToST (newMVar / newChan ... )
> I hadn't thought of that, but I don't think there's any problem with
> type MVar = STMVar RealWorld
> newMVar :: a -> ST s (STMVar s a)
> withMVar :: STMVar s a -> (a -> ST s b) -> ST s b
> For that matter it seems like we could (should?) have
> forkST :: ST s () -> ST s (STThreadId s)
> forkIO = forkST
> and so on.
> -- Ben
But what semantics would they have?
It cannot be the normal concurrency as
AFAIK runST is supposed to be deterministic.
Nobody can be exactly like me. Even I have trouble doing it.
More information about the Haskell