Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/default-handlers.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ providing a handler in a `run-with` block.
For example, we can write:

```flix
def main(): Unit \ {Clock, Env, Logger} =
use Time.Clock

def main(): Unit \ {Clock, Env, Logger} =
let ts = Clock.currentTime(TimeUnit.Milliseconds);
let os = Env.getOsName();
Logger.info("UNIX Timestamp: ${ts}");
Expand All @@ -19,7 +21,9 @@ def main(): Unit \ {Clock, Env, Logger} =
which the Flix compiler translates to:

```flix
def main(): Unit \ IO =
use Time.Clock

def main(): Unit \ IO =
run {
let ts = Clock.currentTime(TimeUnit.Milliseconds);
let os = Env.getOsName();
Expand Down
7 changes: 4 additions & 3 deletions src/effect-polymorphism.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@ Here the `nth` function has a heap effect in the region `r`.
We can also write functions that mix different effects:

```flix
def strange(a: Array[t, r]): Unit \ {r, Clock, Net, IO}
use Time.Clock

def strange(a: Array[t, r]): Unit \ {r, Clock, Http, IO}
// ^^^^^^^^^^^^^^^^^^^ a mixture of effects
```

This function has a heap effect `r` and three primitive effects: `Clock`,
`Net`, and `IO`.
This function has a heap effect `r` and three effects: `Clock`, `Http`, and `IO`.

## Higher-Order Functions

Expand Down
3 changes: 3 additions & 0 deletions src/http-and-https.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ appears in the type signature:
```flix
use Net.Http
use Net.HttpResponse
use Time.Clock
use Time.Duration.seconds

def main(): Unit \ { Clock, Http, IO } =
Expand Down Expand Up @@ -309,6 +310,7 @@ All three require the `Clock` effect:
```flix
use Net.Http
use Net.HttpResponse
use Time.Clock
use Time.Duration.{milliseconds, seconds}

def main(): Unit \ { Clock, Http, IO } =
Expand Down Expand Up @@ -362,6 +364,7 @@ URL, default headers, retry, circuit breaker, rate limiting, and logging:
use Net.Http
use Net.Retry
use Net.HttpResponse
use Time.Clock
use Time.Duration.{milliseconds, seconds}

def main(): Unit \ { Clock, Http, Logger, IO } =
Expand Down