Learn Effects

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

Effects are introduced by extending the Effect.t extensible variant.

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

We can write a new function to perform our effect.

let hello () = Effect.perform Hello

Now it is your turn, complete this effect handler to do something with the Hello effect!

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

0