···11+# 1.2.1
22+33+- Convert from Jbuilder to Dune (#5).
44+55+# 1.2
66+77+- Fix copyright year
88+99+# 1.1
1010+1111+- Added a LICENSE.md file
1212+1313+# 1.0
1414+1515+- Initial release
+24
vendor/opam/ppx_derivers/LICENSE.md
···11+Copyright (c) 2017, Jeremie Dimino <jeremie@dimino.org>
22+All rights reserved.
33+Redistribution and use in source and binary forms, with or without
44+modification, are permitted provided that the following conditions are met:
55+66+ * Redistributions of source code must retain the above copyright
77+ notice, this list of conditions and the following disclaimer.
88+ * Redistributions in binary form must reproduce the above copyright
99+ notice, this list of conditions and the following disclaimer in the
1010+ documentation and/or other materials provided with the distribution.
1111+ * Neither the name of Jeremie Dimino nor the names of his
1212+ contributors may be used to endorse or promote products derived
1313+ from this software without specific prior written permission.
1414+1515+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
1616+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1717+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
1818+DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE FOR ANY
1919+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2020+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
2121+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
2222+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2323+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2424+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
···11+Ppx_derivers
22+------------
33+44+Ppx_derivers is a tiny package whose sole purpose is to allow
55+[ppx_deriving](https://github.com/whitequark/ppx_deriving) and
66+[ppx_type_conv](https://github.com/janestreet/ppx_type_conv) to inter-operate
77+gracefully when linked as part of the same
88+[ocaml-migrate-parsetree](https://github.com/let-def/ocaml-migrate-parsetree)
99+driver.
1010+
···11+type deriver = ..
22+33+let all = Hashtbl.create 42
44+55+let register name deriver =
66+ if Hashtbl.mem all name then
77+ Printf.ksprintf failwith
88+ "Ppx_deriviers.register: %S is already registered" name;
99+ Hashtbl.add all name deriver
1010+1111+let lookup name =
1212+ match Hashtbl.find all name with
1313+ | drv -> Some drv
1414+ | exception Not_found -> None
1515+1616+let derivers () =
1717+ Hashtbl.fold (fun name drv acc -> (name, drv) :: acc) all []
+19
vendor/opam/ppx_derivers/src/ppx_derivers.mli
···11+(** Ppx derivers
22+33+ This module holds the various derivers registered by either ppx_deriving or
44+ ppx_type_conv.
55+*)
66+77+(** Type of a deriver. The concrete constructors are added by
88+ ppx_type_conv/ppx_deriving. *)
99+type deriver = ..
1010+1111+(** [register name deriver] registers a new deriver. Raises if [name] is already
1212+ registered. *)
1313+val register : string -> deriver -> unit
1414+1515+(** Lookup a previously registered deriver *)
1616+val lookup : string -> deriver option
1717+1818+(** [derivers ()] returns all currently registered derivers. *)
1919+val derivers : unit -> (string * deriver) list