Johansson Mikael <[EMAIL PROTECTED]> writes:

> 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

_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to