mirage / ocaml-cohttp

An OCaml library for HTTP clients and servers using Lwt or Async
Other
706 stars 174 forks source link

Get rid of annoying inconsistencies between Lwt and Async #200

Open rgrinberg opened 9 years ago

rgrinberg commented 9 years ago

As we've said before, async and lwt backends should follow the conventions of async and lwt but in some cases we have some pointless differences. For example:

I'm sure there's more - this is just after a quick glance.

I know we've ruled against #119 but how about resurrecting an lwt/async agnostic signatures for these functions and simply using them for type checking. While still expanding all of the aliases to have decent docs.

avsm commented 9 years ago

That's a good idea...I'd be very much in favour of using those signatures to "consistency check" the backends.

On 8 Nov 2014, at 22:35, Rudi Grinberg notifications@github.com wrote:

I know we've ruled against #119 https://github.com/mirage/ocaml-cohttp/pull/119 but how about resurrecting an lwt/async agnostic signatures for these functions and simply using them for type checking. While still expanding all of the aliases to have decent docs.

avsm commented 9 years ago

Did the change to Body, but not sure it isn't just bikeshedding -- the Async backend is still different.

rgrinberg commented 9 years ago

Yeah that's probably the least important change. Imo the naming of things is what's really ugly now. Unfortunately, cohttp has quite a few downstream users for a "beta" library. I suppose we can keep always keep aliases for the old stuff.

What about the deal with labelled arguments in the lwt server api. E.g. it takes unit as a last parameter in every call while Async has the last parameter non labelled? The former is much more consistent, while the latter is "prettier".

neojski commented 9 years ago

See also: Lack of post_form in async: #235.