-
Notifications
You must be signed in to change notification settings - Fork 25
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
Remove *R methods #25
Comments
Awesome! Thanks so much. Turns out this was an incomplete copy-paste, since the One more thing that happened, and I'm not sure why that is, was that calling
(notice the |
OK, I finally took some time to play around this a bit, and it doesn't work (not easily, at least). The issue is, the transaction method have optional parameters (the |
Yeah, unfortunately I had the same conclusion. Scala really doesn't like default arguments on overloaded methods. So without redesigning the API there's no easy solution. Oh well, it was a nice hack anyway :) |
Closing for now, might come back later if we completely redo the API at some point. |
Hey, sorry to bump this, but I wanted to share something we use internally:
A very thin wrapper, delegating to tranzactio. I was able to create two overloads called
transaction
. Normally this doesn't work, since[E, A]
and[R, E, A]
have the same erasure, but turns out that sticking an implicit causes them to be different as far as Scala is concerned!So I can have my cake and eat it too - a single
transaction
function (from the user's perspective) that handles eitherConnection
orConnection with R
.Not sure if that ship had sailed (now that you've published v2.0), but maybe you could use this trick and remove the R overloads completely! :)
Originally posted by @hmemcpy in #24 (comment)
The text was updated successfully, but these errors were encountered: