Set type t for a better approach on universal code
Hi there,
I was working on universalize the melange-json code on server-reason-react: https://github.com/ml-in-barcelona/server-reason-react/pull/133
Reading the melange-json code led me to doubt.
Could we have type t = Js.Json.t instead of using directly the Js.Json.t inside the code?
The idea is to create a nice way to have a code that works by itself, I understand it depends on Js.Json.t internally, but every usage of Json would return its type: Json.t, and will handle on every function by its type.
The usage in the end could be:
let encodeStr str : Json.t = Json.encode str
Without conflict between Js.Json.t (Which isn't the main type of Json) and any other tool, such as Yojson.
Is it valid? WDYT?
Ppx_deriving_json_runtime is kinda like that, the module name isn't nice though...