
12 Sep
2001
12 Sep
'01
3:32 a.m.
Johansson Mikael
But when I try to write a program with this function:
f x = x mod 7 == 0 || x mod 10 == 7 || x div 10 mod 10 == 7
The IO doesn't seem to work How do I put programs like this in a IO shell.
Haskell can be confusing at first. How about: f :: Integer -> Bool f x = x `mod` 7 == 0 || x `mod` 10 == 7 || x `div` 10 `mod` 10 == 7 main = do putStrLn $ show (f 1) Hope that helps, Jens