package ocamlmig
 sectionYPositions = computeSectionYPositions($el), 10)"
  x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
  >
  
  
  OCaml source code rewriting tool
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
  
    
      ocamlmig-5.2-20250202.tbz
    
    
        
    
  
  
  
    
  
  
    
  
        sha256=4e8e966d32d45c5fce23f5310de0ad6885b5879b9c5293d2dfa04ed6f6cb8f93
    
    
  sha512=d1fb37be81b4adb92e4cf38f2f41e1655b522ca1a45103224643fa41ee88603bb4d9b44b8bfa7028fb8e28a680d210209fe1068d8a75102c925139954d037e37
    
    
  doc/README.html
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
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.
 sectionYPositions = computeSectionYPositions($el), 10)"
  x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
  >