Re: diff in Haskell: clarification

2002-11-25 Thread George Russell
Francis Girard wrote: > > You caught my attention. > > It would be nice if you write your own version from scratch to make all of us > profit of this. I have a confession to make. Andrew Bromage's list-based code is much faster than my array-based code. So I think I shall end up adapting Andrew

Web Demonstration of Type Error Slicing

2002-11-25 Thread Christian Haack
Previous methods have generally identified the location of a type error as a particular program point or the program subtree rooted at that point. In the paper "Type Error Slicing in Implicitly Typed Higher-Order Languages" by two of us (Haack and Wells), we present a new approach that treats the

Re: how to convert IO String to string---- still have questions

2002-11-25 Thread Ganesh Sittampalam
On Sun, 24 Nov 2002 22:50:43 +0100, Nick Name <[EMAIL PROTECTED]> wrote: >On Sun, 24 Nov 2002 20:42:31 + >Glynn Clements <[EMAIL PROTECTED]> wrote: > >> Even if Haskell were strict, you still wouldn't be able to treat I/O >> operations as functions without discarding referential transparency.

Re: Web Demonstration of Type Error Slicing

2002-11-25 Thread Greg Michaelson
Please tell me when it recognises [] as the empty list and :: as a list constructor. Thanks! Greg ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Web Demonstration of Type Error Slicing

2002-11-25 Thread Greg Michaelson
Please give some examples. It doesn't like ; at the end but says EOF when ; is missed. It doesn't show the examples when I select them. Greg ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Best recursion choice for "penultimax"

2002-11-25 Thread Dean Herington
Mark P Jones wrote: > Moreover, > in attempting to "optimize" the code, you might instead break it > and introduce some bugs that will eventually come back and bite. Indeed! If we take Mark Phillips's original version of penultimax as our specification, all four alternate versions are incorrect:

Re: Best recursion choice for "penultimax"

2002-11-25 Thread Richard Braakman
On Sun, Nov 24, 2002 at 10:06:42PM -0800, Mark P Jones wrote: > To your three implementations, let me add another two. If you are > looking > for the smallest possible definition, consider the following: > > import List > > penultimax1 :: Ord a => [a] -> a > penultimax1 = head . tail . so

RE: Best recursion choice for "penultimax"

2002-11-25 Thread Simon Marlow
> Some quick tests with Hugs +s on a example list that I constructed > with 576 elements give food for thought: > > reductions cells >my one liner 403511483 >tournament705312288 >your penultimax 1671520180 >

Re: diff in Haskell: clarification

2002-11-25 Thread Andrew J Bromage
G'day all. On Mon, Nov 25, 2002 at 12:19:10PM +0100, George Russell wrote: > I have a confession to make. Andrew Bromage's list-based code is > much faster than my array-based code. So I think I shall end up > adapting Andrew Bromage's code, even though I do not understand it. You mean you did

Re: diff in Haskell: clarification

2002-11-25 Thread George Russell
Andrew J Bromage wrote: > > G'day all. > > On Mon, Nov 25, 2002 at 12:19:10PM +0100, George Russell wrote: > > > I have a confession to make. Andrew Bromage's list-based code is > > much faster than my array-based code. So I think I shall end up > > adapting Andrew Bromage's code, even though

RE: Best recursion choice for "penultimax"

2002-11-25 Thread Dr Mark H Phillips
Thanks for your alternative solutions. (I also take Mark Jones' point that there was an error with some of my initial solutions.) On Mon, 2002-11-25 at 16:36, Mark P Jones wrote: > To your three implementations, let me add another two. If you are > looking > for the smallest possible definition,

You can finally run your Chameleon programs!

2002-11-25 Thread Martin Sulzmann
The latest Chamleon release includes a compiler. Chameleon programs are translated into plain Haskell (= Hindley/Milner subset plus polymorphic recursion). Note that Chameleon comes also with a type debugger. Check out http://www.comp.nus.edu.sg/~sulzmann/chameleon/ for the latest release includ

Re: Best recursion choice for "penultimax"

2002-11-25 Thread Dr Mark H Phillips
On Tue, 2002-11-26 at 02:38, Richard Braakman wrote: > penultimax1' :: Ord a => [a] -> a > penultimax1' = head . tail . sortBy (flip compare) . nub What does "nub" stand for? (This is the first I've heard of it.) >From the definition in List.hs it seems to remove repeats, keeping only the first.

RE: Best recursion choice for "penultimax"

2002-11-25 Thread David Bergman
Hi, (maybe I got the message to the community this time, Mark P ;-) I would like to know if anyone (maybe Mark P) knows the status of "Cartesian classes" in different Haskell implementations. I.e., does anyone implement the suggested functional dependencies or the less general parameterized type

Re: Best recursion choice for "penultimax"

2002-11-25 Thread John Hughes
> > What does "nub" stand for? (This is the first I've heard of it.) > From the definition in List.hs it seems to remove repeats, keeping > only the first. Yes, that's what it does. It doesn't stand for anything, it's a word: "nub: small knob or lump, esp. of coal; small residue, stub; point or