Susan Harkins (195) [Avatar] Offline
Please post errors in the published version of Functional and Reactive Domain Modeling here. We'll publish a comprehensive list for everyone's convenience. Thank you!

Susan Harkins
Errata Editor
Norbert Scheller (2) [Avatar] Offline
In chapter 3 and 4 you mention that scala.util.Try is a monad.
In fact Try is not a monad. It fails the left identity law.
But, the left identity law is not relevant in for-comprehensions.
So one can use Try safely in for-comprehensions.

Maybe one has to point out that Try is not a monad, but has a monadic API.
Debasish Ghosh (111) [Avatar] Offline
I mention as a footnote in Page 78 (Chapter 3) that Try violates a law of being a monad. I also provide a link to the SIP which discusses the details.

Norbert Scheller (2) [Avatar] Offline
Sorry, my fault!! I missed that!!
I love your book!!
Martijn Blankestijn (1) [Avatar] Offline
p. 123 the Applicative for List

I think the List should occur in first position as defined by the Applicative Trait.
override def ap[A, B](as: List[A])(fs: List[A => B]) =
for {
a <- as
f <- fs
} yield f(a)

Or did I miss anything?
Debasish Ghosh (111) [Avatar] Offline
Good catch .. you are absolutely correct! The arguments need to be flipped ..

Susan Harkins (195) [Avatar] Offline
339603 (2) [Avatar] Offline
Section 1.5, pg 30, verification of correctness code snippet, top of page:

Remove "=>" at the beginning of 4 lines, then this code will execute. Otherwise it's misleading.


val a = Account("a1', "John")

credit(a, 100).flatMap ...
=> Success(a.copy(balance ...
=> debit(Account("a1", ...
=> Success(a.copy(balance ...
=> Success(Account("a1", ...
339603 (2) [Avatar] Offline
pg 29, Listing 1.10 end, top of page

object AccountService extends AccountService

The above object declaration should be outside of the closing brace for trait AccountService.
In other words, the object declaration should be below the closing brace that appears on the next line, rather than above it.