Home

Leksah manual

image

Contents

1. context menu e Get INFO about an identifier select Select Info from the context menu e Get THE KIND of a type select Select Kind e STEP through code Select the expression in a source buffer Select step from the context menu or F7 Use the toolbar icons or shortcuts for stepping O3step F6 Step local F7 Step in module F8 Continue F9 lt Continue F9 Abandon Stop Step F6 7 Step Local F7 t Step Module F8 Show Bindings Show Context Show Loaded Modules Show Packages Show Languages Riickg ngig 2 Wiederholen e Ausschneiden Kopieren gt Einf gen 7 L schen LI Alles markieren Eval Eval amp Insert Step Trace Set Breakpoint Type Info Kind Find text Search metadata Figure 18 Debug amp Buffer menu e Set BREAKPOINTS by putting the cursor at the breakpoint and select set breakpoint from the context menu Run your application or test cases and start stepping at 34 1 2 Distribution Version noVersion 3 4 emptyInstalledPackageInfo 6 showInstalledPackageInfo emptyIpstalledPackageInfo 7 8 Breakpoints 5 Trace Variables gt lt Name Type Value it String nL LIM esl Lian Ene weak tt Figure 19 Debug Pane the break point After a break point is reached you use the operations of GHCi with convenient shortcuts The debugger has a pane in which you can enter expressions and have them evaluated The pane is a Haskell source b
2. Design Acknowledgment Thanks to Ricardo Herrmann for making the new Leksah logo Thanks to Fabian Emmes who created the icons for the module browser Thanks to Lakshmi Narasimhan for packaging for Fedora Thanks to all others who helped us with patches bug reports and helpful feedback Al Possible extension and en 11 Appendix 11 1 Command line arguments for leksah server Leksah Haskell IDE server Usage leksah server OPTION files S r Maybe Port e Verbosity l LogFile for leksah 11 2 Usage leksah V l NAME h e Verbosity System server Maybe Port rebuild sources version help debug verbosity Verbosity logfile LogFile forever Collects new information for installed packages otart as server Modifier for s and p Rebuild metadata Modifier for s Gather info about pathes to sources Show the version number of ide Display command line options Write ascii pack files One of DEBUG INFO NOTICE WARNING ERROR CRITICAL ALERT EMERGENCY File path for logging messages Don t end the server when last connection ends end Versi LoadSession NAME Help verbosity Verbosity The Candy file ox eon gt Yl lt grec n n v lt lt gt z a ugu gt gt n forall exist not n alpha beta gamma delta epsilon zeta eta theta 0x2192 0x2
3. Log pane Or Choose Package gt Install open a Shell and try out your newly created exe cutable Congratulations you have now entered compiled linked and run your first Haskell program with Leksah It is as easy as Create workspace New package enter your code Run Remember the project folder is the folder in which your cabal file for the project is stored A workspace is just a file which contain information about included packages You see what Leksah is doing by observing the output from the Log window Furthermore You can add Packages with the context menu in the workspace pane You can construct new packages with Package gt New from the menubar You can add other modules by selecting Add module from the context menu of the modules pane of the browser group You can open panes you need by selecting Panes gt Browser Log from the menubar 12 e You can editing modules by selecting them in the Browser You can search in the modules pane of the browser by typing text You may as easily debug it e owitch debugger Mode on e Pane gt Debugger e Select the word main in your code e Right click and choose Eval from the pop up menu or press ctrl enter e Switch of debugger Mode if you want to compile an executable It is probably counter productive for new users to use Candy mode converts some common ASCII based operators to Unicode alternatives because all the
4. RR 4 eA Ss 10 The Leksah Project a a a A orar osea seras List of Figures 1 First Start dialog ee 2 Leksah after first start 2 22 124 R4 555221 44 2949329939 212 29 5 4 50259 TTC 5 EMT REI aos eee eae eee eee eee ee ss ee ee ee EE ee RENE Pee eb GPR PES EOE ECR EME EO ee ee eee tees 9 Editor Preferentes 10 Workspace Medal PL Package Menlo ox wok eons keene E ene een ee eee eae 12 PackageEditor 1 22r 13 _ Error Pane sewn ee ee 9 X 9 WORSE eee RR 9 2 09 3 47 eG 20 21 21 21 22 27 29 29 32 34 36 36 38 38 39 40 40 41 lA Packase Pablo 489 9 9 9 X ONOWO 3 99 9 9 RA 3 5 27 15 Module browserl 22h 30 16 Construct module dialog a a 31 17 Search padel 32 18 Debug amp Buffer menu 2 004 34 19 Debug Panel 304 Fame ee hee eee HEH HEH HERDER ME B 30 20 Metadata Preferences Sy 21 View and panes Medusa 38 License Leksah has been put under the GNU GENERAL PUBLIC LICENSE Version 2 The full license text can be found in the file data gpl TX in the distribution 1 Introduction Leksah is an IDE Integrated Development Environment for the programming language Haskell It is written in Haskell and integrates various tools available for writing pro grams in Haskell the GHC compiler and interpreter the CABAL package management system the Common Architecture for Building Applications a
5. The easiest way to do this is to double click on an identifier while pressing CTRL Only previously collected metadata is available this way If the item has changed you could initiate an update of the information collected with update workspace metadata menu configuration update workspace data or Ctrl m 31 Package C Workspace System C Imports m Symbol Module Package sos AssBeg 3 Yi Syntax JavaScript yi 0 6 2 2 aaa ASSEIT Yi Syntax JavaScript yi 0 6 2 2 aaa AssRst 3 Yi Syntax JavaScript yi 0 6 2 2 d AssertionFailed GHC IOBase base 4 2 0 0 aaa AssertionFailed GHC IO Exception base 4 2 0 0 AssertionFailed GHC IO Exception base 4 2 0 0 aaa AssertionFailed Control OldException base 4 2 0 0 AssertionFailed Control OldException base 4 2 0 0 AssertionFailed Control Exception Base base 4 2 0 0 AssertionFailed Control Exception base 4 2 0 0 see Assign Yi Lexer JavaScript yi 0 6 2 2 aaa AssignTo StgCmmMonad ghc 6 12 1 Assoc Control Parallel Strategies parallel 1 1 0 1 Assoc Language Haskell Exts Syntax haskell src exts 1 6 1 Assoc Language Haskell Exts Annotated Syntax haskell src exts 1 6 1 Assoc Language Haskell Exts Annotated haskell src exts 1 6 1 Assoc Language Haskell Exts Annotated haskell src exts 1 6 1 Assoc Language Haskell Exts haskell src exts 1 6 1 v 4 gt Exact e Prefix C Regex Case sensitive a ass Figure 17 Search pane If a source
6. a keystroke In the statusbar the state regarding to the build is displayed in the third compartment from the right It reads Building as long as a build is on the way and displays the numbers of errors and warnings after a build This is the symbol which initiates a BUILD when clicked on the toolbar Ctrl b The error pane shows the errors in the form of a table and provides the same functionality you find in the log but it may be more convenient to use 5 4 7 Run You can run your program after the build operation has compiled and linked it there is a convenient button to start it 5 4 8 Background build Leksah can run builds while you work and highlight errors as it finds them This works with a timer that runs continuously in the background If there are changes made to any open file it 20 Location Description Couldn t match expected type Map GUlEventSelector a gt Maybe against inferred type Maybe al In the pattern Nothing In a case alternative Nothing gt return ger In a stmt of a do expression src Graphics Ul Editor Basics hs 192 12 newGer lt case Map lookup eventSel of Nothing gt return ger Just cids notis um gt case unique Map lookup um of Nothing gt return ger Just gt do Couldn t match expected type Maybe a against inferred type Maybe Unique Notifier Expected type Maybe a src Graphics UI Editor Basics hs 238 42 Inferred type Maybe Uniq
7. any time leksah server sbo RTS N2 from the console Details about metadata collection can be found here If you want to start from scratch again delete or rename the leksah folder in your home folder Then you will see the first start dialog again In the first start dialog you are asked for 1 The location of folders where Haskell source code for installed packages can be found This is important for packages which can t be found on Hackage 2 Maybe a directory where Leksah will unpack source files for packages If you give no directory here Leksah will not try to unpack the sources 3 Some packages are difficult to process with Haddock So we provide some prebuild metadata If you allow this Leksah will look for prebuild metadata if sources are available but Haddock fails to process 4 The port number used for the local connection to the Leksah server 9 By default the Leksah server terminates with the last connection You can change this setting here Leksah collects information about all installed packages on your system that will take some time minutes to half an hour the first time Errors occuring in this metadata collection step indicate only that Leksah has not succeeded to extract the source locations and comments from a module or package they are not consequential except that some metainformation may be missing The metada is cached and future starts only scan newly installed packaEges starts only inform
8. are going to open you get prompted if you want to open this session this means mostly opening the files you had open before in the editor This helps you to switch between different workspaces you are working on In addition sessions can be stored and loaded with a name manually by using the session menu but the need to use these features occurs rarely The menu Configuration gt Forget Session is useful if you inadvertently changed the layout drastically and do not want the current session to be stored 39 9 3 Shortcuts You can configure the keystrokes by providing a keymap file which should be be in the leksah 0 8 folder The name of the key map file to be used can be specified in the Preferences dialog without extension A line in the keymap file looks like lt ctrl gt o gt FileOpen Opens an existing file Description of the key or key combination Allowed modifiers are lt shift gt lt ctrl gt lt alt gt lt apple gt lt compose gt lt apple gt is on a Microsoft keyboard the windows key and on a Mac obviously the apple key lt compose gt is right ALT key often labeled Alt Gr It is as well possible to specify Emacs like keystrokes in the following way lt ctrl gt x lt ctrl gt f gt FileOpen Opens an existing file The name of the action can be any one of the ActionDescr s given in the action function in the Module JDE Command The comment following will be displayed as tool tip for the toolbar
9. binary installer for Windows 4 Go to the post installation section 2 3 Mac OS X 1 Install Haskell Platform with an installer for Mac OS X alternatively install Ghc directly 2 Make sure wget and grep are on the path 3 Install Leksah from the most recent binary installer for Mac 4 Go to the post installation section 2 4 Linux from Distro Packages 1 Install Leksah with the package management system of your Linux platform which should pull all prerequisites automatically 2 Go to the post installation section 2 5 2 6 Install from Hackage Install Haskell Platform alternatively install Ghc directly install Cabal and cabal install Install gtk2hs in a version compatible with the installed Ghc compiler Currently gtk2hs can t be installed via Hackage but this should be possible in the near future so that you don t have to care about this step any more Make sure the gtk2hs etksourceview2 package gets built and installed open a Console and do cabal update cabal install leksah Go to the post installation section Post Installation steps Until the next release of gtk2hs for a pleasant visual appearance you have to copy or append the gtkrc 2 0 file from the Leksah data folder or from the data folder in Leksah sources to your home folder If you miss the step the cross x buttons on tabs are almost invisible or don t fit in tabs This step may become obsolete during the 0 8 rel
10. bounded const True const True t where bounded lo hi t case t of Tip gt True Bin kx lr gt lo kx a hi kx bounded lo kx l a bounded gt kx hi r Exported only for Debug QuickCheck balanced Map ka Bool balanced t case t of Tip gt True Bin lr gt size l size r s1 v size l s 6 size r A size r s 6 size 1 amp balanced l a balanced r Figure 7 Source candy example 4 3 Completion Leksah has the ability to auto complete identifiers in text you type Additionally the Package Module and Type of the id gets displayed if selected The completion mode can either be always on or only be activated on pressing Ctrl Space or a user defined keystroke You can choose between these two possibilities in the Preferences case t of Ti True Tick al ghc 6 12 1 0ccName TickBox type TidyOccEnv valids i ckBoxId OccEnv Int valids r TickBoxOp ghc 6 12 1 N wher rickBoxOpId re TidyEnv TidyPgm Tilda type TidyOccEnv OccEnv Int foldls TimeExpired foldlS TimeOfDay io TimeStamp TimeToLive La 4 gt 4 Figure 8 Completion Autocompletion has currently limitations e locally defined names are not included e Qualified imports are not handled e All names from all packages imported are provided this may be more than you want 17 4 4 Using the Flipper to Switch Between Editors You can change the active pane using a keyboard shortcut to br
11. configDirName src IDE Utils FileUtils hs 87 import IDE Utils Tool 4 gt Browser gt Errors 5 Grep x Search Figure 6 Grep pane The use of the candy feature can be switched on and off in the menu and the preferences dialog This feature can be configured by editing a candy file in the leksah folder or in the data folder The name of the candy file to be used can be specified in the Preferences dialog Lines in the candy file looks like N 0x03bb GREEK SMALL LETTER LAMBDA gt 0x2192 Trimming RIGHTWARDS ARROW The first entry in a line are the characters to replace The second entry is the hex adecimal representation of the Unicode character to replace with The third entry is an optional argument which specifies that the replacement should add and remove blanks to keep the number of characters This is important because of the layout feature of Haskell The last entry in the line is an optional comment which is by convention the name of the Unicode character Using the source candy feature can give you problems with layout because the align ment of characters with and without source candy may differ Leksah reads and writes files encoded in UTF 8 5o you can edit Unicode Haskell source files When you want to do this switch of source candy because otherwise Unicode characters may be converted to ASCII when saving the file 16 ordered Ord a Map a b gt Bool ordered t
12. in the editor for editing the file New module Graphics UI Editor Fluffy Root of the source path Is this an exposed library module YOK Qpabbrechen Figure 16 Construct module dialog From the context menu of right click the modules pane you can add a new module by selecting Add module The Construct Module dialog will open 16 You have to enter the name of the module the source path to use if alternatives exist If the project is a library you have to specify if the module is exposed Leksah will construct the directory modify the cabal file and construct an empty module file from a template The template is stored in the file module lksht in the data folder of the project and will be read from the leksah folder if you want to provide a different template file there The modification of the cabal file will currently only happen if it does not contain configurations The Info Pane The Info Pane is the lower pane of the module browser and shows information about an interface element which may be a function a class a data definition or a type selected for example in the modules pane It shows the identifier the package and module that it is exported by it s Haskell type and if found the Haddock documentation inserted in the source as a comment If you select and initiate an identifier search in an editor pane the information about this identifier is automatically displayed in the info pane maybe nothing
13. location is attached you can go to the definition by clicking the Source button You can select the module and the interface element in the modules pane by clicking the Modules button With the Refs button a pane opens which displays modules which uses this element With the Docu button you can initiate an external search in a browser with e g Hayoo or Hoogle depending on the configuration in the Preferences With the Search button you can initiate a metadata search for the identifier 6 2 The Search Pane You can search for an identifier in the metadata by typing in characters in the entry at the bottom of the pane not the search entry at the bottom of the window The search result depends on the settings in the search pane 17 You can choose 1 The scope in which to search which can be Package Workspace or System For Package and Workspace scopes you can search with or without imports which gives 5 different scopes 2 The way the search is executed which can be exact prefix or as a regular expression 3 You can choose if the search shall be case sensitive or not The result of the search is displayed in the list part of the Search pane You can see if the module reexports the identifier or if the source of the identifier is reachable When you single click on a search result the module browser shows the 32 corresponding information If you double click on an entry the modules and info pane shows the corresponding in
14. use Leksah to develop Leksah and users of Leksah can read the code and contribute improvements Leksah uses GTK as GUI Toolkit with the gtk2hs binding It is platform independent and runs on any platform where GTK gtk2hs and GHC can be installed It is used on Linux Windows and Mac This document is a reference to the functionality of Leksah it is not intended to be a tutorial Since Leksah is still under development the information may be incomplete or superseded The current version is 0 8 1 1 Further Information The home page for Leksah is leksah org Stable version of Leksah can be installed from Hackage sing Cabal install The source code for Lek sah is hosted under and The Lek sah user Wiki is The Leksah forum can be accessed at The current version of this manual can be found at An issue tracker to collect bug reports and sug gestions for improvements is at code google com p leksah issues list You can contact info at leksah org For information about the Programming language Haskell go to www haskell org The GHC computer is found at www haskell org ghc For information about gtk2hs www haskell org gtk2hs For information about GTK go to 1 2 Release Notes 1 2 1 Version 0 8 Release March 2010 The 0 8 release adds the notion of workspaces to allow develop comfortably projects where part of the code is in separate packages This changes the handling of packages to a degree which has been improve
15. 1 Layout Leksah has always one special pane which is called the ac tive pane and its name is displayed in the second compart Browser ment from the left side in the status bar Some actions like O moving splitting closing panes or finding or replacing items em in a text buffer act on the current pane so check the display Log in the status bar to see if the pane you want to act on is E really the active one Workspace You can tailor the layout with the View menu to suit m your work style better Internally the panes are arranged Neu se in a layout of a binary tree where the leaves are horizontal a dk or vertical splits Every area can be split horizontally or Soup vertically and panes can collapse With the commands in the meee IEEE View menu you manipulate this tree to change the layout ee Le dein In the initial pane positions part of the Preferences you eee Tabs Left can configure the placement of panes Panes belongs to cat a Pei egories and a category specify a path were a pane will open rarer Clear Log The layout of the Leksah window contains areas which a contain notebooks which contain panes The division be TER tween the two areas is adjustable by the user by dragging a handle Panes can be moved between areas in the window This can be done by dragging the notebook tab and release it on the frame of another notebook Alternatively you can use keystrokes Shift Alt Arrow to move panes around The tabs of n
16. 190 0x21d2 0x2265 0x2264 0x2260 0x2227 0x2228 0x2295 0x2237 Trimming 0x2025 0x2191 0x2261 0x2218 OxO3bb Ox291e Ox21a0 Ox25ca 0x226b 0x2200 0x2203 OxOOac OxO3b1 0x03b2 0x03b3 0x03b4 0x03b5 0x03b6 0x03b7 0x03b8 WithLast OPTION files on Trimming Trimming End the server when last connection ends Show the version number of ide Load session Display command line options One of DEBUG INFO NOTICE WARNING ERROR CRITICAL ALERT EMERGENCY RIGHTWARDS ARROW LEFTWARDS ARROW RIGHTWARDS DOUBLE ARROW GREATER THAN OR EQUAL TO LESS THAN OR EQUAL TO NOT EQUAL TO LOGICAL AND LOGICAL OR CIRCLED PLUS PROPORTION TWO DOT LEADER UPWARDS ARROW IDENTICAL TO RING OPERATOR GREEK SMALL LETTER LAMBDA MUCH GREATER THEN FOR ALL THERE EXISTS NOT SIGN ALPHA BETA GAMMA DELTA EPSILON ZETA ETA THETA 42 11 3 The Keymap file Default Keymap file for Leksah Allowed Modifiers are lt shift gt lt ctrl gt lt alt gt lt apple gt lt compose gt lt apple gt is the Windows key on PC keyboards lt compose gt is often labelled Alt Gr The defined values for the keys can can be found at http gitweb freedesktop org p xorg proto xiiproto git a blob plain f keysymdef h The names of the keys are the names of the macros without the prefix File lt ctrl gt n gt FileNew Opens a new empty buffer lt ctrl gt o gt Fi
17. Leksah An Integrated Development Environment for Haskell Version 0 8 Jurgen Nicklisch Franken Hamish Mackenzie edited for v 0 8 Andrew U Frank and Christian Gruber May 27 2010 Contents 1 Introduction 2 11 Further Information 0202020202020 0 0002 eee 12 Release Notes Installing Leksah mom rosa P SN S E 2 2 Microsoft Windows a a a a RewWoRE GEE Reese eRe se eee eeeeeaeae SB oe oe 2A Linux from Distro PackaBes e 4 se 99 dr e 9 de a 2 5 Install from Hackage o m have ed o kw se EEO Om X RO ES 2 6 Post Installation steps e 2 __First start of Leksah 20 0 0 00000 eee ee 2 9 First start dialog e x e o ok R49 cw o boR o P EIS 9c ede ec d S4ee es 3 Hello World example 4 The Editor a 4 2 Source Candy bu a OOo de HEARERS RHE RE ER ESS pee eee eee meee E eae se ee me eee pGoasen aed 4 5 Change Your Preferences for the Editor MM o PE awe eee oeaoe Rape eh anne Se O O AN PCM 7 o 6 Module Browser and Metadata 6 1 The Module Browser 0 0 2 ee ee ee ee aa 6 2 The Search Pana 7 Debugger and Interpreter mode 8 Metadata collection 8 1 Background infos 0 0 0 000022 ee 9 Configuration Ol Diao oa eed ene eee Ass 9 2 Session handling os ae eae oo te eRe et eee eee A Ma DIOLDSUEST GaGa 9m ee BOO eee eed ee eae oe ee ae eee eS 94 Configuration files og wo oboe Romo X Row
18. ain character combinations by a Unicode character when loading a file or when typing and replace it back when the file is saved 15 File Line Context src LeksahEcho hs 20 import IDE Utils FileUtils getHaddockVersion getGhcV src IDE Utils Server hs 4 Module IDE Utils Server src IDE Utils Server hs 16 module IDE Utils Server src IDE Utils GHCUtils hs 4 Module IDE Utils GHCUtils src IDE Utils GHCUtils hs 15 module IDE Utils GHCUtils src IDE Utils GHCUtils hs 27 impor Distribution Simple withinRange Packageldenti src IDE Utils GHCUtils hs 46 import IDE Utils FileUtils getSysLibDir src IDE Utils GHCUtils hs 104 findFittingPackages Dependency gt Ghc Packageld src IDE Utils GHCUtils hs 115 let filtered filter 1 Packageldentifier name vers sr DEU lU lshs 4 Module IDE Utils Utils src IDE Utils Utils hs 16 module IDE Utils Utils where src IDE Utils Tool hs B Module IDE Utils Tool src IDE Utils Tool hs 17 module IDE Utils Tool src IDE Utils FileUtils hs 4 Module IDE Utils FileUtils src IDE Utils FileUtils hs 16 module IDE Utils FileUtils src IDE Utils FileUtils hs 64 GenTokenParser TokenParser identStart src IDE Utils FileUtils hs 67 TokenParser identStart src IDE Utils FileUtils hs 77 import Distribution Package Packageldentifier src IDE Utils FileUtils hs 83 import IDE Utils Utils src IDE Utils FileUtils hs 84 import IDE Core CTypes
19. askell code may be found which is entered in the preferences Occasionally you may find it useful to rebuild the metadata Metadata collection can be manually triggered If you select Configuration gt Update workspace data the metadata for the current project is collected This brings the meta data of the current project up to date You can as well press Ctrl m or hit this symbol in the toolbar If you select Configuration gt Rebuild workspace data the metadata for the current project is rebuild If you select Configuration gt Update system data Leksah checks if a new library has been installed and then collects metadata for additions If you select Configuration gt Rebuild system data Leksah rebuilds all metadata which may take a long time Currently the preferred way to do this is to call leksah server rbo RIS N2 from the command line The reason for this is that the server process may allocate a lot of memory during collection 8 1 Background infos The metadata collection itself proceeds different for workspace and system packages e For workspace packages Leksah just uses the parser without typechecking and maybe hi files if available e For system packages Leksah uses hi files and if sources are available Haddock as a library Collection for system packages works as follows 1 Packages you installed with cabal from Hackage If Leksah can t find sources it does a cabal unpack in the source direct
20. ation for new packages will be installed 10 File Edit Workspace Package Debug Panes View Configuration Help ERES AEREAS E RAE REITERAR 5e atc O 7777777 0 I N 777777711 8 0 ZDNDZ 771 1 Z D 7717117 771II N 07117 D SD 77177 BIII IISZ 771 778 87777150 1717150 8711770 DIIII7S 7117Z 871175 Z 117Z 81717 N 777 D IIIISN 777 077772 D 77 0 17177 Z 1117Z Z777 D 71117 DI777D 7777777Z 17755 0777585771 8777 N 27770 D77 0777 N Z77 7 710 1777 N 77 8 N 77 Z777 7770 D 7 17775 77775 77 7770 N 77 0 D 71 I7 8 77 8 7III O 21777 N 717 Z71778 N7777 N II7 777 81717 D 717 Z I 1770 N7II N Z 7117 N 711 Z 07N D 71 8 077 N 717777777717 8 7711 17 N N77111177Z Z7777 0 II I7 DI I77777 0 The Miracle comes quietly into the mind that stops an instant and is still 3 GHHHHHE HHH HHHHHE HHHH HE HA EH EA HHHH HE OS HHHH HHH H HA HA HA EE o RRR HHH HHHHHE HHH H f ES F Ff f AHHH GHHHE HHH GHHHHHE HHHHH egGexisS eildsil eamvmsaaleei ielnumood welcome txt 54 TL Imports l Blacklist Alpha Annotations ghc 6 12 1 ins Array haskell98 1 0 1 AsmCodeGen ghc 6 12 1 Bag ghc 6 12 1 BasicTypes ghc 6 12 1 Binlface ghc 6 12 1 Binary ghc 6 12 1 Bitmap
21. button if one exists for this action Every keystroke must at most be associated with one action and every action may only have one associated keystroke Simple keystrokes are shown in the menu but Emacs like keystrokes are not This is because simple keystrokes are handled by the standard GTK mechanism while other keystrokes are handled by Leksah Independently how you initiated an action by a menu a toolbar button or a keystroke the keystroke with its associated ActionsString is displayed in the Status bar in the leftmost compartment 9 4 Configuration files Leksah stores its configuration in a directory called leksah under your home folder Indexing the hidden Leksah directory with the version number avoids that changes to preferences file layout from version to version cause difficulties Moving your preferences from a previous version can potentially be automatic The file prefs lkshp stores the general preferences It is a text file you could edit with a text editor but more comfortable and safer is to do it in Leksah with the menu CONFIGURATION EDIT PREFS from the menu If no preference file is found in your leksah folder then the global prefs lkshp in the installed data folder will be used If a preference file get corrupted which means Leksah does not start it is then often sufficient to just delete the preference file The source packages txt file stores source locations for installed packages It can be reb
22. d Leksah looks if it can download a prebuild metadata package from the server if this option is selected in the preferences 4 The result of metadata collection is stored in the folder leksah metadata in files called lkshm In this folder for every package a metadata file is stored e g binary 0 4 1 lkshm These files are in binary format If you want to rebuild just one package you can delete it here and update the system metadata The files kshe specify the base path to sources if the collection for sources was successfully or if a metdata file could be downloaded for this For the workspace packages a different procedure is used 1 Metadata is collected from the source directories of the packages you are working on The results are stored in a per module base in a folder with the package name e g leksah metadata package 2 Update happens on a per file base only for changed source files 37 9 Configuration Leksah is highly customizable and can be adapted to your specific needs and work or ganization What follows here is not needed for initial use of Leksah and need not be read on a first lecture of the manual Leksah works well with the default settings and a desire to adapt better to your work habits comes only with extended use of Leksah How ever with time you may use one or the other option to tailor Leksah to your personal preference It is easy Here it is explained how this works 9
23. d all imports from the context menu in which case all Not in scope errors will be treated sequentially When Leksah does not find an identifier update the Leksah database QO UPDATE METADATA OR CTRL M The import helper just looks in imported packages so if you miss a package import you have to fix it manually 27 Obviously some not in scope errors have other reasons e g you have misspelled some identifier which can t be resolved by adding imports After adding all imports you have to save the file and then start a new build 28 6 Module Browser and Metadata Leksah collects data about the modules of all installed Haskell packages on your system It does this by reading sort symbol the Haskell interface files hi files from GHC It as well functi D x unction collects source positions and comments from sources For ES this it looks in the source directories you specified in the data E preferences and downloads and unpacks sources from Hack uum constructor age depending on your settings Starting from the current El version Leksah can as well use prebuild metadata it might slot find on the web to provide metadata for packages you have type sources for but the call to the Haddock library fails for some reason newtype The packages in the workspace are treated differently as class gt not only external exported entities are collected but all ex EN member ports from all modules ar
24. d with introducing suitable defaults a simple single shot program can be started with very few clicks and entering not much more than the name of the program Leksah becomes usable even for just quickly testing an idea Other changes include e Better metadata with non exported definitions for workspace packages Support for prebuild metadata packages Better completion keywords language extensions module name non exported definitions Splittet in a client and server part Client part doesn t import ghc api Added support for Ghc 6 12 Prepared for Yi Abstract TextEditor interface not ready for use e Various other changes improve usability and stability of the platform A large number of bugs has been fixed but there remain probably a large number of bugs some old and not yet fixed and some new ones We expect also to improve and streamline the user interface in the next minor release to achieve more consistency and make Leksah easier to learn You may see comments to this effect in this document suggesting possible changes in the interface Your opinion on these and other possible improvements you see will be highly appreciated Version 0 8 works with GHC 6 10 and 6 12 The installation is described in Section 2 for the standard case more up to date information on installation may be found on the Wiki haskell org haskellwiki Leksah If you have any trouble installing please check the Wiki the forum or contact the
25. developers to find a solution A smooth implementation is a priority for us and we like to hear about difficulties you encounter to fix them please report them on the bug and issues tracker code google com p leksah issues list 1 2 2 Version 0 6 Beta Release Juli 2009 The 0 6 version introduces an interpreter debugger mode This mode can be switched on and off 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 fly work in debugger mode as in compiler mode but not configuring installing etc of packages Another new feature is integration of grep and text search with regular expression This can be accessed from the findbar 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 fixed Known bugs and problems e The package editor works only for cabal files without configurations e MS Windows The check for external modifications of source files does not w
26. e collected As well identifiers which are not exported from a module get listed The source instance symbol for them is shown in gray le A This metadata is used to answer questions like Table 1 Sorts of e Which packages and modules export this identifier l identifiers e What is the type of the exported identifier If the source was found it lists as well e The comment for this identifier e and can mark the item in the source file at the correct position If you like to get information about some identifier in the code the easiest way is to press CTRL and DOUBLE CLICK on it More precisely the operation starts with a release of the left mouse button with a selection with CTRL pressed You can use this if the double click doesn t select the intended area If the identifier is known unambiguously the modules and info pane will show information about it If more than one possibility exist the search pane will open and present the alternatives The sorts of the identifiers shown are differentiated by the symbols you find in Table Note as well the special symbol for identifiers exposed but only indirectly because the definition is imported from another module T 6 1 The Module Browser The module browser shows information about modules and their interface separated in scopes package workspace and system If no package or workspace is open only the system scope has information If a workspace package is open it s name
27. ease cycle cd wget http code haskell org leksah leksah data gtkrc 2 0 0 gtkrc 2 0 leksah echo e ninclude gtkrc 2 0 leksah gt gt gtkrc 2 0 Before you start Leksah for the first time do a ghc pkg recache It has been observed that a package recache is often necessary after installation The symptom is an empty Module Browser if you select the System scope 2 7 First start of Leksah The first time you start Leksah it will take you through the follow steps 1 You are asked to fill in a form telling Leksah where your Haskell sources are if you are not sure or just want to test you can accept the defaults and correct them later in the metadata preferences Leksah collects metadata 1 e exported symbols and their type comments ex plaining them etc for all installed packages on your machine This step may take a while and may give no feedback or a lot of strange errors and warnings don t worry but be patient Welcome to Leksah the Haskell IDE At the first start Leksah will collect metadata about your installed haskell packages You can add folders under which you have sources for Haskell packages not available from Hackage If you are not shure what to do just keep the defaults This process may take a long time but it only needs to run one time Paths under which haskell sources may be found Add Remove Neue ee eee nnno se ses sese ee ena sees esee eee home jutaro D
28. ent pane down lt ctrl gt 2 gt ViewSplitHorizontal Split the current pane in horizontal direction lt ctrl1 gt 3 gt ViewsplitVertical Split the current pane in vertical direction lt ctrl gt 1 gt ViewCollapse Collapse the panes around the currentla selected pane into one gt ViewTabsLeft Shows the tabs of the current notebook on the left gt ViewTabsRight Shows the tabs of the current notebook on the right gt ViewTabsUp Shows the tabs of the current notebook on the top gt ViewTabsDown Shows the tabs of the current notebook on the bottom gt ViewSwitchTabs Switches if tabs for the current notebook are visible lt ctrl gt t gt ToggleToolbar gt HelpDebug gt HelpAbout lt ctrl gt b gt BuildPackage lt ctrl gt r gt AddAllImports lt ctrl gt lt alt gt r gt RunPackage lt ctrl gt j gt NextError lt ctrl gt lt shift gt j gt PreviousError lt ctrl gt o gt ShowModules lt ctrl gt i gt ShowInterface lt ctrl gt i gt ShowInfo lt ctrl gt lt shift gt e gt EditAlignEqual lt ctrl gt lt shift gt 1 gt EditAlignLeftArrow lt ctrl gt lt shift gt r gt EditAlignRightArrow lt ctrl gt lt shift gt t gt EditAlignTypeSig lt alt gt i gt AddOneImport lt alt gt lt shift gt i gt AddAllImports For the next to entries the lt ctrl gt modifier is mandatory lt ctrl gt Page_Up gt FlipUp Switch to next pane in reverse recently used oder lt ctrl gt Page_Down gt Fl
29. evelop Select folders Maybe a directory for unpacking cabal packages v Yes leksah 0 8 packageSources Select folder for unpacking cabal packages Maybe an URL to load prebuild metadata v Yes http www leksah org Port number for server connection 11111 V End the server with last connection Y ox O Abbrechen Figure 1 First Start dialog 3 The Leksah IDE starts and you can start working Later starts will read in the previously collected metadata and check only for changes After starting up Leksah will open its Main window in a standard configuration Progress on your first contact with Leksah 1 Start with the infamous Hello World example The next section gives you a step by step description 2 Then it might be the best to construct a workspace and add an existing project and explore Leksah while you work on it 2 8 First start dialog When you start Leksah for the first time it must collect the information about the packages you have on your computer and may use in your projects The first start dialog let you enter settings about this process Leksah then collects information about exported symbols their type and possible comments collectively called metadata to support your work e g by suggesting auto completion and type information about functions you may use while you edit your source Later you can change this settings in the preferences pane in Leksah and you can rebuild the metadata at
30. formation If you double click on an identifier while pressing Ctrl in an editor pane a case sensitive and exact search in the is started 33 Debugger and Interpreter mode You can switch Debugger mode on only from the toolbar with the d toggle which switches debugger Mode on or off In debugger mode the packages and modules for your cur rent project are loaded into GHCi In debugger mode the menu entries from the Debug menu are no longer disabled Fig 18 and the context menu of source buffers have entries that were not meaningful in the regular GHC mode There is also a group of panes specif ically used for debugging allowing you to manage break points observe variables etc You can open the debugger group pane by choosing Panes Debugger Commands using the debugger are given mostly in the source editor pane with a context menu You select some text and right click to get the context menu it lets you e EVALUATE the selected expression in the interpreter and observe the result If no text is selected the cur rent line is taken as input Select eval The result of the evaluation is shown in the log window and as t in the variables pane You can as well use the keystroke Ctrl Enter Choose Eval amp Insert to insert a string representa tion of the result after the selected expression e Determine the TYPE of an expression Select the ex pression in a source buffer and select Type from the
31. ge file contains appropriate defaults and for a small program you may just save and close it 5 4 2 New package To start with a new package select Package NewPackage from the menu Then you have to select a folder for the project this is by GHC convention the same name you will give to your package in the package editor see 5 4 3 Then the package editor will open to collect the package details This currently does not work if an editor for a different package is open 5 4 3 Package editor The package editor is an editor for cabal files and but you can edit the cabal files in your regular text editor as well Leksah works usually with the cabal files you and others have already written for example those you get when you install a package from Hackage Since cabal files offer complex options the editor offers many separate sub panes in a list on the right For a complete description of all options see the Cabal User s The package editor does currently not support the cabal configurations feature If you need cabal configurations you need to edit the cabal files as a text file separately Leksah uses standard cabal files with no modifications this is no problem just the package editor will not work for you 5 4 4 The most important parts of cabal files A package has as a minimal requirement a name and a version default is 0 0 1 meaning something like first idea If your code uses other packages then they must be lis
32. ghc 6 12 1 ins Bits haskell98 1 0 1 Rlackid nhc 6 12 1 Now updating sytem metadata Now loading metadata Now updating workspace metadata Find c S Words Regex wrap amp Replace Ys Replace All Grep Goto Line 1 2 og INS Ln 37 Col 81 Figure 2 Leksah after first start 11 Hello World example Workspace gt New Constructs a new workspace in a selected folder and give it a name e g Hello This produces a file Hello lkshw Package gt New and use the Create Folder button to make a new folder for the package Make sure to be in this folder when you click Open An editor opens up which let you edit cabal files The name proposed for your package is the name of the folder you just constructed That is the convention with Cabal packages The defaults are set for creating a simple executable The base package is specified as build dependencies and an executable with the name of the package will be constructed The main module resides in a file Main hs The sources are in a src subdirectory of the packages Click Save to write the cabal file The main module gets automatically constructed and opens Now add your code to the module main putStrLn Hello World By default auto build is on and you can see that the file will be compiled in the Log pane Choose Package gt Run or ctrl alt r and you will see Hello World in the
33. he Tab size you want Leksah always stores tabs as spaces Using hard tabs is not recommended for Haskell and the Haskell compilers allow only tab size of 8 Leksah offers as well to remove trailing blanks in lines which you may choose as default because blanks at the end of lines make no sense in source code Leksah dialogs offer mostly a APPLY SAVE and a CLOSE button Be aware that the close button does not save your changes press apply save and then close We will change this for the next version In dialogs where you select something there is typically an ADD button selecting does not add neither Therefore adding an item means select item add save close 4 6 Further info The work with the editor is influenced by other features e For background building which may save your files automatically after every change refer to 5 4 8 e For information about editor preferences go to 19 5 Working with Projects Workspaces and Packages Haskell organizes software projects in packages which are managed independently A package is compiled and linked as a unit to produce one or more executables or and a library It is installed with the package manager Cabal A package can be uploaded to Hackage And provided packages are downloaded from Hackage and installed Packages have version numbers and specify version ranges for dependencies Cabal assures that if a packages is compiled correct versions of other packages are selec
34. ing up the flipper It lists the most recently used panes first so they are easier to get to The default shortcuts for the flipper are Ctrl Tab and Ctrl Shift Tab or Ctrl Page Down and Ctrl Page Up The approach in Leksah is comparable to the Alt Tab and Alt Shift Tab used to switch between programs in the OS Ubuntu Windows 4 5 Change Your Preferences for the Editor GUI Options Initial Pane positi Mi Show line numbers Metadata TextView Font Blacklist Monospace 10 Build Debug Right margin Help Position iv Show it 110 aj Tab width 4 al v Use standard line ends even on windows w Remove trailing blanks when saving a file Source candy Candy specification iw Use it candy Editor Style Editor Style iv Select a special style li Found Text Background Execution Context Text Background Breakpoint Text Background M Use Yi Experimental feature could wipe your files c Anwenden Restore amp Speichern 2 Schlie en Figure 9 Editor Preferences When selecting Configuration Edit Prefs the preferences pane opens which has a selection called Editor Figure 8 were you can edit preferences for the editor Some of the options you find here refer to visual elements like the display of line numbers the 18 font used the display of a right margin and the use of a style file for colors and syntax highlighting You can set here t
35. ion 0 8 Speichern Figure 12 PackageEditor 1 24 5 4 5 Initializing a package Clean and configure operations 3 Schlie en where the sources can be found relative to the root folder of the project which is the one with the cabal file what additional non exposed or non main modules your project includes used language extensions in addition to Haskell 98 These can also be specified in the source files with pragmas Because more than one executable and a library can be build from one package it is possible to have cabal files with more than one build info The package editor deals with this by the buttons Add Remove Build Info Every build info gets an index number and for executables and a library you specify the index of the build info Before a package can be acted on it must be configured you may clean a package i e delete its dist folder to start afresh Configure checks that the packages the current packages depend on are installed in GHC package manager it checks for name and version if you specify them Hackage package is missing you can CABAL INSTALL it in a terminal window Two types of errors regarding packages may be reported While configuring Cabal checks that the packages you have listed in the depends on section are installed on your computer If one of your packages is missing or missing the version that is needed you can install it either for packages you have the source on yo
36. ipDown Switch to next pane in recently used oder lt ctrl gt space gt StartComplete Initiate complete in a source buffer F6 gt DebugStep F7 gt DebugStepLocal F8 DebugStepModule F9 gt DebugContinue lt ctrl gt Return gt ExecuteSelection lt ctrl gt m gt UpdateMetadataCurrent 43
37. le however the comment symbol must start in the first column beware of illegal sequences like which may be automatically produced by inserting a comment in front of some symbol Selected blocks of code can be shifted left or right using the tab or Tab Shift Tab keys Furthermore you can align some special characters lt gt in selected lines The characters are never moved to the left but the operation is very simple and takes the 14 Find c S Words Regex IDE wrap Y Replace 4 Replace All Grep GotoLine 1 3 Figure 5 Find bar rightmost position of the special character in all lines and inserts spaces before the first occurrence of this special characters in the other lines for alignment 4 1 Find and Replace in the current folder Leksah supports searching in text files When you select Edit Find from the menu the find bar will open and you can type in a text string Alternatively you can hit Ctrl F or select a text and hit Ctrl F a standard keystrokes binding which can be configured see 9 3 Pressing the up and down arrow will bring you to the next previous occurrence of the search string Hitting Enter has a similar effect as the down arrow Hitting Escape will closes the find bar and sets the cursor to the current find position You have options for case sensitive search labeled c S for searching only whole worlds toggle Words and for wrapping around button Wrap which means tha
38. leOpen pens an existing file lt ctrl gt x lt ctrl gt f gt FileOpen pens an existing file lt ctrl gt s gt FileSave Saves the current buffer lt ctrl gt lt shift gt s gt FileSaveAll Saves all modified buffers lt ctrl gt w gt FileClose Closes the current buffer lt alt gt F4 gt Quit Quits this program Edit lt ctrl gt z gt EditUndo Undos the last user action lt shift gt lt ctrl gt y gt EditRedo Redos the last user action lt ctrl gt x r gt EditRedo Redos the last user action lt ctrl gt a gt EditSelectAll Select the whole text in the current buffer lt ctrl gt f gt EditFind Search for a text string Toggles the F3 gt EditFindNext Find the next occurence of the text string lt shift gt F3 gt EditFindPrevious Find the previous occurence of the text string lt ctrl gt 1 gt EditGotoLine Go to line with a known index lt ctrl gt lt alt gt Right gt EditComment Add a line style comment to the selected lies lt ctrl gt lt alt gt Left gt EditUncomment Remove a line style comment lt alt gt Right gt EditShiftRight Shift right lt alt gt Left gt EditShiftLeft Shift Left View lt alt gt lt shift gt Left gt ViewMoveLeft Move the current pane left lt alt gt lt shift gt Right gt ViewMoveRight Move the current pane right lt alt gt lt shift gt Up gt ViewMoveUp Move the current pane up lt alt gt lt shift gt Down gt ViewMoveDown Move the curr
39. nd Libraries Haddock for producing documentation etc in one single comprehensive and easy to use environ ment It allows the developer to concentrate on writing the program and Leksah gives him easy access to all information she needs and helps with the necessary housekeeping for compiling linking and package management A unified focus for translating source code to executable programs Leksah introduces the notion of a workspace that can include several packages transparently to the pro grammer it appears as if there were a single program with a simple make command Leksah manages rebuilding and installing packages as far as desired automatically Support for writing source code Leksah supports debugging with GHCi evaluation of expressions gathering type information setting breakpoints displays values at break points etc is all possible from within Leksah Last but not least Leksah collects information about installed packages helps to find function names and their type and offers an auto completion feature while you type new code The features of Leksah often reflect directly features of the Haskell tools used therefore to understand behavior in special cases needs sometimes reading the specific documen tation of GHC Cabal or Haddock and this manual to a degree repeats what is found with more detail and authority in the respective tool documentation Leksah is written in Haskell which means the Leksah developers
40. o install the result of a built in the user package database the alternative is global to put the resulting files in global space in ghc pkg Haddock documentation for the leksah source will not be build because it is not a library unless you pass the executable flag The flags are stored in a file called IDE flags in the root folder of the project 26 Config flags user Build flags prof auto all Haddock flags Executable flags Install flags Register flags Unregister flags Source Distribution flags of ox 3 Schlie en Figure 14 Package Flags 5 5 Import Helper A frequent and annoying error is the NOT IN SCOPE compiler error In the majority of cases it means that an import statement is missing and to write import statements is a frequent and annoying task In Leksah if the compiler informs about a missing import you can choose Add import from the context menu in the log pane Leksah will then add an import statement to the import list If there is more than one module that exports this identifier a dialog will appear which queries you about the module you want to import it from Leksah then adds a line or an entry to the import list of the affected module with the compiler error Leksah imports individual elements but imports all elements of a class or data structure if one of them is needed The import helper can work with qualified identifiers and will add a correct import statement You can as well select ad
41. o the source file you are working on doesn t need to belong to the active package Leksah will detect and compile the package for you The active project is important for the menu items of the package menu because they always work on the active package e Background build can be permanently set in Prefs gt Build gt Background build You can temporarily enable and disable it from the toolbar with this button AN e You can set if Leksah automatically save all files before building by the setting Prefs gt Build gt Automatically save all files before building e Linking can take a long time and on Windows we can t interrupt the build process in the moment so it may be an advantage to switch of linking This can be done by Prefs gt Build gt Include linking in background builds You can temporarily enable and disable it from the toolbar with this button e The same option disable linking can be used to disable cross package build tem porarily 20 5 1 Cross package build The following is valid in compiler mode Depending on your settings the following may happen After a library has been successfully build it will be installed if e Include linking in background builds is on and either Install always after a successful build is selected or Install if it s a library with depended packages in the workspace is selected and 1t has dependent packages After this dependend packages
42. om the menu bar Then the notebook is opened in a new window which you can then move to another screen When you close the detached window the pane goes back to the place where it was before detaching The state of detached window is remembered when you close Leksah and they will be reopened when you restart Leksah It is possible to drag and drop panes between windows But splitting and collapsing of panes is disabled for detached windows So a recommended way to use this feature is to split a pane arrange the panes that you want to detach in the area of the new notebook Select the new notebook and detach The detached windows have no menu bar toolbar and status bar on their own This may be a problem when you want to select a menu entry the focus changes from a pane in the detached window to a pane in the main window and you may not be able to do what you want We recommend that you use keystrokes or context menus 9 2 Session handling When you close Leksah the current state is saved in the file current lksks in the leksah folder A session contains the layout of the window its content the active package and some other state When you restart Leksah it recovers the state from this informa tion When you close a workspace the session is saved in the folder of the workspace in a file named workspacename lksks When you open a workspace and Leksah finds a workspacename lksks file together with the workspace file you
43. ork e MS Windows Interruption of a background build does not work e GUI History still not working e Traces pane of the Debugger does not work appropriately 1 2 3 Version 0 4 Beta Release February March 2009 The 0 4 Release is the first beta release of Leksah It should be usable for practical work for the ones that wants to engage with it It depends on GHC gt 6 10 1 and gtk2hs gt 0 10 0 The class pane and the history feature are not quite ready so we propose not to use it yet 1 2 4 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 2 Installing Leksah 2 1 How to Install Brief Instructions You can install from e a binary installer for your operating system which is typically Windows or Macin tosh e a package for your platform which is currently Arch Linux and Fedora Linux and Debian Ubuntu is in preparation e install from sources from Hackage via cabal install leksah e leksah or leksah head development repositories If you want the very last or want to help with Leksah development You can consult the Download page for up to date information and try the user Wiki for further help 2 2 Microsoft Windows 1 Install Haskell Platform with an installer for Windows alternatively install Ghc directly 2 Make sure wget and grep are on the path of your Windows shell 3 Install Leksah from the most recent
44. ory you specified for this in the preferences By default leksah packageSources 2 Source files in the folders listed as source folder in the preferences Leksah looks for all cabal files it can find below the source folders Therefore Leksah collects source information only from Cabalized projects i e projects that have a cabal file From this information the file source packages txt in the leksah folder is written If you miss sources for a package in Leksah consult this file if the source place of the package has been correctly found You can run this step by typing in a terminal leksah server o or sources 36 Editor GUI Options Initial Pane positi Paths under which haskell sources for packages may be found Blacklist Add Remove Build Debug Select folder Help Maybe a directory for unpacking cabal packages vV Yes leksah 0 8 packageSources Select folder Maybe an URL to load prebuild metadata v Yes http www leksah org v Update metadata at startup Port number for server connection 11111 el Server IP address 127 0 0 1 iw End the server with last connection c Anwenden Restore amp Speichern 34 Schlie en Figure 20 Metadata Preferences 3 Problems may occur due to preprocessing header files language extensions etc Error message produced while metadata collection indicate that not all information for a package was found If the Haddock call doesn t succee
45. otebooks can be positioned at any of the four di rections or the tabs can be switched off Note that holding the mouse over the tabs and selecting the right button brings up a menu of all panes in this area Edit Prefs Update workspace data Strg M Rebuild workspace data Update system data Rebuild system data Save Session Load Session Forget Session Figure 21 View and panes menus so that you can for example quickly select one of many open source buffers The layout will be saved with sessions The session mechanism will be explained in Currently there is no way to load different layouts independent of the other data stored in a sessions 38 9 1 1 Advanced layout Group panes A notebook cannot only contain single panes but it can as well contain group panes which have a layout on their own and may contain arbitrary other panes the debug pane is an example for a group pane This gives you the possibility to arrange the subpanes in a debugger pane as 1t fits you best A new group starts by selecting VIEW GROUP from the menu You have to give a unique name for the group Then you can arrange panes in the group as you like When closing a group and the group is not empty you have to confirm it 9 1 2 Using Leksah with multiple displays Detached windows This feature allows you to move panes to a separate window on a separate display This is as simple as You select a notebook and choose VIEW DETACH fr
46. packages can be excluded by blacklisting them The packages you want to hide can be specified in the preferences and you can use the radio button at the right to hide them If you select a module in the modules list its interface is displayed in the interface list on the right You can search for a module or package by selecting the modules list and typing some text With the up and down arrows you find the next previous matching item With the escape key or by selecting any other GUI element you leave the search mode 1f this icon shows up Leksah has found a SOURCE file or source position for this element You can open the source file or bring it to the front and display the source for the selected location with a double click on the element the same is achieved with selecting Go to definition from the context menu This is the same as before but is used for definitions not exported from the module 30 This icon indicates that the symbol is REEXPORTED from another module because its long list is not much hierarchically structured By selecting an element in the Interface List the so called Info Pane is shown with detailed information see next subsection The modules pane provides detailed information and are the quickest way to open a source file for edit Go to the modules pane select package or workspace scope possibly find the module by entering some text and double click on the module s name to open the file
47. pendencies of the package 5 4 Packages The concept of a package is used to handle a unit of work for the development of some library or executable It is in NewPackage the first place the unit Cabal deals with and is a standard nc in the Haskell community t ari inis 0 Leksah stores data for packages in the standard cabal files suia Package Strg B The same files can be used outside of leksah for example you can issue the command cabal install in the folder that Install Package contains the cabal file and cabal will as it would inside see leksah configures compiles and links and install or register Lou the library or executable produced ni Open Doc 5 4 1 Opening and activating a package Figure 11 Package Menu Leksah uses Cabal for package management and opening a package is done by opening the corresponding cabal file To open a package select Add Package from the context menu of the workspace select the cabal file of the desired package You must not have more than one cabal file in a folder 22 For workspaces with more then one package you can activate a package in the workspace pane by double clicking on it or by selecting Activate Package from the context menu The active package is the one that the commands in the Package menu refers to e g configure build install Leksah shows the currently active package in the third compartment in the status bar and in the window title The packa
48. s are displayed in the third subdivision from the left of the status and in the title bar 29 C Package e Workspace System Imports Blacklist Modules Packages Interface y Binary o l h Getter Shared binary shared 0 8 ns Setter Default Itk 0 8 gt ns Injector v Graphics gt ns Extractor v Ul gt ns Applicator Composite Itk 0 8 P hs GUlEventSelector DescriptionPP Itk 0 8 s allGUIEvents MakeEditor Itk 0 8 gt ns GtkHandler Parameters Itk 0 R 3 gt ns GtkReaFunc y ES ad P m A type to describe an editor alpha is the type of the individual field of the record type Editor alpha Parameters Notifier IO Widget Injector alpha Extractor alpha Source Modules Refs Docu Search Browser X Errors 34 Grep 3 Search Figure 15 Module browser The scope of the displayed information is selected with the radio button on top of the modules pane The Package scope shows only modules which are part of the active project The Workspace scope shows all modules of all packages in the workspace The System scope shows all modules of installed packages of the system It lists all modules of installed packages These you would get with ghc pkg list Leksah scans the user and the global package database when both are present The amount of information displayed may overwhelm you with details from packages that are not of interest to you Like e g like Haskell 98 ghc or base 3 0 Such
49. t the search will start at the beginning end of the file when the end beginning is reached If there is no occurrence of the search string in the currently open file the entry turns red You can search for regular expressions by switching on the Regex option Leksah supports regular expressions in the Posix style by using the regex posix package When the syntax of regular expressions is not legal the background of the find pane turns orange To replace a text enter the new text in the replace entry and select replace or replace all The last field on the line gives you a mean to jump to a certain line number in the current text buffer 4 1 1 Search in the package Grep Searching for text in all files in a package is often useful For this feature the grep program must be on your path You can then enter a search string in the find bar and search for all occurrences for the string in the folder and sub folder of the current package with pressing the Grep button A pane will open 6 and in every line show where the expression was found with context By clicking on the line the file is opened in an editor and the focus is set to the selected line You can navigate between lines with the up and down keys Greps supports the search for regular expressions 4 2 Source Candy When using Source Candy Leksah reads and writes pure ASCII Code files but can nevertheless show you nice symbols like A This is done by replacing cert
50. ted The difficulties when working with a project where source code under development is spread over several packages are overcome in Leksah with the concept of a workspace It combines several packages and allows smooth working with files from all packages Leksah always works in a workspace and always needs at least one package to do any thing useful This seems overkill for very simple projects where the workspace contains just one package and this package just one source module producing one executable but Leksah provides defaults that reduce the effort to a minimum The principle to always to work in a workspace and in a package is beneficial in the long run because it gives a smooth transition from a one shot idea to a complex projects and integrates the widely used cabal system fully Leksah in addition saves the state of your work environment with a workspace so you can switch between workspaces and get exactly back to where you stopped working when leaving the workspace the same files open in editors and the cursor in the same file and position When you open a workspace and a session is attached to it Leksah prompts you if you want to switch to the session associated with the workspace Leksah silently always saves the session for the workspace you are closing If you have auto build on and you change a file Leksah detects if this file belongs to any project in your Workspace If this is the case 1t builds the package S
51. ted in dependencies This will be at least the base package which is entered by default This is independent whether you downloaded them e g from Hackage produced them yourself Version numbers are used to document and enforce that older versions of a program use the corresponding older versions of other packages with which it was developed originally The result of the packages can be an executable and you enter the name of the Haskell file that contains the main function in the executable pane and the name of the exe cutable The result of the package can be a library in the corresponding pane you tick off the modules which should be exposed i e their exports can be used in other pack ages Cabal gives the possibility to build more then one executable from one package and to build a library and executables from one package You have to specify a build info With build information you give additional informa tion e g 23 Description Dependencies Meta Dep Data Files Extra Files Other Executables Library 1 Build Info 1 Compiler 1 Extensions 1 Build Tools 1 Pkg Config 1 Opts C 1 1 Opts C 2 1 Opts Libs 1 Other Add Build Info compiler flags and many more Synopsis Leksah tool kit Package Identifier Name Itk Description Ul Framework used by leksah Homepage http www leksah org Package URL http code haskell org Itk Category GUI Remove Build Info Revert Vers
52. tutorials use ASCII Switch it off when you get irritated Deselect Configuration gt To Candy from the menubar 13 4 The Editor Most of the time programming is editing source code To edit Haskell source files Leksah uses the GtkSourceView2 E Strg N 1 7 Open Strg 0 widget It provides editing undo redo syntax highlighting ME i and similar features In the file menu 3 you find the cus 3 Svea pid Save All Umschalt Strg S tomary functionality to open save close and revert files To mt avoid confusion it is useful to be able to close all files or cese all files which are not stored in or below the top folder of Gece All But Package the current project this is the folder where the cabal file _ 99 A But Workspace resides at once this helps you focus on your project This way it is as well possible to close all files which don t belong to a workspace Leksah does not store backup files Leksah detects if a file which is currently edited has changed on disk and queries the user if a reload is desired Attention This don t currently work for Windows so take care When you open a file which is already open a dialog pops up to inquire if you want to make the currently open file active instead of opening it a second time Leksah does not support multiple views on a file but if you open a file a second time it s like editing the file two times which makes little sense The list of files is sho
53. ue Notifier In the second argument of namely zip lu notifiers In the second argument of namely filter isjust zip lu notifiers Browser gt lt Errors X Grep gt lt Search 5X Figure 13 Error Pane e interrupts any running build by sending SIGINT this step is OS X and Linux only at this point it s not working on MS Windows e waits for any running build processes to finish e saves all the modified files e starts a new build Current limitation Because we can t interrupt the build on windows there is an option in the Leksah build preferences to have it skip the linking stage in background builds This reduces the delay before a next build starts Background build and linking can be configured in the preferences and as well switched on and off from the toolbar This is the toggle which switches BACKGROUND BUILD on or off in the toolbar The LINKING toggle that switches background build on or off 5 4 9 Build system flags Cabal allows more operations than just build for example producing documentation with Haddock with The Build documentation item in the package menu For each of these operations you can enter the specific flags they require for you special case We give here two often examples of flags others work similarly and we recommend that you consult the respective documentations consult the Cabal User s Guide Cabal needs the user flag which is set by default in Leksah t
54. uffer which has the reserved name _ Eval Its contents is saved with the session Note that e breakpoints are set on identifiers selected not necessarily where you have found it in the source e g used in an expression e current breakpoints are listed in the breakpoints pane you can remove breakpoints from this pane e While stepping through code you can observe VARIABLES in the variables pane You can print or force a variable from the context menu of the variables pane You can update the pane from the context menu e You can observe an execution trace in the traces pane Navigation in the traces pane is currently not supported back forward e You can query information about the current state of GHCi from the Debugger menu E g Show loaded modules Show packages and Show languages e You can directly communicate with GHCi by evaluating commands entered as text in the source editor and select it E g set For more information about debugging in GHCi read the GHCi section in the GHC manual 30 8 Metadata collection Remember that metadata is the data Leksah has collected from all the Haskell code including hi files for installed packages it could reach on your computer The initial scan may take a long time some minutes when Leksah starts later it checks only for changes but does not scan all files again Metadata collection depends on the local configuration especially the list of places where H
55. uild by calling leksah server in a terminal with the o or sources argument Do this after you moved your source or added sources for previous installed packages without sources Files for Keymaps keymap lkshk and SourceCandy candy lkshc may be stored in the leksah folder and will be found according to the name selected in the Preferences Dialog Leksah first searches in this folder and after this in the data folder 40 10 The Leksah Project The development of an integrated Development Environment is a major undertaking and Leksah should become increasingly supported by the user community If you are a user or just test Leksah we would appreciate to here from you Do not miss to report bugs unclear or wrong information in the documentation and suggestion for improvements on the Leksah issue tracker Everyone is invited to contribute Spreading the word supplying error reports pro viding keymap and candy files providing a tutorial caring for a platform will develop are all helpful and meaningful ways to contribute Leksah will advance over time and become more useful hancements are Package editor with configurations Add traces to the Debugger Support for some kind of plug ins or extensions Context enriched completion Version Control Darcs Testing Quick check Object browser Coverage HPC Profiling Ghc Profiler Re factoring HaRe FAD Functional Analysis and
56. ur computer e g because you wrote them by switching Leksah to the folder where this package is and configure build and install them with the command cabal install For packages that are on Hackage use a console go to the directory where you keep such sources and type cabal install packageName possibly package name version cabal then recursively installs the package and all packages it depends on Separate from this error message the case where the compiler misses a module you want to import Ghc provides an error message indicating what package you have to add to the depends on section in the cabal file Edit the package add the dependency and do configure build You have to take care as well that there is a user and a global package db Leksah uses the user flag by default to minimize errors 5 4 6 Building The most frequently used functionality with packages is to make a build If the package was not configured before Leksah does that step automatically When you start a build you can see the standard output of the Cabal build procedure in the Log pane A build may produce errors and warnings If this is the case the focus is set to the first error warning in the Log and the corresponding source file will open with the focus at the point where the compiler reports the error You can navigate to the next or previous errors by clicking on the error or warning in the log window or by using the menu the toolbar or
57. us bar informs you always about ceanworspace da Make Workspace the currently open workspace ne E 4 Previous Error Umschalt Strg Add All Imports Strg R 5 3 2 Add packages to the workspace Figure 10 Workspace Open the workspace pane from menu Panes Workspace Meni and do a right click to get the pop up menu to add a package by selecting the corresponding cabal file 21 5 3 3 Open workspace When starting Leksah opens the last workspace used You can change to another workspace by opening the corresponding workspace file or by choosing from the list of recently used workspaces When opening a Workspace you can choose to 5 3 4 Clean and make workspace A workspace can be cleaned meaning all packages gets cleaned and must be recompiled from scratch Make builds all the packages in a meaningful order and installs libraries if needed It only stops if an error occurs 5 3 5 Jump between errors There are menu items to move to the next or the previous error the compiler found You can as well use keyboard shortcuts for this CTR J and SHIFT CTRL J It is as well possible to move by pointing to the error messages in the log pane or error pane 5 3 6 Add all imports If you miss imports given error messages xx is not in scope CTRL R is adding them automatically to your import list Limitation it does so only if the modules they export are in a workspace package or are in a package listed in the build de
58. will be build If you want a background build but only for the one package you re working on you can temporarily disable this mechanism by deselecting 5 2 File Organization with Workspaces A workspace is represented by a file workspace name lkshws in a directory You may choose a hierarchical folder structure with a workspace file at the top and the projects in sub folders for complex projects but you can as well put all workspaces in one directory and put all packages flat You have to use care when you create a new workspace file Each package directory contains at least a cabal file packagename cabal and typically folders for the source files following the usual Haskell ghc convention of hierarchical module names Cabal controls the compilation and linking of packages with GHC and puts the results in a dist folder in the package this folder is reconstructed often and may be deleted without loss In the folder package name dist build executable name you find the executable but it is also installed in the folder cabal bin for a build with the user flag You may wish to add this folder to your search path 5 3 Workspace Operations 5 3 1 New workspace Under the menu workspace you find commands to create a new workspace with a specific name and select the folder _ New workspace Open Workspace in which it should reside The windows title and the 3 Recent Workspaces Close Workspace compartment of the stat
59. wn as notebook tabs on top or left of the files as you prefer Menu gt View gt Tabs Left When a file has changed compared to the stored version Strg W lh Quit AIt F4 Figure 3 File menu the file name is shown in red in the notebook tab reminding Undo Strg Z you that it needs to be saved before compilation es missam d If you want to change to a different file editor buffer you rue can open a list of all open files by pressing the right mouse c button while the mouse is over a notebook tab You can 3 SelectAll Strg A x gt cf Find Strg F then select an entry in this list to select this file See un id for a better way to switch between source files Find Previous Umschalt F3 On the right side in the status bar at the bottom you can Sekss Comment Strg Alt Rechts see the line and column in which the cursor currently is and AA Strg Alt Links if overwrite mode is switched on In the second compartment oe Shift Right Alt Rechts from the left you can see the currently active pane which a2 Umschalt strg E is helpful if you want to be sure that you have selected the Align lt Umschalt Strg L Align gt Umschalt Strg R right pane for some operation Align Umschalt Strg T In the edit menu 4 you find the usual operations undo redo cut copy paste and select all In addition you can Figure 4 Edit menu comment and un comment selected lines in a per line sty

Download Pdf Manuals

image

Related Search

Related Contents

InLine 74011H  Manual de instrucciones  K280取扱説明書を見る  株式会社テレビ朝日  CT-M11 Connection Cable  Citizen CL-S300 label printer  Vigo VG15257 Instructions / Assembly    RED 3000 Fog Machine fog machine user manual  Lego Jurassic World Raptor Escape 394pc(s)  

Copyright © All rights reserved.
Failed to retrieve file