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

XorT.toOption returns an OptionT #610

Merged
merged 1 commit into from
Nov 7, 2015

Conversation

ceedubs
Copy link
Contributor

@ceedubs ceedubs commented Nov 7, 2015

This makes toOption on XorT[F, A, B] return OptionT[F, B] instead
of F[Option[B]]. This makes it symmetrical with toRight and toLeft
on OptionT. My assumption here is that if you are working with XorT
instead of F[Xor...] that you would also prefer to work with OptionT
rather than F[Option[...]]. And if not, it's easy enough to call
.value.

This makes `toOption` on `XorT[F, A, B]` return `OptionT[F, B]` instead
of `F[Option[B]]`. This makes it symmetrical with `toRight` and `toLeft`
on `OptionT`. My assumption here is that if you are working with `XorT`
instead of `F[Xor...]` that you would also prefer to work with `OptionT`
rather than `F[Option[...]]`. And if not, it's easy enough to call
`.value`.
@codecov-io
Copy link

Current coverage is 76.29%

Merging #610 into master will not affect coverage as of 06ea4e6

@@            master    #610   diff @@
======================================
  Files          160     160       
  Stmts         2194    2194       
  Branches        68      68       
  Methods          0       0       
======================================
  Hit           1674    1674       
  Partial          0       0       
  Missed         520     520       

Review entire Coverage Diff as of 06ea4e6

Powered by Codecov. Updated on successful CI builds.

@frosforever
Copy link
Contributor

I am super on board with this. There's yet to be a time where I didn't want OptionT from XorT.
Would it make sense to name it explicitly toOptionT instead?

@ceedubs
Copy link
Contributor Author

ceedubs commented Nov 7, 2015

@frosforever I considered toOptionT. The reason I didn't go forward with it was that then it seemed like toRight and toLeft on OptionT should be named something else. And toRightT didn't quite seem right. I'm definitely open to suggestions here.

@adelbertc
Copy link
Contributor

👍 from me

@frosforever
Copy link
Contributor

@ceedubs fair enough, that would be a mess. The types should make it clear what it's returning anyway.

@mpilquist
Copy link
Member

👍

mpilquist added a commit that referenced this pull request Nov 7, 2015
XorT.toOption returns an OptionT
@mpilquist mpilquist merged commit 2329e47 into typelevel:master Nov 7, 2015
@ceedubs ceedubs deleted the xort-tooption branch November 15, 2015 23:38
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.

5 participants