My own corner of monopam
2
fork

Configure Feed

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

ocaml-csts: fix README state-machine example

Three bugs:
- [Csts.Unbind] takes [{ unbind_reason; ... }], not [{ reason }].
- [Csts.Unbound] doesn't exist as an output; the constructor is
[Csts.Unbound_ok].
- The session driver fed only [bind; unbind], so the state machine
rejected the unbind from [Bind_pending]. Add the [Bind_return] /
[Unbind_return] inputs that complete the round-trip.

Switch [Printf.printf] / [print_endline] to [Fmt.pr] for consistency.

+10 -6
+9 -5
ocaml-csts/README.md
··· 66 66 version = 1; 67 67 } 68 68 69 - let unbind = Csts.Unbind { reason = Csts.End } 69 + let bind_return = Csts.Bind_return { result = Ok 1 } 70 + let unbind = Csts.Unbind { unbind_reason = Csts.End } 71 + let unbind_return = Csts.Unbind_return 70 72 71 73 let () = 72 - let _state, outputs = run_session [ bind; unbind ] in 74 + let _state, outputs = 75 + run_session [ bind; bind_return; unbind; unbind_return ] 76 + in 73 77 List.iter 74 78 (function 75 - | Csts.Bound v -> Printf.printf "bound (version %d)\n" v 76 - | Csts.Unbound -> print_endline "unbound" 79 + | Csts.Bound v -> Fmt.pr "bound (version %d)@." v 80 + | Csts.Unbound_ok -> Fmt.pr "unbound@." 77 81 | Csts.Send_pdu _ -> () 78 82 | _ -> ()) 79 83 outputs ··· 103 107 | Ok (_state', outputs) -> 104 108 List.iter 105 109 (function 106 - | Csts.Bound v -> Printf.printf "bound with version %d\n" v 110 + | Csts.Bound v -> Fmt.pr "bound with version %d@." v 107 111 | Csts.Send_pdu _pdu -> () 108 112 | _ -> ()) 109 113 outputs
+1 -1
ocaml-csts/dune
··· 4 4 5 5 (mdx 6 6 (files README.md) 7 - (libraries csts)) 7 + (libraries csts fmt))