Created
September 25, 2010 14:40
-
-
Save VoQn/596894 to your computer and use it in GitHub Desktop.
閏年判定とかいうの
This file contains 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
leap :: Integral a => a -> Bool | |
leap y = let m = (== 0) . (mod y) in if m 100 then m 400 else m 4 | |
{- | |
leap 3 -- False | |
leap 4 -- True | |
leap 5 -- False | |
leap 96 -- True | |
leap 100 -- False | |
leap 104 -- True | |
leap 300 -- False | |
leap 400 -- True | |
leap 500 -- False | |
-} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fix comment