From 3f440d21fa3847ab30a940013ceffb99ae3497b9 Mon Sep 17 00:00:00 2001
From: JP Moresmau This document shows how you would create and run the 'Hello World'
-application in Eclipse with Haskell support. It also explains some of the
-main user interface elements in Eclipse. The focus is on helping
-developers who are not familiar with Eclipse to quickly get started
-with it as an IDE that supports Haskell development.
- A quick start guide to Haskell programming with Eclipse
-
-
-
Note: This is work in progress, which means that some of the features -described here may not yet be in place.
- -Open the Haskell Perspective -
- Eclipse makes use of a concept called Perspectives. - Everything in the workspace is seen from such a Perspective. When you - start Eclipse for the first time, the most basic of all Perspectives is - open: the Resource Perspective, which handles just some basic - file management and text editing. By openening the Haskell perspective, - you activate everything that is Haskell-aware. -
-- Select from the menu: Window > Open Perspective > Haskell. - (You can also open the Haskell Perspective from a link on the - Welcome page.) -
- Seen from the Haskell Perspective, a file is not just a file, but (if it - has the correct extension) a Haskell source file, which means that you - can open it with the Haskell source editor, you can compile it and run - it with a Haskell interpreter (like HUGS) or as (e.g. with GHC) - compiled and linked executable. The Perspective contains also some - Views, which provide Haskell-specific information about - the file which is currently opened in the editor (Outline View) - or about the last build process (in the Console View). -
-- You can switch and close Perspectives at any time from the vertical - toolbar at the left of the workbench. If you have closed a Perspective - or a View, you can re-open it from the menu Window > Open - Perspective or Show View. -
-- The workspace is organized into Projects (roughly: - directories within the workspace directory). -
- -- Create a new project by selecting File > New > Project from - the menu, expanding the Functional programming icon, then choosing - Haskell Project. Specify a project name and hit OK. -
- A Haskell project has some properties: -
- When the project has been created, you will see the respective folders, - which are created by the New Project wizard. You can configure - these settings on the Preference Page for that wizard. -
-- Add source files to the project source folder. -
- -- Files can be created either from the menu (File > New), or from - the context menu you get when you right-click the project in the - Project Explorer View). -
- For the 'Hello world' program, create a new file named
- Main.hs
.
-
- If you give the files a Haskell-specific extension (like .hs
- or .lhs
(for literate Haskell), you can open the files with
- the Haskell source code editor from the Project Explorer
- view.
- Right-click the file and choose Open with >Haskell editor. - Type some code. -
You can configure the editor in the main Preferences Dialog: - Select Window > Preferences from the menu and choose the - Functional Programming section.
- -- Enter the code for your 'Hello world', e.g. -
| |
- Save. This will trigger the auto building, and you will see compiler - errors (if there were errors in the build) in the Problems - View. If no errors have occured, the compiled object files and - the linked executable should be in their respective folders. Auto building - works incrementally, that is, only changed resources are built when you - save again. -
- You can launch the compiled executable of your Haskell programs from within - the IDE. -
- -- Running a program creates a new Launch configuration for that - program. You can re-run a lauch configuration from the Run menu. - Clicking the Run-icon re-launches always the last launched configuration. -
- -- If you choose Run ... from the menu, you get a dialog where you - can edit launch configurations. For example, you may want to add parameters - to the program launch. -
- -- Console input and output are handled by the Console View (at the - bottom left of the workbench). You should see the 'Hello world' output - appear there, and if your program takes console input, the Console View - is where you can type in while developing. -
+This document shows how you would create and run the 'Hello World' +application in Eclipse with Haskell support. It also explains some of the +main user interface elements in Eclipse. The focus is on helping +developers who are not familiar with Eclipse to quickly get started +with it as an IDE that supports Haskell development.
+ ++
Note: This is work in progress, which means that some of the features +described here may not yet be in place.
+ +Open the Haskell Perspective +
+ Eclipse makes use of a concept called Perspectives. + Everything in the workspace is seen from such a Perspective. When you + start Eclipse for the first time, the most basic of all Perspectives is + open: the Resource Perspective, which handles just some basic + file management and text editing. By openening the Haskell perspective, + you activate everything that is Haskell-aware. +
++ Select from the menu: Window > Open Perspective > Haskell. + (You can also open the Haskell Perspective from a link on the + Welcome page.) +
+ Seen from the Haskell Perspective, a file is not just a file, but (if it + has the correct extension) a Haskell source file, which means that you + can open it with the Haskell source editor, you can compile it and run + it with a Haskell interpreter (like HUGS) or as (e.g. with GHC) + compiled and linked executable. The Perspective contains also some + Views, which provide Haskell-specific information about + the file which is currently opened in the editor (Outline View) + or about the last build process (in the Console View). +
++ You can switch and close Perspectives at any time from the vertical + toolbar at the left of the workbench. If you have closed a Perspective + or a View, you can re-open it from the menu Window > Open + Perspective or Show View. +
++ The workspace is organized into Projects (roughly: + directories within the workspace directory). +
+ ++ Create a new project by selecting File > New > Project from + the menu, expanding the Haskell icon, then choosing + Haskell Project. Specify a project name and hit OK. +
Specify a project name
Specify where you want the project to reside (default is inside your workspace
Specify some initial components to be created for you. The New Project wizard will auto generate a cabal file that will contain a reference to each component you select. You can choose to create an executable, a library, or both.
+ Add source files to the project source folder. +
+ +If you have selected "executable" in the new project wizard page, a
+ Main.hs
file should have been created for you.
+ Otherwise you can create a new Haskell module from the menu (File > New > Haskell > Haskell Module).
+ The second page of the wizard lets you choose in which component the module will be present. You can have a project with several components, and not all modules are present in all components.
+
+ If you give the files a Haskell-specific extension (like .hs
+ or .lhs
(for literate Haskell), you can open the files with
+ the Haskell source code editor from the Project Explorer
+ view.
+ Right-click the file and choose Open with >Haskell editor. + Type some code. +
You can configure the editor in the main Preferences Dialog: + Select Window > Preferences from the menu and choose the + General > Editors > Text Editors section.
+ ++ Enter the code for your 'Hello world', e.g. +
| |
+ Save. This will trigger the auto building, and you will see compiler + errors (if there were errors in the build) in the Problems + View. If no errors have occurred, the compiled object files and + the linked executable should be in their respective folders. Auto building + works incrementally, that is, only changed resources are built when you + save again. +
+ You can launch the compiled executable of your Haskell programs from within + the IDE. +
+ ++ Running a program creates a new Launch configuration for that + program. You can re-run a lauch configuration from the Run menu. + Clicking the Run-icon re-launches always the last launched configuration. +
+ ++ If you choose Run ... from the menu, you get a dialog where you + can edit launch configurations. For example, you may want to add parameters + to the program launch. +
+ ++ Console input and output are handled by the Console View (at the + bottom left of the workbench). You should see the 'Hello world' output + appear there, and if your program takes console input, the Console View + is where you can type in while developing. +
+ +You can right click on any Haskell module and choose Run GHCi session. This will open GHCi, the GHC interpreter, in a Eclipse console, and load all the required modules.
+ +You can type in that console and have a full interactive session, modifying your modules in the Eclipse editors and running code in the console
+ +The launch configuration options for interpreter sessions let you configure some automation features, like automatically reloading modules that you've saved in the editor.
+ + \ No newline at end of file diff --git a/net.sf.eclipsefp.haskell.doc.user/html/installation.html b/net.sf.eclipsefp.haskell.doc.user/html/installation.html new file mode 100644 index 000000000..e50daf685 --- /dev/null +++ b/net.sf.eclipsefp.haskell.doc.user/html/installation.html @@ -0,0 +1,32 @@ +If you see this, you have successfully installed the eclipseFP plugins. +However there may still be some configuration steps to be done before you can use the plugins fully.
+ ++EclipseFP requires GHC to compile Haskell source files. +We recommend installing the Haskell Platform that comes with all required libraries bundled in a installer for your platform. +You can configure GHC by opening the Eclipse Preferences and going to Haskell > Haskell implementations. If a GHC is in your PATH you should see it in the list. Otherwise you can manually add a GHC installation. +
+ ++EclipseFP also requires a working Cabal. Cabal is a build management tool for Haskell. Similarly, the Haskell Platform contains a version of Cabal compatible with the GHC it ships with. +You can configure Cabal in the Eclipse Preferences under Haskell > Scion and Cabal. By default EclipseFP will have looked in your PATH and use any Cabal installation it can find there. +
+ ++Scion is a Haskell program that uses GHC and Cabal to give a consistent API to manage and build Haskell projects. EclipseFP uses Scion for a lot of operations. +It comes with a version of Scion in source form, that should get built automatically once GHC and Cabal have been set up. +The Eclipse Preferences page under Haskell > Scion and Cabal allows you to change settings if required. +We recommend to stick to default setting (built-in server through Standard Stream/Pipe) unless you feel adventurous! +
+ ++It may happen that Scion does not build successfully when you start EclipseFP. +The build process dumps its outputs and errors into a Console in the Console View of Eclipse. Please check this file for errors. +Often, the build fails due to some libraries conflict. Please run cabal update before restarting EclipseFP. +This will ensure your Cabal knows about the latest versions of libraries available on Hackage. +
\ No newline at end of file diff --git a/net.sf.eclipsefp.haskell.doc.user/html/overview.html b/net.sf.eclipsefp.haskell.doc.user/html/overview.html index 60335e54b..09f48acdb 100644 --- a/net.sf.eclipsefp.haskell.doc.user/html/overview.html +++ b/net.sf.eclipsefp.haskell.doc.user/html/overview.html @@ -1,57 +1,49 @@ -- This is the overview page for the functional programming tools features, - implemented by an open source project located at - eclipsefp.sourceforge.net. -
- -- Eclipse is an open source project that - has at its center an extensible, universal plugin architecture and a - (meanwhile very popular) IDE. There are various programming languages - already supported by this IDE, namely Java, C/C++, COBOL and more. -
- -We are adding development tools for functional programming to that - framework. These tools extend the Eclipse IDE to support currently - Haskell, a pure, non-strict functional - programming language, and Objective Caml. -
- -Andrei de A. Formiga | -- | - |
Leif Frenzel | -- | himself@leiffrenzel.de | -
Thiago Arrais | -- | thiago.arrais@gmail.com | -
- ... and of course all the people who try it and send feedback. -
- -Any feedback is most welcome. If you want to actively help visit -eclipsefp.sourceforge.net and -subscribe to the development Mailing list (or simply file a bug report or -feature request on the Tracker or in one of the Forums). - -
+ This is the overview page for the functional programming tools features, + implemented by an open source project located at + eclipsefp.sourceforge.net. +
+ ++ Eclipse is an open source project that + has at its center an extensible, universal plugin architecture and a + (meanwhile very popular) IDE. There are various programming languages + already supported by this IDE, namely Java, C/C++, COBOL and more. +
+ +We are adding development tools for functional programming to that + framework. These tools extend the Eclipse IDE to support + Haskell, a pure, non-strict functional + programming language. +
+ ++
+ ... and of course all the people who try it and send feedback. +
+ +Any feedback is most welcome. If you want to actively help visit +eclipsefp.sourceforge.net and +subscribe to the development Mailing list (or simply file a bug report or +feature request on the Tracker or in one of the Forums). + +
-
View compiler output | -Compiling takes place in the - background, when a source file is saved. Compiler errors and warnings are - displayed in the Problems view. You can, however, also view the complete - compiler output of the build in Eclipse's Console view. - |
-
- Default structure for Haskell projects - | -
- - In the Preferences for the New Project wizard you can edit - the default values for these properties (Window > Preferences > - Functional Programming > Haskell > New Project). You can also - let the project folder the combined source/binary/output folder. - - |
-