Created
December 3, 2015 11:36
-
-
Save ccapndave/edd4d52df97315d49049 to your computer and use it in GitHub Desktop.
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 alias Doc a = { a | id : Int } | |
type alias User = Doc { userName : String } | |
type alias Group = Doc { groupName : String } | |
user1 = { id = 1, userName = "dave" } | |
group1 = { id = 100, groupName = "some group" } | |
getIdFromDoc : Doc a -> Int | |
getIdFromDoc doc = doc.id | |
id1 = getIdFromDoc user1 | |
id2 = getIdFromDoc group1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment