kmeredith (23) [Avatar] Offline
#1
The Listing 5.5 code sample includes:

import AccountRepository._
val account = checkingAccount("a-123", "John K.", today.some,
            None, Balance(0)).toOption.get #A
val dsl = for {
  b <- updateBalance(account, 10000) #B
  c <- store(b)
  d <- balance(c.no)
} yield d


Would it be worthwhile to include that `Option#get` is a method that should never be used (since it's Partial), but OK to use in a test?
Debasish Ghosh (116) [Avatar] Offline
#2
I agree that Option#get should not be used. But here it's only in a sample test and I am sure that the data set up ensures that the get actually gets a result. But I would not use it in any serious code.

Thanks.