Hello,
I have to make a loop where on the number 1 - 100 the square is
calculated.
So I did this :
loop :: Int -> IO ()
loop n = do
if n <= 100
then do
x n = n * n;
putStrLn (show n );
putChar ' ';
putStrLn (show x n);
loop (n + 1);
else
return n ;
main :: IO ()
main = loop 1
but now I see this error message :
-
Main.hs@5:13-5:14
parse error on input `='
-
✖
So somthing is wrong at this line x n = n * n
But its looking well to me.
Where did I take the wrong lane or were did I misunderstood
something.
Give me a tip or a explanation please and not a answer.
Otherwise I do not learn anything .
Roelof