在我的Windows 7 Home Premium框中,为什么以下Haskell程序会挂起?
main = do
putStrLn "Hello, World"
脚本编译(使用GHC)如下:
C:\>ghc --make my_script
[1 of 1] Compiling Main ( my_script.hs, my_script.o )
Linking my_script.exe ...
然后执行该程序:
C:\>my_script.exe
即使几分钟后,命令提示符窗口中也没有输出。
GHC版本是:
C:\>ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.0.2
(Haskell编译器从https://www.haskell.org/platform/windows.html获得。)
C:\>ghci my_script.hs
GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( my_script.hs, interpreted )
Ok, modules loaded: Main.
*Main> main
Hello, World
*Main> :quit
Leaving GHCi.