将文件传递给 GHCi 并在命令行上接收输出?
在 Python 中,我们可以这么说:
python script.py
从命令行接收 script.py 的内联输出。是否可以使用 Haskell 的 GHCi 来做到这一点?基本上我想知道是否有一种方法可以从命令行运行 Haskell 程序而无需编译,也无需用户输入解释器。
In Python one can say this:
python script.py
from the command line and receive script.py
's output inlined. Is it possible to do this with Haskell's GHCi? Basically I'm wondering if there's a way to run a Haskell program from the command line without compiling and without the user entering the interpreter.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
runghc
就是您要寻找的。从它的联机帮助页来看:编辑:Ubuntu 提供了一个名为
runhaskell
的符号链接,但它可能不是标准的。runghc
is what you're looking for. From its manpage:Edit: Ubuntu provides a symlink called
runhaskell
, but it might not be standard.