September 2023
Intermediate to advanced
470 pages
11h 12m
English
Now we need to understand how to safely access remote data in a functional way. This is a harder problem than just sending stateless requests remotely, like using HTTP, because for our data, we need to keep using the same session and transaction for related calls, since they are executed atomically—either all of them or none.
Since a simple call won’t work, and we want to abstract on the actual database transaction, a solution is to put database operations in some kind of context where they can be used safely and passed around. Looking at the problem in this way, functors seem like a good fit.
From the definition, functors (see Learning Functors and Categories) are transformations from one category ...
Read now
Unlock full access