Marek Kubica
2014-10-20 21:48:13 UTC
Hello,
I'd like to announce a new release of Slacko, the OCaml Slack API
binding. This is both an announcement as well as a request for comments
regarding the API.
The homepage is at <https://github.com/Leonidas-from-XIV/slacko>, the
documentation can be read online at
<https://leonidas-from-xiv.github.io/slacko/> and the tarball as well
as release notes can be found on
<https://github.com/Leonidas-from-XIV/slacko/releases/tag/0.10.0>. The
recommended way is to install it from OPAM of course, which already
carries the 0.10.0 release.
I've listened to the suggestions by Malcolm, Gabriel and Jaques as well
as Drup so the methods are not longer "stringly" typed, each function
supports parameters that make more sense, like user/group/channel
types, booleans, integers etc. The results are changed from a huge
monolithic type to individual polymorphic variants composed of smaller
types.
But some questions remain: I have a number of types and conversion
functions (foo_of_string mostly). These can validate the input
(checking if the format is correct or whether the input is not too
long) and most likely should. But what is the preferred OCaml way of
handling failure to convert? I could use exceptions but that seems
kinda type unsafe to me. I could use option types, but that might make
for some clunky conversions. Any ideas?
Also there are errors like `Msg_too_long. I'm currently exposing them,
because the API might throw them. But when doing validation inside my
binding, these errors can't really happen, since I validated
beforehand. I think that these can be filtered out (since the length
limit is static and if it changes, the library can be updated), but if
anyone has a different perspective, please speak up.
Looking forwards to comments!
Oh and I ported from the Camlp4 Lwt macros to PPX. Was super easy and
worked like a charm, zero issues.
regards,
Marek
I'd like to announce a new release of Slacko, the OCaml Slack API
binding. This is both an announcement as well as a request for comments
regarding the API.
The homepage is at <https://github.com/Leonidas-from-XIV/slacko>, the
documentation can be read online at
<https://leonidas-from-xiv.github.io/slacko/> and the tarball as well
as release notes can be found on
<https://github.com/Leonidas-from-XIV/slacko/releases/tag/0.10.0>. The
recommended way is to install it from OPAM of course, which already
carries the 0.10.0 release.
I've listened to the suggestions by Malcolm, Gabriel and Jaques as well
as Drup so the methods are not longer "stringly" typed, each function
supports parameters that make more sense, like user/group/channel
types, booleans, integers etc. The results are changed from a huge
monolithic type to individual polymorphic variants composed of smaller
types.
But some questions remain: I have a number of types and conversion
functions (foo_of_string mostly). These can validate the input
(checking if the format is correct or whether the input is not too
long) and most likely should. But what is the preferred OCaml way of
handling failure to convert? I could use exceptions but that seems
kinda type unsafe to me. I could use option types, but that might make
for some clunky conversions. Any ideas?
Also there are errors like `Msg_too_long. I'm currently exposing them,
because the API might throw them. But when doing validation inside my
binding, these errors can't really happen, since I validated
beforehand. I think that these can be filtered out (since the length
limit is static and if it changes, the library can be updated), but if
anyone has a different perspective, please speak up.
Looking forwards to comments!
Oh and I ported from the Camlp4 Lwt macros to PPX. Was super easy and
worked like a charm, zero issues.
regards,
Marek
--
Caml-list mailing list. Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
Caml-list mailing list. Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs