Description:
Polymorphically-typed lazy purely-functional programming.
|
|
|
Non-lazy read
|
| |
I'd like to run: readFile :: String -> String where I pass in a file name and pull out a string with the file contents. In main, it would look like this (where I have some code that does the lazy read before I do the close). inh <- openFile inFile ReadMode contents <- hGetContents inh... more »
|
|
File name
|
| |
When should I have a main.hs file containing a main function and other functions - with a comment to tell me what that main.hs does? And when should I have a Haskell file with a meaningful name? It seems that Leksah is expecting a main.hs file, but this is alien to my past (non-Haskell) experience. I expect my application will start... more »
|
|
Function returning a string
|
| |
I want to convert the following to a simple do getOS :: String getOS = "Windows" ============== getOS :: String getOS = do "Windows" =============== That worked. So now I want to try simple conditional code. I keep trying variations of the following, with and without return and adding ->, etc. What am I doing wrong? Also - after I get it working... more »
|
|
profiling memory usage
|
| |
hi I'd like to understand why my program eats that much memory in order to optimize it (if it is possible). On the nature of program: it computes pretty large tables and outputs them to XML (via HaXML). Memory usage for 900 MB XML file is 400 MB. It does most output line-by-line, so with lazy evaluation it probably does... more »
|
|
Ed Lambda: Functional programming meetup in Edinburgh
|
| |
Hi guys, I'm running a meetup for functional programming in Edinburgh. The first one will be on the 13th of September at Malone's Irish Bar (14 Forrest Road) and will continue every 2nd monday of each month. For the first meetup I think we'll just be having a chat and getting to know each other but I hope to be able to expand it to talks and coding... more »
|
|
Finding packages
|
| |
I'm a beginner trying to do something in Haskell, and I Google to find a function I want in a package. I want to incorporate that within my program. But my 4 decades of programming have been without packages. It is not obvious to me even whether that package is on my computer, and if not, how to get it there, where to put it, and what the import should... more »
|
|
Newbie question (1 of n) -- type signature
|
| |
I am trying to teach myself Haskell by working my way through Real World Haskell. I have no significant experience yet, so small words and pictures are appreciated in replies. :-) The question up front is: what is the correct type signature for function cosSegX in the code below? When I un-comment my attempt at the type signature, I get the... more »
|
|
Regarding supposedly simple I/O
|
| |
This problem baffles me quite a bit. I'm currently preparing for some Haskell coding in the coming month which will involve I/O. As a result I'm currently reading The Craft of Functional Programming and doing the exercises to test my understanding. The one i'm stuck at is INSANELY simple if it wasnt for I/O. But With... more »
|
|
Determining environment
|
| |
How can I write a Haskell function that checks my environment? For instance, if I am running from within Leksah, I can't answer a prompt, so my program should have hard-coded values for my testing. Or when I copy a program from my Windows computer to my Mac computer, I would want to point to different GUI libraries (I haven't gotten to... more »
|
|
Controlling extra lines
|
| |
How do we control extra lines in files we create? I want my programs to run in both Windows and on a Mac. The following program reads in a dictionary file on my Windows machine and writes out a file - with two lines. The first line contains the word JACK, and the second line is empty. import System.IO... more »
|
|
|