diff changePoller.urs @ 14:0827320b0f04

Write calendarCtl in terms of a source with a listener.
author Karn Kallio <kkallio@eka>
date Fri, 05 Aug 2011 18:55:24 -0430
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/changePoller.urs	Fri Aug 05 18:55:24 2011 -0430
@@ -0,0 +1,17 @@
+(* A source which can poll for changes and call an action on the new value
+ * when one is found. *)
+
+con changePoller :: Type -> Type
+(* The type of pollers over the given type. *) 
+
+val create : t ::: Type -> eq t -> t -> transaction (changePoller t)
+(* From an initial value get a poller. *)
+
+val addChangeListener : t ::: Type -> eq t -> (t -> transaction unit) -> int -> changePoller t -> transaction unit
+(* Add an action to run on changed values with a polling period given by the int. *)
+
+val ctl : t ::: Type -> changePoller t -> source t
+(* Get a source to control or set the current value. *)
+
+val value : t ::: Type -> changePoller t -> signal t
+(* A signal holding the current value. *)