
--- Simon Peyton-Jones
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 this: 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 state)]) Example LS: openWindow (0::Int) (Window NilLS [WindowClose closeWin]) 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 http://taxes.yahoo.com/
participants (1)
-
Krasimir Angelov