Jump to content

Eban numbers: Difference between revisions

m
Line 657:
{{trans|Julia}}
<lang haskell>{-# LANGUAGE NumericUnderscores #-}
 
anyPass :: [a -> Bool] -> a -> Bool
anyPass [] _ = False
anyPass (f:fs) x = f x || anyPass fs x
 
isEban :: Int -> Bool
isEban n = all (anyPass`elem` [(==0), (==2), (==4), (==6)]) z
where
(b, r1) = n `quotRem` (10 ^ 9)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.