Re: Module Initialisation? (was Re: [Haskell] (no subject))

2004-10-17 Thread Remi Turk
On Sun, Oct 17, 2004 at 07:20:28PM +0100, Ben Rudiak-Gould wrote: > Remi Turk wrote: > > > On Sun, Oct 17, 2004 at 05:11:02PM +0100, Ben Rudiak-Gould wrote: > > > >> I don't think there's any problem with > >> > >> type MVar = STMVar RealWorld > >> > >> newMVar :: a -> ST s (STMVar s a) > >> w

Re: Module Initialisation? (was Re: [Haskell] (no subject))

2004-10-17 Thread Ben Rudiak-Gould
Remi Turk wrote: On Sun, Oct 17, 2004 at 05:11:02PM +0100, Ben Rudiak-Gould wrote: > 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

Re: Module Initialisation? (was Re: [Haskell] (no subject))

2004-10-17 Thread Adrian Hey
On Sunday 17 Oct 2004 4:45 am, Wolfgang Thaller wrote: > Adrian Hey wrote: > > I'm puzzled about this idea of "module init action" in a declarative > > language. Perhaps, if it's desirable to have some module initialisation > > applied to a module if anything from it is used, the way to do this > >

Re: Module Initialisation? (was Re: [Haskell] (no subject))

2004-10-17 Thread Remi Turk
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 ... ) > >

Re: Module Initialisation? (was Re: [Haskell] (no subject))

2004-10-17 Thread Ben Rudiak-Gould
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 = ST

Re: Module Initialisation? (was Re: [Haskell] (no subject))

2004-10-17 Thread Remi Turk
On Sun, Oct 17, 2004 at 01:53:22PM +0100, Ben Rudiak-Gould wrote: [snip] > >> Since a lot of the concerns expressed about this seem to centre > >> around possible abuse of arbitrary IO operations in these top level > >> constructions, maybe the problem could be addressed by insisting > >> that a re

Re: Module Initialisation? (was Re: [Haskell] (no subject))

2004-10-17 Thread Ben Rudiak-Gould
Wolfgang Thaller wrote: Adrian Hey wrote: > I'm puzzled about this idea of "module init action" in a > declarative language. Perhaps, if it's desirable to have some > module initialisation applied to a module if anything from it is > used, the way to do this would be to have a reserved identifier