Skip to content

Commit 8fb48b9

Browse files
author
cardano-node-wiki
committed
chore(docs): Sync wiki to docs [skip-cd]
1 parent 2a115ab commit 8fb48b9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/ADR-8-ReaderT-Pattern-in-cardano‐cli.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ runClientCommand = \case
6464

6565

6666
# Decision
67-
- As such we are choosing to adopt the [ReaderT design pattern](https://tech.fpcomplete.com/blog/2017/06/readert-design-pattern/), treating all errors as `Exception`s and installing a single error handler at the top level to catch and report these exceptions (with a callstack included).
67+
- Error handling: All errors will be converted to exceptions that will be caught by a single exception handler at the top level.
68+
- Top level monad: [RIO](https://hackage.haskell.org/package/rio-0.1.22.0/docs/RIO.html#t:RIO). See the [ReaderT design pattern](https://tech.fpcomplete.com/blog/2017/06/readert-design-pattern/).
69+
6870
# Consequences
6971
- This should dramatically improve our code's composability and remove many unnecessary error types.
70-
- Readability concerning what errors can be thrown will be negatively impacted. We believe the trade off is worth it.
72+
- Readability concerning what errors can be thrown will be negatively impacted. However `ExceptT` already lies about what exceptions can be thrown because it is not limited to the error type stated in `ExceptT`'s type signature. In other words `IO` can implicitly throw other `Exception`s.
7173
- Initially this will be adopted under the "compatible" group of commands so `cardano-cli` will have a design split temporarily. Once we are happy with the result we will propagate to the rest of `cardano-cli`

0 commit comments

Comments
 (0)