Created
April 11, 2016 05:50
-
-
Save kkismd/3d6ff3abc664b24b1d464bd92c38c5a7 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
| data Person = Person { firstName :: String, lastName :: String } deriving Show | |
| data DisplayPerson = DisplayPerson { name :: String } deriving Show | |
| names :: Person -> [String] | |
| names person = [firstName person, lastName person] | |
| translate :: Person -> DisplayPerson | |
| translate = DisplayPerson . unwords . names | |
| translateR :: Person -> DisplayPerson | |
| translateR = DisplayPerson . unwords . reverse . names |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment