Skip to Content
Mastering Functional Programming
book

Mastering Functional Programming

by Anatolii Kmetiuk
August 2018
Intermediate to advanced
380 pages
10h 2m
English
Packt Publishing
Content preview from Mastering Functional Programming

Asynchronous API

First of all, we need to remark what exactly we mean by the word asynchronous. We mean asynchronous with respect to the thread pool that the IO data type is executed on. We assume that we have no control of the task itself, and we are not able to redefine it. In fact, we do not care about how it is implemented; all we care about is the precise moment when it terminates. The task here is to prevent the threads of this precise IO execution from blocking.

To achieve this, we can use the IO.async method:

This method has a somewhat tricky signature. So, first, let's take a look in brief at what it does. Given a particular computation, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Functional Programming

Learning Functional Programming

Jack Widman

Publisher Resources

ISBN: 9781788620796Supplemental Content