package ocamlmig
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
OCaml source code rewriting tool
Install
dune-project
Dependency
Authors
Maintainers
Sources
ocamlmig-5.5.20260803.tbz
sha256=c82b8574cd84ab842d818bc544eb97bf2abe51374ad418a40f650c9d8a2865ea
sha512=2bb5524ca83e70c5abc5887be3bad22fea6e7a1a5aff4d346f4a07a1a581e55ad6d61ff75328d0f85177ba82394d076f25063b8102b24ffb76f7247ca88ca7fd
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.14" - ppx_partial
- csexp
- core_unix
- core
- base
-
dune
>= "3.22" -
ocaml
>= "5.5" & < "5.6"
Dev Dependencies (1)
-
odoc
with-doc
Used by
None
Conflicts
None
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page