Re: [GHC] #917: -O introduces space leak

2006-09-29 Thread GHC
#917: -O introduces space leak
--+-
  Reporter:  [EMAIL PROTECTED]  |  Owner: 
  Type:  bug  | Status:  new
  Priority:  lowest   |  Milestone:  _|_
 Component:  Compiler |Version:  6.5
  Severity:  normal   | Resolution: 
  Keywords:   | Os:  Unknown
Difficulty:  Unknown  |   Architecture:  Unknown
--+-
Changes (by simonpj):

  * milestone:  = _|_
  * priority:  normal = lowest

Comment:

 Thanks for recording this.  You are right that full laziness can introduce
 space leaks.  GHC provides no way to selectively disable it, but you can
 use -fno-full-laziness.

 It's a good research topic.  It'd be great if someone could find a way to
 solve it... but I doubt we'll do anything to GHC in the short term.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/917
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #801: random list from randomseed ... amd64 differs

2006-09-29 Thread GHC
#801: random list from randomseed ... amd64 differs
---+
  Reporter:  caaadar   |  Owner:
  Type:  bug   | Status:  new   
  Priority:  normal|  Milestone:
 Component:  Compiler  |Version:  6.4.2 
  Severity:  normal| Resolution:
  Keywords:| Os:  Linux 
Difficulty:  Unknown   |   Architecture:  x86_64 (amd64)
---+
Comment (by simonpj):

 Lennart writes: The library works when Int has at least 32 bits.  So 64
 should be fine.  I guess it should be rewritten with Int32.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/801
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: Bogus stats when running SMP programs

2006-09-29 Thread Tomasz Zielonka
On Thu, Sep 28, 2006 at 12:42:50PM +0100, Ian Lynagh wrote:
 On Thu, Sep 28, 2006 at 09:07:33AM +0200, Tomasz Zielonka wrote:
  Great! Which snapshot can I use to test this change?
 
 Tonight's or later - there isn't one yet.

As I wrote in another message to glasgow-haskell-bugs, there are some
problems with snapshots (bunzip2 complains about corrupted data).
The recent ghc-6.5.20060928-i386-unknown-linux.tar.bz2 has those
problems too.

I will compile GHC from sources now.

Best regards
Tomasz
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #904: :e test.hs overwrites test.hs with emacs tags

2006-09-29 Thread GHC
#904: :e test.hs overwrites test.hs with emacs tags
--+-
  Reporter:  guest|  Owner:  simonmar
  Type:  bug  | Status:  closed  
  Priority:  normal   |  Milestone:  6.6 
 Component:  GHCi |Version:  6.5 
  Severity:  normal   | Resolution:  fixed   
  Keywords:   | Os:  Unknown 
Difficulty:  Unknown  |   Architecture:  Unknown 
--+-
Changes (by simonmar):

  * resolution:  = fixed
  * status:  new = closed

Comment:

 Fixed: {{{:e}}} now pops up the editor, just like Hugs.

 I didn't implement all of Hugs' :edit functionality, in particular we
 don't attempt to jump to a particular line in the file, but I've done
 enough to close this bug :-)

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/904
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #95: GHCi editor binding with :e

2006-09-29 Thread GHC
#95: GHCi editor binding with :e
--+-
  Reporter:  martijnislief|  Owner:  nobody  
  Type:  feature request  | Status:  assigned
  Priority:  normal   |  Milestone:  
 Component:  None |Version:  None
  Severity:  minor| Resolution:  None
  Keywords:   | Os:  Unknown 
Difficulty:  Easy (1 hr)  |   Architecture:  Unknown 
--+-
Changes (by simonmar):

  * architecture:  = Unknown
  * difficulty:  = Easy (1 hr)
  * os:  = Unknown

Old description:

 {{{
 For me, a very useful feature of Hugs is the :e command,
 allowing to jump directly to the file and line number that
 contain the first error.

 I'd be very happy if GHCi supported this feature.
 }}}

New description:

 {{{
 For me, a very useful feature of Hugs is the :e command,
 allowing to jump directly to the file and line number that
 contain the first error.

 I'd be very happy if GHCi supported this feature.
 }}}

Comment:

 I implemented :edit, but without the line-number-jumping facility for now.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/95
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #637: Ctrl-Break handler doesn't work in forked threads in -threaded RTS

2006-09-29 Thread GHC
#637: Ctrl-Break handler doesn't work in forked threads in -threaded RTS
+---
  Reporter:  [EMAIL PROTECTED]  |  Owner:  simonmar
  Type:  bug| Status:  new 
  Priority:  normal |  Milestone:  6.6.1   
 Component:  Runtime System |Version:  6.4.1   
  Severity:  normal | Resolution:  
  Keywords: | Os:  Windows 
Difficulty:  Moderate (1 day)   |   Architecture:  Unknown 
+---
Changes (by simonmar):

  * milestone:  6.6 = 6.6.1

Comment:

 Punt.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/637
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #716: Unloading a dll generated by GHC doesn't free all resources

2006-09-29 Thread GHC
#716: Unloading a dll generated by GHC doesn't free all resources
-+--
  Reporter:  [EMAIL PROTECTED]  |  Owner:  simonmar
  Type:  bug | Status:  reopened
  Priority:  normal  |  Milestone:  6.6.1   
 Component:  Runtime System  |Version:  6.4.1   
  Severity:  normal  | Resolution:  
  Keywords:  | Os:  Unknown 
Difficulty:  Unknown |   Architecture:  Unknown 
-+--
Changes (by simonmar):

  * milestone:  6.6 = 6.6.1

Comment:

 Punt to 6.6.1 - it may be fixed, but we need to investigate fully.
 Related to #804.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/716
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: Broken snapshot archives

2006-09-29 Thread Simon Marlow

Tomasz Zielonka wrote:


Some recent GHC snapshot files seem to be broken.
For example with

http://www.haskell.org/ghc/dist/current/dist/ghc-6.5.20060927-i386-unknown-linux.tar.bz2
I get:
$ tar jxf ghc-6.5.20060927-i386-unknown-linux.tar.bz2

bzip2: Compressed file ends unexpectedly;
perhaps it is corrupted?  *Possible* reason follows.
bzip2: Inappropriate ioctl for device
Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become
corrupted.
You can use the -tvv option to test integrity of such
files.

You can use the `bzip2recover' program to attempt to
recover
data from undamaged sections of corrupted files.

tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now


Yes, this is due to a long-standing problem with our firewalls that sometimes 
cause corruption of an SSH connection.  I'll try to make it retry or delete the 
file on failure instead of leaving a broken tarball in place.


Cheers,
Simon
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #885: GHC doesn't work with Data Execution Prevention on Windows

2006-09-29 Thread GHC
#885: GHC doesn't work with Data Execution Prevention on Windows
---+
  Reporter:  guest |  Owner: 
  Type:  bug   | Status:  new
  Priority:  normal|  Milestone:  _|_
 Component:  Compiler  |Version:  6.4.2  
  Severity:  major | Resolution: 
  Keywords:| Os:  Windows
Difficulty:  Unknown   |   Architecture:  x86
---+
Comment (by simonmar):

 Ah, that's interesting.  Yes the RTS does have a way to allocate
 executable memory, but it appears that the Win32 object linker isn't using
 it: line 1379 of rts/Linker.c:

 {{{
oc-image = stgMallocBytes(oc-fileSize + misalignment,
 loadObj(image));
 }}}

 Could you try changing this to

 {{{
oc-image = allocateExec(oc-fileSize + misalignment);
 }}}

 and see if that helps?

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/885
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: Broken snapshot archives

2006-09-29 Thread Tomasz Zielonka
On Fri, Sep 29, 2006 at 12:30:10PM +0100, Simon Marlow wrote:
 Tomasz Zielonka wrote:
 Some recent GHC snapshot files seem to be broken.
 
 Yes, this is due to a long-standing problem with our firewalls that 
 sometimes cause corruption of an SSH connection.  I'll try to make it retry 
 or delete the file on failure instead of leaving a broken tarball in place.

Try using rsync. It doesn't leave partially transferred files (unless
you ask it to do it). The file on the target machine is first created
with a different name, and renamed to the final name only if it was
transferred successfully.

rsync can work over SSH, and in the basic scenario has similar
command-line options.

Best regards
Tomasz
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: Bogus stats when running SMP programs

2006-09-29 Thread Tomasz Zielonka
On Fri, Sep 29, 2006 at 11:00:25AM +0200, Tomasz Zielonka wrote:
 I will compile GHC from sources now.

The stats seem to be OK now.
Thanks!

Best regards
Tomasz
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #735: Missing case in fgl/Data/Graph/Inductive/Internal/RootPath.hs

2006-09-29 Thread GHC
#735: Missing case in fgl/Data/Graph/Inductive/Internal/RootPath.hs
+---
  Reporter:  [EMAIL PROTECTED]  |  Owner:  
  Type:  bug| Status:  closed  
  Priority:  normal |  Milestone:  
 Component:  libraries (other)  |Version:  6.4.1   
  Severity:  normal | Resolution:  fixed   
  Keywords: | Os:  Multiple
Difficulty:  Easy (1 hr)|   Architecture:  Multiple
+---
Changes (by panne):

  * resolution:  = fixed
  * status:  new = closed

Comment:

 Merged fix from HEAD

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/735
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Map.genericSize

2006-09-29 Thread Serge D. Mechveliani
Dear GHC developers,

Can you, please, provide   Map.genericSize :: Map - Integer

in addition to Map.size:: Map - Int
?

For I use `Map.size', a bit, and need its variant which is both  O(1)  
and  Integer  (because Int is less reliable).

Probably, this is not hard to arrange.
The same request is for  Data.Set.

What do you think of this?

-
Serge Mechveliani
[EMAIL PROTECTED]
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Map.genericSize

2006-09-29 Thread Christian Maeder
Map (and Set) use (unboxed) Int internally. So bigger Maps and Sets are
not possible.

Christian

Serge D. Mechveliani schrieb:
 Dear GHC developers,
 
 Can you, please, provide   Map.genericSize :: Map - Integer
 
 in addition to Map.size:: Map - Int
 ?
 
 For I use `Map.size', a bit, and need its variant which is both  O(1)  
 and  Integer  (because Int is less reliable).
 
 Probably, this is not hard to arrange.
 The same request is for  Data.Set.
 
 What do you think of this?
 
 -
 Serge Mechveliani
 [EMAIL PROTECTED]
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re[2]: Map.genericSize

2006-09-29 Thread Bulat Ziganshin
Hello Christian,

Friday, September 29, 2006, 1:02:07 PM, you wrote:

 Map (and Set) use (unboxed) Int internally. So bigger Maps and Sets are
 not possible.

interfaces has their own lives :)  someone can write DiskMap library
which allows to old more data but has the same interface as Data.Map


-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


[Haskell] Re: ANN: Efficient, dynamically compiled, lazy functional semantics on JVM, having tight integration with the Java language

2006-09-29 Thread apfelmus
I'd like to summarize why you chose to create a new language instead of
a Haskell-JVM backend and to throw in ideas which address these points
in Haskell.

 1. Java
 2) Why did we create CAL instead of just using Haskell?
 2)b) CAL is a low-risk choice for business applications
 2)c) Programs do not need to be entirely written,
   or even primarily written in CAL
 2)d) CAL seeks to be as comfortable as possible for mainstream
   developers to use
 3. Simple syntax, appropriate features

The functional stuff should be integrated as tightly as possible with
Java which means a foreign function interface that blurs the lines and
using the JVM runtime and its garbage collector.

When it goes to marshaling, the Haskell FFI does not blur anything.
Perhaps this could be remedied by adding a foreign data interface:

foreign data c-struct Foo { bar :: Int, bar2 :: Bool }
foreign export foobar :: Foo - Int
foobar f = (if bar2 f then id else negate) $ bar f

foreign data java-object Foo { bar :: Int, bar2 :: Bool, foobar :: Foo
- Int}
etc.

so that foreign data things become first class values.

In the paper Strongly typed memory areas, something similar is done
for memory areas. The type of such areas gets a special kind different
from *. For conservative reasons, this could be done here, too. With
some form of kind polymorphism, one could trash all CInt and the like
and have the kind annotation (Int :: forall * . *). The function (+)
f.i. could then be specialized for (CInt :: C) and Haskell (Int :: *).

The main problem is an embedding of System F into Java (or any other
foreign language, strictly speaking -fvia-C already provides such an
embedding) with the additional property that normal functions are
exported *without marshaling*. Viewed as a mathematical map, the
embedding should be a projection, so to speak. Maybe a kind system can
help: everything that can be exported transparently gets a simple kind
and is automatically exported/imported. So (foreign export) and (foreign
import) should be dropped altogether. Those things using System F
features (polymorphism, rank-n-types etc.) get a complicated kind which
clearly marks them as to be marshaled.

One tricky point is how to marshal laziness and it looks like Business
Objects solved this in a very pragmatic way (i.e. Java objects are
always strict)?
The point
 3. CAL performance
also falls under this category: no marshaling means compiling to loops etc.

To summarize, there is a need for a very sophisticated foreign language
interface / foreign run-time system integration.


 2. Dynamic compilation

With lambdabot, Dynamic applications from the ground up and
hs-plugins, there are some things underway.

Clean seems to offer a potent solution, where one can pattern match
against types:

foo :: Dynamic - Dynamic - Dynamic
foo (Dyn f :: a - b) (Dyn x :: a) = Dyn (f a) :: b
foo _ _ = error foo falls through

Values of type Dynamic are/can be serialized which allows one to
serialize functions (!). I don't know exactly, but I think its even
possible to use the Clean compiler as a library and compile things at
runtime to values of type Dynamic. The paper Towards a strongly typed
operating system mentions some things in that direction.

Maybe there is no need for another language construct to allow the
pattern matching of types, some approach to generic programming à la
Hinze already could do things like that. Somehow, it becomes a problem
of representing and manipulating types at runtime.



Leaving aside the syntactic differences, I think that these two points
are actually the essence of what separates CAL from Haskell?

A minor motivation why busy enterprise business integration applications
need the two mentioned features might be:
1. Java is the official machine architecture of business applications.
Point. At least, so it seems to me. The need for a foreign language
interface (software reuse!) is obvious, then.
2. Software for a banking-house that handles all the financial
transactions just cannot be shut down for bug fixing or rewrites. The
same goes for lambdabot :)


Regards,
apfelmus

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] Re: Haskell Weekly News: September 27, 2006

2006-09-29 Thread Cyril Schmidt
Donald Bruce Stewart wrote:
Conference roundup

   The [41]Commercial Users of Functional Programming workshop (CUFP),
   held in association with [42]ICFP, attracted a record turn-out this
   year.
[...]
 * Haskell programming at Credit Suisse. Howard Mansell talked about
   Haskell programming at [44]Credit Suisse in New York.

Sadly, I was unable to attend. Is the presentation, by any chance,
available online? Pointers to other related info will be much
appreciated.

(Yes, I know that a report of the conference will be published, but
that won't happen before December :(

Regards,

Cyril

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] Proceedings Haskell Workshop 1995

2006-09-29 Thread Henrik Nilsson

Dear Haskellers,

In celebration of the 10th Haskell Workshop, that took place in
Portland, Oregon, on the 17th September 2006, the proceedings
of the very first Haskell workshop, in La Jolla 1995, have
now been made available off the Haskell Workshop home page:

www.haskell.org/haskell-workshop/1995

Thanks to Paul Hudak for helping locating the proceedings
and arranging for them to be scanned into PDF.

All the best,

/Henrik

--
Henrik Nilsson
School of Computer Science and Information Technology
The University of Nottingham
[EMAIL PROTECTED]

This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Re: Haskell Weekly News: September 27, 2006

2006-09-29 Thread John Hughes
The intention is to put the speaker's slides online. But in some cases, that 
will require additional permission from the company concerned--putting 
slides on the web is more public than talking at a workshop. So some 
sanitation may perhaps be needed. All this is going to take a little while, 
so while the slides WILL appear in the medium term, don't hold your breath.


John

- Original Message - 
From: Cyril Schmidt [EMAIL PROTECTED]

To: haskell@haskell.org
Sent: Friday, September 29, 2006 3:47 PM
Subject: [Haskell] Re: Haskell Weekly News: September 27, 2006



Donald Bruce Stewart wrote:

Conference roundup



  The [41]Commercial Users of Functional Programming workshop (CUFP),
  held in association with [42]ICFP, attracted a record turn-out this
  year.

[...]

* Haskell programming at Credit Suisse. Howard Mansell talked about
  Haskell programming at [44]Credit Suisse in New York.


Sadly, I was unable to attend. Is the presentation, by any chance,
available online? Pointers to other related info will be much
appreciated.

(Yes, I know that a report of the conference will be published, but
that won't happen before December :(

Regards,

Cyril

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell




___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: All Monads are Functors

2006-09-29 Thread Ashley Yakeley

Jon Fairbairn wrote:

I think joining up the classes is a good idea,


Definitely -- as is slicing them into finer layers (of which
this is also an example).


I have added a ticket for joined-up classes:

  http://hackage.haskell.org/trac/haskell-prime/ticket/113

--
Ashley Yakeley
Seattle WA

___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: [Haskell-cafe] instance of String illegal

2006-09-29 Thread Stefan Holdermans

Adam,


class Foo a where
mkFoo :: a - String

instance Foo String where
mkFoo x = x


In addition to making use of language extensions or wrapper types,  
you could go with the following workaround in just plain Haskell 98:


  import List

  class MkFoo a where
mkFoo :: a - String

mkFooList :: [a] - String
mkFooList =  concat . intersperse ,  . map mkFoo

  instance MkFoo Char where
mkFoo = (: [])
mkFooList = concatMap mkFoo

  instance (MkFoo a) = MkFoo [a] where
mkFoo = mkFooList

For instance:

   mkFoo False
  no

   mkFoo [False, True]
  no, yes

   mkFoo 'h'
  h

   mkFoo haskell
  haskell

The same approach is taken for implementing Show in the standard  
libraries. Note that it requires you to fix the type constructors  
that are to be treated in a special manner ([] in the above example).


HTH,

  Stefan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


RE: [Haskell-cafe] Optimizing a title matcher

2006-09-29 Thread Bayley, Alistair
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Bulat Ziganshin
 Sent: 28 September 2006 17:29
 To: Lyle Kopnicky
   
 now i will work on edit-distance algorithm. i'm have an idea of
 checking the real distance between chars - as on my keyboard, so for
 example sprry can be mistake for sorry, but not for serry


For English text, the Soundex algorithm (or one of its variations) might
do a good job of matching:

http://en.wikipedia.org/wiki/Soundex

Google doesn't show any Haskell implementations yet.

Alistair
*
Confidentiality Note: The information contained in this message,
and any attachments, may contain confidential and/or privileged
material. It is intended solely for the person(s) or entity to
which it is addressed. Any review, retransmission, dissemination,
or taking of any action in reliance upon this information by
persons or entities other than the intended recipient(s) is
prohibited. If you received this in error, please contact the
sender and delete the material from any computer.
*
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Haskell DLL crashes Excel

2006-09-29 Thread Cyril Schmidt
A few people recently asked how to pass a string between a Haskell DLL 
and Excel.
I attach the proof-of-concept code that I wrote a while ago; it 
demonstrates passing
a string from Excel to Haskell and the other way. Most of the C++ code 
is taken

from code examples at http://msdn.microsoft.com

Beware, though, that the code has never been thoroughly tested. I ran 
it, and it did not
crash -- that's almost all I can say. I even do not know if it leaks any 
memory. Use it

at your own peril.

The tar file contains a sample Excel sheet, and the sources of two DLLs: 
a COM DLL
which interfaces with Excel, and a Haskell DLL which is invoked by the 
COM DLL.

You will need Visual Studio 7.1 to build the COM DLL.

The Haskell DLL exports one function, hString2String, which takes a 
C-style string,

and returns the reverse of it.

To build the Haskell DLL, run build.bat.
To build (and register) the COM DLL, open Excel2Haskell.sln in Visual 
Studio, and hit Build.
Once the two libraries are built, open Worksheet.xls and see how the 
function is invoked.


Note that the COM DLL can be used not only by Excel, but by any other 
program or script that
understands COM. For example, VBA scripts in Word, or VB and Javascript 
run by Wscript or

Cscript.

Hope this helps.

Regards,

Cyril
___



Excel2Haskell.tar.bz2
Description: Binary data
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Computing lazy and strict list operations at the same time

2006-09-29 Thread Brandon Moore

Andrew Pimlott wrote:

This is a follow-up to a thread from June-July[1].  The question was how to
write the function

initlast :: [a] - ([a], a)
initlast xs = (init xs, last xs)

so that it can be consumed in fixed space:

main = print $ case initlast [0..10] of
 (init, last) - (length init, last)

Attempts were along the lines of

initlast :: [a] - ([a], a)
initlast [x]= ([], x)
initlast (x:xs) = let (init, last) = initlast xs
  in  (x:init, last)

I seemed obvious to me at first (and for a long while) that ghc should
force both computations in parallel; but finally at the hackathon
(thanks to Simon Marlow) I realized I was expecting magic:  The elements
of the pair are simply independent thunks, and there's no way to partly
force the second (ie, last) without forcing it all the way.

According to the stuff about selector thunks, it seems this should work

initlast [x] = ([],[x])
initlast (x:xs) =
let ~(init,last) = initlast xs
in (x:init, last)

It does, at least when I build with -ddump-simpl. Other builds, I get a 
program that overflows. Attached is a heap profile for a run with the 
main (10M rather than 100M as above - that just takes too long)


main = print $ case initlast [0..1]
of (init, last) - (length init, last)

Brandon


a.out.ps
Description: PostScript document
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] existential types (was Re: Optimization problem)

2006-09-29 Thread Ross Paterson
On Thu, Sep 28, 2006 at 03:22:25PM +0100, Simon Peyton-Jones wrote:
 | Does anything go wrong with irrefutable patterns for existential types?
 
 Try giving the translation into System F.

I'm a bit puzzled about this.  A declaration

data Foo = forall a. MkFoo a (a - Bool)

is equivalent to

newtype Foo = forall a. Foo (Foo' a)
data Foo' a = MkFoo a (a - Bool)

except that you also don't allow existentials with newtypes, for
similarly unclear reasons.  If you did allow them, you'd certainly
allow this equivalent of the original irrefutable match:

... case x of
Foo y - let MkFoo val fn = y in fn val

So, is there some real issue with existentials and non-termination?

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: A better syntax for qualified operators?

2006-09-29 Thread Brian Hulley

Benjamin Franksen wrote:

Brian Hulley wrote:

ith = Data.Array.IArray.(!)


Sorry, but I can't see the problem here. Why can't the editor offer
the operator as '!' in the list of options, and if the user selects
it insert both '(' and ')' at the right places (i.e. before the
module name and after the operator)? Is there some unwritten law that
forbids editors or IDEs to insert stuff at positions other than the
current cursor position?


I hadn't thought of that - I've now decided to just use the existing syntax 
here.




Generally speaking, I would always hesitate to change the language so
it better suits programming tools(*). It is the tools which should
adapt to the language, even if that means the programmer has to find
new ways of suporting the user (and the language). The most important
reason being that code is more often read than written.


My motivation for the change was that it would better suit the human user of 
the programming tool, though in this particular instance you and Henning 
have convinced me that the original syntax was better after all.




At the danger of becoming completely off-topic now (sorry!), I have
to say that I find /both/ versions ugly and unnecessarily hard to
read. My personal solution is to generally avoid qualified imports.


How does this solution scale? Surely it's only lucky if people happen to 
choose names that don't clash with those of other modules?



I use it only if absolutely necessary to disambiguate some symbol, and
then just for that symbol. I am aware that there is an opposing
faction here, who tries to convinve everyone that qualified import
should be the standard (and the actual exported symbols --at least
some of them-- meaningless, such as 'C' or 'T').


Although C and T are in themselves meaningless, the name of the module 
itself is not. As I understand it, this convention makes the module name 
carry the meaning so you use Set.T instead of Set.Set where the meaning is 
duplicated (a rather uneasy situation) in both the module name and type 
name.



I think such a
convention is inappropriate for a functional language (especially one
with user defined operators). There simply is no natural 1:1
correspondence between data type declaration and functions acting on
that data built into the language, as opposed to e.g. OO languages.
Extensibility in the functional dimension, i.e. the ability to
arbitrarily add functions that operate on some data without having to
change the code (module) that defines the data, is one of the
hallmarks of functional programming, as opposed to OO
programming.


If you have an abstract data type then it *is* like an object (though in a 
potentially more powerful way than in OOP) because there is no other way to 
manipulate values of that type.
If the type is not abstract, the advantage of calling it T is just that it 
avoids naming it twice (by type name and module name) in the situation where 
you want to not worry about name clashes with constructors of other types.



However, nothing prevents us from offering two
interfaces (visible modules), one where the data type is abstract (client
interface) and a different one where it is concrete (extension
interface)


You can still call both types T... :-)

Regards, Brian.
--
Logic empowers us and Love gives us purpose.
Yet still phantoms restless for eras long past,
congealed in the present in unthought forms,
strive mightily unseen to destroy us.

http://www.metamilk.com 


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


RE: [Haskell-cafe] existential types (was Re: Optimization problem)

2006-09-29 Thread Simon Peyton-Jones
I must be missing your point.  Newtype is just type isomorphism; a new
name for an existing type.  But there is not existing type exists x.
T(x).  So it's not surprising that newtype doesn't support
existentials.

I've lost track of this thread.  Can you re-state the question?  I'm
strongly influence by the question can we translate this into System F
+ (existential) data types because (a) that's what GHC does (b) it's an
excellent sanity check.  E.g. if you can, then we know the system is
sound.

Simon

| -Original Message-
| From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ross
| Paterson
| Sent: 29 September 2006 10:37
| To: haskell-cafe@haskell.org
| Subject: [Haskell-cafe] existential types (was Re: Optimization
problem)
| 
| On Thu, Sep 28, 2006 at 03:22:25PM +0100, Simon Peyton-Jones wrote:
|  | Does anything go wrong with irrefutable patterns for existential
types?
| 
|  Try giving the translation into System F.
| 
| I'm a bit puzzled about this.  A declaration
| 
|   data Foo = forall a. MkFoo a (a - Bool)
| 
| is equivalent to
| 
|   newtype Foo = forall a. Foo (Foo' a)
|   data Foo' a = MkFoo a (a - Bool)
| 
| except that you also don't allow existentials with newtypes, for
| similarly unclear reasons.  If you did allow them, you'd certainly
| allow this equivalent of the original irrefutable match:
| 
|   ... case x of
|   Foo y - let MkFoo val fn = y in fn val
| 
| So, is there some real issue with existentials and non-termination?
| 
| ___
| Haskell-Cafe mailing list
| Haskell-Cafe@haskell.org
| http://www.haskell.org/mailman/listinfo/haskell-cafe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] existential types (was Re: Optimization problem)

2006-09-29 Thread Ross Paterson
On Fri, Sep 29, 2006 at 11:19:26AM +0100, Simon Peyton-Jones wrote:
 I must be missing your point.  Newtype is just type isomorphism; a new
 name for an existing type.  But there is not existing type exists x.
 T(x).  So it's not surprising that newtype doesn't support
 existentials.

And yet newtype does support recursion.

 I've lost track of this thread.

The story so far:
apfelmus: why are there no irrefutable patterns for GADTs?
Conor: because you could use them to write unsafeCoerce
Ross: how about irrefutable patterns (or newtypes) for existential types?
Simon: Try giving the translation into System F + (existential) data types

Copying a notion of datatype from Haskell to Core and then asking for
a translation to that seems to be begging the question.  If your target
really was System F, you could use the standard encoding of existentials
as nested foralls, but there's the problem that Haskell function spaces
differ from System F ones, System F is strongly normalizing, etc.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] irrefutable patterns for existential types / GADTs

2006-09-29 Thread apfelmus
Ross Paterson wrote:
 The story so far:
 apfelmus: why are there no irrefutable patterns for GADTs?
 Conor: because you could use them to write unsafeCoerce
 Ross: how about irrefutable patterns (or newtypes) for existential types?
 Simon: Try giving the translation into System F + (existential) data types

I'd like to add that I see no problem with

   coerce :: Eq a b - a - b
   coerce ~Refl x = x

as long as we have

   coerce _|_ x === _|_

The wish is that

   f = \refl - Just . coerce refl
 = \~Refl x - Just x

should satisfy

   f _|_ x === Just _|_
   f _|_ x =/= _|_

and likewise for any other constructor than Just.

Regards,
apfelmus

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] irrefutable patterns for existential types / GADTs

2006-09-29 Thread Conor McBride

[EMAIL PROTECTED] wrote:

Ross Paterson wrote:
  

The story so far:
apfelmus: why are there no irrefutable patterns for GADTs?
Conor: because you could use them to write unsafeCoerce
Ross: how about irrefutable patterns (or newtypes) for existential types?
Simon: Try giving the translation into System F + (existential) data types



I'd like to add that I see no problem with

   coerce :: Eq a b - a - b
   coerce ~Refl x = x

as long as we have

   coerce _|_ x === _|_
  


But that makes it refutable! For the above, either

 coerce _|_ x === x

or the notation is being abused.

The trouble is that GADT pattern matching has an impact on types, as 
well as being a selector-destructor mechanism, and for the impact on 
types to be safe, the match must be strict.


For existentials, I'm not sure, but it seems to me that there's not such 
a serious issue. Isn't the only way you can use the type which allegedly 
exists to project out some dictionary/other data which is packed inside 
the existential? Won't this projection will cause a nice safe _|_ 
instead of a nasty unsafe segfault?


I think it's the extra power of GADTs to tell you more about type 
variables already in play which does the damage.


All the best

Conor

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Is Haskell a 5GL?

2006-09-29 Thread Robert Dockins

On Sep 28, 2006, at 8:47 PM, David Curran wrote:


Sorry if this comes across as the rant it is. If you are interested in
doing useful stuff rather then navel gazing please stop here.

Where are compute languages going?
I think multi core, distributed, fault tolerant.
So you would end up with a computer of the sort envisioned by Hillis
in the 80s with his data parallel programs. The only language that
seems even close to this model is Erlang. What am I missing about the
ability of Haskell to distribute across processors or a network?

Say instead of fault tolerant it is fault avoiding.
Can proving programs correct (with Haskell) really reduce our  
workload?

http://www.seas.upenn.edu/~sweirich/wmm/03-benton.pdf


I read that paper as saying formal methods have an extremely steep  
learning curve and large initial investment, but that the learning  
and initial investment pay off over time.  The author found that,  
even in the short time he worked with it, formal methods saved time  
when he needed to modify his definitions (third paragraph in the  
second column).  As with many automation tasks, the payoff comes with  
repeated identical or similar iterations.  Furthermore, his acquired  
knowledge transferred well to an unrelated project.  I can personally  
vouch for many of his experiences, having worked some with Coq myself.



Finally is Haskell a language for programming or a mental gymnasium
that might be the proving ground for concepts in the next popular
language? To quote from a post on the topic Old functional
programming ideas  on programming.reddit.com


I don't know how much you agree with this quote, but for the purposes  
of discussion I'll assume that you have expressed these views  
personally.  You did, after all, preface your message by saying it  
was a rant so I'm going to assume you're prepared for the flames. ;-)



Church-Turing equivalence tells us that all models of recursive
computing have the same formal power. But it tells us nothing about
which models are the most effective way for humans to understand and
express definitions of functions. For some reason I'd expect
researchers in programming languages to have a lot of opinions on this
subject. But they don't seem to talk about it much.


I think the Haskell community is doing better than many in this  
regard.  There is a concurrent thread on haskell-prime occurring  
_right now_ about whether pattern guards should be in Haskell'.  The  
primary point of disagreement is about whether pattern guards are a  
more effective way for humans to understand and express definitions  
of functions or not!  The ages-old disagreement about top-level state  
is similar, if more heated.  Similar for (n+k) patterns, and a host  
of other issues.  The endless discussions about monads often revolve  
around the goal of achieving new and better ways to express  
complicated function definitions.


I think this is because a fundamental value of the Haskell community  
is flexibility of the language.  Many languages are presented to the  
programmer as a complete package, which doesn't encourage them to  
consider the various possible design decisions that went into  
creating that language.  With Haskell, new users are often quickly  
confronted with various different ways of expressing their goals and  
with extensions they can enable (or not) and are forced to consider  
how best to express their program.  I think this is more good than it  
is bad.



Instead, a cynical and mean-spirited person might come to the
conclusion that PL researchers (such as Wadler) are actually just
mathematicians,


You seem to say this like its a bad thing; I completely disagree.  I  
don't think of myself as mean-spirited, and I have no problems  
calling, eg, Wadler a mathematician.  Just as I would call Church and  
Turing and Kleene and Goedel and Milner (etc, etc, etc)  
mathematicians.  If someone were ever to call _me_ a mathematician, I  
would consider it an honor.  Furthermore, if anyone attempted to  
belittle these distinguished persons or their accomplishments by  
calling them just mathematicians, I would begin to question his or  
her qualifications to have an opinion on the subject worthy of  
consideration.


The field mathematics has a long and glorious history of helping  
people to solve real problems.  I don't understand this undercurrent  
of antagonism that some people in our field have towards it.  Let's  
be honest: developing correct programs that perform non-trivial tasks  
and reasoning about them is HARD.  The techniques of mathematics and  
its sister discipline formal logic can help us with these tasks.  I  
find it a little strange that this position even requires a defense.   
All of the other scientific and engineering disciplines embrace the  
mathematics that help them do their work.  I don't believe there are  
very many physicists who would call Newton a mathematician and intend  
it to be a derogatory term.


I 

Re: [Haskell-cafe] Is Haskell a 5GL?

2006-09-29 Thread David Curran

After some thought on your replies I have realised that I was completely wrong.
1. Software needs to be concurrent
Haskell is doing more towards this goal then any other language I know of
2. Software should be provably correct.
Haskell is doing more towards this goal then any other language I know
of. ML and Haskell do seem to be the only communities really trying to
do this. Current systems do need to be easier to use though.
3. Haskell might be too academic
1 and 2 seem to indicate it is academic in the sense of finding out
useful things that a company might consider too blue sky to invest in.
So it might be too academic for now but for five years time maybe not.
   David

On 29/09/06, Robert Dockins [EMAIL PROTECTED] wrote:

On Sep 28, 2006, at 8:47 PM, David Curran wrote:

 Sorry if this comes across as the rant it is. If you are interested in
 doing useful stuff rather then navel gazing please stop here.

 Where are compute languages going?
 I think multi core, distributed, fault tolerant.
 So you would end up with a computer of the sort envisioned by Hillis
 in the 80s with his data parallel programs. The only language that
 seems even close to this model is Erlang. What am I missing about the
 ability of Haskell to distribute across processors or a network?

 Say instead of fault tolerant it is fault avoiding.
 Can proving programs correct (with Haskell) really reduce our
 workload?
 http://www.seas.upenn.edu/~sweirich/wmm/03-benton.pdf

I read that paper as saying formal methods have an extremely steep
learning curve and large initial investment, but that the learning
and initial investment pay off over time.  The author found that,
even in the short time he worked with it, formal methods saved time
when he needed to modify his definitions (third paragraph in the
second column).  As with many automation tasks, the payoff comes with
repeated identical or similar iterations.  Furthermore, his acquired
knowledge transferred well to an unrelated project.  I can personally
vouch for many of his experiences, having worked some with Coq myself.

 Finally is Haskell a language for programming or a mental gymnasium
 that might be the proving ground for concepts in the next popular
 language? To quote from a post on the topic Old functional
 programming ideas  on programming.reddit.com

I don't know how much you agree with this quote, but for the purposes
of discussion I'll assume that you have expressed these views
personally.  You did, after all, preface your message by saying it
was a rant so I'm going to assume you're prepared for the flames. ;-)

 Church-Turing equivalence tells us that all models of recursive
 computing have the same formal power. But it tells us nothing about
 which models are the most effective way for humans to understand and
 express definitions of functions. For some reason I'd expect
 researchers in programming languages to have a lot of opinions on this
 subject. But they don't seem to talk about it much.

I think the Haskell community is doing better than many in this
regard.  There is a concurrent thread on haskell-prime occurring
_right now_ about whether pattern guards should be in Haskell'.  The
primary point of disagreement is about whether pattern guards are a
more effective way for humans to understand and express definitions
of functions or not!  The ages-old disagreement about top-level state
is similar, if more heated.  Similar for (n+k) patterns, and a host
of other issues.  The endless discussions about monads often revolve
around the goal of achieving new and better ways to express
complicated function definitions.

I think this is because a fundamental value of the Haskell community
is flexibility of the language.  Many languages are presented to the
programmer as a complete package, which doesn't encourage them to
consider the various possible design decisions that went into
creating that language.  With Haskell, new users are often quickly
confronted with various different ways of expressing their goals and
with extensions they can enable (or not) and are forced to consider
how best to express their program.  I think this is more good than it
is bad.

 Instead, a cynical and mean-spirited person might come to the
 conclusion that PL researchers (such as Wadler) are actually just
 mathematicians,

You seem to say this like its a bad thing; I completely disagree.  I
don't think of myself as mean-spirited, and I have no problems
calling, eg, Wadler a mathematician.  Just as I would call Church and
Turing and Kleene and Goedel and Milner (etc, etc, etc)
mathematicians.  If someone were ever to call _me_ a mathematician, I
would consider it an honor.  Furthermore, if anyone attempted to
belittle these distinguished persons or their accomplishments by
calling them just mathematicians, I would begin to question his or
her qualifications to have an opinion on the subject worthy of
consideration.

The field mathematics has a long and glorious history of helping
people 

[Haskell-cafe] Greetings...

2006-09-29 Thread Seth Gordon
I've finally gotten enough round tuits to learn Haskell, and now that
I've done some of the exercises from _The Haskell School of Expression_
and I finally (think I) understand what a monad is, the language is
making a lot more sense to me (although my code is not always making so
much sense to the compiler :-).

My employer (MetaCarta) makes a search engine that can recognize
geographic data.  My group within MetaCarta is responsible for building
the Geographic Data Module within our software.  To do this, we slurp
a heap of geographic and linguistic data from a variety of sources,
normalize it, and then use some algorithms (that I'm not allowed to
describe) to generate the module.

This seems like the sort of task that cries out for a
functional-programming approach, and that's what we use, sorta: a lot of
the code that I'm responsible for is SQL, with chains of CREATE TEMP
TABLE X AS [insert very complicated query here], some C++ for the parts
that would be very time-consuming or impossible to implement in SQL, and
shell scripts to tie everything together.

I told my tech lead that I want to try porting some of this code to
Haskell in the hope that it would run faster and/or be easier to read.
He said I should spend two work days on the project and then be prepared
to convince my co-workers that further research in this vein is (or is
not) worth doing.

So before I embark on day 1 of the project, I thought I should check and
see if anyone on this list has used Haskell to munge a ten-million-row
database table, and if there are any particular gotchas I should watch
out for.

adTHANKSvance

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] How can I redirect stdout?

2006-09-29 Thread Matthew Bromberg
I'm reposting this in it's own new thread since I think it involves a 
general issue beyond exporting Haskell DLLs.


I am having some problems with GHCs stdout when a Haskell program is 
called from a windows program.




As I noted earlier I am calling some Haskell code from C as a bridge to 
being able to

ultimately call Haskell from Matlab 6.5.

The Haskell code is compiled into a .DLL file on a windows machine.
Matlab calls some C code which then calls the Haskell code.

As soon as it gets into the Haskell code I get this run time error in 
ghcDLL.dll


stdout: hPutChars: invalid argument (Bad File Descriptor)

The Haskell code seems to work correctly if called from a stand-alone C 
program. Moreover, if I scrub all print statements from the Haskell 
code, it appears to run correctly from Matlab.


Matlab does not properly redirect stdout so any printf calls from the C 
code simply fail to print.

However Haskell's behavior is to halt after generating a runtime error.

The C code used to generate the Haskell .dll is of course mingw gcc, but 
the C code used to create my Matlab mex file is Microsoft VC++ 6.0.  I 
tried to redirect stdout using freopen() in C, but that never seems to 
work with Microsoft.  At any rate it certainly doesn't effect Haskells 
use of stdout.  I think in general for windows programs there is no 
stdout defined, whereas it's always defined for console programs.


My question is, is there some way I can redirect stdout from inside 
Haskell so that all output is sent to a file?  Is there an equivalent of 
freopen() in Haskell that works?

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Re: [Haskell-cafe] Is Haskell a 5GL?

2006-09-29 Thread Nicolas Frisby

snip



Call me elitist if you want, but I don't want anyone who refuses or
is unable to learn calculus to be, eg, a civil engineer.  He don't
have to be an expert in real analysis, but if he don't understand the
basics, I don't want him building any bridges that I'm going to be
driving on!



Excellent point that certainly does not make one an elitist. Many
engineering disciplines such as civil, chemical, architectural,
aerospace, etc. enjoy a mature relationship between their best design
practices and mathematics/hard science. Also note that a bad bridge
almost certainly endangers multiple peoples' lives (consider the
history behind http://www.ironring.ca/).


In a similar way, if a someone refuses or is unable to learn the
mathematical foundations of computation, I don't think I really want
him programming any systems that I'm going to be relying on.  He
don't need to be an expert in category theory, but if programmers
aren't learning the skills they need to understand the basics and
mathematical notation of PL theory, then something is very, very
wrong.  (Not to beat you over the head with my point, but what I'm
saying is that programmers really ought to know this stuff and the
fact that most do not is a terrible state of affairs).



I hope to someday agree with this, but for now I cannot. The fact of
the matter is it's a rare case when a programmer's lack of
mathematical background threatens lives. If my GUI crashes, I'm angry
but not injured. Programmers make a living without the math background
because the vast majority of employers don't seek it--their products
simply don't need it.

Note that I said rare case; I think there are plenty of safety
critical programs out there. Consider the shuttle, deep-sea equipment,
military or medical equipment, etc. Now if the programmer you're
worred about is on one of these projects, I most certainly share your
unease.

Software engineering is as of yet misnamed. A professional engineer's
design work should never include figuring out why the first attempt
exploded/collapsed/failed--professionals in mature engineering fields
only debug catastrophes.

My intended takeaway is that design in software engineering does not
yet compare to design in the mature engineering fields. In my
engineering-centric opinion, the goal of computer science is to enrich
the design principles of software engineering so that it does compare.

[Disclaimer regarding that paragraph's punch-line: there's obvious
gradations between engineering fields, as well as gradations within a
field between researchers progressing the best practices and
professionals simply using best practices.]


 If a responsible scientist wanted to counter this cynical,
 mean-spirited, and generally Luddite and Philistine argument, what
 would he or she say?

Mu




Rob Dockins

Speak softly and drive a Sherman tank.
Laugh hard; it's a long way to the bank.
   -- TMBG



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe



Nick Frisby
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Re: [Haskell-cafe] Is Haskell a 5GL?

2006-09-29 Thread Gene A

Nicolas Frisby said:
{}
The fact of the matter is it's a rare case when a programmer's lack of
mathematical background threatens lives. If my GUI crashes, I'm angry
but not injured. Programmers make a living without the math background
because the vast majority of employers don't seek it--their products
simply don't need it.

Note that I said rare case; I think there are plenty of safety
critical programs out there. Consider the shuttle, deep-sea equipment,
military or medical equipment, etc. Now if the programmer you're
worried about is on one of these projects, I most certainly share your
unease.
{...}

All those angry office workers with those crashing GUI's cost hundreds
of millions of dollars every year... arguably some billions perhaps..
And besides deep space probes and aircraft, there are many machines
out in industrial plants that have some pretty dangerous processes and
such running on computer instructions... right to a dryer that maybe
doesn't shut off the heating element when it should due to a glitch in
a program... and burns up.
 Now as to the need for EVERY programmer to know discreet mathematics
and know how to run a proof through a theorem prover, and understand
fully all the nuances of lambda calculus, and pi calculus, and all
those other calculuses and such.. well, I guess that is why I am happy
to be using tools like Haskell, or the ML family of languages, because
at least the tool is built by folks the like of  Wadler, Peyton
Jones, and many other out and out academics and highly skilled and
brilliant mathematicians.  That means that I benefit from the type
checking {and inference} that make my programs more likely to be
correct on the first go.  I have found that to be the case so far.
  I was able to build an equation solver in three variable and
basically unlimited number of terms in about 6 hours, that would have
taken probably weeks to complete in any language other than Haskell or
one of the other functionals that support higher order functions, and
the mapping and folding functions, and list comprehensions etc.
   I am just a happy camper that I have the ability to use such fine
tools, and not have to be lost in the catacombs of mediocrity: ie.
Java, C++, C, and C#.

good programming,
gene
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] smallest double eps

2006-09-29 Thread Tamas K Papp
Hi,

Is there a built-in constant in Haskell (or, if it is
compiler-specific, in ghc) that gives the smallest positive floating
point number x such that 1+x /= x?  Some languages refer to that as
double.eps or similar.  I need it for numeric algorithms.

Thanks,

Tamas
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] smallest double eps

2006-09-29 Thread Joachim Breitner
Hi,

Am Freitag, den 29.09.2006, 19:30 -0400 schrieb Tamas K Papp:
 the smallest positive floating point number x such that 1+x /= x?
That would be the smallest positive number, woudn't it?

Do you mean the smalles postive number x with 1+x /= 1?

Greetings,
Joachim


-- 
Joachim Breitner
  e-Mail: [EMAIL PROTECTED]
  Homepage: http://www.joachim-breitner.de
  ICQ#: 74513189
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] smallest double eps

2006-09-29 Thread Tamas K Papp
On Sat, Sep 30, 2006 at 12:20:16AM +, Joachim Breitner wrote:
 Hi,
 
 Am Freitag, den 29.09.2006, 19:30 -0400 schrieb Tamas K Papp:
  the smallest positive floating point number x such that 1+x /= x?
 That would be the smallest positive number, woudn't it?
 
 Do you mean the smalles postive number x with 1+x /= 1?

Hi Joachim,

Specifically, I would be happy with the smallest Double that makes the
statement true.  I need it as a convergence bound for an iterative
algorithm.  Anyhow, thanks for the clarification, but I would be
happier with an answer.

Tamas
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] smallest double eps

2006-09-29 Thread Lennart Augustsson
Haskell doesn't provide such a value, but you could easily compute it  
from from the values given in the RealFloat class.  It tells you the  
base, number of digits in mantissa, etc.


As for using such an eps in a convergence test I'd be very careful.   
How do you know that your iteration doesn't make the value bounce  
back and forth with more than eps?


-- Lennart

On Sep 29, 2006, at 20:26 , Tamas K Papp wrote:


On Sat, Sep 30, 2006 at 12:20:16AM +, Joachim Breitner wrote:

Hi,

Am Freitag, den 29.09.2006, 19:30 -0400 schrieb Tamas K Papp:

the smallest positive floating point number x such that 1+x /= x?

That would be the smallest positive number, woudn't it?

Do you mean the smalles postive number x with 1+x /= 1?


Hi Joachim,

Specifically, I would be happy with the smallest Double that makes the
statement true.  I need it as a convergence bound for an iterative
algorithm.  Anyhow, thanks for the clarification, but I would be
happier with an answer.

Tamas
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] smallest double eps

2006-09-29 Thread Tamas K Papp
On Fri, Sep 29, 2006 at 09:26:27PM -0400, Lennart Augustsson wrote:

 As for using such an eps in a convergence test I'd be very careful.   
 How do you know that your iteration doesn't make the value bounce  
 back and forth with more than eps?

Hi Lennart,

Thanks for the answer, I will try it.

I am not using eps, but rather a value derived from eps by analyzing
the algorithm (eg eps^0.25).  Your answer will help me calculate that
directly.

Thanks,

Tamas
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Is Haskell a 5GL?

2006-09-29 Thread Tamas K Papp
On Mon, Sep 25, 2006 at 03:27:32PM +0200, Henning Thielemann wrote:

Hi Henning,

 Actually, laziness allows me to formulate algorithms that look more like
 the specification of the problem than the solution. E.g., I can formulate
 the solution of a differential equation in terms of a power series or time
 series in that way. However I have to put some effort into formulating it
 in a way that works. E.g. I'm only able to solve such equations if it is
 possible to express the second derivative in terms of the first and the
 zeroth one. Computer algebra systems are essentially better here.

In my experience, most people use CAS interactively: they encounter an
integral or a PDE that's difficult to solve, so they type it into
Mathematica (which frequently cannot solve it either, then you go
crazy, numerical, or both ;-).  It is more like a sophisticated
symbolic calculator with a lot of patterns built in for manipulating
expressions.

Mathematica has features of a programming language, but most people I
know are not using those when manipulating formulas, and conversely,
when _programming_ in Mathematica (ie writing code and then executing
it do so something repetitive) they rarely do anything symbolic.

CAS are great for specific purposes, especially for replacing those
tomes which have solutions of equations/ODEs/PDEs/integrals etc in
them, and some CAS have Algol-style flow control and numerical methods
which you can use for solving numerical problems, but the two are
almost never mixed.

Best,

Tamas
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] smallest double eps

2006-09-29 Thread Chad Scherrer

Tamas,

You might want to read Joachim's post more carefully - he's trying to
help you, and I think he makes a good point.

-Chad


 Am Freitag, den 29.09.2006, 19:30 -0400 schrieb Tamas K Papp:
  the smallest positive floating point number x such that 1+x /= x?
 That would be the smallest positive number, woudn't it?

 Do you mean the smalles postive number x with 1+x /= 1?

Hi Joachim,

Specifically, I would be happy with the smallest Double that makes the
statement true.  I need it as a convergence bound for an iterative
algorithm.  Anyhow, thanks for the clarification, but I would be
happier with an answer.

Tamas


--

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


End of Haskell-Cafe Digest, Vol 37, Issue 92





--

Chad Scherrer

Time flies like an arrow; fruit flies like a banana -- Groucho Marx
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] smallest double eps

2006-09-29 Thread Tamas K Papp
On Fri, Sep 29, 2006 at 06:53:35PM -0700, Chad Scherrer wrote:

 Tamas,
 
 You might want to read Joachim's post more carefully - he's trying to
 help you, and I think he makes a good point.

Chad,

If his point is that there is no smallest positive number, then I
think I understand it, thanks.  I should have said that I was looking
for the smallest positive number Double can represent, but thought
that was clear from the context.

If this is not his point, I'd really appreciate an explanation.

Thanks,

Tamas
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe