This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Good morning everyone, I'm currently learning ocaml for one of my CS class and needed to implement | |
an avl tree using ocaml. I thought that it would be interesting to go a step further and try | |
to verify the balance property of the avl tree using the type system. Here's the resulting code | |
annotated for people new to the ideas of type level programming :) | |
*) | |
(* the property we are going to try to verify is that at each node of our tree, the height difference between | |
the left and the right sub-trees is at most of 1. *) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Cmdliner | |
let mycli _ _ = print_endline "Success!" | |
let interface = | |
let docv = "INTERFACE" in | |
let doc = "parse AST as an interface (true or false)" in | |
Arg.(required & pos 0 (some bool) None & info ~docv ~doc []) |