-
Notifications
You must be signed in to change notification settings - Fork 22
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
Extension methods for await/unlift/reflect #83
Comments
When talking about short syntax: I actually really like the short syntax |
Yes, it (postfix await) makes sense. |
Oops -- looks like in 3.5.0 we can't define an extension with the same name as a method, I will submit it to the compiler team, but I am unsure if it will be classified as unexpected behavior. |
Hmm, maybe we can use only extensions instead ...yes, this works |
Awesome, I am very happy that it works :) |
0.9.22. with await extension method is published on maven central |
It would be great to have chainable methods for awaiting a value inside an async block like this:
I find it a nice because it requires less braces than
await(Future(1))
. Furthermore, it would support the syntax from https://github.com/typelevel/cats-effect-cps here. So, it very easy to switch.As far as I understand, this could be achieved by making
await/unlift/reflect
extension methods onF[T]
, defining it like this:Afaik, it should then be available as method
await(f)
and as an extensionf.await
. What do you think?The text was updated successfully, but these errors were encountered: