Skip to content

Commit

Permalink
Trying to fix links #bruce #time 30m
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruce Eckel committed Jul 18, 2024
1 parent b0b6da9 commit 5a1cc74
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
10 changes: 6 additions & 4 deletions Chapters/04_Initialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ For example, you can share a single instance of a dependency across multiple tes
## Let Them Eat Bread

To illustrate how ZIO assembles programs, we simulate making and eating `Bread`.[^1]
[^1]: We were inspired by Li Haoyi's excellent article ["What's Functional Programming All About?"](https://www.lihaoyi.com/post/WhatsFunctionalProgrammingAllAbout.html)
[^1]: We were inspired by Li Haoyi's excellent article ["What's Functional Programming All About?"](https://effectorientedprogramming.com/resources/zio/whats-functional-programming-all-about)
We will create different types of `Bread`, so we start by defining `trait Bread`:

```scala 3 mdoc:silent
Expand Down Expand Up @@ -624,7 +624,7 @@ If we keep asking, we eventually get `Bread`.

### Fallback Dependencies

If our `Friend` does not have `Bread` to give us, we can set up a fallback strategy:
If our `Friend` does not have `Bread` to give us, we can set up a fallback strategy using `orElse`:

```scala 3 mdoc:runzio
import zio.*
Expand Down Expand Up @@ -659,6 +659,8 @@ def eatEatEat(retries: Int) =
retries
```

`retries` is then passed as the argument to `eatEatEat`:

```scala 3 mdoc:runzio
import zio.*
import zio.direct.*
Expand All @@ -667,7 +669,7 @@ def run =
eatEatEat(retries = 2)
```

Operations like `retry` also work on `ZLayer`s!
This shows that operations like `retry` also work on `ZLayer`s.

## External Configuration

Expand All @@ -678,7 +680,7 @@ Three typical ways are:
- Configuration Files
- OS Environment Variables

We can use the [ZIO Config library](https://github.com/zio/zio-config) to read these.
We can use the [ZIO Config library](https://effectorientedprogramming.com/resources/zio/zio-config/) to read these.
This is one of the few additional libraries used in this book on top of core ZIO.

```scala 3 mdoc:silent
Expand Down
2 changes: 1 addition & 1 deletion Chapters/07_Composability.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def openFileZ(path: String) =
```

Once we do this, the `ZIO` runtime will manage the lifecycle of this object via the `Scope` mechanism.
For a more thorough discussion of this, see the [ZIO documentation](https://www.zio.dev/reference/resource/scope/).
For a more thorough discussion of this, see the [ZIO documentation](https://effectorientedprogramming.com/resources/zio/docs).

Now we open a `File`, and check if it contains a topic of interest.

Expand Down
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ plugins:
'resources/zio/sharing-layers-between-multiple-files.md': 'https://zio.dev/reference/test/sharing-layers-between-multiple-files/'
'resources/zio/test-assertion-library.md': 'https://zio.dev/reference/test/assertions/'
'resources/zio/docs.md': 'https://zio.dev/reference/'
'resources/zio/zio-config.md': 'https://zio.dev/zio-config/'
'resources/zio/whats-functional-programming-all-about.md': 'https://www.lihaoyi.com/post/WhatsFunctionalProgrammingAllAbout.html'

0 comments on commit 5a1cc74

Please sign in to comment.