My own corner of monopam
2
fork

Configure Feed

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

ocaml-oem: rewrite README example to typecheck

The block had several glitches: missing [in] after [Oem.time_range
oem], a stray [(] before the inner match, [some_ptime] free, and
mixed [Printf.printf] / [Fmt.pr]. Wrap as [report ~path ~at = ...] so
the time argument is bound, switch fully to [Fmt.pr], and add [vec3]
/ [ptime] / [fmt] to the mdx libraries.

+12 -10
+11 -9
ocaml-oem/README.md
··· 26 26 ## Usage 27 27 28 28 ```ocaml 29 - match Oem.of_file "ephemeris.oem" with 30 - | Ok oem -> 31 - Printf.printf "Object: %s\n" (Oem.object_name oem); 32 - let (start, stop) = Oem.time_range oem (* Interpolate at a specific time *) 33 - ( 34 - match Oem.interpolate_all oem some_ptime with 35 - | Some sv -> Fmt.pr "Position: %a\n" Vec3.pp sv.pos 36 - | None -> print_endline "Time out of range") 37 - | Error e -> Fmt.epr "%a\n" Oem.pp_error e 29 + let report ~path ~at = 30 + match Oem.of_file path with 31 + | Error e -> Fmt.epr "%a@." Oem.pp_error e 32 + | Ok oem -> 33 + Fmt.pr "Object: %s@." (Oem.object_name oem); 34 + let start, stop = Oem.time_range oem in 35 + Fmt.pr "Range: %a -> %a@." Ptime.pp start Ptime.pp stop; 36 + (* Interpolate at a specific time. *) 37 + (match Oem.interpolate_all oem at with 38 + | Some sv -> Fmt.pr "Position: %a@." Vec3.pp sv.pos 39 + | None -> Fmt.pr "Time out of range@.") 38 40 ``` 39 41 40 42 ## API Overview
+1 -1
ocaml-oem/dune
··· 4 4 5 5 (mdx 6 6 (files README.md) 7 - (libraries oem)) 7 + (libraries oem vec3 fmt ptime))