Created
May 12, 2018 03:34
-
-
Save russmatney/d3f4ddea2e7e3d88e18c5cb60d5f1a02 to your computer and use it in GitHub Desktop.
This file contains 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
viewExamples :: IO () | |
viewExamples = do | |
let bob = User (UserName "Bob") 42 Nothing HM.empty | |
print "Bob's name is: " | |
print $ view userName bob | |
-- UserName "bob" | |
print $ bob ^. userName | |
-- UserName "bob" | |
print "Bob's score is: " | |
print $ view score bob | |
-- 42 | |
print $ bob ^. score | |
-- 42 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment