Created
November 7, 2018 18:06
-
-
Save jochasinga/fc7ba6cb9128a6864282e69db7dac149 to your computer and use it in GitHub Desktop.
Ocaml modules
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 State = struct | |
type t = int | |
let inc (n: t) = Transformer.inc n | |
end | |
;; | |
module Transformer = struct | |
let inc (n: State.t) = n + 1 | |
end | |
;; | |
let num: State.t = 1 in | |
let b = State.inc num | |
;; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment