Skip to content

Instantly share code, notes, and snippets.

@aaronpowell
Last active June 21, 2016 01:04
Show Gist options
  • Save aaronpowell/dd28a8d141d12f4284ac2abe292b232a to your computer and use it in GitHub Desktop.
Save aaronpowell/dd28a8d141d12f4284ac2abe292b232a to your computer and use it in GitHub Desktop.
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