package ocamlmig

  1. Overview
  2. Docs
OCaml source code rewriting tool

Install

dune-project
 Dependency

Authors

Maintainers

Sources

ocamlmig-5.4-20251020.tbz
sha256=cefdf4a018a159ae253786f82208e6b86529f417d77910c5a1875a900502e98c
sha512=a09a06bfb069933fc7ef2ce9fdca9a9b794d9e740e4a1cd7ddfebdf4d886b4ee3b8e00b098068acfb816cd87e0ea87015cfc1b19f198282422151d6c5b6f16cb

Description

Ocamlmig is a command line tool to rewrite ocaml source code, especially to make updating to newer interfaces easier.

Published: 28 Nov 2025

README

ocamlmig is a command line tool for rewriting ocaml source code with access to scope and type information.

As a simple example of what it can do, let's say an opam-installed library A provides this interface:

val new_name : int -> int

val old_name : int -> int
[@@migrate { repl = Rel.new_name }]

and your repository contains a file b.ml:

let _ = A.old_name 1

then you could do:

$ git diff b.ml
$ ocamlmig migrate -w
$ git diff b.ml
-let _ = A.old_name 1
+let _ = A.new_name 1

Examples of real rewrites:

If that piqued your interest, you can find more information about what ocamlmig does, and using it.

This is work in progress, so many things are only partially implemented, but the existing functionality as is should still be interesting.

Dependencies (29)

  1. re >= "1.10.3"
  2. camlp-streams
  3. astring
  4. csexp >= "1.4.0"
  5. uutf >= "1.0.1"
  6. uuseg >= "10.0.0"
  7. stdio
  8. ocp-indent >= "1.8.0" | "1" = "0" & >= "1.8.1"
  9. ocamlformat-rpc-lib "1" = "0" & = version
  10. ocaml-version >= "3.5.0"
  11. menhirSdk >= "20201216"
  12. menhirLib >= "20201216"
  13. menhir >= "20201216"
  14. fpath >= "0.7.3"
  15. fix
  16. either
  17. dune-build-info
  18. dune
  19. cmdliner >= "1.1.0"
  20. base >= "v0.12.0"
  21. alcotest "1" = "0" & >= "1.3.0"
  22. ocaml >= "4.08"
  23. ppx_partial
  24. csexp
  25. core_unix
  26. core
  27. base
  28. dune >= "3.15"
  29. ocaml >= "5.4" & < "5.5"

Dev Dependencies (1)

  1. odoc with-doc

Used by

None

Conflicts

None