Created
April 4, 2015 17:25
-
-
Save benjic/8ce447b0292bd2b12b05 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
module LeapYear(isLeapYear) where | |
isLeapYear :: Int -> Bool | |
isLeapYear x | |
| isDivisible 400 = True | |
| isDivisible 100 = False | |
| isDivisible 4 = True | |
| otherwise = False | |
where isDivisible year = mod x year == 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment