Created
December 3, 2015 12:15
-
-
Save ccapndave/be3ec494b286b8d70f82 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 RDoc a = { a | id : Int } | |
type alias RUser = RDoc { userName : String } | |
type alias RGroup = RDoc { groupName : String } | |
type RSelectedDoc | |
= RSelectedUser RUser | |
| RSelectedGroup RGroup | |
rselectedDocToDoc : RSelectedDoc -> RDoc a | |
rselectedDocToDoc selectedDoc = | |
case selectedDoc of | |
RSelectedUser user -> { id = user.id } | |
RSelectedGroup group -> { id = group.id } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment