Last active
June 21, 2016 01:04
-
-
Save aaronpowell/dd28a8d141d12f4284ac2abe292b232a to your computer and use it in GitHub Desktop.
Generic record type
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
let foo = (bar: 'a) -> | |
{ something: bar } | |
let baz = foo(1) | |
let baz2 = foo("a") | |
printf "bar: %d" baz.bar | |
printf "bar2: %s" baz2.bar |
Yep that's what I got to, working nicely
👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
type Foo<'a> = { Something : 'a }
let baz = { Something = 1 }
let baz2 = { Something = "a" }