{"action":"opened","issue":{"url":"https://api.github.com/repos/ocaml-community/yojson/issues/71","repository_url":"https://api.github.com/repos/ocaml-community/yojson","labels_url":"https://api.github.com/repos/ocaml-community/yojson/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/ocaml-community/yojson/issues/71/comments","events_url":"https://api.github.com/repos/ocaml-community/yojson/issues/71/events","html_url":"https://github.com/ocaml-community/yojson/issues/71","id":392747244,"node_id":"MDU6SXNzdWUzOTI3NDcyNDQ=","number":71,"title":"Type Yojson.Safe.t with equal and show/pp","user":{"login":"Leonidas-from-XIV","id":121531,"node_id":"MDQ6VXNlcjEyMTUzMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/121531?v=4","gravatar_id":"","url":"https://api.github.com/users/Leonidas-from-XIV","html_url":"https://github.com/Leonidas-from-XIV","followers_url":"https://api.github.com/users/Leonidas-from-XIV/followers","following_url":"https://api.github.com/users/Leonidas-from-XIV/following{/other_user}","gists_url":"https://api.github.com/users/Leonidas-from-XIV/gists{/gist_id}","starred_url":"https://api.github.com/users/Leonidas-from-XIV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Leonidas-from-XIV/subscriptions","organizations_url":"https://api.github.com/users/Leonidas-from-XIV/orgs","repos_url":"https://api.github.com/users/Leonidas-from-XIV/repos","events_url":"https://api.github.com/users/Leonidas-from-XIV/events{/privacy}","received_events_url":"https://api.github.com/users/Leonidas-from-XIV/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-19T19:33:50Z","updated_at":"2018-12-19T19:33:50Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"In recent years the OCaml community has converged on some conventions:\r\n\r\n* The main type in a module is `t`\r\n* There is a non-polymorphic comparison function\r\n* There is a way to print the data type (to a lesser degree adopted but often still useful)\r\n\r\nYojson is odd in these regards as the type is called `json` (it always trips me up and I have to look it up what it is named), there is no compare function (so I have to write my own) and the pretty printing functions have non-standard names and signatures so I can't just use `show` and `pp` as `ppx_deriving_show` helpfully generates.\r\n\r\nTherefore I would suggest:\r\n\r\n* Change the type to be `Yojson.Safe.t` while keeping a type alias `json` to preserve compatibility\r\n* Add an `equal : 't -> 't -> bool` function in the `Safe` module\r\n* Add `show`/`pp` functions in the `Safe` module\r\n\r\nI would volunteer of sending a PR, I just want to avoid spending the time implementing to have the suggestions ultimately rejected."}}
{"actor":{"display_login":"Leonidas-from-XIV"}}