clairec

leap

Sep 15th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. leap n = dv n 400 || dv n 4 && not (dv n 100) where dv x y = mod x y == 0
  2. leap' n = False `unl` dv n 4 `unl` dv n 100 `unl` dv n 400
  3.  where
  4.    infixr `unl`
  5.    unl a b = if b then not a else a
  6.    dv x y = mod x y == 0
Add Comment
Please, Sign In to add comment