Re: [Haskell] modern language design, stone age tools

2004-06-23 Thread John Meacham
On Wed, Jun 23, 2004 at 06:52:32PM +0100, MR K P SCHUPKE wrote: > >So how do you debug problems like "Prelude.head: empty list" > >in large programs? > for precisely this reason - and the fact that I dont like bindings > that can fail... Note that pattern matching rather than deconstruction funct

Re: [Haskell] modern language design, stone age tools

2004-06-23 Thread John Meacham
On Wed, Jun 23, 2004 at 09:43:46PM +0100, Alastair Reid wrote: > 2) If you don't want to put errors in the type system, you could instead use >exceptions something along the lines of: > > myFunc 0 x = mapException > (\ err -> show err ++ "when invoked by myFunc 0")

Re: [Haskell] modern language design, stone age tools

2004-06-23 Thread John Meacham
On Wed, Jun 23, 2004 at 10:39:08AM -0700, Fergus Henderson wrote: > On 23-Jun-2004, MR K P SCHUPKE <[EMAIL PROTECTED]> wrote: > > This may not be the right answer to the question (which is of > > course lets write a debugger) - But I have never used a debugger, > > and find them more or less the mo

Re: [Haskell] modern language design, stone age tools

2004-06-23 Thread MR K P SCHUPKE
>Thank you for the programming practice recomendation, Sorry if it seemed like that... I was really trying to suggest practical measures that someone could use in the absence of a debugger - but I do feel that 'commercial quality' code should be bullet proof, and of a different calibre to code for

Re: [Haskell] modern language design, stone age tools

2004-06-23 Thread Alastair Reid
On Wednesday 23 June 2004 20:38, S. Alexander Jacobson wrote: > It would be really nice if you could pass an > error message down to every function that might > fail. e.g. using implicit parameters*: > >myFunc 0 x = head x with ?failMsg="myfunc 0 caused the error" Interesting. Two variations

Re: [Haskell] modern language design, stone age tools

2004-06-23 Thread S. Alexander Jacobson
Thank you for the programming practice recomendation, but I would still prefer to have something like the implicit parameters solution I described. The solution you describe forces you to put code in functions to handle cases that are outside its domain. Usually I just want to know what function

Re: [Haskell] modern language design, stone age tools

2004-06-23 Thread MR K P SCHUPKE
I like to write programs so functions cannot fail... so head should really be: maybeHead :: [a] -> Maybe a maybeHead (a:_) = Just a maybeHead _ = Nothing etc... The the calling function can do something like: case maybeHead x of Just y ->

Re: [Haskell] modern language design, stone age tools

2004-06-23 Thread S. Alexander Jacobson
It would be really nice if you could pass an error message down to every function that might fail. e.g. using implicit parameters*: myFunc 0 x = head x with ?failMsg="myfunc 0 caused the error" Head would be defined as e.g. head [] = fail $ "empty list.\n" ++ ?failMsg head (x:xs) = x I

Re: [Haskell] modern language design, stone age tools

2004-06-23 Thread Fergus Henderson
On 23-Jun-2004, Hal Daume III <[EMAIL PROTECTED]> wrote: > On Wed, 23 Jun 2004, Fergus Henderson wrote: > > > On 23-Jun-2004, MR K P SCHUPKE <[EMAIL PROTECTED]> wrote: > > > This may not be the right answer to the question (which is of > > > course lets write a debugger) - But I have never used a

Re: [Haskell] modern language design, stone age tools

2004-06-23 Thread MR K P SCHUPKE
>Hmmm... chickens and eggs. I don't see a lot of *companies* using Haskell Actually I have used Haskell in commercial projects... and am continuing to do so. My development environment is Vim and GHC. Same one I have used for C/C++ VHDL Perl, and anything else... It is not that lack of GUI tool

Re: [Haskell] modern language design, stone age tools

2004-06-23 Thread MR K P SCHUPKE
>So how do you debug problems like "Prelude.head: empty list" >in large programs? I normally dont use head, but instead code: case x of (a0:_) -> _ -> fail for precisely this reason - and the fact that I dont like bindings that can fail... Keean. ___

Re: [Haskell] modern language design, stone age tools

2004-06-23 Thread Fergus Henderson
On 23-Jun-2004, Ketil Malde wrote: > > Thirdly, profiling seems to be incompatible with the use of ghci; there > > doesn't seem to be any easy way to build a workspace so that you can > > get stack traces and use ghci in that workspace at the same time. > > You can compile with: -prof -auto-all -

Re: [Haskell] modern language design, stone age tools

2004-06-23 Thread Fergus Henderson
On 23-Jun-2004, MR K P SCHUPKE <[EMAIL PROTECTED]> wrote: > This may not be the right answer to the question (which is of > course lets write a debugger) - But I have never used a debugger, > and find them more or less the most unfriendly and useless things So how do you debug problems like "Prelu

Re: [Haskell] modern language design, stone age tools

2004-06-23 Thread Graham Klyne
At 11:48 23/06/04 +0100, Malcolm Wallace wrote: If companies are willing to invest in development, they will get the tools they want. Hmmm... chickens and eggs. I don't see a lot of *companies* using Haskell right now. And probably they won't until the tools they want are available (and more...

Re: [Haskell] modern language design, stone age tools

2004-06-23 Thread Alastair Reid
MR K P SCHUPKE <[EMAIL PROTECTED]> writes: > You either end up single stepping through a million lines of code, > or you find the error is of a complex non-localised kind anyway. Or you find that inserting a breakpoint (or waiting to hit an exception), examining data structures which are either i

Re: [Haskell] modern language design, stone age tools

2004-06-23 Thread MR K P SCHUPKE
>Unless, of course, you have: >1) A large program operating on a large body of data that takes a long time to debugs logs go to a file, grep and awk let you quickly find things >3) A complex library written by someone else which contains a bug or makes before calling out print a funtion trace li

Re: [Haskell] modern language design, stone age tools

2004-06-23 Thread Malcolm Wallace
> Seeing as Haskell is apparently such a popular language these days, > I don't suppose a working debugger would be too much to ask for, would it? I agree. > In case you're wondering, yes I have already tried using Hat and Buddha. > But I'm trying to debug a real application, not a toy one, and n

RE: [Haskell] modern language design, stone age tools

2004-06-23 Thread MR K P SCHUPKE
This may not be the right answer to the question (which is of course lets write a debugger) - But I have never used a debugger, and find them more or less the most unfriendly and useless things You either end up single stepping through a million lines of code, or you find the error is of a complex

RE: [Haskell] modern language design, stone age tools

2004-06-23 Thread Krasimir Angelov
--- Simon Marlow <[EMAIL PROTECTED]> wrote: > We would be delighted if someone would take Robert's > hsdebug and port it > to the non-speculative version of the compiler. In > fact, this is one of > the items on the GHC Task list: > > http://sourceforge.net/pm/task.php?func=detailtask&project_tas

RE: [Haskell] modern language design, stone age tools

2004-06-23 Thread Simon Marlow
On 23 June 2004 09:27, Robert Ennals wrote: > I wrote such a debugger as part of my PhD work. It is called > "hsdebug" and you can read the Haskell Workshop paper on it here: > > http://www.cambridge.intel-research.net/~rennals/hw2003.pdf > > Unfortunately, HsDebug depends on Optimistic Evaluati

Re: [Haskell] modern language design, stone age tools

2004-06-23 Thread Robert Ennals
I wrote such a debugger as part of my PhD work. It is called "hsdebug" and you can read the Haskell Workshop paper on it here: http://www.cambridge.intel-research.net/~rennals/hw2003.pdf Unfortunately, HsDebug depends on Optimistic Evaluation, and it seems unlikely that Optimistic Evaluation w

Re: [Haskell] modern language design, stone age tools

2004-06-23 Thread Ketil Malde
Fergus Henderson <[EMAIL PROTECTED]> writes: > Seeing as Haskell is apparently such a popular language these days, > I don't suppose a working debugger would be too much to ask for, would it? Hah. You're not supposed to debug, just stare at the code until you become enlightened (why did you thin