LeapYear.hs

1
2
3
4
5
6
7
8
9
10
module LeapYear where

isLeapYear :: Integer -> Bool
isLeapYear y
  | dividesBy 400 = True
  | dividesBy 100 = False
  | dividesBy 4   = True
  | otherwise     = False
  where
    dividesBy n = rem y n == 0

@Abbath and @abo64 think this looks great

Comments


You're not logged in right now. Please login via GitHub to comment