Created
July 3, 2017 22:09
-
-
Save scrwtp/6f60cc6ed422ed7aee6fc2593d0f4c1d to your computer and use it in GitHub Desktop.
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
namespace SO44893428 | |
module Generic = | |
let nextId = | |
let mutable i = 0 | |
let help (key:obj) = | |
i <- i + 1 | |
i | |
help | |
let a = nextId "a" // returns 1 | |
let b = nextId "b" // returns 1 | |
module Concrete = | |
let nextId : obj -> int = | |
let mutable i = 0 | |
let help (key:obj) = | |
i <- i + 1 | |
i | |
help | |
let a = nextId "a" // returns 1 | |
let b = nextId "b" // returns 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment