Haskell Hello world,eclipse IDE [英] Haskell Hello world, eclipse IDE

查看:166
本文介绍了Haskell Hello world,eclipse IDE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有以下代码,

  module Main where 
main = putStrHello world!

当我用

  ghc.exe .\H1.hs -o hw.exe 

它工作正常,但在eclipseFP下,当我运行它时,我只在控制台窗口中看到以下内容:

  GHCi,版本6.10.4:http://www.haskell.org/ghc/:?为了帮助
加载包ghc-prim ... linked ... done。
加载包整数...链接...完成。
加载包基...链接...完成。
好​​的,加载模块:Main。
前奏主>

我犯了什么错误?

解决方案

从我看到的EclipseFP的一点,它只是GHCi的接口。这就意味着,就我而言,没有理由使用它,因为你得到了所有坏的Eclipse(膨胀,无底的渴望的记忆,乌龟的镇静速度),绝对没有好(索引,调试器,工具堆栈的管理)。



那么你做了什么错误?你使用Eclipse没关系 - 一个容易的错误。如果您正在学习Scala,Eclipse可能是要走的路。但是使用Haskell,您最好从命令行运行GHCi,并使用诸如Notepad ++(其语法高亮)的编辑器。一次,命令行/编辑器组合最好不是因为它是强壮的,而是因为它更有用。



如果你绝对必须有一个IDE,那么选择很少现在,但这是我发现的。



Leksah

WinGHCi



当然,任何在此问题的答案中找到。



我没有使用它,但是Leksah似乎是迄今为止功能最丰富的IDE。就个人而言,我坚持使用Notepad ++和命令行。


I'm having trouble getting "hello world" going with eclipseFP and Haskell.

I have the following code,

module Main where
  main = putStr "Hello world!"

and when I compile it with

ghc.exe .\H1.hs -o hw.exe

it works fine, but under eclipseFP, when I run it I only see the following in the console window:

GHCi, version 6.10.4: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
Ok, modules loaded: Main.
Prelude Main> 

What mistakes am I making?

解决方案

From what little I've seen of EclipseFP, it's merely an interface for GHCi. Which means, as far as I'm concerned, that there's no reason to use it, since you get all the bad of Eclipse (the bloat, the bottomless thirst for memory, the tortoise-on-sedatives speed), with absolutely none of the good (the indexing, the debugger, the management of your tool stack).

So what noob mistake did you make? You used Eclipse. It's OK -- an easy mistake to make. If you were learning Scala, Eclipse might have been the way to go. But with Haskell, you're better off running GHCi from the command line and using an editor like Notepad++ (which has decent syntax highlighting). For once, the command-line/editor combination is preferable not because it's macho, but because it's more useful.

If you absolutely must have an IDE, the pickings are few right now, but here's what I've found.

Leksah
WinGHCi

And of course, any found in the answer to this question.

I haven't used it, but Leksah seems to be the most feature-rich IDE to date. Personally, I'm sticking with Notepad++ and the command line.

这篇关于Haskell Hello world,eclipse IDE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆