Handling a timer in Mercury

Thomas Charles CONWAY conway at cs.mu.OZ.AU
Thu Aug 6 11:19:44 AEST 1998

Jack Andrews, you write:
> How does Mercury model the idea of a timer?  A timer has one state at a
> given time, and a different state at another, with no apparent influence
> from other parts of the system.

Actually it does - the values of the timer depend on the state of the
world. An appropriate interface might be:

:- module timer.

:- interface.

:- import_module io.

:- type time.

:- pred get_time(time, io__state, io__state).
:- mode get_time(out, di, uo) is det.

Thomas Conway <conway at cs.mu.oz.au>
Nail here [] for new monitor.  )O+

More information about the users mailing list