module type LIFECYCLE =sig..end
LIFECYCLE provides the ability to watch important events
occuring in the life time of the program.
type 'a event
'a.type watcher
val watch : 'a event -> ('a -> unit) -> watcherwatch e f is a key-value watcher such that f is called whenever
event e occurs.val unwatch : watcher -> unitunwatch w stops the watcher w. After that call it's callback
is guaranteed not to be called again.val poweron : unit eventpoweron occurs shortly after the system powers up.val poweroff : unit eventpoweroff occurs shortly before the system is going to power off.val suspend : unit eventsuspend occurs shortly before the system is suspended.val resume : unit event