module Pa_duppy:sig
..end
Duppy.Monad
This module provides syntactic extensions to OCaml
using Camlp4 used to write code using Duppy.Monad
.
It provides the following extensions:
duppy v =
foo
in
bar x
is equivalent to:
Duppy.Monad.bind foo (fun x -> bar x)
duppy_run
foo
with
{ return = f ;
raise = g }
is equivalent to:
Duppy.Monad.run ~return:f ~raise:g ()
duppy_try
foo
with
| a -> f
| b -> g
is equivalent to:
Duppy.Monad.catch
foo
(function
| a -> f
| b -> g)
duppy_fold_left
is equivalent to Duppy.Monad.fold_left
duppy_iter
is equivalent to Duppy.Monad.iter
duppy_return
is equivalent to Duppy.Monad.return
duppy_raise
is equivalent to Duppy.Monad.raise
duppy_do
foo ;
bar ;
...
done
is equivalent to:
Duppy.Monad.bind
(Duppy.Monad.bind
foo
(fun () -> bar))
(fun () -> ...)
duppy_exec
foo
with
{ priority = p ;
handler = h
delay = d }
is equivalent to:
Duppy.Monad.Io.exec
~priority:p ~delay:d h foo
delay
is an optional field.
duppy_delay
is equivalent to Duppy.Monad.Io.delay
duppy_read
marker
with
{ priority = p ;
handler = h ;
timeout = t }
is equivalent to:
Duppy.Monad.Io.read
~timeout:t ~priority:p h marker
Timeout parameter is optional.
duppy_read_all
socket
with
{ priority = p ;
handler = h ;
timeout = t }
is equivalent to:
Duppy.Monad.Io.read_all
~timeout:t ~priority:p s socket
Timeout parameter is optional.
duppy_write
s
with
{ priority = p ;
handler = h ;
timeout = t }
is equivalent to:
Duppy.Monad.Io.write
~timeout:t ~priority:p ~string:s h
Timeout parameter is optional.
duppy_write_bigarray
ba
with
{ priority = p ;
handler = h ;
timeout = t }
is equivalent to:
Duppy.Monad.Io.write
~timeout:t ~priority:p ~bigarray:ba h
Timeout parameter is optional.