My own corner of monopam
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

ocaml-cache: enable MDX on lib/cache.mli, fix broken doc example

Run mdx on lib/cache.mli so the {[ ... ]} odoc block now type-checks.

The example referenced `env` out of nowhere when calling
`Eio.Stdenv.clock env`. Wrapped in `let run () = Eio_main.run @@ ...`
so the env is bound, and replaced the trailing `(* Some "answer" *)`
prose comment with `assert (MyCache.get cache 42 = Some "answer")`
so the documented round-trip is verified at mdx test time.

+10 -3
+6 -3
ocaml-cache/lib/cache.mli
··· 17 17 let hash = Hashtbl.hash 18 18 end) 19 19 20 - let cache = MyCache.create ~clock:(Eio.Stdenv.clock env) () 21 - let () = MyCache.set cache 42 "answer" 22 - let value = MyCache.get cache 42 (* Some "answer" *) 20 + let run () = 21 + Eio_main.run @@ fun env -> 22 + let clock = Eio.Stdenv.clock env in 23 + let cache = MyCache.create ~clock () in 24 + MyCache.set cache 42 "answer"; 25 + assert (MyCache.get cache 42 = Some "answer") 23 26 ]} *) 24 27 25 28 module type KEY = sig
+4
ocaml-cache/lib/dune
··· 2 2 (name cache) 3 3 (public_name cache) 4 4 (libraries eio logs)) 5 + 6 + (mdx 7 + (files cache.mli) 8 + (libraries cache eio eio.unix eio_main))