-- import Text.Parsec -- import Text.Regex.Posix oddEx :: Integer -> Bool oddEx n = case quotRem n 10 of (0,0) -> False (0,r) -> odd r (q,r) -> odd r && oddEx q oddEx' :: Integer -> Bool oddEx' = all (flip notElem "02468") . show -- oddEx'' :: Integer -> Bool -- oddEx'' = (== "") . (=~ "[02468]") . show -- oddEx''' :: Integer -> Bool -- oddEx''' = either (const False) (const True) . parse (many1 (noneOf "02468") >> eof) "" . show main :: IO () main = do let xs = [0..1000] a = filter oddEx xs print $ a print $ all ((a ==) . flip filter xs) [oddEx' -- ,oddEx'' ,oddEx''' ]