Skip to content

Instantly share code, notes, and snippets.

@jastice
Created August 17, 2014 15:47
Show Gist options
  • Save jastice/bfccf4b96b40be3eb432 to your computer and use it in GitHub Desktop.
Save jastice/bfccf4b96b40be3eb432 to your computer and use it in GitHub Desktop.
Why does this compile?
type Thing t = { t | a:Int, b: String }
type Tag = { c: Int, d: String }
type Tagged = Thing Tag
thing = { a=3, b="foo" }
tagged = { thing | d = "derp" }
write: Tagged -> Element
write {a,b,c,d} = asText <| join " " [show c, d]
main = write tagged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment