My own corner of monopam
2
fork

Configure Feed

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

ocaml-opm: rewrite README example to typecheck

The block referenced an unbound [kvn_text], had a stray paren before
the inner match, and mixed [Printf.printf] / [Fmt.pr]. Wrap as
[report kvn_text = ...], use [Fmt.pr] throughout, and add [fmt] to
the mdx libraries.

+12 -14
+10 -10
ocaml-opm/README.md
··· 31 31 ## Usage 32 32 33 33 ```ocaml 34 - match Opm.of_string kvn_text with 35 - | Ok opm -> 36 - Printf.printf "Object: %s\n" opm.metadata.object_name; 37 - ( 38 - match opm.state with 39 - | Opm.Cartesian sv -> 40 - Fmt.pr "Position: (%.3f, %.3f, %.3f) km\n" sv.x sv.y sv.z 41 - | Opm.Keplerian ke -> 42 - Fmt.pr "SMA: %.3f km, ecc: %.6f\n" ke.semi_major_axis ke.eccentricity) 43 - | Error e -> Fmt.epr "%a\n" Opm.pp_error e 34 + let report kvn_text = 35 + match Opm.of_string kvn_text with 36 + | Error e -> Fmt.epr "%a@." Opm.pp_error e 37 + | Ok opm -> ( 38 + Fmt.pr "Object: %s@." opm.metadata.object_name; 39 + match opm.state with 40 + | Opm.Cartesian sv -> 41 + Fmt.pr "Position: (%.3f, %.3f, %.3f) km@." sv.x sv.y sv.z 42 + | Opm.Keplerian ke -> 43 + Fmt.pr "SMA: %.3f km, ecc: %.6f@." ke.semi_major_axis ke.eccentricity) 44 44 ``` 45 45 46 46 ## API Overview
+2 -4
ocaml-opm/dune
··· 3 3 (flags :standard %{dune-warnings}))) 4 4 5 5 (mdx 6 - (files 7 - README.md 8 - ) 9 - (libraries opm)) 6 + (files README.md) 7 + (libraries opm fmt))