Error with winGHCi Not in Scope

511 views Asked by At

I have just started programming Haskell using Haskell Platform. I'm running winGHCi 1.0.6.

I created a "basic.hs" file with the following code: square x = x * x

I create a folder under Haskell Platform and saved the "basic.hs" there. Then when I loaded the "basic.hs" file I got the following message:

*ghci> :cd C:\Program Files\Haskell Platform\2011.4.0.0\winghci
Warning: changing directory causes all loaded modules to be unloaded,
because the search path has changed.

ghci> :load "basic.hs"
[1 of 1] Compiling Main             ( basic.hs, interpreted )
Ok, modules loaded: Main.*

Then I try to use the function "square" I defined and I get the following error:

*ghci> square 3
<interactive>:1:1: Not in scope: `square*

Any help would be appreciated.

Isom

0

There are 0 answers