summaryrefslogtreecommitdiff
path: root/testsuite/tests/effects/test3.ml
blob: 1a64454399fb110f6df60257bff4c13f66135d84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(* TEST *)

open Effect
open Effect.Deep

type _ t += E : unit t
exception X

let () =
  Printf.printf "%d\n%!" @@
  match_with (fun () ->
    Printf.printf "in handler. raising X\n%!";
    raise X) ()
    { retc = (fun v -> v);
      exnc = (function
        | X -> 10
        | e -> raise e);
      effc = (fun (type a) (e : a t) ->
        match e with
        | E -> Some (fun k -> 11)
        | e -> None) }