Last active
March 24, 2021 11:46
-
-
Save rexcfnghk/5aba69c0088968217f7697396eeecd7f 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
isLeapYear :: Int -> Bool | |
isLeapYear year | |
| isDivisibleBy 400 = True | |
| isDivisibleBy 100 = False | |
| isDivisibleBy 4 = True | |
| otherwise = False | |
where isDivisibleBy divisor = year `mod` divisor == 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment