A question regarding haskell mode for Emacs

2000-10-20 Thread Friedrich Dominicus
I wonder if there are some known troubles. This mode yesterday nearly drive me nuts. Indentation seem to be ok from the layout, but I got complains about block closed to early, missing ; ... Regards Friedrich -- for e-mail reply remove all after .com

Re: Another question about higher order functions

2000-08-26 Thread Friedrich Dominicus
Where can I find DrScheme? What other functional/logic programming languages have similar well-documented IDE's for beginners, and where can these IDE's be found? I hope this is not too offtopic;-) You can download DrSchem from http://www.cs.rice.edu/CS/PLT/packages/drscheme/ It runs on a

Another question about higher order functions

2000-08-25 Thread Friedrich Dominicus
As you might know, I'm working to find my way through Haskell using School of Expression from Paul Hudak. I have done all the examples up to chapter 5. I do think I've learned quite a bit. But again I'm wondering if this: makeChange :: Int - [Int] - [Int] makeChange 0 (c:coins) = 0:makeChange 0

Re: Another question about higher order functions

2000-08-25 Thread Friedrich Dominicus
Paul Hudak [EMAIL PROTECTED] writes: As you might know, I'm working to find my way through Haskell using School of Expression from Paul Hudak. I have done all the examples up to chapter 5. I do think I've learned quite a bit. But again I'm wondering if this: makeChange :: Int -

Re: Another question about higher order functions

2000-08-25 Thread Friedrich Dominicus
Zhanyong Wan [EMAIL PROTECTED] writes: How about this: makeChanges total coins = tail $ map fst $ scanl (\(how_many,rest) - divMod rest) (0,total) coins But I doubt this is easier to understand. No, but I hope it will help me getting away a bit for explicit recursion. And it's anyway

A small problem.

2000-08-22 Thread Friedrich Dominicus
Dear Haskell Fans, I'm afraid that I'm a bit dumb but I'm somewhat stuck. Can someone give me a hand on this problem I wrote this code to solve SOE, exc 5.1. import Shape triangleArea :: [Vertex] - Float triangleArea (v1:v2:v3:_) = let a = distBetween v1 v2 b

Re: A small problem.

2000-08-22 Thread Friedrich Dominicus
Jan Skibinski [EMAIL PROTECTED] writes: On 22 Aug 2000, Friedrich Dominicus wrote: Dear Haskell Fans, I'm afraid that I'm a bit dumb but I'm somewhat stuck. Can someone give me a hand on this problem I wrote this code to solve SOE, exc 5.1. import Shape triangleArea

Re: A small problem.

2000-08-22 Thread Friedrich Dominicus
Ronny Wichers Schreur [EMAIL PROTECTED] writes: area :: Shape - Float area (Polygon vertices) = 0.5 * sum [(x1-x2)*(y1+y2) | (Vertex x1 y1, Vertex x2 y2) - zip vertices (tail vertices ++ [head vertices])] thanks, John Huges pointed me to a

Re: The importance and relevance of FP

2000-08-16 Thread Friedrich Dominicus
Julz [EMAIL PROTECTED] writes: Could you explain why Lisp isn't a FP language? Well, the obvious arguments would be that : functions, while pretty first class objects, reside in their own namespace, and need special operators. : iteration and side effects are not particularly

Re: The importance and relevance of FP

2000-08-16 Thread Friedrich Dominicus
Why abused? Why should the "pure" functional way the best for programming? Couldn't it be that a language which supports other features besides functionl elements. Indeed. Could it be that Lisp supports, yea, even encourages, non-functional programming? Why, then, is it important to

Re: Where do I start ?

2000-07-19 Thread Friedrich Dominicus
Nicolas Tremblay [EMAIL PROTECTED] writes: My few suggestions (I have starting looking at Haskell just a year or so ago and never used it very intensivly) Download Hugs it's somewhat nicer to work with. There are two books available for Haskell Haskell The Craft of Functional Programming

How to debug Haskell programs?

2000-04-26 Thread Friedrich Dominicus
This question may sound a bit strange. I'll try to explain. I have written a piece of Haskell and found that I did not understand things. I tried to look what I got wrong and searched for a possibility to give me output. Now obvious is that Haskell has not debugger so I was thinking helping

string to Integer

2000-04-05 Thread Friedrich Dominicus
I was again playing around with Haskell to learn it a bit better. I do not found a function to turn a String into an Integer This is what I come up with: string_to_int_list :: String - [Int] -- filter out all Digits first and then turn it into a list -- of integers string_to_int_list = filter

Re: string to Integer

2000-04-05 Thread Friedrich Dominicus
"AvI" == Arjan van IJzendoorn [EMAIL PROTECTED] writes: AvI Hello Friedrich, AvI Turning a string into an integer is easy with the Prelude function 'read': AvI n :: Integer AvI n = read "-34232" Yes, other have told me. As I mailed back I was just too blind. AvI Your own

Re: A Haskell-Shell

1999-08-21 Thread Friedrich Dominicus
Koen Claessen wrote: Hello, | Just wondering if someone uses Hugs for writing Unix-Shell Scripts. Or | what would you think about a Haskell-Shell. These are two quite separate issues of course. I can comment on the first one. Of course you're rigth, and I better had just asked if

A Haskell-Shell

1999-08-20 Thread Friedrich Dominicus
Just wondering if someone uses Hugs for writing Unix-Shell Scripts. Or what would you think about a Haskell-Shell. SCSH (a Scheme-Shell) brought me on that idea. Don't you think that would be a nice thing? Regards Friedrich

Re: how to write a simple cat

1999-06-11 Thread Friedrich Dominicus
I disagree, small scripts spend most of the time doing I/O if I don't understand how to do that I'm not able to even write the most simple things. This is eg. true for my cat ... I disagree. You need to know more about Functional Programming (and also the Haskell type system and its IO

Re: how to write a simple cat

1999-06-09 Thread Friedrich Dominicus
Hannah Schroeter wrote: Hello! On Fri, Jun 04, 1999 at 12:29:45PM +0200, Friedrich Dominicus wrote: [...] What is difficult is that by using some predefined function, one can express very much in very small code. I believe Haskell is even more expressive than most OO languages

Re: how to write a simple cat

1999-06-05 Thread Friedrich Dominicus
Lennart Augustsson wrote: Friedrich Dominicus wrote: That might be good advice but I/O is one of the most essential things and I have to know how to use it proper for writing small skripts. Actually, you can do a lot without learning about I/O. The function `interact' converts

Re: how to write a simple cat

1999-06-04 Thread Friedrich Dominicus
Then split it up like you'd do in an OO language. I think, FP also is good for writing small functions that do one thing well, and then composing them in various ways (as you see, composing functions (and perhaps also values) in Haskell is possible in very many various ways :-) ). In the

Re: how to write a simple cat

1999-06-04 Thread Friedrich Dominicus
So after I read in a chunk form that file into one large String, lines splits that line on a '\n' position. The lines li are filtered and l is one line a String-List which is added to fl all the filterd lines are then put back into on large String. Uff. Is that nearly correct? Yes,

Re: how to write a simple cat

1999-06-02 Thread Friedrich Dominicus
At first, thanks to all of you about this nice insight into FP used programmers. It was really a suprise to me to see that that what Sven wrote seems to be easily understood. I would really like to see such code-snippets to found on a central site what about www.haskell.org ? I reread my book

Re: how to write a simple cat

1999-06-01 Thread Friedrich Dominicus
Hannah Schroeter wrote: Hello! On Mon, May 31, 1999 at 06:01:31PM +0200, Friedrich Dominicus wrote: Hannah Schroeter wrote: Hello! On Fri, May 28, 1999 at 08:00:27AM +0200, Friedrich Dominicus wrote: I wrote before with my trouble understanding hugsIsEOF. But I don't have

Re: how to write a simple cat

1999-06-01 Thread Friedrich Dominicus
Hannah Schroeter wrote: Hello! On Tue, Jun 01, 1999 at 06:58:32AM +0200, Friedrich Dominicus wrote: [...] I want to do the following, read a file line by line and finding out which line is longer than x-chars. I want to print out which lines are so long. I think that can just

Re: how to write a simple cat

1999-05-31 Thread Friedrich Dominicus
Hannah Schroeter wrote: Hello! On Fri, May 28, 1999 at 08:00:27AM +0200, Friedrich Dominicus wrote: I wrote before with my trouble understanding hugsIsEOF. But I don't have found a clean way just to write a cat. Can s.o give me a hand? import System(getArgs) file2stdout :: String

how to write a simple cat

1999-05-28 Thread Friedrich Dominicus
I wrote before with my trouble understanding hugsIsEOF. But I don't have found a clean way just to write a cat. Can s.o give me a hand? Regards Friedrich

I/O Question for Haskell

1999-05-13 Thread Friedrich Dominicus
I don't have very much luck with this question in c.l.f. So I'll try it here. I tried to run a simple program form the book "The craft of Functional Programming" from Simon Thompson, page 392f. Here's my source #!/usr/local/bin/runhugs import System import IO main :: IO () main = while