1

The problem is quite simple, i have a pretty messy ocaml code, with wrong indentation, break line ecc. is there any tool to format a ocaml code properly?

thanks!

  • 2
    This is an apparent duplicate of: [ocaml pretty printer (code formatter)](http://stackoverflow.com/q/12798723/487781). – hardmath Jan 22 '13 at 01:12

2 Answers2

3

You can use ocp-indent either in you editor or as an external tool to indent your code. It should work on windows.

Thomas
  • 5,047
  • 19
  • 30
  • 2
    Note: `ocp-indent` only does code indentation, not full blown code formatting. For example, it will not change positions of `->` inside a match. – typesanitizer Jun 26 '17 at 01:02
1

You could use Emacs with TypeRex extension. I don't use Emacs everyday, but use it to indent my code, it's a very good tool !

Ontologiae
  • 595
  • 4
  • 11
  • The problem is that I'm working on Windows –  Jan 22 '13 at 13:28
  • 1
    It's not very convenient for a daily workflow, but if you don't need to convert such code often, consider using Linux in a VirtualBox. – jrouquie Jan 22 '13 at 22:39