Created
January 26, 2017 19:31
-
-
Save esad/b7ee57ce627e228fc46a012779a27075 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
type Foo<'a> = Foo of string | |
let get (Foo key : Foo<'a>) : 'a option = | |
None | |
let set (Foo key : Foo<'a>) (value : 'a) = | |
() | |
let f = Foo "test" | |
set f 3 | |
let x = get f | |
/// ^ Value restriction. The value 'x' has been inferred to have generic type | |
/// val x : '_a option |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment