     // can throw an Exception
   .checkout               // can throw an Exception
```

<br>

```scala
def orderWorkflow(orderId: Int, items: List[Item]): `IO`[Order] =
  createOrder(orderId)
   .`addItems`(items)       // IO[Order]
   .flatMap(_.`checkout`)   // IO[Order]
```
]

---
# IO spreads

.eighty-two-left[
```scala
def orderWorkflow(orderId: Int, items: List[Item]): Order =
  createOrder(orderId)
   .addItems(items)        // can throw an Exception
   .checkout               // can throw an Except