Last active
June 21, 2016 01:04
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" }