Created
March 12, 2018 22:05
-
-
Save saesh/7ca7f7ac998fa032bb4025d995810967 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
| -- Find the K'th element of a list. The first element in the list is number 1. | |
| elementAt :: [a] -> Int -> a | |
| elementAt list k = (last (take k list)) | |
| main :: IO () | |
| main = print $ elementAt "wikipedia" 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment