Wish list: RULES, line number and filenames.

2000-08-04 Thread Marc van Dongen

Dear ghc-team,


At the moment I think it is only possible that
error messages about functions can refer to line
numbers and names of source files at the points
of *definition* of these functions. These error
messages are the ones that ghc automatically
generates when there is a pattern matching error.

I think it would be useful to have error messages
about functions that refer to the line number and
the name of the source files at the moment these
functions are *used*. This would make it a lot
easier to locate errors.

I also think it would be handy to give the user
more control about line numbers and file names.
One possibility (modulo newlines in the RULES section)
would be an extension as follows:

{-# RULES
"lookupFM.range check" forall m key . rdMap m key =
 maybe (lookupFmError #LINE #FILE)
   id
   (#lookupFM m key)
#-}  --  

lookupFmError line file
  = error $ concat ["lookupFM :: key not in range in line ",line," in ",file]

The function #lookupFM would be the ``real''
lookupFM function. The idea is that after debugging
of a function one can just disable a rule in the
RULES section.


Just a thought.

Regards,


Marc van Dongen
-- 
 Marc van Dongen, CS Dept | phone:  +353 21 4903578
University College Cork, NUIC | Fax:+353 21 4903113
  College Road, Cork, Ireland | Email: [EMAIL PROTECTED]




Re: Haskell and the NGWS Runtime

2000-08-04 Thread Chris Saunders

Why not Linux?

Regards
Chris Saunders
[EMAIL PROTECTED]

- Original Message -
From: "Bill Halchin" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, August 03, 2000 10:49 PM
Subject: Re: Haskell and the NGWS Runtime


 To Linux?   :^)




 From: "Chris Saunders" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED], "Erik Meijer" [EMAIL PROTECTED]
 CC: "Marcin 'Qrczak' Kowalczyk" [EMAIL PROTECTED],
[EMAIL PROTECTED]
 Subject: Re: Haskell and the NGWS Runtime
 Date: Thu, 3 Aug 2000 22:24:14 -0400
 
 It seems to me that this .Net thingy is a runtime
 and therefore could potentially be as portable
 as anything from Java.  This runtime just needs
 to be ported to other operating systems similarily
 to the Java runtime.
 
 Regards
 Chris Saunders
 [EMAIL PROTECTED]
 
 
 - Original Message -
 From: "Kevin Glynn" [EMAIL PROTECTED]
 To: "Erik Meijer" [EMAIL PROTECTED]
 Cc: "Marcin 'Qrczak' Kowalczyk" [EMAIL PROTECTED];
[EMAIL PROTECTED]
 Sent: Thursday, August 03, 2000 8:57 PM
 Subject: Re: Haskell and the NGWS Runtime
 
 
  
  
   I don't believe this says anything about support for other OS's.  I
   think the devices here are hardware, (PCs, handhelds, phones, fridge
   interfaces, ...)  Of course Microsoft believes that some day, very
   soon, all devices will run (a version of) Windows.  Hence this
   statement refers to Microsoft's announced plans to port .NET to all
   Windows OS's, including WinCE.
  
   Do you have another reference which is more convincing?
  
   k
  
  
   Erik Meijer writes:
  Not "at least" but "only". I haven't heard of plans for .NET on
any
  non-Windows platform.

 Then you should listen more closely! a quote from the .NET
 whitepaper:

 Microsoft .NET proactively adapts to what you
 want to do, on any of your devices. This inversion
 of the traditional installation-dependent application
 model is a necessity in a world where users will
 enjoy the benefits of services on multiple devices.

 http://www.microsoft.com/net/

 Erik



  
 
 

 
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com







RE: Haskell and the NGWS Runtime

2000-08-04 Thread Carsten Kehler Holst


A few comments on this (stuff after the line beneath):

The C implementation isn't really that inefficient. A factor of log(n)
in average of course a factor of n i worst case.

This doesn't change when using a lazy language! because of the nature of
quicksort.
As a matter of fact you have to have a "nice" version of merge sort
(there are several
variants - see fx Ralf Hinze, A Data-structural Look at Sorting, 1998, I
don't know if it has been published except on this list) to be sure that
(hd (sort list)) runs in time O(n).

But, you are right a degree in CS doesn't guarantee that you know about
complexity,
but neither does programming in a lazy language. Personally I'm
programming large 
systems in Prolog (www.pdc.dk) upto 150K lines. We try to make programs
readable and
correct firstmost, when they are too slow we measure where and fix it.

Carsten Kehler Holst




Fergus wrote:

 I guess one could argue that the costs of most other things pale
 in comparison to the costs of having lazy evaluation as the default
;-)

Of course, if you're the sort of person who likes to write "head (sort
lst)"
to get the least member of a list, then lazy evaluation is incredibly
efficient. Getting used to lazy evaluation, and really learning how to
use
it properly, is probably really the hardest thing about Haskell for
someone
who has already learned how to program using strict languages. Possibly
even
harder than monads.

Funny/sad anecdote: I once saw a senior software engineer with over 15
years
of C experience and a master's degree in CS, write the following code in
C
to locate the least member of an array:

qsort(array,
  sizeof(array) / sizeof(array[0]),
  sizeof(array[0]),
  comparator);
least = array[0];

Essentially, this is just "head (sort lst)" in C, which, as I daresay we
all
know, is NOT a lazy language! I actually had to explain to her why it
was
inefficient. Depending how you look at it, this is either strong
evidence
that lazy evaluation is a more natural way to think than strict
evaluation,
or proof that a master's in CS doesn't necessarily mean you really know
anything about programming.

Craig






Re: Haskell and the NGWS Runtime

2000-08-04 Thread Nigel Perry

We're drifting a bit off Haskell here, but...

At 10:57 am +1000 4/8/00, Kevin Glynn wrote:
I don't believe this says anything about support for other OS's.  I
think the devices here are hardware, (PCs, handhelds, phones, fridge
interfaces, ...)  Of course Microsoft believes that some day, very
soon, all devices will run (a version of) Windows.  Hence this
statement refers to Microsoft's announced plans to port .NET to all
Windows OS's, including WinCE.

Do you have another reference which is more convincing?

I haven't seen a WinCE version but at a recent conference one of the 
exhibitors was offering a .NET on WindowsCE course - however when I 
inquired they just said "ask MS, we don't know, we just teach the 
courses" (somehow I don't think I'll be recommending them!) So that's 
not too convincing!

They are talking phones - but that has to be a stripped down version. 
However I'm not sure why I want Haskell on my phone ("the phone with 
higher-order polymorphic lazy dialing"?)

As to others OSES...

At 10:24 pm -0400 3/8/00, Chris Saunders wrote:
It seems to me that this .Net thingy is a runtime
and therefore could potentially be as portable
as anything from Java.  This runtime just needs
to be ported to other operating systems similarily
to the Java runtime.

Porting JVM is a big enough job (you find a lot of "native" 
methods...) .NET has more paraphernalia than the JVM so it will be 
quite a job. However I think MS is moving to "standardise" the IL 
(the byte codes) which I guess is to suggest it is not a moving 
target (not the the JVM really is but I hear the lack of JVM 2's has 
been blamed on lack of info out of Sun - but that might be just 
passing the blame)

At 5:59 pm +0200 3/8/00, Juan J. Quintela wrote:
nigel Disclaimer, as Fergus added one: I am working with Microsoft on .NET
nigel implementation, but I run Windows 2000 on my G3 PowerBook and take it
nigel to Microsoft with me. I'm biased on everything :-)

Windows 2000 in a G3 Powerbook? I am lost here :((

Why have any other computer when you can have a Mac?

Mine runs:
DVD Movies
MacOS
JVM
Playstation games
Windows 95
Windows 2000 (a bit slugglish)
and could run:
Linux (but I have no use for it at present)

At 2:07 am +1000 4/8/00, Fergus Henderson wrote:
 Note that on x86 there are only six general purpose registers,
 so you very quickly run out...

Who uses the x86? Oh I remember... ;-)

Cheers,
Nigel
-- 
--
Dr Nigel PerryEmail: [EMAIL PROTECTED]
IIST  Tel: +64 6 350 5799 2477
Massey University Fax: +64 6 350 2259
Palmerston North  FTP/WWW: smis-asterix.massey.ac.nz
New Zealand

It makes as much sense to wear a "cycle" style helmet in a car as on a bike...
Choosing to wear one on a bike but not in a car is mere inconsistency.
Refusing to wear one in a car while insisting others do so on a bike 
is pure hypocrisy.

Will the new Labour government repeal the National government's hypocrisy,
or will they insult cyclists' like their predecessors?

Politics and hypocrisy before safety - the NZ Helmet Law, NZ's Shame




Re: Haskell and the NGWS Runtime

2000-08-04 Thread Lennart Augustsson

 Why have any other computer when you can have a Mac?
 
 Mine runs:
 DVD Movies
 MacOS
 JVM
 Playstation games
 Windows 95
 Windows 2000 (a bit slugglish)
 and could run:
 Linux (but I have no use for it at present)
I notice that your Mac can run a lot of things, but among the things
you actually run there is only one operating system (Win 2k).  :)

But I agree, Macs are cool.

-- Lennart




Tackling the Awkward Squad

2000-08-04 Thread Richard Uhtenwoldt

Simon Peyton-Jones tell us of his latest paper:

   Tackling the Awkward Squad: monadic I/O, concurrency, exceptions,
   and foreign-language calls in Haskell.

   http://research.microsoft.com/~simonpj/papers/marktoberdorf.ps.gz

This 40-page tutorial focuses on explaining the "bits round
the edges" of Haskell programs, rather than the beautiful
functional core we all know and love.

it took me a long time to understand monadic programming, but now that I
do it hurts to hear monadic I/O and concurrency described as "bits round
the edges of Haskell programs" and part of the "awkward squad" and
outside the "beautiful functional core we all know and love".

given that Dr Peyton Jones co-wrote "Concurrent Haskell" and "Imperative
Functional Programming", I'm wondering if those words reflect his true
opinion or whether it is an ironic reference to sentiments he has heard
from other people.

and I'd like to hear what Marcin thinks, too: is the IO monad
outside the beautiful core of Haskell?

thank you in advance.




Re: Haskell and the NGWS Runtime

2000-08-04 Thread Eduardo Nahum Ochs

  Why have any other computer when you can have a Mac?
 
  Mine runs:
  DVD Movies
  MacOS
  JVM
  Playstation games
  Windows 95
  Windows 2000 (a bit slugglish)
  and could run:
  Linux (but I have no use for it at present)
 I notice that your Mac can run a lot of things, but among the things
 you actually run there is only one operating system (Win 2k).  :)

Weird, nobody mentioned neither NetBSD nor OpenBSD...
CS people are weird. :-)

Cheers,
  Edrx
  http://angg.twu.net/

--
Recycle your keystrokes - http://angg.twu.net/eev-manifesto.html




Re: Haskell and the NGWS Runtime

2000-08-04 Thread Lennart Augustsson

Eduardo Nahum Ochs wrote:

   Why have any other computer when you can have a Mac?
  
   Mine runs:
   DVD Movies
   MacOS
   JVM
   Playstation games
   Windows 95
   Windows 2000 (a bit slugglish)
   and could run:
   Linux (but I have no use for it at present)
  I notice that your Mac can run a lot of things, but among the things
  you actually run there is only one operating system (Win 2k).  :)

 Weird, nobody mentioned neither NetBSD nor OpenBSD...
 CS people are weird. :-)

I consider myself a CS person and I run NetBSD on all my machines.
And I'm also weird.

--

-- Lennart







RE: Haskell and the NGWS Runtime

2000-08-04 Thread Brent Fulgham

  Weird, nobody mentioned neither NetBSD nor OpenBSD...
  CS people are weird. :-)
 
 I consider myself a CS person and I run NetBSD on all my machines.
 And I'm also weird.
 
I'm weird, but not a true 'CS' person.  I run Linux -- do I
need to move to NetBSD?

-Brent