在Windows中将Haskell(.hs)编译为exe

前端之家收集整理的这篇文章主要介绍了在Windows中将Haskell(.hs)编译为exe前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
是否可以在Windows中将一组.hs的haskell文件编译成exe? .hs – > .可执行程序
绝对.安装 the Haskell Platform,它为您提供了一个最先进的Haskell编译器 @L_403_1@.

默认情况下,它编译为可执行文件,它在Linux或Windows上的工作相同.例如.

给定一个文件

$cat A.hs
main = print "hello,world"

用GHC编译:

$ghc --make A.hs
[1 of 1] Compiling Main             ( A.hs,A.o )
Linking A.exe ...

你现在可以运行:

$./A.exe
"hello,world"

注意,这是在Cygwin下.但同样适用于Windows:

C:\temp>ghc --make A.hs
[1 of 1] Compiling Main             ( A.hs,A.o )
Linking A.exe ...

C:\temp>A.exe
"hello,world"
原文链接:https://www.f2er.com/windows/371584.html

猜你在找的Windows相关文章