question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Kotlin suspending function variant to fold

See original GitHub issue

I think it would be useful to add a suspend fun <L, R, U> Either<L, R>.fold(leftMapper: suspend (L) -> U, rightMapper: suspend (R) -> U) Kotlin extension in order to be able to use suspending functions here.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
makingcommented, May 6, 2019

I’ll use awaitSomething, thanks!

0reactions
makingcommented, May 6, 2019

4a688ce is a mistake

Read more comments on GitHub >

github_iconTop Results From Across the Web

Composing suspending functions - Kotlin
What do we do if we need them to be invoked sequentially — first doSomethingUsefulOne and then doSomethingUsefulTwo , and compute the sum...
Read more >
Composing Coroutines and Suspend Functions - Baeldung
Learn how to work with coroutines in Kotlin and how to compose them together.
Read more >
kotlin - Flow reducing operations expect suspend function
The operation doesn't have to be suspendable, but Kotlin allows it to be. It is simply not opinionated and allows suspendable functions here ......
Read more >
suspend Functions and Flows - Klassbook - CommonsWare
A Flow , such as one created via flow() is welcome to call suspend functions. Those functions are welcome to switch the context...
Read more >
Resource folding and linting broken within private Kotlin ...
Description: When only referencing a resource (e.g. R.string.foo) within a private Kotlin suspend function, the lint tool will incorrectly warn, that the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found