Skip to content

Instantly share code, notes, and snippets.

@aaronpowell
Last active June 21, 2016 01:04
Generic record type
let foo = (bar: 'a) ->
{ something: bar }
let baz = foo(1)
let baz2 = foo("a")
printf "bar: %d" baz.bar
printf "bar2: %s" baz2.bar
@rodrigovidal
Copy link

type Foo<'a> = { Something : 'a }

let baz = { Something = 1 }

let baz2 = { Something = "a" }

@aaronpowell
Copy link
Author

Yep that's what I got to, working nicely

@rodrigovidal
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment