RE: [Haskell] ANNOUNCING: The Haskell Bookstore

2004-06-25 Thread Simon Marlow
On 25 June 2004 11:30, Daan Leijen wrote: > Is there anyone who knows why "atomicModifyIORef" has type: > > IORef a -> (a -> (a, b)) -> IO b(1) > > Instead of: > > IORef a -> (a -> a) -> IO a (2) > > > It seems to me that returning the old value is always good

Re: [Haskell] ANNOUNCING: The Haskell Bookstore

2004-06-25 Thread Marcin 'Qrczak' Kowalczyk
W liście z pią, 25-06-2004, godz. 12:30 +0200, Daan Leijen napisał(a): > It seems to me that returning the old value is always good > enough right? Here is an implementation of "atomicModifyIORef" > with the current type in terms of a function "proposedModifyIORef" with > type (2). > > atomicMod

Re: [Haskell] ANNOUNCING: The Haskell Bookstore

2004-06-25 Thread Daan Leijen
Is there anyone who knows why "atomicModifyIORef" has type: IORef a -> (a -> (a, b)) -> IO b (1) Instead of: IORef a -> (a -> a) -> IO a (2) It seems to me that returning the old value is always good enough right? Here is an implementation of "atomicModifyIORef" wi