Created
August 6, 2013 23:57
-
-
Save joseph-montanez/6170027 to your computer and use it in GitHub Desktop.
get a parameter regardless of record type?
This file contains hidden or 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
food.fs(25,25): error FS0001: This expression was expected to have type | |
fruit | |
but here has type | |
vegie |
This file contains hidden or 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
type vegie = { | |
Seeds: int | |
Name: string | |
} | |
type fruit = { | |
Seeds: int | |
Name: string | |
Color: string | |
} | |
let countSeeds item = item.Seeds | |
let apple : fruit = { | |
Seeds = 8 | |
Name = "Apple" | |
Color = "Red" | |
} | |
let pepper : vegie = { | |
Seeds = 1024 | |
Name = "Green Bell Pepper" | |
} | |
printf "%A" (countSeeds pepper) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment