ANNOUNCE: Object I/O released

Krasimir Angelov
Mon, 8 Apr 2002 03:05:05 -0700 (PDT)

--- Simon Peyton-Jones <> wrote:
> Well done!
> You never responded to my question about MVars...
> Simon

   The version that I release is based entirely on LS
version. I think that it is more elegant and more
useful for customer. 

   1) In the MVAR version each event handler must like

eventHandler state = do
   st <- takeMVar state
   putMVAR state st'

In LS version there isn't need of takeMVar/putMVAR and
the handler is more easy. 

   2) In MVAR version the event handlers in the device
definitions must be defined as curry functions

Example MVAR:
   state <- newMVAR (0::Int)
   openWindow (Window NilLS [WindowClose (closeWin

Example LS:
   openWindow (0::Int) (Window NilLS [WindowClose

   3) Modification of local state doesn't mean
modification of device behaviour. The behaviour of the
device is described with both local state and internal
device data. This means that direct access to the
state isn't a good idea. In the LS version the local
state is encapsulated in the device and I think that
this is more OOP style. Communication between devices
is posible only with message dispatching, that is
better object oriented tehnology.

Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax