Skip to content

Instantly share code, notes, and snippets.

@jochasinga
Created November 7, 2018 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jochasinga/fc7ba6cb9128a6864282e69db7dac149 to your computer and use it in GitHub Desktop.
Save jochasinga/fc7ba6cb9128a6864282e69db7dac149 to your computer and use it in GitHub Desktop.
Ocaml modules
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