This PR allows to user [@@deriving js] to generate the conversion functions.
This is helpful to avoid writing their signature in interfaces (see issue #116) but it integrates better in the ecosystem.
Example
Before
In signature:
type ('a, 'b) t = { x : 'a; y : 'b }
val t_of_js : (Ojs.t -> 'a) -> (Ojs.t -> 'b) -> Ojs.t -> ('a, 'b) t
val t_to_js : ('a -> Ojs.t) -> ('b -> Ojs.t) -> ('a, 'b) t -> Ojs.t
and in structure :
type ('a, 'b) t = { x : 'a; y : 'b } [@js]
After
In both signture and structure:
type ('a, 'b) t = { x : 'a; y : 'b } [@@deriving js]
This attributes works in preprossed ml/mli files.
It also works through the "standalone" tool although the resulting implementation file will still need to be preprocessed by the ppx.
Context
This PR allows to user [@@deriving js] to generate the conversion functions. This is helpful to avoid writing their signature in interfaces (see issue #116) but it integrates better in the ecosystem.
Example
Before
In signature:
and in structure :
After
In both signture and structure:
This attributes works in preprossed ml/mli files. It also works through the "standalone" tool although the resulting implementation file will still need to be preprocessed by the ppx.