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

Added BatResult.{map,map_both} #705

Merged
merged 3 commits into from
Jan 11, 2017
Merged

Conversation

ifazk
Copy link
Contributor

@ifazk ifazk commented Jan 10, 2017

This resolves #704

(** [map_both f g (Ok x)] returns [Ok (f x)] and [map_both f g (Bad e)] returns [Bad (g e)].
@since 2.5.4
*)
val map_both : ('a -> 'b) -> ('c -> 'd) -> ('a, 'c) t -> ('b, 'd) t
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this signature would be more readable with 'a1 -> 'a2, 'b1 -> 'b2.

val map : ('a -> 'b) -> ('a, 'c) t -> ('b, 'c) t

(** [map_both f g (Ok x)] returns [Ok (f x)] and [map_both f g (Bad e)] returns [Bad (g e)].
@since 2.5.4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you use NEXT_RELEASE instead of 2.5.4, so that we can replace with the correct version (which may not be 2.5.4) at release time?

@ifazk
Copy link
Contributor Author

ifazk commented Jan 10, 2017

Fixed. Should I also change the ChangeLog file?

@gasche
Copy link
Member

gasche commented Jan 11, 2017

Yes, please. Thanks!

@ifazk
Copy link
Contributor Author

ifazk commented Jan 11, 2017

Done!

@gasche gasche merged commit 830d6cd into ocaml-batteries-team:master Jan 11, 2017
@gasche
Copy link
Member

gasche commented Jan 11, 2017

Thanks, I just merged.

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 this pull request may close these issues.

BatResult does not have a map function
2 participants