Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use result instead of the polymorphic equivalent #113

Closed
cfcs opened this issue Jan 1, 2018 · 2 comments
Closed

Use result instead of the polymorphic equivalent #113

cfcs opened this issue Jan 1, 2018 · 2 comments

Comments

@cfcs
Copy link

cfcs commented Jan 1, 2018

It would be nice if vchan would use the result type rather than the equivalent polymorphic variants, for better composability with rresult continuations:

`Ok of 'a | `Error of string

lib/port.mli:

val of_string: string -> [ `Ok of t | `Error of string ]
(* replace with: *))
val of_string : string -> (t, [`Msg of string] ) result

lib/location.mli:

val of_order: int -> [ `Ok of t | `Error of string ]
(* replace with: *)
val of_order: int -> (t, [`Msg of string] ) result

lib/s.mli:

val port_of_string: string -> [ `Ok of port | `Error of string ]
(* replace with: *)
val port_of_string: string -> (port, [`Msg of string] ) result
@samoht
Copy link
Member

samoht commented Apr 8, 2018

That sounds like a very good idea. Patches are welcome :-)

hannesm added a commit to hannesm/ocaml-vchan that referenced this issue Jul 29, 2019
@hannesm hannesm mentioned this issue Jul 29, 2019
hannesm added a commit to hannesm/ocaml-vchan that referenced this issue Jul 29, 2019
@hannesm
Copy link
Member

hannesm commented Jul 29, 2019

I submitted a PR addressing this issue as #130, happy to get it reviewed and merged!

hannesm added a commit to hannesm/ocaml-vchan that referenced this issue Jul 29, 2019
hannesm added a commit to hannesm/ocaml-vchan that referenced this issue Jul 29, 2019
hannesm added a commit to hannesm/ocaml-vchan that referenced this issue Oct 31, 2019
hannesm added a commit to hannesm/ocaml-vchan that referenced this issue Nov 1, 2019
@hannesm hannesm closed this as completed in b000d99 Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants