-
-
Save Wilfred/57fdf70b38a6c36e20c6e819897254d8 to your computer and use it in GitHub Desktop.
playing with modules in ocaml
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
module type HasLength = sig | |
type t | |
val my_length : t -> int | |
end | |
module UnitHasLength = struct | |
type t = unit | |
let my_length (items: unit): int = 0 | |
end | |
let inc_length (x: HasLength) = (my_length x) + 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment