Last active
December 10, 2015 19:39
-
-
Save exterm/4482720 to your computer and use it in GitHub Desktop.
Showing that a function that depends only on a single attribute of a map like data structure is also possible with static records/structs. This allows adding/removing attributes from the record without modification of the all_members function.
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
| data Project = Project { | |
| projId :: String, | |
| projKind :: ProjectKind, | |
| projDescription :: String, | |
| projBudget :: Int, | |
| projTeam :: [Person] | |
| } | |
| all_members :: [Project] -> [Person] | |
| all_members projects = concat $ map projTeam projects |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment