Function
Adds a user-customized delivery function to a list of hooks that will be executed during delivery.
MLWORKS.Deliver
MLWorks.Deliver
val with_delivery_hook: delivery_hook -> ('a -> 'b) -> 'a -> 'bwith_delivery_hook hook f x -> fn
delivery_hook.
Adds a user-customized delivery function, hook, to a list of hooks that will be executed during delivery whenever the deliver function is called during the application of f to x. Note that hooks are executed in the order they were added: if h1 is added first, it will be executed first.
The following example defines a hook that catches a failed delivery:
MLWorks> fun hello () = print "Hello, world.\n"; val hello : unit -> unit = fn
MLWorks> fun deliver_hello () =
MLWorks.Deliver.deliver("hello", hello, true);
val deliver_hello : unit -> unit = fn