[Haskell-cafe] Possibilities for website construction using Haskell?

2008-01-13 Thread Hugh Perkins
What are the possibilities for website construction using Haskell? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Possibilities for website construction using Haskell?

2008-01-13 Thread Hugh Perkins
On Jan 13, 2008 8:13 PM, Derek Elkins [EMAIL PROTECTED] wrote: http://www.haskell.org/haskellwiki/Applications_and_libraries/Web_programming Good link. Lots of options apparently :-) I'm sure you can figure it out from here, or at least come back with a more specific question. Which ones

[Haskell-Cafe] Add number of downloads to hackageDB page?

2008-01-13 Thread Hugh Perkins
I seem to remember a thread about this a while back actually, but... Any chance of adding the number of downloads to the hackageDB page? For those packages that are included in ghc, hugs etc, perhaps add a green tick with included in ghc, included in hugs, etc? That way it should be relatively

Re: [Haskell-cafe] Why purely in haskell?

2008-01-12 Thread Hugh Perkins
On Jan 9, 2008 5:43 PM, Derek Elkins [EMAIL PROTECTED] wrote: A shorter and lighter and and also interesting and entertaining read is: http://research.microsoft.com/~simonpj/Papers/haskell-retrospective/index.htm While the reason Haskell was pure was to support laziness, at this point though

[Haskell-Cafe] Linq (FP in C#)

2008-01-12 Thread Hugh Perkins
Linq went live in C# in November, as part of .Net 3.5. It adds lots of FP-things to C#. It's really fun to be able to use Haskell-ish things in C#. Manipulating lists and collections just got *much* easier. Things it does: - map, fold, filter are all there (they're called select, agregate,

Re: [Haskell-cafe] Solving a geometry problem with Haskell

2008-01-12 Thread Hugh Perkins
On Jan 12, 2008 10:19 PM, Rafael Almeida [EMAIL PROTECTED] wrote: After some profiling I found out that about 94% of the execution time is spent in the ``isPerfectSquare'' function. I guess that Haskell's referential transparence means the answers to the isPerfectSquare will be cached, ie

Re: [Haskell-cafe] [newbie question] Memoization automatic in Haskell?

2008-01-12 Thread Hugh Perkins
On Jan 12, 2008 10:54 PM, Henning Thielemann [EMAIL PROTECTED] wrote: On Sat, 12 Jan 2008, Hugh Perkins wrote: I guess that Haskell's referential transparence means the answers to the isPerfectSquare will be cached, ie automatically memoized? (not sure if is correct term?) http

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-11-03 Thread Hugh Perkins
On Nov 3, 2007 5:00 AM, Ryan Dickie [EMAIL PROTECTED] wrote: Lossless File compression, AKA entropy coding, attempts to maximize the amount of information per bit (or byte) to be as close to the entropy as possible. Basically, gzip is measuring (approximating) the amount of information

Re: [Haskell-cafe] Why can't Haskell be faster?

2007-11-01 Thread Hugh Perkins
On 10/31/07, Paulo J. Matos [EMAIL PROTECTED] wrote: Hello all, I, along with some friends, have been looking to Haskell lately. I'm very happy with Haskell as a language, however, a friend sent me the link: http://shootout.alioth.debian.org/gp4/ Careful: it's worse than you think. Many

Re: [Haskell-cafe] Re: Hiding side effects in a data structure

2007-11-01 Thread Hugh Perkins
On 10/26/07, John Meacham [EMAIL PROTECTED] wrote: Heh, the plethora of pdf papers on Haskell is part of what originally brought me to respect it. Something about that metafont painted cmr just makes me giddy as a grad student. A beautifully rendered type inference table is a masterful work of

Re: [Haskell-cafe] On the verge of ... giving up!

2007-10-14 Thread Hugh Perkins
On 10/14/07, Vimal [EMAIL PROTECTED] wrote: Dear Haskellers, I have been trying my best to read about Haskell from the various tutorials available on the internet and blogs. I havent been following YAHT properly, so its always been learning from 'bits and pieces' scattered around. You might

Re: [Haskell-cafe] On the verge of ... giving up!

2007-10-14 Thread Hugh Perkins
You're picking on Andrew Coppin? That's insane. He's got a sense of humour, and he's a lay (non-phd) person. Honestly, in one thread you've got Haskell is misunderstood! Its the greatest language in the world! Why does no-one use it and in another you're insulting one of the few non-phds

Re: [Haskell-cafe] On the verge of ... giving up!

2007-10-14 Thread Hugh Perkins
Correction, I'm also very interested in Haskell, and I even don't have a bachelor degree :-) I'm a completely self-educated kind-a-guy... That's true, and actually you and Andrew are two of the people whose opinions I respect the most. Well, I'll add SPJ to that list I guess. Anyway, IMHO

Re: [Haskell-cafe] Hugs, dotnet, C#...

2007-10-10 Thread Hugh Perkins
On 10/3/07, Peter Verswyvelen [EMAIL PROTECTED] wrote: I needed to type at least 3 times the amount of code, much of which was boilerplate code, and the code is not elegant. Reflection is your friend here. Example. Code before reflection: MyConfig { // some properties here public

Re: [Haskell-cafe] Hugs, dotnet, C#...

2007-10-10 Thread Hugh Perkins
Have you tried F#? I mean, I havent ;-) but maybe it's an interesting half-way house? Presumably you can use all the standard .Net libraries (maybe good enough for getting asp.net working etc?), and you can still use FP constructs? I understand F# is not pure (I think?), and doesnt have monads,

Re: [Haskell-cafe] what is f=f (not) doing ?

2007-09-22 Thread Hugh Perkins
Gotta love lazy infinite loops :-D Sounds like something out of a Douglas Adams novel. Ok, this post is totally off-topic... On 9/22/07, Pasqualino 'Titto' Assini [EMAIL PROTECTED] wrote: The funny thing is that, while it is stuck in an infinite loop, GHCi doesn't seem to use any CPU time

Re: [Haskell-cafe] Dynamic thread management?

2007-09-17 Thread Hugh Perkins
Couple of thoughts/observations: - Erlang has a vm, so that would avoid building a vm. On the downside, erlang is not pure: the message-passing and the io: commands imply the possibility of side-effects. Still, it could be good enough for a proof-of-concept? - implementation as a library

Re: [Haskell-cafe] Building production stable software in Haskell

2007-09-17 Thread Hugh Perkins
Just out of curiosity, how could one do something like a factory, so that by default a library uses, say, Data.Map, but by making a simple assignment we can switch the library to use a different implementation? (This is alluded to above, but not explicitly stated. I guess it's too easy, but

Re: [Haskell-cafe] Building production stable software in Haskell

2007-09-17 Thread Hugh Perkins
On 9/18/07, Hugh Perkins [EMAIL PROTECTED] wrote: Just out of curiosity, how could one do something like a factory, so that by default a library uses, say, Data.Map, but by making a simple assignment we can switch the library to use a different implementation? (And of course, the 10 million

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

2007-09-03 Thread Hugh Perkins
On 9/3/07, Adrian Hey [EMAIL PROTECTED] wrote: FYI, I am old enough to actually remember life before MS and I can also remember what's happened to the industry at large and to various the organisations I've worked in and had dealings with over the last 25 years or so. Fair enough.

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

2007-09-03 Thread Hugh Perkins
On 9/3/07, Peter Verswyvelen [EMAIL PROTECTED] wrote: Well, then you should take a look at Boo... http://boo.codehaus.org Yes, I've looked at Boo a little. It looks cool. It made me think that a lot of language wars boils down not just to the syntactic sugar that hits one in the face at the

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] 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] 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] 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] 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 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] 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()

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

2007-09-01 Thread Hugh Perkins
Cool I had prolog for my Spectrum, many years ago (83?), but I stopped using it when I realized it didnt have any input/output capabilities beyond print, and no way to escape from the prolog bubble, eg FFI (not sure what FFI stands for, but I think it is a way for Haskell to escape into other

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

2007-09-01 Thread Hugh Perkins
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 downloading it means more

Re: [Haskell-cafe] Haskell on the Playstation 3? :-)

2007-08-30 Thread Hugh Perkins
On 8/30/07, Miguel [EMAIL PROTECTED] wrote: What about running Haskell on a PostScript printer? PostScript IS Turing-complete. Yes, because postscript printers are famous for being really fast ;-) ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Haskell on the Playstation 3? :-)

2007-08-30 Thread Hugh Perkins
Dan Piponi [EMAIL PROTECTED] wrote: http://developer.nvidia.com/object/cuda.html It's a C compiler with multiprocessor streaming extensions that targets nvidia cards. Whoa :-O Cool :-) But it's not that simple... Few things are ;-) Whats the catch? Can we use a graphics-card as an n-core

Re: Re[2]: [Haskell-cafe] Haskell on the Playstation 3? :-)

2007-08-30 Thread Hugh Perkins
So, according to the blurb, and since this is product-specific, I dont know if this is allowed on the newsgroup?, but it does seem to be a fairly unique product? : - this technology works on GeGForce 8800 cards or better - there's a dedicated processing unit available called the Tesla, which is

Re: Re[4]: [Haskell-cafe] Haskell on the Playstation 3? :-)

2007-08-30 Thread Hugh Perkins
On 8/30/07, Bulat Ziganshin [EMAIL PROTECTED] wrote: it's the same as 8800GTX. please read CUDA manual first. these 128 threads are not independent, each 8 or 16 threads execute the same code H, yes you are right. The GPU contains 8 multiprocessors, where each multiprocessor contains

Re: Re[4]: [Haskell-cafe] Haskell on the Playstation 3? :-)

2007-08-30 Thread Hugh Perkins
On 8/31/07, Dan Piponi [EMAIL PROTECTED] wrote: Right. But the functions and data that we are trying to map and fold could be anything, so we are required to have the full functionality of Haskell running on the GPU - unless the compiler can smartly figure out what should run on the GPU and

Re: [Haskell-cafe] Haskell on the Playstation 3? :-)

2007-08-29 Thread Hugh Perkins
On 8/30/07, Derek Elkins [EMAIL PROTECTED] wrote: Either the language of the graphics card is Turing complete and the answer is yes or the language isn't and the answer is no. Well, a quick google for are graphics cards turing complete? suggests that some nVidia cards are Turing complete, but I

Re: [Haskell-cafe] GHC optimisations

2007-08-22 Thread Hugh Perkins
On 8/22/07, Twan van Laarhoven [EMAIL PROTECTED] wrote: But Double is already quite badly behaved: let x = 1e20 Prelude 1 + (x - x) 1.0 Prelude (1 + x) - x 0.0 E. Whilst that's understandable and unavoidable, that kindof rings alarm bells for folds of Doubles in an automatic

Re: [Haskell-cafe] Dynamic thread management?

2007-08-22 Thread Hugh Perkins
On 8/22/07, Brandon Michael Moore [EMAIL PROTECTED] wrote: Automatic threading is inherently limited by data dependencies. You can't run a function that branches on an argument in parallel with the computation producing that argument. Even with arbitrarily many processors and no communication

Re: [Haskell-cafe] Dynamic thread management?

2007-08-21 Thread Hugh Perkins
On 8/11/07, Neil Bartlett [EMAIL PROTECTED] wrote: You're absolutely right that a dynamic/adaptive approach is the only one that will work when the tasks are of unknown size. Whether this approach is as easy as you think is open for you to prove. I look forward to testing your VM

Re: [Haskell-cafe] Dynamic thread management?

2007-08-21 Thread Hugh Perkins
On 8/21/07, Tim Chevalier [EMAIL PROTECTED] wrote: I don't think you have to worry too much about the political obstacles. People want automatic multithreading, and in a year or two we'll all have multicore boxen. In any case, if you don't solve the technical problems, the political ones will

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

2007-08-21 Thread Hugh Perkins
Exactly. For this to work there needs to be the constraint that there's a one-to-one mapping in each direction. The Bimap should have the uniqueness promise that Set (k, v) gives. Yet you should be able to search on either tuple value. Or... have the possibility of returning a list of values.

Re: [Haskell-cafe] GHC optimisations

2007-08-21 Thread Hugh Perkins
On 8/21/07, Stefan O'Rear [EMAIL PROTECTED] wrote: Currently, it's never worse. GHC's backend is about as good as GCC; most of the optimiations it doesn't do are not possible for GCC because of various lack-of-information problems (the stack pointer never aliases the heap pointer, stuff like

Re: [Haskell-cafe] Dynamic thread management?

2007-08-21 Thread Hugh Perkins
On 8/21/07, Andrew Coppin [EMAIL PROTECTED] wrote: I highly doubt that automatic threading will happen any time this decade - but I just learned something worth while from reading this email. ;-) That's an interesting observation. I cant say I dont believe it, but I'm interested to know why

Re: [Haskell-cafe] GHC optimisations

2007-08-21 Thread Hugh Perkins
Thank-you for the information. It was very useful. Couple of reactions FWIW: On 8/21/07, Stefan O'Rear [EMAIL PROTECTED] wrote: Sooo if I was feeling evil, could I take this c-code and pipe it into something that turns it into C#??? Yes. You could do the same with the original

Re: [Haskell-cafe] zip3, zip4 ... - zipn?

2007-08-11 Thread Hugh Perkins
I was looking for something like this too. Note that Erlang can do this ;-) but Erlang is probably not so strongly typed, so it's easier to do? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Small question

2007-08-10 Thread Hugh Perkins
On 8/10/07, Stefan O'Rear [EMAIL PROTECTED] wrote: Haskell's purpose: To be a generally cool language Haskell's competition: C++, SML, ... hundreds of thousands more and I make no assertion of a representative sample ... Well, C++ is not really competitive with Haskell, because C++ does not

Re: Re[2]: [Haskell-cafe] Haskell vs GC'd imperative languages, threading, parallelizeability (is that a word? :-D )

2007-08-10 Thread Hugh Perkins
On 8/10/07, Bulat Ziganshin [EMAIL PROTECTED] wrote: if you mean Erlang's sophisticated rules of which messages in queue to process first - this may be not yet implemented for Haskell. if you mean that program is just many threads which pass messages through channels to each other - it's

Re: [Haskell-cafe] Dynamic thread management?

2007-08-10 Thread Hugh Perkins
On 8/10/07, Bayley, Alistair [EMAIL PROTECTED] wrote: Well, the Harris/Singh paper summarises the common problems: - not many programs are inherently parallel If thats the case, then multicores are not going to be very useful. Where there's a will there's a way. What I think is: if maps etc

Re: [Haskell-cafe] Haskell vs GC'd imperative languages, threading, parallelizeability (is that a word? :-D )

2007-08-10 Thread Hugh Perkins
Well, managed to shave 25% of C# execution time by writing my own bit array. For now, I will concede that, under the conditions of the shoot, bitarrays in c# are slower than bitarrays in Haskell. I'll let you know if I get any new ideas on this. Getting back to the original problem, which is:

[Haskell-cafe] Haskell vs GC'd imperative languages, threading, parallelizeability (is that a word? :-D )

2007-08-10 Thread Hugh Perkins
Haskell vs GC'd imperative languages === On 8/10/07, Thomas Conway [EMAIL PROTECTED] wrote: Well, C++ is not really competitive with Haskell, because C++ does not have a GC, and it's trivial to corrupt the stack/heap. Beg to differ. I offer the following proof by

Re: [Haskell-cafe] Haskell vs GC'd imperative languages, threading, parallelizeability (is that a word? :-D )

2007-08-10 Thread Hugh Perkins
On 8/10/07, Stefan O'Rear [EMAIL PROTECTED] wrote: Bool is 32 bits, but Don is using UArray. UArray is not parametric in the element type, which means it's less generally useful (no UArray of Complex Double, for instance), but conversely it is able to use more efficient representations

Re: [Haskell-cafe] Haskell vs GC'd imperative languages, threading, parallelizeability (is that a word? :-D )

2007-08-10 Thread Hugh Perkins
On 8/10/07, Donald Bruce Stewart [EMAIL PROTECTED] wrote: It's using bit arrays. Well I'm a total Haskell newbie, and you're using Haskell to write imperative code, so it's really hard for me to read, but looking at your code, you have: (IOUArray Int Bool) -- an array of Bool Bool is a

Re: [Haskell-cafe] Haskell vs GC'd imperative languages, threading, parallelizeability (is that a word? :-D )

2007-08-10 Thread Hugh Perkins
On 8/10/07, Michael Vanier [EMAIL PROTECTED] wrote: Just to get the history right: garbage collectors have been around a _long_ time, since the '60s in Lisp systems. They only became known to most programmers through Java (which is one unarguable good thing that Java did). Ah interesting

Re: [Haskell-cafe] Haskell vs GC'd imperative languages, threading, parallelizeability (is that a word? :-D )

2007-08-10 Thread Hugh Perkins
On 8/10/07, Donald Bruce Stewart [EMAIL PROTECTED] wrote: No, STUArray s Int Bool is a bit array. Look at the space use. Or try replacing Bool with Word32, and see what happens. Fair enough. Well, the mono example in the shootout is lacking quite a few optimizations, eg its using the

Re: [Haskell-cafe] Dynamic thread management?

2007-08-10 Thread Hugh Perkins
Not many replies on this thread? Am I so wrong that no-one's even telling me? I find it hard to believe that if there were obvious errors in the proposition that anyone would resist pointing them out to me ;-) So, that leaves a couple of possibilites: some people are agreeing, but see no point

Re: [Haskell-cafe] Dynamic thread management?

2007-08-10 Thread Hugh Perkins
On 8/11/07, Thomas Conway [EMAIL PROTECTED] wrote: There are many papers about this in the Parallel Logic Programming area. It is commonly called Embarrassing Parallelism. Ah, I wasnt very precise ;-) I didnt mean I dont understand the problem; I meant I dont understand why people think it is

Re: [Haskell-cafe] Language support for imperative code. Was: Re: monad subexpressions

2007-08-08 Thread Hugh Perkins
On 8/8/07, Brian Hulley [EMAIL PROTECTED] wrote: In contrast, all the pure functional GUIs that I've seen are just wrappers around someone else's imperative code, and moreover, they exchange the simplicity of the object oriented imperative API for a veritable mindstorm of unbelievably heavy,

Re: [Haskell-cafe] a regressive view of support for imperative programming in Haskell

2007-08-08 Thread Hugh Perkins
On 8/9/07, peterv [EMAIL PROTECTED] wrote: IMHO and being a newbie having 20 years of professional C/C++/C# experience but hardly any Haskell experience, I agree with this… I find the monad syntax very confusing, because it looks so much like imperative code, but it isn't. Personally I also

Re: [Haskell-cafe] Pure functional GUI (was

2007-08-08 Thread Hugh Perkins
To be fair, GTK is pretty standard. This is so even for big name gc'd imperative languages such as C#. Sure, you can use Windows.Forms in C#, but you often wouldnt, because of the patent burden. Also, gtk in partnership with glade rocks! How easy is gtk to use from haskell by the way? In gc'd

Re: [Haskell-cafe] Pure functional GUI (was

2007-08-08 Thread Hugh Perkins
On 8/9/07, Marc Weber [EMAIL PROTECTED] wrote: -- load up the glade file dialogXmlM - xmlNew simple.glade let dialogXml = case dialogXmlM of (Just dialogXml) - dialogXml Nothing - error can't find the glade file \simple.glade\ \

Re: [Haskell-cafe] a regressive view of support for imperative programming in Haskell

2007-08-08 Thread Hugh Perkins
On 8/9/07, ok [EMAIL PROTECTED] wrote: We get extra , =, \, -, and in tokens, but no new parentheses. Yes exactly. It's the = and that gets rid of the parentheses, and reverses the order of the operations. I cant remember where I saw this, but somewhere there is a monad tutorial that starts

[Haskell-cafe] Any ideas how to go about doing a phd in threading?

2007-08-07 Thread Hugh Perkins
Hi, Really interested in doing a phd on threading. Any ideas how I'd go about doing/applying for that? Basically, threading seems to be the cutting-edge right out (for a while) as processor frequencies top out, and multicores increase. I dont have any formal CS training, but I do have a degree

Re: [Haskell-cafe] Sudoku Solver

2007-08-07 Thread Hugh Perkins
On 8/7/07, Murray Gross [EMAIL PROTECTED] wrote: I am working on a parallel brute-force solver, which will be tested on 25x25 puzzles (my current serial solver requires less than 1 second for the most difficult 9x9 puzzles I've been able to find; while I haven't tried it on 16x16 puzzles on

Re: [Haskell-cafe] Sudoku Solver

2007-08-07 Thread Hugh Perkins
On 8/7/07, Hugh Perkins [EMAIL PROTECTED] wrote: Question: what do you mean by, for example 25x25? Do you mean grids with a total length of 25 on each side, eg: (because on my super-dooper 1.66GHz Celeron, generating 10 random 25x25 grids such as the one above takes about 1.01 seconds

Re: [Haskell-cafe] creating graphics the functional way

2007-08-07 Thread Hugh Perkins
On 8/8/07, Conal Elliott [EMAIL PROTECTED] wrote: *Unless*, you abandon the traditional acceleration of a fixed set of 2D (or 3D) primitives and transformations and instead compile into graphics processor code as in http://conal.net/Vertigo . Wow, cool :-)

Re: [Haskell-cafe] Perfect example

2007-08-06 Thread Hugh Perkins
There's a neat Haskell solution to the knapsack problem which runs very fast. I'm not 100% sure that it runs faster than an optimal solution in other GC'd imperative languages, but it's very concise and not (too) convoluted. Have a search for the thread with xkcd in the title. Chung-chieh Shan

Re: [Haskell-cafe] Sudoku Solver

2007-08-06 Thread Hugh Perkins
Note that the official way to solve sudoku is to use dancing links, but I guess you are creating a naive implementation precisely as a base-line against which to measure other implementations? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Sudoku Solver

2007-08-06 Thread Hugh Perkins
On 8/7/07, Donald Bruce Stewart [EMAIL PROTECTED] wrote: See also, http://haskell.org/haskellwiki/Sudoku -- Don Just out of ... errr curiosity... which of those implementations is the fastest? ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Sudoku Solver

2007-08-06 Thread Hugh Perkins
On 8/7/07, Donald Bruce Stewart [EMAIL PROTECTED] wrote: No idea. You could compile them all with -O2, run them on a set of puzzles, and produce a table of results :-) Well I could, but I wont ;-) If you had to guess which one is fastest which one would you guess? I'm a little surprised no

Re: [Haskell-cafe] ANN: Finance.Quote.Yahoo 0.1 on hackage

2007-07-29 Thread Hugh Perkins
This is totally off-topic, but... how could I go about getting hold of the information on per-country exports and imports of specific types of things? (lets say for example, a thing could be: coffee ,but also a computer program, so not just physical commodities, but also services and somewhat

Re: [Haskell-cafe] Another analogy

2007-07-25 Thread Hugh Perkins
* Haskell* is an incredibly elegantly-designed and beautiful car, which is rumored to be able to drive over extremely strange terrain. The one time you tried to drive it, it didn't actually drive along the road; instead, it made copies of itself and the road, with each successive copy of the

Re: [Haskell-cafe] Another analogy

2007-07-23 Thread Hugh Perkins
C would be an engine. You have to add the wheels. If you use anything but a 75.0% mix of gasoline to oil, it explodes. Fine you guys can have Haskell as the hovercraft, not one of those big ones mind, one of those Florida glades ones, like in Lassie, with one guy sitting on it, weaving between

Re: [Haskell-cafe] Another analogy

2007-07-23 Thread Hugh Perkins
On 7/23/07, Jonathan Cast [EMAIL PROTECTED] wrote: Fine you guys can have Haskell as the hovercraft, not one of those big ones mind, How do you get that Haskell has to be small? It seems a great big language to me. Well, partly to be controversial, partly because one of those small

Re: [Haskell-cafe] Minim interpreter

2007-07-22 Thread Hugh Perkins
heh! well everyone was busy working on icfp or something, so the newsgroup was pretty dead :-) And I played with opengl a little, which gave better results than I thought, but not good enough to pursue, and the whole program was in imperative dos anyway, so I couldnt quite see what was the point

Re: [Haskell-cafe] Equational Reasoning goes wrong

2007-07-22 Thread Hugh Perkins
On 7/22/07, Neil Mitchell [EMAIL PROTECTED] wrote: However, if we use the rule that anywhere we encounter span (not . g) we can replace it with break g then we can redefine break as: break g = break g For some reason this reminds me of the paradoxes of being able to go back in time. What I

Re: [Haskell-cafe] gui libs? no thanks, i'm just browsing.. ;-)

2007-07-21 Thread Hugh Perkins
I'm not sure if you're talking about C++ ABIs or C ABIs? If you're already using a C ABI, and you're getting incompatibilities, well I have nothing useful to say :-) If you're talking about C++ ABIs, technically it's possible to use a Generator to drop-down into a C ABI, pump across the

Re: [Haskell-cafe] Minim interpreter

2007-07-20 Thread Hugh Perkins
Newbie question: why does the following give Not in scope 'c' for the last line? string :: Parsec.Parser String string = do c - Parsec.letter do cs - string return c:cs Parsec.| return [c] (This is copied more or less rote from

Re: [Haskell-cafe] Minim interpreter

2007-07-20 Thread Hugh Perkins
Kindof vaguely made a start on this, but cant quite see how to handle variables. I guess variables can be stored as a (Map.Map String Double), at least for a first draft? Then, I'm building up two hierarchies in parallel: - a set of parsec functions to parse the incoming string into a Program

Re: [Haskell-cafe] Minim interpreter

2007-07-20 Thread Hugh Perkins
Ok, that got the variables working. Example: *Minim evaluateprog $ ProgramTree ( ProgramLeaf $ AssignmentStatement( VarAssignment (Variable test) ( ValueFromConstant (Constant 3 ( PrintStatement (PrintValue( ValueFromVariable(Variable test 3.0 3.0 I'm having eval return the IO monad,

Re: [Haskell-cafe] Re: xkcd #287 NP-Complete

2007-07-19 Thread Hugh Perkins
Thank-you for the explanation :-) You make it very easy to understand, awesome :-) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Producing MinimumValue

2007-07-19 Thread Hugh Perkins
You can get the head and the tail by pattern matching. Lets say you have a function that takes a list: myfunction list = -- do something here go = myfuction [1,4,2,6] ... you can write the list bit of the function as (x:xs), where x is the head, or first element, of the list, and xs is the

Re: [Haskell-cafe] Master's thesis project at Philips Research

2007-07-19 Thread Hugh Perkins
Not applying (probably not eligible), just answering for fun, so feel free to pipe to null :-D : Is your target user for the language the end-user of the toy itself, or a toy designer who will be using your middleware? I'm guessing the latter. Is there any reason why you cant use Lua? It's an

Re: [Haskell-cafe] Maintaining the community

2007-07-19 Thread Hugh Perkins
Just found this in a gmail adtext link, it's quite interesting (and convincing): http://www.janestcapital.com/yaron_minsky-cufp_2006.pdf ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Producing MinimumValue

2007-07-19 Thread Hugh Perkins
On 7/19/07, Sebastian Sylvan [EMAIL PROTECTED] wrote: Actually, since Haskell is lazy and only the first element is required for minimumValue, the above algorithm should be O(n). That's pretty cool :-) ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] RE: haskell for web

2007-07-17 Thread Hugh Perkins
On 7/17/07, Martin Coxall [EMAIL PROTECTED] wrote: I wonder why 'we' aren't pushing things like this big time. When Ruby took off, more than anything else it was because of Rails. Web programming is something 'the kids' can really get into, and it caused Ruby to explode into the mainstream geek

Re: [Haskell-cafe] Maintaining the community

2007-07-17 Thread Hugh Perkins
On 7/17/07, Thomas Conway [EMAIL PROTECTED] wrote: And this is where I think Haskell has it all over C++, Java, and the rest. Haskell is easy to learn at a simple level, and hard to learn at the expert level, but once learned is very powerful and has excellent payoffs in terms of productivity.

Re: [Haskell-cafe] RE: haskell for web

2007-07-17 Thread Hugh Perkins
On 7/18/07, brad clawsie [EMAIL PROTECTED] wrote: i have wondered what it would take to get a mod_haskell for apache If you make a mod_haskell, please make sure it's secure. It's insanely hard to convince web hosting companies to add support for new mod_myfavoritelanguagehere. If the mod

Re: [Haskell-cafe] Re: Re[4]: In-place modification

2007-07-16 Thread Hugh Perkins
On 7/16/07, Bulat Ziganshin [EMAIL PROTECTED] wrote: Topcoder certainly isn't about benchmarking. Undoubtedly, it would be absolutely awesome to be able to use Haskell in topcoder... but it wouldn't say anything about speed. My guess is that practically no topcoder submissions fail by

Re: [Haskell-cafe] xkcd #287 NP-Complete

2007-07-16 Thread Hugh Perkins
On 7/16/07, Tom Pledger [EMAIL PROTECTED] wrote: I'll be a nuisance and bring up this case: solve 150005 [2, 4, 150001] Argh, that makes my solution hang! :-/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Re: xkcd #287 NP-Complete

2007-07-16 Thread Hugh Perkins
On 7/16/07, Chung-chieh Shan [EMAIL PROTECTED] wrote: Here's my solution to the xkcd problem (yay infinite lists): dynamic programming? Cool :-) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Re: xkcd #287 NP-Complete

2007-07-16 Thread Hugh Perkins
Your solution looks really elegant, and runs insanely fast. Can you explain how it works? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Maintaining the community

2007-07-16 Thread Hugh Perkins
On 7/16/07, Malcolm Wallace [EMAIL PROTECTED] wrote: After all, we would expect the same attributes (intelligence and training) from a neurosurgeon, a nuclear scientist, or someone who calculates how to land a person on the moon. Programming computers may not seem very skilled to most people,

Re: Re[4]: [Haskell-cafe] In-place modification

2007-07-15 Thread Hugh Perkins
Sebastian, Why would I write a slow, complicated algorithm in C#? I'm not making these comparisons for some academic paper, I'm trying to get a feel for how the languages run in practice. And really in practice, I'm never going to write a prime algorithm using merge and so on, I'd just use the

Re: Re[4]: [Haskell-cafe] In-place modification

2007-07-15 Thread Hugh Perkins
Hey, guys, I just realized this test is not really fair! I've been using the Microsoft .Net compiler ,which is a proprietary closed-source compiler. To be fair to Haskell, we should probably compare it to other open source products, such as g++ and mono? Here are the timings ;-) Haskell

Re: Re[4]: [Haskell-cafe] In-place modification

2007-07-15 Thread Hugh Perkins
On 7/15/07, Sebastian Sylvan [EMAIL PROTECTED] wrote: [me thinks he doth protest too much] ;-) The rules of the competition are quite fair: both sides make an optimal algorithm using their preferred language. It's ok to hardcode the first 3 or 4 primes if you must, hardcoding the entire

Re: Re[4]: [Haskell-cafe] In-place modification

2007-07-15 Thread Hugh Perkins
On 7/15/07, Donald Bruce Stewart [EMAIL PROTECTED] wrote: [snip] unsafeWrite[snip] [snip]unsafeRead[snip] Hi Donald, the idea is to use this for operational code, so avoiding unsafe operations is preferable ;-) You'll note that the C# version is not using unsafe operations, although to be

Re: Re[4]: [Haskell-cafe] In-place modification

2007-07-15 Thread Hugh Perkins
On 7/15/07, Donald Bruce Stewart [EMAIL PROTECTED] wrote: What C# version are you using, by the way? (So I can check if it does any tricks). - csc is in the Microsoft.Net Framework 2.0 runtime, which you can download from microsoft.com (free download). - gmcs/mono are from Mono 1.2.2.1 ,

Re: Re[4]: [Haskell-cafe] In-place modification

2007-07-15 Thread Hugh Perkins
On 7/15/07, Sebastian Sylvan [EMAIL PROTECTED] wrote: unsafe' here just means direct array indexing. Same as the other languages. Haskell's 'unsafe' is a little more paranoid that other languages. Yes, I was kindof hoping it was something like that. Cool :-) Since the goal is to flip

Re: Re[4]: [Haskell-cafe] In-place modification

2007-07-15 Thread Hugh Perkins
On 7/15/07, Hugh Perkins [EMAIL PROTECTED] wrote: On 7/15/07, Sebastian Sylvan [EMAIL PROTECTED] wrote: unsafe' here just means direct array indexing. Same as the other languages. Haskell's 'unsafe' is a little more paranoid that other languages. Yes, I was kindof hoping

  1   2   >