<script async
  src="https://cdn.jsdelivr.net/gh/art-w/x-ocaml.js@6/x-ocaml.js"
  src-worker="https://cdn.jsdelivr.net/gh/art-w/x-ocaml.js@6/x-ocaml.worker+effects.js"
></script>

<style>
  body {
    font-size: 24px;
  }
</style>

# Learn Effects

Welcome to a (_fake_) presentation about learning effects in OCaml!

{pause up}
Effects are introduced by extending the `Effect.t` extensible variant.

```ocaml
type _ Effect.t += Hello : unit Effect.t
```

{pause}

We can write a new function to _perform_ our effect.

```ocaml
let hello () = Effect.perform Hello
```

{pause up}
Now it is your turn, complete this effect handler to do _something_ with the `Hello` effect!

```ocaml
let custom_handler fn =
  let open Effect.Deep in
  try_with fn () {
    effc = (fun v -> failwith "TODO")
}
```
