4 ms·
I'm not a Haskeller and haven't played with monads knowing they were monads, but async in F# basically works like this: 1. Call the function with async { } blo
by edgyswingset 11y ago
I'm not a Haskeller and haven't played with monads knowing they were monads, but async in F# basically works like this:
1. Call the function with async { } block and have it return a computation object
2. Start that computation object in three primary ways:
a. On another thread, then wait (non-blocking) on it to finish
b. On another thread but don't wait for it to finish
c. On the current thread and don't wait for it to finish
There's a lot more details but that's going to cover probably 95% of the use cases.
My takeaways from it are:
a. Super easy to write code for it that's easy to read
b. Really hard to fuck it up
In my opinion, it's superior to the model that C#/VB have ... and pretty much every other language I've tried async support on. Have yet to use Haskell for it.