Created
October 21, 2014 14:58
-
-
Save jacobwalkr/acc2e443f044b73d9ed4 to your computer and use it in GitHub Desktop.
H-99 problem 2
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
myLastButOne :: [a] -> a | |
myLastButOne [] = error "Not enough elements!" | |
myLastButOne [x] = error "Not enough elements!" | |
myLastButOne [x,y] = x | |
myLastButOne (_:xs) = myLastButOne xs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment