0
votes

I am starting out in haskell (with learnyouahaskell.com) and used the GHCI console so far. Now I installed leksah but I cannot find a way of running my previous files without creating new workspaces/modules etc, which I do not know anything about yet.

How can I run a simple file (like :l in GHCI) in leksah?

After running the file, how can I access the console in leksah? (For e.g. using/testing the functions I created in that file.)

1

1 Answers

1
votes

I came the same path a few days ago. I did not find a way to use leksah in a ghci-with-gui-like mode, so i decided to go along the leksah way.

First, I downloaded the manual, which is a bit hidden at http://leksah.org/leksah_manual.pdf.

In chapter 3, Hello world example, there is a Hello World example which explains the creation of a workspace and a package. Then you just put your file into the src directory. For very small examples, just add the code to Main.hs. Then follow the guideline in chapter 7, Debugger and Interpreter mode. For example, to evaluate an expression you select it, rightclick and select Evaluate. The result is displayed in ´the output window. Similarly you get the type of expressions.

However, there is no console window where you could type to provide input (stdin) for your program, see also Using Leksah debugger with programs that use readLn and similar.