Haskell Platform を使用して Haskell のプログラミングを始めたばかりです。winGHCi 1.0.6 を実行しています。
次のコードで「basic.hs」ファイルを作成しました。square x = x * x
Haskell Platform の下にフォルダーを作成し、そこに「basic.hs」を保存しました。次に、「basic.hs」ファイルをロードすると、次のメッセージが表示されました。
*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.*
次に、定義した関数「square」を使用しようとすると、次のエラーが発生します。
*ghci> square 3
<interactive>:1:1: Not in scope: `square*
どんな助けでも大歓迎です。
イソム