Re: a newbie's question about something related to runST

2000-04-26 Thread Fergus Henderson
On 26-Apr-2000, Jan Brosius <[EMAIL PROTECTED]> wrote: > > runST :: forall s. (ST s a) -> a It would be clearer to write that as runST :: (forall s. ST s a) -> a rather than relying on the relative precedences of `.' and `->'. > give runST the type signature >

Re: a newbie's question about something related to runST

2000-04-26 Thread Jan Brosius
> On 26-Apr-2000, Jan Brosius <[EMAIL PROTECTED]> wrote: > > Hi, > > > > First I give the following primitive operations > > > > newVar :: a -> ST s (MutVar s a) > > > > readVar :: MutVar s a -> ST s a > > > > writeVar :: MutVar s a -> a -> ST s () > > > > Next consider the

Re: a newbie's question about something related to runST

2000-04-26 Thread Fergus Henderson
On 26-Apr-2000, Jan Brosius <[EMAIL PROTECTED]> wrote: > Hi, > > First I give the following primitive operations > > newVar :: a -> ST s (MutVar s a) > > readVar :: MutVar s a -> ST s a > > writeVar :: MutVar s a -> a -> ST s () > > Next consider the function >

a newbie's question about something related to runST

2000-04-25 Thread Jan Brosius
Hi,   First I give the following primitive operations      newVar  :: a -> ST s (MutVar s a)     readVar :: MutVar s a  ->  ST s a     writeVar :: MutVar s a -> a -> ST s ()   Next consider the function     f :: MutVar s a -> Mut Var s a       f v = runST (n