An Integrated Development Environment for Haskell
Total Page:16
File Type:pdf, Size:1020Kb
Leksah: An Integrated Development Environment for Haskell Jürgen Nicklisch-Franken Hamish Mackenzie July 21, 2009 Contents 1 Introduction 4 1.1 Further Information . .4 1.2 Release Notes . .4 1.2.1 Version 0.6 Beta Release Juli 2009 . .4 1.2.2 Version 0.4 Beta Release February/March 2009 . .5 1.2.3 Version 0.1 Alpha Release February 2008 . .5 2 Installing Leksah 6 2.1 Generic Installation Instructions . .6 2.1.1 Install GHC (Glasgow Haskell Compiler) . .6 2.1.2 Install Cabal . .6 2.1.3 Install Gtk2Hs . .6 2.1.4 Install Leksah . .7 2.1.5 Where Things Are Installed . .7 2.1.6 Post installation steps . .7 2.2 OS X (using MacPorts) . .7 2.2.1 Install MacPorts . .7 2.2.2 Set up ~/.prole . .8 2.2.3 Update MacPorts . .8 2.2.4 Set Variants To Use Quartz (Optional) . .8 2.2.5 Install . .8 2.2.6 Make It Look Nice . .8 2.2.7 Point Leksah At The Source . .9 2.3 Ubuntu . .9 2.3.1 Install Prerequisites . .9 2.3.2 Install GHC (Once 6.10.1 is in the universe repository) . .9 2.3.3 Install Cabal . .9 1 2.3.4 Install Gtk2Hs . 10 2.3.5 Add Cabal To Your PATH . 10 2.3.6 Install Leksah . 10 2.4 MS Windows . 10 3 First start of Leksah 12 3.1 Hello World example . 13 4 The Editor 16 4.1 Find and Replace . 16 4.1.1 Grep . 17 4.2 Source Candy . 18 4.3 Completion . 18 4.4 Using the Flipper to Switch Editors . 19 4.5 Editor Preferences . 19 4.6 Further info . 20 5 Packages 21 5.1 Package Editor . 21 5.2 Building . 22 5.3 Background Build . 23 5.4 Build system ags . 24 5.5 Import Helper . 24 6 Module Browser and Metadata 26 6.1 The Modules Pane . 26 6.2 The Info Pane . 28 6.3 The Search Pane . 29 6.4 The References Pane . 30 6.5 Metadata collection . 30 7 Debugger 32 8 Conguration 34 8.1 Layout . 34 8.1.1 Group panes . 34 8.1.2 Detached windows . 35 8.2 Session handling . 35 8.3 Shortcuts . 36 8.4 Conguration les . 36 9 The Project 38 10 Appendix 39 10.1 Command line arguments . 39 2 10.2 The Candy le . 39 10.3 The Keymap le . 40 List of Figures 1 FirstStart dialog . 12 2 After start . 13 3 Leksah with open project . 14 4 File menu . 16 5 Edit menu . 16 6 Find bar . 17 7 Grep pane . 17 8 Source candy example . 18 9 Completion . 19 10 Editor Preferences . 19 11 Package Menu . 21 12 PackageEditor 1 . 22 13 Error Pane . 23 14 Package Flags . 24 15 Import dialog . 25 16 Modules pane . 27 17 Construct module dialog . 28 18 Info pane . 28 19 Search pane . 29 20 References Pane . 30 21 Metadata menu . 30 22 Metadata Preferences . 31 23 Debug & Buer menu . 32 24 Debug Pane . 33 25 View menu . 34 26 Initial pane position . 35 27 Session menu . 36 License Leksah has been put under the GNU GENERAL PUBLIC LICENSE Version 2. The full license text can be found in the le data/gpl.TX in the distribution. 3 1 Introduction Leksah is an IDE (Integrated Development Environment) for the programming language Haskell. It is written in Haskell. Leksah is intended as a practical tool to support the Haskell development process. Leksah uses GTK+ as GUI Toolkit with the gtk2hs binding. It is platform independent and should run on any platform where GTK+, gtk2hs and GHC can be installed. It is tested on Linux, Windows and Mac. It uses the Cabal package management and build system for Package Management. It needs the Glasgow Haskell Compiler for full functionality (GHC). This document is a reference to the functionality of Leksah, it is not intended to be a tutorial. Since Leksah is in the state of development the information may be incomplete or even wrong. 1.1 Further Information The home page for Leksah is leksah.org. The source code for Leksah is hosted under code.haskell.org/leksah. The Leksah user Wiki is haskell.org/haskellwiki/Leksah. The Leksah mailing list can be accessed at projects.haskell.org/cgi-bin/mailman/listinfo/leksah. The current version of this manual can be found at leksah.org/leksah_manual.pdf. An issue tracker is at code.google.com/p/leksah/issues/list. You can contact the developers at info (at) leksah.org. For the Programming language Haskell go to www.haskell.org. For information about gtk2hs www.haskell.org/gtk2hs/. For information about GTK+ go to www.gtk.org. 1.2 Release Notes 1.2.1 Version 0.6 Beta Release Juli 2009 The 0.6 version introduces an interpreter/debugger mode. This mode can be switched on and o from the toolbar. In interpreter/debugger mode expressions can be evaluated and the type of expressions can be dynamically shown. The GHCi debugger is integrated, so that breakpoints can be set, it is possible to step through the code, observe the values of variables and trace the execution history. The other features of Leksah like building in the background and reporting errors on the y work in debugger mode as in compiler mode. Another new feature is integration of grep and text search with regular expression. This can be accessed from the ndbar. The GUI framework has been enhanced, so that layouts can be nested in so called group panes. This feature is used for the debugger pane. Furthermore notebooks can be detached, so that Leksah can be used on multiple screens. A lot of little enhancements has been made and numerous bugs has been xed. Known bugs and problems: • The package editor works only for cabal les without congurations. 4 • MS Windows: The check for external modications of source les does not work. • MS Windows: Interruption of a background build does not work. • GUI History still not working. • Traces pane of the Debugger does not work appropriately. 1.2.2 Version 0.4 Beta Release February/March 2009 The 0.4 Release is the rst beta release of Leksah. It should be usable for practical work for the ones that wants to engage with it. It depends on GHC ≥6.10.1 and gtk2hs ≥ 0.10.0. The class pane and the history feature are not quite ready, so we propose not to use it yet. 1.2.3 Version 0.1 Alpha Release February 2008 This is a pre-release of Leksah. The editor for Cabal Files is not ready, so we propose not to use it yet. w 5 2 Installing Leksah It is a good idea to install sources for your Haskell libraries when using Leksah. Leksah can then give you much better information from Metadata. Installing with cabal install will do that, and you can download the sources for GHC even after you installed it from a binary package. However compiling from sources is necessary for special packages, which perform some special magic, like generating header les or such. With sources installed Leksah will show you source comments for functions while auto-completing and will be navigate you to the sources of functions. If you have any trouble installing and this manual will not help, please check the Wiki, the mailing list or contact the developers to nd a solution. If it is a Leksah problem, then it is important to us and needs to be xed. We work on installers for Windows and Mac and packages for Debian/Ubuntu are in preparation. Further help needed! 2.1 Generic Installation Instructions 2.1.1.