Haskell 学习笔记-14:再写 Hello World,编译成 exe 文件

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/quicmous/article/details/80810107

写下面的程序:

main = putStrLn "Hello, world!"

在命令行环境下键入命令:

>> C:\HaskellTest>C:\ghc-8.4.3\bin\ghc.exe hello.hs
[1 of 1] Compiling Main             ( hello.hs, hello.o )
Linking hello.exe ...

>> dir
驱动器 G 中的卷是 xxxx
卷的序列号是 0000-0000

C:\HaskellTest 的目录
2018/06/26  08:58         6,205,644 hello.exe
2018/06/26  08:58               805 hello.hi
2018/06/26  08:56                31 hello.hs
2018/06/26  08:58             2,130 hello.o

>> hello
Hello, world!

今天用 Haskell 第一次生成了 exe 应用程序,或许,我真的能用 Haskell 做些真正有价值的工作。

猜你喜欢

转载自blog.csdn.net/quicmous/article/details/80810107
今日推荐