Skip to content

Instantly share code, notes, and snippets.

@benjic
Created April 4, 2015 17:25
Show Gist options
  • Save benjic/8ce447b0292bd2b12b05 to your computer and use it in GitHub Desktop.
Save benjic/8ce447b0292bd2b12b05 to your computer and use it in GitHub Desktop.
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