sig
module Deferred :
sig
type 'a t
val bind :
'a Async.Std.Deferred.t ->
('a -> 'b Async.Std.Deferred.t) -> 'b Async.Std.Deferred.t
val both :
'a Async.Std.Deferred.t ->
'b Async.Std.Deferred.t -> ('a * 'b) Async.Std.Deferred.t
val all : 'a Async.Std.Deferred.t list -> 'a list Async.Std.Deferred.t
val any : 'a Async.Std.Deferred.t list -> 'a Async.Std.Deferred.t
module List :
sig
val fold :
'a list ->
'b ->
('b -> 'a -> 'b Async.Std.Deferred.t) -> 'b Async.Std.Deferred.t
val find :
'a list ->
('a -> bool Async.Std.Deferred.t) ->
'a option Async.Std.Deferred.t
val map :
?how:[ `Parallel | `Sequential ] ->
'a list ->
('a -> 'b Async.Std.Deferred.t) -> 'b list Async.Std.Deferred.t
val iter :
?how:[ `Parallel | `Sequential ] ->
'a list ->
('a -> unit Async.Std.Deferred.t) -> unit Async.Std.Deferred.t
val filter :
?how:[ `Parallel | `Sequential ] ->
'a list ->
('a -> bool Async.Std.Deferred.t) -> 'a list Async.Std.Deferred.t
end
end
val ( >>= ) :
'a Async.Std.Deferred.t ->
('a -> 'b Async.Std.Deferred.t) -> 'b Async.Std.Deferred.t
val ( >>| ) :
'a Async.Std.Deferred.t -> ('a -> 'b) -> 'b Async.Std.Deferred.t
val return : 'a -> 'a Async.Std.Deferred.t
val don't_wait_for : unit Async.Std.Deferred.t -> unit
val never : unit -> 'a Async.Std.Deferred.t
module Ivar :
sig
type 'a t
val create : unit -> 'a Async.Std.Ivar.t
val read : 'a Async.Std.Ivar.t -> 'a Async.Std.Deferred.t
val fill : 'a Async.Std.Ivar.t -> 'a -> unit
val fill_if_empty : 'a Async.Std.Ivar.t -> 'a -> unit
val is_full : 'a Async.Std.Ivar.t -> bool
val is_empty : 'a Async.Std.Ivar.t -> bool
end
module Pipe :
sig
module Reader : sig type 'a t end
module Writer : sig type 'a t end
val create :
unit -> 'a Async.Std.Pipe.Reader.t * 'a Async.Std.Pipe.Writer.t
val write :
'a Async.Std.Pipe.Writer.t -> 'a -> unit Async.Std.Deferred.t
val read :
'a Async.Std.Pipe.Reader.t ->
[ `Eof | `Ok of 'a ] Async.Std.Deferred.t
end
val after : Core.Std.Time.Span.t -> unit Async.Std.Deferred.t
val with_timeout :
Core.Std.Time.Span.t ->
'a Async.Std.Deferred.t ->
[ `Result of 'a | `Timeout ] Async.Std.Deferred.t
val every :
?start:unit Async.Std.Deferred.t ->
?stop:unit Async.Std.Deferred.t ->
Core.Std.Time.Span.t -> (unit -> unit) -> unit
val printf : ('a, unit, string, unit) Pervasives.format4 -> 'a
module Reader :
sig
type t
val file_lines : string -> string list Async.Std.Deferred.t
val file_contents : string -> string Async.Std.Deferred.t
val read_line :
Async.Std.Reader.t -> [ `Eof | `Ok of string ] Async.Std.Deferred.t
end
module Writer :
sig type t val write_line : Async.Std.Writer.t -> string -> unit end
module Socket :
sig
type 'a t
val shutdown :
'a Async.Std.Socket.t -> [ `Both | `Receive | `Send ] -> unit
module Address : sig type t end
end
module Tcp :
sig
type 'a where_to_connect
val to_host_and_port :
string ->
int -> Async.Std.Socket.Address.t Async.Std.Tcp.where_to_connect
val connect :
'a Async.Std.Tcp.where_to_connect ->
('a Async.Std.Socket.t * Async.Std.Reader.t * Async.Std.Writer.t)
Async.Std.Deferred.t
end
val try_with :
(unit -> 'a Async.Std.Deferred.t) ->
('a, exn) Core.Std.Result.t Async.Std.Deferred.t
end