package ocamlmig
Not available on OCaml 5.5Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=48fa5c5e3780016ed9f8dcfa1ca68d486c022bebe4f96e01967d5d6db56b999e
sha512=9d8adcb84dd7e58e64c00d2b781828f0e842c6b4e828f05df671161c34ba58a1887623b0b49f822646cd5664814f478173b65ce6610f8cf51d0f1c167b096d18
Description
Ocamlmig is a command line tool to rewrite ocaml source code, especially to make updating to newer interfaces easier.
Added to opam-repository:
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 1then you could do:
$ git diff b.ml
$ ocamlmig migrate -w
$ git diff b.ml
-let _ = A.old_name 1
+let _ = A.new_name 1Examples of real rewrites:
- Renaming operators (not trivial because the operators change precedence)
- Switching code using both Stdlib and Core to mostly Core
- Switching code using Cmdliner's
$tolet+, in three parts: switch to let+ proper (commit 2), removing tags (commit 3), and inlining flag terms (last commit). ocamlmig also checks that variables in moved code keep pointing to the same value. ocamlmig also checks that variables in moved code keep pointing to the same value.
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)
-
re
>= "1.10.3" - camlp-streams
- astring
-
csexp
>= "1.4.0" -
uutf
>= "1.0.1" -
uuseg
>= "10.0.0" - stdio
-
ocp-indent
>= "1.8.0" | "1" = "0" & >= "1.8.1" -
ocamlformat-rpc-lib
"1" = "0" & = version -
ocaml-version
>= "3.5.0" -
menhirSdk
>= "20201216" -
menhirLib
>= "20201216" -
menhir
>= "20201216" -
fpath
>= "0.7.3" - fix
- either
- dune-build-info
- dune
-
cmdliner
>= "1.1.0" -
base
>= "v0.12.0" -
alcotest
"1" = "0" & >= "1.3.0" -
ocaml
>= "4.08" - ppx_partial
- csexp
- core_unix
- core
- base
-
dune
>= "3.18" & >= "3.22" -
ocaml
>= "5.4" & < "5.5"
Dev Dependencies (1)
-
odoc
with-doc
Optional Dependencies
None
Used by
None
Conflicts
None
Build status
Results of building ocamlmig with each compiler on check.ci.ocaml.org, run of against opam-repository 8a77e58. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 5.5.20260803 | n/a | n/a | n/a | n/a | good |
| 5.4.20260731 (this version) | n/a | n/a | n/a | good | n/a |
| 5.2-20250228 | n/a | n/a | good | n/a | n/a |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure