Re: [Haskell-cafe] Learn Prolog...

2007-09-02 Thread Peter Verswyvelen
Peter Verswyvelen wrote: Thanks, this is very useful information! Prolog is indeed on my list as languages I want to learn. I understand the basic principles, but haven't digged deep yet. But first I want to do Haskell, which I'm now totally addicted to! But after reading

[Haskell-cafe] Extending the idea of a general Num to other types?

2007-09-02 Thread Peter Verswyvelen
I like the fact that Haskel treats numbers in a generic way, so you can lift them to any other datatype by instantiating Num. Can the same be done on other builtin constructs? For example, if I have [a], can this list be lifted to other types? I guess not, because no type class exists for the

Re: [Haskell-cafe] Re: HApps API Documentation?

2007-09-02 Thread James Britt
Martin Lütke wrote: James Britt james at neurogami.com writes: Are there alternative sites for HAppS API docs? There are two links on http://happs.org/#documentation but both give File not found! messages. Thanks, James Just compile your one version from the HAppS source. Use runghc

Re: [Haskell-cafe] Looking for suggestions to improve my algorithm

2007-09-02 Thread Sterling Clover
I played around with this for a while based on the same sort of algorithm and ended up with a similar solution too. It turns out the operations saved by keeping track of already visited nodes are more than outweighed by the cost of doing so. (As you can see, I still have the hook in my

Re: [Haskell-cafe] interaction between OS processes

2007-09-02 Thread Andrea Rossato
On Sat, Sep 01, 2007 at 09:12:30PM -0400, Albert Y. C. Lai wrote: Andrea Rossato wrote: loop s = do putStrLn s Most likely, the content of s sits in a local buffer and never leaves this process, following most OS conventions and as others point out. Another process

Re: [Haskell-cafe] RE: Definition of the Haskell standard library

2007-09-02 Thread Sven Panne
On Sunday 02 September 2007 03:29, Hugh Perkins wrote: A really simple way to track the quality of a package is to display the number of downloads. A posteriorae, this works great in other download sites. We can easily hypothesize about why a download count gives a decent indication of some

Re: [Haskell-cafe] RE: Definition of the Haskell standard library

2007-09-02 Thread Hugh Perkins
On 9/2/07, Sven Panne [EMAIL PROTECTED] wrote: High-qualitiy standard libraries which are packaged with GHC/Hugs/... will probably almost never be downloaded separately. Good point. Note however that if someone is hunting for a library, it's generally because it's not already bundled with

Re: [Haskell-cafe] Looking for suggestions to improve my algorithm

2007-09-02 Thread Chaddaï Fouché
Right, your program is 2 times faster than mine on my machine... I wonder if there is a better structure to do this bookkeeping than IntSet (maybe Sequence slightly remanied ?), anyway it goes to show how sometimes the bookkeeping can be more expensive than the operations it's meant to prevent !

Re: [Haskell-cafe] Extending the idea of a general Num to other types?

2007-09-02 Thread Peter Verswyvelen
Chaddaï Fouché wrote: You can indeed already do that, except it won't be a single instance since list have a bucketful of interesting properties. A good starting is looking at what list is an instance of and trying to identify the set of instance which interest us in this case, Foldable and

Re: [Haskell-cafe] Re: HApps API Documentation?

2007-09-02 Thread Martin Lütke
Just compile your one version from the HAppS source. Use runghc Setup.hs haddock. OK, I can give that a shot. I'm still curious about my original question, though. Are there alternative online API docs for Happs? I am sorry I dont answer your question directly, but the last online api

Re: [Haskell-cafe] Learn Prolog...

2007-09-02 Thread Brandon S. Allbery KF8NH
On Sep 2, 2007, at 2:08 , Peter Verswyvelen wrote: But after reading http://en.wikipedia.org/wiki/ Fifth_generation_computer, it seemed to me that Prolog was a dead language, having only pure theoretical purposes. Is this true? Tell that to the order pricing system I wrote in Prolog for a

Re: [Haskell-cafe] Learn Prolog...

2007-09-02 Thread Hugh Perkins
On 9/2/07, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: in the early 90s I think I found the flaw in your argument ;-) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] RE: Definition of the Haskell standard library

2007-09-02 Thread Peter Verswyvelen
Sven Panne wrote: ... and even more easily hypothesize why this is not always a good indication: High-qualitiy standard libraries which are packaged with GHC/Hugs/... will probably almost never be downloaded separately. Solution: change GHC/Hugs so it submits usage counters of which

Re: [Haskell-cafe] Learn Prolog...

2007-09-02 Thread Andrew Coppin
One of standard exercices in Prolog is the construction of the meta-interpreter of Prolog in Prolog. While this is cheating, I recommend it to you. It opens eyes. Ever tried implementing Haskell in Haskell? ;-) Prolog strategies are straightforward, and I simply cannot understand the

Re: [Haskell-cafe] RE: Definition of the Haskell standard library

2007-09-02 Thread Peter Verswyvelen
Sven Panne wrote: ... and even more easily hypothesize why this is not always a good indication: High-qualitiy standard libraries which are packaged with GHC/Hugs/... will probably almost never be downloaded separately. Solution: change GHC/Hugs so it submits (via a webservice, stored in a

Re: [Haskell-cafe] Learn Prolog...

2007-09-02 Thread Neil Davies
Cut is a means of preventing backtracking beyond that point - it prunes the potential search space saying the answer must be built on the current set of bindings. (Lots of work went into how automatically get cut's into programs to make them efficient but without the programmer having to worry

Re: [Haskell-cafe] Learn Prolog...

2007-09-02 Thread jerzy . karczmarczuk
Andrew Coppin writes: Ever tried implementing Haskell in Haskell? ;-) Seriously: Haskell is a *complicated* language, needing a parser, which by itself is a non-trivial exercice. Moreover, it has a type-inference engine, which may be simulated, sure, but Haskell in Haskell is a tough job.

[Haskell-cafe] Array.Diff, strange oversight or myopia ?

2007-09-02 Thread Chaddaï Fouché
Data.Array.Diff don't have an instance for DiffUArray Bool, which is strange by itself since IOUArray Bool exists and it's the only IOUArray that is not mirrored in Diff. But ok, why not, I guess it might be a small oversight, so I go on to create the missing instance IArray (IOToDiffArray

Re: [Haskell-cafe] Learn Prolog...

2007-09-02 Thread Bill Wood
As to whether Prolog is dead or not, it depends on your definition of dead. Three years ago (not ten!) I made my living maintaining and developing a large application written in Prolog. That was actually an interesting experience, since one of the performance drivers was speed. As a result code

Re: [Haskell-cafe] interaction between OS processes

2007-09-02 Thread Bryan O'Sullivan
Andrea Rossato wrote: Most likely, the content of s sits in a local buffer and never leaves this process, following most OS conventions and as others point out. Another process waiting for it will deadlock. Yes, I knew it was something related to the underneath OS. I'll have to study

Re: [Haskell-cafe] Learn Prolog...

2007-09-02 Thread Andrew Coppin
[EMAIL PROTECTED] wrote: Andrew Coppin writes: Ever tried implementing Haskell in Haskell? ;-) Seriously: Haskell is a *complicated* language, needing a parser, which by itself is a non-trivial exercice. It looks so simple on the surface... [Actually, so does cold fusion.] Read my whole

[Haskell-cafe] GHC-API: a few questions

2007-09-02 Thread Andrea Rossato
Hi, I'm trying to acquire some confidence with the GHC-API and I'm having some problems, related to error handling, I seem not be able to solve. Basically there are 3 functions to (interactively) compile/run Haskell expressions: compileExpr, dyCompileExpr and runStmt. The first 2 will return

Re: [Haskell-cafe] Learn Prolog...

2007-09-02 Thread Hugh Perkins
Sooo.. what is the modern equivalent of Prolog? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Learn Prolog...

2007-09-02 Thread jerzy . karczmarczuk
Hugh Perkins writes: Sooo.. what is the modern equivalent of Prolog? Well, first, I wouldn't agree entirely that Prolog is not modern. Anyway... If you want something wih more bells and whistles, modularity, coroutining, more security (less power, e.g. no program auto-modification), etc.,

Re: [Haskell-cafe] Extending the idea of a general Num to other types?

2007-09-02 Thread Lennart Augustsson
You're right. The list syntax is only for lists in Haskell. It would be nice if the list syntax was overloaded too. You can overload numeric literals (by defining fromInteger) and string literals (by defining fromString, in 6.7). BTW, the [1..10] syntax is overloaded, you need an Enum instance.

Re: [Haskell-cafe] Ideas

2007-09-02 Thread Sven Panne
On Saturday 25 August 2007 20:49, Andrew Coppin wrote: [...] Would be nice if I could build something in Haskell that overcomes these. OTOH, does Haskell have any way to talk to the audio hardware? Depending on what you are exactly trying to do, the OpenAL/ALUT packages might be of interest.

Re: [Haskell-cafe] interaction between OS processes

2007-09-02 Thread Albert Y. C. Lai
Bryan O'Sullivan wrote: Your problem may be buffering-related (I haven't read your code to check), but if so, there's a fair likelihood that it has nothing to do with the OS. GHC's runtime does its own buffer management on Handles. It's quite possible that your deadlock lies at that level,

Re: [Haskell-cafe] interaction between OS processes

2007-09-02 Thread Albert Y. C. Lai
Albert Y. C. Lai wrote: It is similar to saying, if you use Haskell, you don't have to learn dependent typing. Ah, but knowing dependent typing informs you of certain typing issues and how to use the Haskell type system more successfully. This is despite tutorials on dependent typing talk

Re: [Haskell-cafe] GHC 6.6.1 and SELinux issues

2007-09-02 Thread Alexander Vodomerov
On Wed, Aug 29, 2007 at 01:03:56PM -0700, Stefan O'Rear wrote: So it is not clear if GHC does really need this PROT_EXEC. Can someone familiar with GHC internals answer why PROT_EXEC is used in getMBlocks? It's not possible to correctly implement 'foreign import ccall wrapper' without

Re: [Haskell-cafe] RE: Definition of the Haskell standard library

2007-09-02 Thread Adrian Hey
Hugh Perkins wrote: A really simple way to track the quality of a package is to display the number of downloads. A posteriorae, this works great in other download sites. We can easily hypothesize about why a download count gives a decent indication of some measure of quality: - more people

Re: [Haskell-cafe] Extending the idea of a general Num to other types?

2007-09-02 Thread Peter Verswyvelen
Snif, this is sad... :-( Oh well, maybe this gets improved in Haskell Prime ;-) Lennart Augustsson wrote: You're right. The list syntax is only for lists in Haskell. It would be nice if the list syntax was overloaded too. You can overload numeric literals (by defining fromInteger) and

Re: [Haskell-cafe] Learn Prolog...

2007-09-02 Thread Peter Verswyvelen
Jerzy Karczmarczuk wrote Perhaps somebody can say more about constraint languages which replaced Yes please! Of example, how correct is http://en.wikipedia.org/wiki/Constraint_programming? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] RE: Definition of the Haskell standard library

2007-09-02 Thread Chaddaï Fouché
2007/9/2, Adrian Hey [EMAIL PROTECTED]: Other meaningless measures that have been suggested are the rate of patch submissions of the number of developers involved. I seem to remember someone recently suggesting that libraries that score highly in on this regard should be elevated to blessed

[Haskell-cafe] Re: Learn Prolog...

2007-09-02 Thread Benjamin Franksen
Hugh Perkins wrote: Sooo.. what is the modern equivalent of Prolog? I once learned about LIFE (Logic, Inheritance, Functions, and Equations) and was deeply fascinated. However, it died the quick death of most research languages. Cheers Ben ___

Re: [Haskell-cafe] Haskell as an extension language

2007-09-02 Thread Hugh Perkins
Off-topic, so stop reading now if you want ;-) , but reminds me of my experience using Python and C++. Python and C++ are both great languages, with their own strengths, and one might think that combining thing gets the best of both. However, using Swig etc to join Python to C++ takes a

Re: [Haskell-cafe] Learn Prolog...

2007-09-02 Thread Derek Elkins
On Sun, 2007-09-02 at 22:52 +0800, Hugh Perkins wrote: Sooo.. what is the modern equivalent of Prolog? Because no one has said it quite this way: The modern equivalent of Prolog is Prolog. Most of the advancement in logic programming has either been folded back into Prolog or has been advanced

Re: [Haskell-cafe] RE: Definition of the Haskell standard library

2007-09-02 Thread Hugh Perkins
On 9/3/07, Adrian Hey [EMAIL PROTECTED] wrote: The popularity of MS Winders or Office Suite are the obvious examples. We all know why these are used on 95% or whatever of the worlds PCs, and it has nothing whatever to do with quality. Oh come on. You've been reading waaayyy too much

Re: [Haskell-cafe] Learn Prolog...

2007-09-02 Thread Hugh Perkins
On 9/3/07, Derek Elkins [EMAIL PROTECTED] wrote: Because no one has said it quite this way: The modern equivalent of Prolog is Prolog. Ok, thanks. Just wanted to check that. (btw, just thought, when I was talking about FFI, probably meant Forth, not Prolog. FFI for Prolog probably isnt that

Re: [Haskell-cafe] Learn Prolog...

2007-09-02 Thread Bill Wood
On Mon, 2007-09-03 at 07:43 +0800, Hugh Perkins wrote: On 9/3/07, Derek Elkins [EMAIL PROTECTED] wrote: Because no one has said it quite this way: The modern equivalent of Prolog is Prolog. I was just about to say the same thing :-); thanks, Derek. . . . (btw, just thought, when I was

Re: [Haskell-cafe] Learn Prolog...

2007-09-02 Thread Hugh Perkins
(BTW I thought the FFI for Forth was the Forth assembler; have things changed since FIG/F83?) I didnt have a real PC, just a ZX Spectrum. It wasnt real Forth, just Spectrum Forth. It was kindof fun, but a little disappointing not to be able to do anything useful with it. Well, I wanted to

Re: [Haskell-cafe] GHC 6.6.1 and SELinux issues

2007-09-02 Thread Bertram Felgenhauer
Alexander Vodomerov wrote: On Wed, Aug 29, 2007 at 01:03:56PM -0700, Stefan O'Rear wrote: [snip] What is so special about wrapper and dynamic functions? Can you please give some ideas how self-modifying code can be used in FFI implementation? It's not self-modifying code really, it's

Re: [Haskell-cafe] Re: Bi-directional Maps

2007-09-02 Thread Hugh Perkins
Just noticed, erlang has the second kind of bimap (a bijection?) built into each process: From http://www.erlang.org/doc/reference_manual/processes.html : 10.9 Process Dictionary Each process has its own process dictionary, accessed by calling the following BIFs: put(Key, Value) get(Key) get()

[Haskell-cafe] APLAS07 - Call for Participation

2007-09-02 Thread Shin-Cheng Mu
Call for Participation The Fifth Asian Symposium on Programming Languages and Systems November 29 - December 1, 2007 Singapore http://www.comp.nus.edu.sg/~aplas07/