Re: [Haskell-cafe] Mathematica

2007-05-11 Thread John Meacham
On Fri, May 11, 2007 at 11:26:42AM +0100, Andrew Coppin wrote: > Hi folks. > > How difficult would it be to implement Mathematica in Haskell? > > I mean, I really like Mathematica, but it costs over £2,000. I can't > really afford to pay that much for something that's only really a "toy". > (It

Re: [Haskell-cafe] "Recent content is available under a simple permissive license"

2007-05-11 Thread Twan van Laarhoven
Robin Green wrote: The Haskell wiki[1] says "Recent content is available under a simple permissive license". But this is unilluminating - recent? how recent, exactly? - and will become increasingly understated as time goes by. Wouldn't it be slightly more helpful to say "Content added after " .

Re: [Haskell-cafe] "Recent content is available under a simple permissive license"

2007-05-11 Thread Derek Elkins
Robin Green wrote: The Haskell wiki[1] says "Recent content is available under a simple permissive license". But this is unilluminating - recent? how recent, exactly? - and will become increasingly understated as time goes by. Wouldn't it be slightly more helpful to say "Content added after " ..

Re: [Haskell-cafe] Higher order types via the Curry-Howard correspondence

2007-05-11 Thread Derek Elkins
Benja Fallenstein wrote: Adding some thoughts to what David said (although I don't understand the issues deeply enough to be sure that these ideas don't lead to ugly things like paradoxes)-- 2007/5/10, Gaal Yahas <[EMAIL PROTECTED]>: Since the empty list inhabits the type [b], this theorem is t

Re: [Haskell-cafe] Disadvantages of de Bruijn indicies?

2007-05-11 Thread Twan van Laarhoven
Neil Mitchell wrote: Hi, de Bruijn indicies look quite nice, and seem to eliminate a lot of complexity when dealing with free variables: http://en.wikipedia.org/wiki/De_Bruijn_index So I was wondering, are they suitable for use in a compiler? If so, what are their disadvantages/advantages? Is

Re: [Haskell-cafe] Mathematica

2007-05-11 Thread Andrew Coppin
Dan Piponi wrote: On 5/11/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: It seems it would be a fairly difficult task to implement the pattern matching engine properly. Not 'difficult' as in "nobody ought to try this in Haskell" but 'difficult' as in "it seems like a task well suited to Haskell

Re: [Haskell-cafe] Mathematica

2007-05-11 Thread Dan Piponi
On 5/11/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: It seems it would be a fairly difficult task to implement the pattern matching engine properly. Not 'difficult' as in "nobody ought to try this in Haskell" but 'difficult' as in "it seems like a task well suited to Haskell, would be worth t

[Haskell-cafe] "Recent content is available under a simple permissive license"

2007-05-11 Thread Robin Green
The Haskell wiki[1] says "Recent content is available under a simple permissive license". But this is unilluminating - recent? how recent, exactly? - and will become increasingly understated as time goes by. Wouldn't it be slightly more helpful to say "Content added after " ... /MM/DD ... " is

Re: [Haskell-cafe] Higher order types via the Curry-Howard correspondence

2007-05-11 Thread Benja Fallenstein
Adding some thoughts to what David said (although I don't understand the issues deeply enough to be sure that these ideas don't lead to ugly things like paradoxes)-- 2007/5/10, Gaal Yahas <[EMAIL PROTECTED]>: Since the empty list inhabits the type [b], this theorem is trivially a tautology, so l

[Haskell-cafe] Re: Higher order types via the Curry-Howard correspondence

2007-05-11 Thread DavidA
Gaal Yahas forum2.org> writes: > > What do higher-order types like lists mean when viewed through the > Curry-Howard correspondence? Okay well I don't know the complete answer, but since no one else has answered I'll have a go. Suppose we define our own version of list as data List a = Nil |

Re: [Haskell-cafe] Mathematica

2007-05-11 Thread Andrew Coppin
How difficult would it be to implement Mathematica in Haskell? OK, you'll be glad to know I wasn't entirely serious when I wrote that. ;-) There are 4 conceptually seperate aspects to Mathematica. - First, there is the absurdly efficient arbitrary precision number crunching engine. It can r

Re: [Haskell-cafe] Disadvantages of de Bruijn indicies?

2007-05-11 Thread Claus Reinke
de Bruijn indicies look quite nice, and seem to eliminate a lot of complexity when dealing with free variables: http://en.wikipedia.org/wiki/De_Bruijn_index the complexity is not really eliminated, but made precise and mechanised, which is helpful for tools, less helpful for humans. From what

Re: [Haskell-cafe] Mathematica

2007-05-11 Thread Dan Piponi
There are two aspects to mathematica. There's the core language and there is the library of functions made available to the user. The library is many lifetimes of work so don't even think about doing more than a fraction of a percent of it on your own! The core language is more straightforward but

[Haskell-cafe] Re: Mathematica

2007-05-11 Thread Rene de Visser
> How difficult would it be to implement Mathematica in Haskell? Why don't you use axiom? It already has several 100 of years man effort put into it. Or for dynamically type package you could use Maxima. Both are free. Rene. ___ Haskell-Cafe mail

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: Harpy -- run-time code generation library

2007-05-11 Thread Duncan Coutts
On Fri, 2007-05-11 at 08:58 -0700, Justin Bailey wrote: > On 5/11/07, Dirk Kleeblatt <[EMAIL PROTECTED]> wrote: > Hi everybody, > > we're pleased to announce the first release of Harpy. > > Harpy is a library for run-time code generation of x86 machine >

[Haskell-cafe] Re: [Haskell] ANNOUNCE: Harpy -- run-time code generation library

2007-05-11 Thread Dirk Kleeblatt
Justin Bailey wrote: On 5/11/07, *Dirk Kleeblatt* <[EMAIL PROTECTED] > wrote: we're pleased to announce the first release of Harpy. Impressive. Does the library require that an assembler ( e.g. MASM) be installed? No, it doesn't, it's doing all the dirty stuff

[Haskell-cafe] Re: [Haskell] ANNOUNCE: Harpy -- run-time code generation library

2007-05-11 Thread Justin Bailey
On 5/11/07, Dirk Kleeblatt <[EMAIL PROTECTED]> wrote: Hi everybody, we're pleased to announce the first release of Harpy. Harpy is a library for run-time code generation of x86 machine code. It provides not only a low level interface to code generation operations, but also a convenient domain

Re: [Haskell-cafe] Lazy HTML parsing with HXT, HaXML/polyparse, what else?

2007-05-11 Thread Malcolm Wallace
Henning Thielemann <[EMAIL PROTECTED]> wrote: > HaXml has a so called lazy parser, but it is not what I consider lazy: Lazy parsing is rather subtle, and it is easy to write a too-strict parser when one intended to be more lazy. Equally, it can be easy to imagine that the parser is too strict, w

Re: [Haskell-cafe] Disadvantages of de Bruijn indicies?

2007-05-11 Thread Stefan O'Rear
On Fri, May 11, 2007 at 03:10:42PM +0100, Neil Mitchell wrote: > Hi, > > de Bruijn indicies look quite nice, and seem to eliminate a lot of > complexity when dealing with free variables: > http://en.wikipedia.org/wiki/De_Bruijn_index > > So I was wondering, are they suitable for use in a compiler

[Haskell-cafe] Disadvantages of de Bruijn indicies?

2007-05-11 Thread Neil Mitchell
Hi, de Bruijn indicies look quite nice, and seem to eliminate a lot of complexity when dealing with free variables: http://en.wikipedia.org/wiki/De_Bruijn_index So I was wondering, are they suitable for use in a compiler? If so, what are their disadvantages/advantages? Is there any particular re

Re: [Haskell-cafe] Problem with finalizers

2007-05-11 Thread Ivan Tomac
It appears that if I add import Control.Concurrent and call yield just after performGC then the finalizer does get called. But it only seems to work if I call both performGC and yield and in that order. Is this normal and if so is it documented anywhere? Can this behavior be relied upon in f

Re: [Haskell-cafe] Mathematica

2007-05-11 Thread Henning Thielemann
On Fri, 11 May 2007, Joe Thornber wrote: > On 11/05/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: > > Hi folks. > > > > How difficult would it be to implement Mathematica in Haskell? > > The language itself; very easy I'd say. The maths libraries ... > years. So if you just want something to pla

Re: [Haskell-cafe] Lazy HTML parsing with HXT, HaXML/polyparse, what else?

2007-05-11 Thread Henning Thielemann
On Fri, 11 May 2007, Jules Bean wrote: > Henning Thielemann wrote: > > I want to parse and process HTML lazily. I use HXT because the HTML parser > > is very liberal. However it uses Parsec and is thus strict. HaXML has a > > so called lazy parser, but it is not what I consider lazy: > > > > *Tex

Re: [Haskell-cafe] Lazy HTML parsing with HXT, HaXML/polyparse, what else?

2007-05-11 Thread Neil Mitchell
Hi That's an interesting option. It could be used as a lexer for a full-blown HTML parser. Sometimes I need the tree structure. But why does this simple piece of code needs -fglasgow-exts? It doesn't. The released version 0.1 doesn't require extensions, and the next 0.2 won't either. In the me

Re: [Haskell-cafe] Lazy HTML parsing with HXT, HaXML/polyparse, what else?

2007-05-11 Thread Henning Thielemann
On Fri, 11 May 2007, Neil Mitchell wrote: > Depending on exactly what you want, TagSoup may be of interest to you. > It is lazy, but it doesn't return a tree. It is very tollerant of > errors, and will simply never "fail to parse" something. > > http://www-users.cs.york.ac.uk/~ndm/tagsoup/ That'

Re: [Haskell-cafe] Lazy HTML parsing with HXT, HaXML/polyparse, what else?

2007-05-11 Thread Jules Bean
Henning Thielemann wrote: I want to parse and process HTML lazily. I use HXT because the HTML parser is very liberal. However it uses Parsec and is thus strict. HaXML has a so called lazy parser, but it is not what I consider lazy: *Text.XML.HaXml.Html.ParseLazy> Text.XML.HaXml.Pretty.document $

Re: [Haskell-cafe] Limits of deduction

2007-05-11 Thread Jules Bean
Andrew Coppin wrote: There are many possible variations - length examines the whole list, but not the elements *in* the list. null does less than that. And so on. I'm sure there are many possible combinations. What I'm wondering is if it's possible to algorithmically decide which class of fun

Re: [Haskell-cafe] Lazy HTML parsing with HXT, HaXML/polyparse, what else?

2007-05-11 Thread Neil Mitchell
Hi Depending on exactly what you want, TagSoup may be of interest to you. It is lazy, but it doesn't return a tree. It is very tollerant of errors, and will simply never "fail to parse" something. http://www-users.cs.york.ac.uk/~ndm/tagsoup/ Thanks Neil On 5/11/07, Henning Thielemann <[EMAIL

[Haskell-cafe] Lazy HTML parsing with HXT, HaXML/polyparse, what else?

2007-05-11 Thread Henning Thielemann
I want to parse and process HTML lazily. I use HXT because the HTML parser is very liberal. However it uses Parsec and is thus strict. HaXML has a so called lazy parser, but it is not what I consider lazy: *Text.XML.HaXml.Html.ParseLazy> Text.XML.HaXml.Pretty.document $ htmlParse "text" $ ""++un

Re: [Haskell-cafe] Limits of deduction

2007-05-11 Thread Rodrigo Queiro
I think it might be impossible. For the function: sumFirst n = sum . take n then for any finite list, we can choose an n large enough that it will examine the whole list, even though the function is able to stop. This means the only way to check is to call it with an infinite list and see if it

Re: [Haskell-cafe] Limits of deduction

2007-05-11 Thread Andrew Coppin
It is possible to determine whether the function always examins the entire input list? Presumably you mean in the case that you examine the entire output list, or do you mean when you only examine the output enough to see if it's a [] or (:) (i.e. to WHNF) ? f1 [] = [] f1 (x:xs) =

[Haskell-cafe] Re: [Haskell] ANNOUNCE: Harpy -- run-time code generation library

2007-05-11 Thread Dirk Kleeblatt
Hi Duncan, Duncan Coutts schrieb: I was wondering what the need for ensureBufferSize is? Could this by automated? I would have thought that we could just check this when writing out a single instruction. Yes, of course, this would be possible. The only reason is a performance improvement when

Re: [Haskell-cafe] Problem with finalizers

2007-05-11 Thread Ivan Tomac
Hi Neil, I've read about that but I thought that was only the case when using finalizers written in Haskell, not in C. Also, even when I remove the call to printf and replace it with an infinite loop or a piece of code that creates a file it doesn't seem to make any difference, the finalize

Re: [Haskell-cafe] Problem with finalizers

2007-05-11 Thread Neil Davies
Ivan If I remember correctly there is a caveat in the documentation that stdin/stdout could be closed when the finalizer is called. So It may be being called - you just can see it! Neil On 11/05/07, Ivan Tomac <[EMAIL PROTECTED]> wrote: Why does the finalizer in the following code never get ca

Re: [Haskell-cafe] Limits of deduction

2007-05-11 Thread Duncan Coutts
On Fri, 2007-05-11 at 12:10 +0100, Andrew Coppin wrote: > Suppose I have you the source code to some arbitrary function that takes > a list and returns another list. > > It is possible to determine whether the function always examins the > entire input list? Presumably you mean in the case that

[Haskell-cafe] Re: [Haskell] ANNOUNCE: Harpy -- run-time code generation library

2007-05-11 Thread Duncan Coutts
On Fri, 2007-05-11 at 10:04 +0200, Dirk Kleeblatt wrote: > Hi everybody, > > we're pleased to announce the first release of Harpy. > > Harpy is a library for run-time code generation of x86 machine code. > It provides not only a low level interface to code generation > operations, but also a conv

[Haskell-cafe] Limits of deduction

2007-05-11 Thread Andrew Coppin
Suppose I have you the source code to some arbitrary function that takes a list and returns another list. It is possible to determine whether the function always examins the entire input list? Or would that be equivilent to solving the Halting Problem? (Last time I checked, the Halting Problem

Re: [Haskell-cafe] Mathematica

2007-05-11 Thread Joe Thornber
On 11/05/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: Hi folks. How difficult would it be to implement Mathematica in Haskell? The language itself; very easy I'd say. The maths libraries ... years. So if you just want something to play with I'm sure you could get something working quickly.

[Haskell-cafe] Mathematica

2007-05-11 Thread Andrew Coppin
Hi folks. How difficult would it be to implement Mathematica in Haskell? I mean, I really like Mathematica, but it costs over £2,000. I can't really afford to pay that much for something that's only really a "toy". (It's not like a *need* it for anything, I just like playing with it.) __

[Haskell-cafe] Problem with finalizers

2007-05-11 Thread Ivan Tomac
Why does the finalizer in the following code never get called unless I explicitly call finalizeForeignPtr fptr? Even adding System.Mem.performGC made no difference. The code was compiled with ghc --make -fffi -fvia-c Test.hs Ivan Test.hs module M

Re: [Haskell-cafe] Monad pronounced like gonad?

2007-05-11 Thread Jules Bean
[If I sound definitive below, it's because I am stating facts; but they are facts about the community of mathematicians and computer scientists I have interacted with in person. I'm sure other physically-connected communities have adopted different conventions] Dan Piponi wrote: A more pressi