From 6c9ce6194f69972c77bdf19a857a97e5f142210c Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Wed, 24 Dec 2014 21:06:51 +0000 Subject: [PATCH 1/2] improve ocamldoc of Cohttp.S --- CHANGES | 7 +++++++ lib/s.mli | 42 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 2d91e55d5b..a588b71cf9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +0.15.0 (2014-12-24): +* Change `Cohttp_lwt_body.map` to use a non-labelled type to fit the Lwt + style better (#200). +* Remove use of deprecated `Lwt_unix.run` and replace it with `Lwt_main.run`. + Should be no observable external change (#217). +* Improve ocamldoc of `Cohttp.S` signature. + 0.14.0 (2014-12-18): Compatibility breaking interface changes: diff --git a/lib/s.mli b/lib/s.mli index 52a12f9520..8e606062c8 100644 --- a/lib/s.mli +++ b/lib/s.mli @@ -16,21 +16,61 @@ * *) +(** Module type signatures for Cohttp components *) + +(** The [IO] module defines the blocking interface for reading + and writing to Cohttp streams *) module type IO = sig + + (** ['a t] represents a blocking monad state *) type +'a t + + (** [a >>= b] will pass the result of [a] to the + [b] function. This is a monadic [bind]. *) val (>>=) : 'a t -> ('a -> 'b t) -> 'b t + + (** [return a] will construct a constant IO value. *) val return : 'a -> 'a t + (** [ic] represents an input channel *) type ic + + (** [oc] represents an output channel *) type oc + + (** [conn] represents the underlying network flow *) type conn + (** [iter f l] will perform a blocking iteration using + [f] over the [l] list. The result is determined + after all the iterating threads have completed in + serial. *) val iter : ('a -> unit t) -> 'a list -> unit t + + (** [read_line ic] will read a single line terminated + by CR or CRLF from the input channel [ic]. It returns + {!None} if EOF or other error condition is reached. *) val read_line : ic -> string option t + + (** [read ic len] will block until a maximum of [len] characters + are read from the input channel [ic]. It returns an + empty string if EOF or some other error condition occurs + on the input channel, and can also fewer than [len] if + input buffering is not sufficient to satisfy the request. *) val read : ic -> int -> string t - val read_exactly : ic -> int -> string option t + (** [read_exactly ic len] will block until exactly [len] characters + are read from the input channel [ic]. If EOF or some other + error condition is reached, then {!None} is returned. *) + val read_exactly : ic -> int -> string option t + + (** [write oc s] will block until the complete [s] string is + written to the output channel [oc]. *) val write : oc -> string -> unit t + + (** [flush oc] will return when all previously buffered content + from calling {!write} have been written to the output channel + [oc]. *) val flush : oc -> unit t end From ef8a65dab81beffb82af54123da1e77da8bf1bf9 Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Wed, 24 Dec 2014 21:09:54 +0000 Subject: [PATCH 2/2] bump to 0.15.0 --- _oasis | 2 +- lib/META | 12 ++++++------ setup.ml | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/_oasis b/_oasis index 85d822de34..d221d3868a 100644 --- a/_oasis +++ b/_oasis @@ -1,6 +1,6 @@ OASISFormat: 0.3 Name: cohttp -Version: 0.14.0 +Version: 0.15.0 Synopsis: HTTP library for Lwt, Async, JavaScript and Mirage Authors: Anil Madhavapeddy, Stefano Zacchiroli, David Sheets, Thomas Gazagnaire, David Scott, Rudi Grinberg, Andy Ray License: ISC diff --git a/lib/META b/lib/META index 9602db2ba1..9af1a5049a 100644 --- a/lib/META +++ b/lib/META @@ -1,6 +1,6 @@ # OASIS_START -# DO NOT EDIT (digest: 83110b7d757d775576f7f656771d933c) -version = "0.14.0" +# DO NOT EDIT (digest: 58f3ba980c68f36d754812ac1d1ae41c) +version = "0.15.0" description = "HTTP library for Lwt, Async, JavaScript and Mirage" requires = "re.emacs stringext uri uri.services fieldslib sexplib bytes base64" @@ -10,7 +10,7 @@ archive(native) = "cohttp.cmxa" archive(native, plugin) = "cohttp.cmxs" exists_if = "cohttp.cma" package "lwt-core" ( - version = "0.14.0" + version = "0.15.0" description = "HTTP library for Lwt, Async, JavaScript and Mirage" requires = "lwt uri cohttp" archive(byte) = "cohttp_lwt.cma" @@ -21,7 +21,7 @@ package "lwt-core" ( ) package "lwt" ( - version = "0.14.0" + version = "0.15.0" description = "HTTP library for Lwt, Async, JavaScript and Mirage" requires = "cohttp.lwt-core unix lwt.unix conduit.lwt-unix" archive(byte) = "cohttp_lwt_unix.cma" @@ -32,7 +32,7 @@ package "lwt" ( ) package "js" ( - version = "0.14.0" + version = "0.15.0" description = "HTTP library for Lwt, Async, JavaScript and Mirage" requires = "cohttp.lwt-core js_of_ocaml" archive(byte) = "cohttp_lwt_xhr.cma" @@ -43,7 +43,7 @@ package "js" ( ) package "async" ( - version = "0.14.0" + version = "0.15.0" description = "HTTP library for Lwt, Async, JavaScript and Mirage" requires = "uri cohttp threads async conduit.async" archive(byte) = "cohttp_async.cma" diff --git a/setup.ml b/setup.ml index c530594a5a..54ee82596c 100644 --- a/setup.ml +++ b/setup.ml @@ -1,7 +1,7 @@ (* setup.ml generated for the first time by OASIS v0.4.5 *) (* OASIS_START *) -(* DO NOT EDIT (digest: 54ae75205e056e18f5770732f89fef88) *) +(* DO NOT EDIT (digest: f9d0dadd97652f942f89c1f80d559a1f) *) (* Regenerated by OASIS v0.4.5 Visit http://oasis.forge.ocamlcore.org for more information and @@ -6975,7 +6975,7 @@ let setup_t = alpha_features = []; beta_features = []; name = "cohttp"; - version = "0.14.0"; + version = "0.15.0"; license = OASISLicense.DEP5License (OASISLicense.DEP5Unit @@ -8353,7 +8353,7 @@ let setup_t = }; oasis_fn = Some "_oasis"; oasis_version = "0.4.5"; - oasis_digest = Some "µÁy\024¡\030yG\141ÖÒzL}\014è"; + oasis_digest = Some "3ò\017\030@ïÙ Ö÷ø¦\007w°î"; oasis_exec = None; oasis_setup_args = []; setup_update = false