Re: [Haskell-cafe] Re: Hugs on iPhone

2009-03-24 Thread Jules Bean
Rick R wrote: The agreement doesn't specifically prohibit the use of interpreters (just those than run external code). It also doesn't say anything about machine generated code. The only thing one would have to ensure is that the dependencies of JHC are all compiled in, or statically linked.

[Haskell-cafe] Don't forget to vote!

2009-03-24 Thread Eelco Lempsink
In less than 4 hours the Haskell Logo poll will be closed. If you're not one of the 423 people that voted so far, please take 1-20 minutes (depending on your level of perfectionism) to support your favorite logo(s) :) -- Regards, Eelco Lempsink PGP.sig Description: This is a digitally

[Haskell-cafe] Making videos of your project

2009-03-24 Thread Don Stewart
Hey guys, I've been making quick youtube videos of projects to convey what they do. Here, for example, using Tim Docker's Charts library in ghci: http://www.youtube.com/watch?v=2Lqzygxvus0 (Click on the HD button for higher res). Or one of Neil Brown's SG OpenGL graphics library,

RE: [Haskell-cafe] Are there performant mutable Arrays in Haskell?

2009-03-24 Thread Brettschneider, Matthias
Thx for your hints, I played around with them and the performance gets slightly better. But the major boost is still missing :) I noticed, that one real bottleneck seems to be the conversion of the array back into a list. The interesting part is, if I use the elems function (Data.Array.Base)

[Haskell-cafe] Re: Learning Haskell

2009-03-24 Thread Jon Fairbairn
Tom.Amundsen tomamund...@gmail.com writes: How long did it take you to become proficient in Haskell? Something more than twenty years. By that, I mean - how long until you were just as comfortable with Haskell as you were with your strongest language at that time? Oh, Haskell was my

Re: [Haskell-cafe] Learning Haskell

2009-03-24 Thread Sjur Gjøstein Karevoll
må. den 23.03.2009 klokka 20:08 (-0700) skreiv Tom.Amundsen: How long did it take you to become proficient in Haskell? By that, I mean - how long until you were just as comfortable with Haskell as you were with your strongest language at that time? It's been nine months since I first started

Re: [Haskell-cafe] Learning Haskell

2009-03-24 Thread Ketil Malde
Tom.Amundsen tomamund...@gmail.com writes: How long did it take you to become proficient in Haskell? Ten years and still working on it. By that, I mean - how long until you were just as comfortable with Haskell as you were with your strongest language at that time? Hm, I'm tempted to

[Haskell-cafe] The votes are in!

2009-03-24 Thread Eelco Lempsink
The results of the Haskell logo competition are in! You can view them at http://www.cs.cornell.edu/w8/~andru/cgi-perl/civs/ results.pl?num_winners=1id=E_d21b0256a4fd5ed7algorithm=beatpath Congratulations Jeff Wheeler! I'll set up a page with the results visibile. -- Regards, Eelco Lempsink

Re: [Haskell-cafe] The votes are in!

2009-03-24 Thread John Van Enk
Is this the part where all the pundits come out and talk about how Jeff isn't a citizen, eats babies, and wants to turn Haskell into an imperative language? /jve 2009/3/24 Eelco Lempsink ee...@lempsink.nl The results of the Haskell logo competition are in! You can view them at

Re: [Haskell-cafe] The votes are in!

2009-03-24 Thread Andrew Wagner
Ooh, let me pop some popcorn! 2009/3/24 John Van Enk vane...@gmail.com Is this the part where all the pundits come out and talk about how Jeff isn't a citizen, eats babies, and wants to turn Haskell into an imperative language? /jve 2009/3/24 Eelco Lempsink ee...@lempsink.nl The

Re: [Haskell-cafe] The votes are in!

2009-03-24 Thread Creighton Hogg
2009/3/24 John Van Enk vane...@gmail.com: Is this the part where all the pundits come out and talk about how Jeff isn't a citizen, eats babies, and wants to turn Haskell into an imperative language? Well given the fact that Haskell has been called the world's best imperative language, that we

[Haskell-cafe] RE: [ANN] Safe Lazy IO in Haskell

2009-03-24 Thread nicolas . pouillard
Excerpts from Wei Hu's message of Mon Mar 23 17:37:15 +0100 2009: Nicolas Pouillard nicolas.pouillard at gmail.com writes: Hi folks, We have good news (nevertheless we hope) for all the lazy guys standing there. Since their birth, lazy IOs have been a great way to modularly

[Haskell-cafe] Re: Are there performant mutable Arrays in Haskell?

2009-03-24 Thread Achim Schneider
Brettschneider, Matthias brettschnei...@hs-albsig.de wrote: Thx for your hints, I played around with them and the performance gets slightly better. But the major boost is still missing :) I noticed, that one real bottleneck seems to be the conversion of the array back into a list. The

Re: [Haskell-cafe] Re: Hugs on iPhone

2009-03-24 Thread John A. De Goes
Go ahead sell your GPL application. I'll get your code, build the application, and sell it for less than half of what you're selling it for. How exactly will you make your money, then? When people say, You can't make commercial software with GPL code, they don't mean it's not legally

Re: [Haskell-cafe] Re: Hugs on iPhone

2009-03-24 Thread Karel Gardas
John A. De Goes wrote: Go ahead sell your GPL application. I'll get your code, build the application, and sell it for less than half of what you're selling it for. How exactly will you make your money, then? Ask RedHat how they make money from RHEL while Oracle and CentOS are exact copies

[Haskell-cafe] Re: Hugs on iPhone

2009-03-24 Thread Achim Schneider
John A. De Goes j...@n-brain.net wrote: Go ahead sell your GPL application. I'll get your code, build the application, and sell it for less than half of what you're selling it for. I don't think you can go below 0.79 in the Apple store, and I guess you'll have a hard time convincing

Re: [Haskell-cafe] Help on using System.Win32.Com.Automation

2009-03-24 Thread Wilkes Joiner
Thank you Sigbjorn. The generated WMI module had the information I was looking for. I wasn't able to find the ihc. Would an old hdirect package work? I just needed to map a handful of functions so I did it by hand. For posterity, here are the mappings I've needed so far: createConnection ::

Re: [Haskell-cafe] Re: Hugs on iPhone

2009-03-24 Thread John A. De Goes
Like I said, go ahead and try that with an iPhone application. If the iPhone app is so buggy or complicated so as to require support, no one will buy it. If it's not, I'll make all the money by selling it for half the price you sell it for. In any case, the examples you mention involve

Re: [Haskell-cafe] The votes are in!

2009-03-24 Thread Sebastiaan Visser
Well done! Although I am quite happy with the result, this was definitely my favorite, this logo is not really 'finished'. Is there going to be some kind of second round in which we can vote for/suggest variations of this logo? With different texts/fonts/colors/ etc? Gr, Sebastiaan On

Re: [Haskell-cafe] Re: Hugs on iPhone

2009-03-24 Thread John A. De Goes
Again, go ahead and write your GPL app -- i.e. put your money where your mouth is. After you spend a year developing some cool app, I'll take your code and sell it -- maybe under a different name, with different screenshots, and a different description. Or maybe I'll just list it in the

Re: [Haskell-cafe] The votes are in!

2009-03-24 Thread Eelco Lempsink
On 24 mrt 2009, at 13:20, Eelco Lempsink wrote: The results of the Haskell logo competition are in! You can view them at http://www.cs.cornell.edu/w8/~andru/cgi-perl/ civs/results.pl?num_winners=1id=E_d21b0256a4fd5ed7algorithm=beatpath Congratulations Jeff Wheeler! And, also

Re: [Haskell-cafe] Re: Hugs on iPhone

2009-03-24 Thread Ketil Malde
John A. De Goes j...@n-brain.net writes: In any case, the examples you mention involve companies selling the labors of others. ...like the original poster wanted to, by linking to GCC and sell it as part of his proprietary product? The difference is that Red Hat et al benefit from the labor

[Haskell-cafe] Re: Hugs on iPhone

2009-03-24 Thread Achim Schneider
John A. De Goes j...@n-brain.net wrote: You simply can't make a living selling GPL software. If the software's complicated enough and you know your way around it, then you can sell support maintenance. However, those conditions doesn't apply to consumer software, because consumers don't want

[Haskell-cafe] Equations for `foo' have different numbers of arguments

2009-03-24 Thread Manlio Perillo
Hi. There is a limitation, in Haskell, that I'm not sure to understand. Here is an example: module Main where divide :: Float - Float - Float divide _ 0 = error division by 0 divide = (/) main = do print $ divide 1.0 0.0 print $ divide 4.0 2.0 With GHC I get: Equations for `divide'

[Haskell-cafe] Re: The votes are in!

2009-03-24 Thread Achim Schneider
Eelco Lempsink ee...@lempsink.nl wrote: My preference would be to have one person with sense of (and education in, if possible) design make some nice looking variations and have a second (final) round of voting, but, we could also do the wiki-thing again ;) That was the plan, yes.

Re: [Haskell-cafe] SOC idea ticket: Rendering Engine

2009-03-24 Thread Roman Cheplyaka
I tried it and it goes out of memory. The log attached. -- Roman I. Cheplyaka :: http://ro-che.info/ Don't let school get in the way of your education. - Mark Twain Script started on Tue Mar 24 16:50:41 2009 [materials,.,..,.svn,car,packs,models]

Re: [Haskell-cafe] Equations for `foo' have different numbers of arguments

2009-03-24 Thread Bulat Ziganshin
Hello Manlio, Tuesday, March 24, 2009, 5:44:14 PM, you wrote: divide _ 0 = error division by 0 divide = (/) Equations for `divide' have different numbers of arguments you should write divide a b = a/b -- Best regards, Bulatmailto:bulat.zigans...@gmail.com

[Haskell-cafe] Re: Equations for `foo' have different numbers of arguments

2009-03-24 Thread Achim Schneider
Manlio Perillo manlio_peri...@libero.it wrote: Hi. There is a limitation, in Haskell, that I'm not sure to understand. Here is an example: module Main where divide :: Float - Float - Float divide _ 0 = error division by 0 divide = (/) main = do print $ divide 1.0 0.0 print

Re: [Haskell-cafe] Re: Hugs on iPhone

2009-03-24 Thread John Meacham
On Mon, Mar 23, 2009 at 07:00:26PM -0400, Rick R wrote: The agreement doesn't specifically prohibit the use of interpreters (just those than run external code). It also doesn't say anything about machine generated code. The only thing one would have to ensure is that the dependencies of JHC

Re: [Haskell-cafe] The votes are in!

2009-03-24 Thread Sean Leather
Eelco Lempsink wrote: Given the winner, the possible variations are limited to color (oh, boy), coloring (lambda accented, bind accented or all the same) and possible font-like things such as the line shapes (much like George Pollard did with his variant, entry #50, placed 9th). I agree

Re: [Haskell-cafe] SOC idea ticket: Rendering Engine

2009-03-24 Thread Roman Cheplyaka
Oh, I managed to enjoy ogre by disabling other entities. -- Roman I. Cheplyaka :: http://ro-che.info/ Don't let school get in the way of your education. - Mark Twain ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Re: Equations for `foo' have different numbers of arguments

2009-03-24 Thread Martijn van Steenbergen
Achim Schneider wrote: The other might be implementation issues: it makes pattern match rules more complex. But only marginally, right? f A B = biz f B = bar f = bam could be trivially rewritten to: f A B = biz f B y = bar y f x y = bam x y Martijn.

Re: [Haskell-cafe] The votes are in!

2009-03-24 Thread Brandon S. Allbery KF8NH
On 2009 Mar 24, at 8:29, John Van Enk wrote: Is this the part where all the pundits come out and talk about how Jeff isn't a citizen, eats babies, and wants to turn Haskell into an imperative language? He uses unsafeInterleaveIO! -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell]

Re: [Haskell-cafe] The votes are in!

2009-03-24 Thread Andrew Wagner
He ONCE used unsafeInterleaveIO, but he never evaluated it, and never tried it again! 2009/3/24 Brandon S. Allbery KF8NH allb...@ece.cmu.edu On 2009 Mar 24, at 8:29, John Van Enk wrote: Is this the part where all the pundits come out and talk about how Jeff isn't a citizen, eats babies, and

[Haskell-cafe] Something wrong with happs.org?

2009-03-24 Thread Vimal
Hi, http://happs.org/ has some Javascript visible as plain text. It looks like some tags are missing in the page... I hope that's the right website, because it turned up first on my Google search happs with a nice description too. -- Vimal ___

Re: [Haskell-cafe] Re: Equations for `foo' have different numbers of arguments

2009-03-24 Thread John Van Enk
Yes, but this seems to have terrifying implications... On Tue, Mar 24, 2009 at 11:25 AM, Martijn van Steenbergen mart...@van.steenbergen.nl wrote: Achim Schneider wrote: The other might be implementation issues: it makes pattern match rules more complex. But only marginally, right? f

Re: [Haskell-cafe] Something wrong with happs.org?

2009-03-24 Thread Ross Mellgren
I thought that HAppS has gone, replaced by happstack? http://happstack.com/ -Ross On Mar 24, 2009, at 11:32 AM, Vimal wrote: Hi, http://happs.org/ has some Javascript visible as plain text. It looks like some tags are missing in the page... I hope that's the right website, because it

[Haskell-cafe] Re: Equations for `foo' have different numbers of arguments

2009-03-24 Thread Achim Schneider
Martijn van Steenbergen mart...@van.steenbergen.nl wrote: f x y = bam x y This would introduce another matching of x on the outside of bam, and I don't know if this works without significantly messing with e.g. strictness. -- (c) this sig last receiving data processing entity. Inspect headers

Re[2]: [Haskell-cafe] The votes are in!

2009-03-24 Thread Bulat Ziganshin
Hello Andrew, Tuesday, March 24, 2009, 6:29:18 PM, you wrote: then it was thoughtcrime and that sort of things even more dangerous for State! He ONCE used unsafeInterleaveIO, but he never evaluated it, and never tried it again! 2009/3/24 Brandon S. Allbery KF8NH allb...@ece.cmu.edu On

Re: [Haskell-cafe] SOC idea ticket: Rendering Engine

2009-03-24 Thread Csaba Hruska
Does your video card support shaders? If it's an old card with fixed function opengl, then edit /media/materials/scripts/Robot.material file. Disable shaders: { //source ambient.vert //source diffuse.vert source toonf2.vert } fragment_program Examples/AmbientShadingFP

Re: [Haskell-cafe] Something wrong with happs.org?

2009-03-24 Thread Don Stewart
We need a redirect... rmm-haskell: I thought that HAppS has gone, replaced by happstack? http://happstack.com/ -Ross On Mar 24, 2009, at 11:32 AM, Vimal wrote: Hi, http://happs.org/ has some Javascript visible as plain text. It looks like some tags are missing in the page... I hope

Exception handling in numeric computations (was Re: [Haskell-cafe] Use unsafePerformIO to catch Exception?)

2009-03-24 Thread Xiao-Yong Jin
Henning Thielemann lemm...@henning-thielemann.de writes: Try to never use exception handling for catching programming errors! Division by zero is undefined, thus a programming error when it occurs. http://www.haskell.org/haskellwiki/Error http://www.haskell.org/haskellwiki/Exception I'm

Re: [Haskell-cafe] Re: Are there performant mutable Arrays in Haskell?

2009-03-24 Thread Don Stewart
barsoap: Brettschneider, Matthias brettschnei...@hs-albsig.de wrote: Thx for your hints, I played around with them and the performance gets slightly better. But the major boost is still missing :) I noticed, that one real bottleneck seems to be the conversion of the array back into

Re: Exception handling in numeric computations (was Re: [Haskell-cafe] Use unsafePerformIO to catch Exception?)

2009-03-24 Thread Jake McArthur
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Xiao-Yong Jin wrote: | The problem is that there will be many functions using such | a function to invert a matrix, making this inversion | function return Either/Maybe or packing it in a monad is | just a big headache. I disagree. If you try to

Re: Exception handling in numeric computations (was Re: [Haskell-cafe] Use unsafePerformIO to catch Exception?)

2009-03-24 Thread Daniel Yokomizo
On Tue, Mar 24, 2009 at 1:27 PM, Xiao-Yong Jin xj2...@columbia.edu wrote: Henning Thielemann lemm...@henning-thielemann.de writes: Try to never use exception handling for catching programming errors! Division by zero is undefined, thus a programming error when it occurs.  

Re: [Haskell-cafe] Re: Hugs on iPhone

2009-03-24 Thread Rick R
Correct. My point was only in the case that it would need to statically link to a GPL'd lib (which I'm not sure if such a case exists) If the gcc license suddenly decided to claim compiled items as derivative works, the IT world as we know it would end. On Tue, Mar 24, 2009 at 11:06 AM, John

[Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Manlio Perillo
Hi. In these days I'm discussing with some friends, that mainly use Python as programming language, but know well other languages like Scheme, Prolog, C, and so. These friends are very interested in Haskell, but it seems that the main reason why they don't start to seriously learning it, is

Re: [Haskell-cafe] Equations for `foo' have different numbers of arguments

2009-03-24 Thread Manlio Perillo
Bulat Ziganshin ha scritto: Hello Manlio, Tuesday, March 24, 2009, 5:44:14 PM, you wrote: divide _ 0 = error division by 0 divide = (/) Equations for `divide' have different numbers of arguments you should write divide a b = a/b Right. But my question was: why can't I write the

Re: [Haskell-cafe] SOC idea ticket: Rendering Engine

2009-03-24 Thread Roman Cheplyaka
* Csaba Hruska csaba.hru...@gmail.com [2009-03-24 16:54:51+0100] Does your video card support shaders? If it's an old card with fixed function opengl, then edit /media/materials/scripts/Robot.material file. Disable shaders: Yeah, that helped. (It's video card embedded in my laptop.) --

[Haskell-cafe] GHC 6.10.2 - PCap package - affected by the change of Finalizers?

2009-03-24 Thread Neil Davies
Hi Looks like pcap package needs a little tweek for 6.10.2 - programs compiled with it bomb out with ..error: a C finalizer called back into Haskell. use Foreign.Concurrent.newForeignPtr for Haskell finalizers. Is my interpretation of this error message correct? Cheers Neil

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Tim Newsham
These friends are very interested in Haskell, but it seems that the main reason why they don't start to seriously learning it, is that when they start reading some code, they feel the Perl syndrome. That is, code written to be too smart, and that end up being totally illegible by Haskell

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Sjur Gjøstein Karevoll
I know what you're saying, in a way. There is much haskell code that's completely illegible to me. I would say there is a difference between Haskell and Perl though, in that Perl code is too smart aka. clever, while Haskell code is usually simply, well, too smart. This means code written using

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Jake McArthur
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Manlio Perillo wrote: | These friends are very interested in Haskell, but it seems that the main | reason why they don't start to seriously learning it, is that when they | start reading some code, they feel the Perl syndrome. | | That is, code

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Miguel Mitrofanov
Well, I'd say that there is something close to the Perl syndrome, in some sense. After all, code IS usually very smart. The difference is that in Perl all smartness is about knowing how the computer works, or how the interpreter works. In Haskell, instead, the smartness is about knowing -

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Manlio Perillo
Tim Newsham ha scritto: These friends are very interested in Haskell, but it seems that the main reason why they don't start to seriously learning it, is that when they start reading some code, they feel the Perl syndrome. That is, code written to be too smart, and that end up being totally

Re: [Haskell-cafe] Making videos of your project

2009-03-24 Thread Claus Reinke
Perhaps the make a video slogan doesn't quite explain what is intended - it didn't to me!-) Reading John Udell's short article What is Screencasting? http://www.oreillynet.com/pub/a/oreilly/digitalmedia/2005/11/16/what-is-screencasting.html?page=1 gave me a better idea: the screen video part is

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Manlio Perillo
Jake McArthur ha scritto: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Manlio Perillo wrote: | These friends are very interested in Haskell, but it seems that the main | reason why they don't start to seriously learning it, is that when they | start reading some code, they feel the Perl

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Jonathan Cast
On Tue, 2009-03-24 at 19:42 +0100, Manlio Perillo wrote: Tim Newsham ha scritto: These friends are very interested in Haskell, but it seems that the main reason why they don't start to seriously learning it, is that when they start reading some code, they feel the Perl syndrome. That

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Jake McArthur
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Manlio Perillo wrote: | This is right. | The problem is that often (IMHO) a function definition can be rewritten | so that it is much more readable. | | As an example, with the takeList function I posted. I looked at it, found nothing wrong with the

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Tim Newsham
When you think about it, what you are saying is that Haskell programmers shouldn't take advantage of the extra tools that Haskell provides. No, I'm not saying this. But, as an example, when you read a function like: buildPartitions xs ns = zipWith take ns . init $ scanl (flip drop) xs ns

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Eugene Kirpichov
2009/3/24 Manlio Perillo manlio_peri...@libero.it: Tim Newsham ha scritto: These friends are very interested in Haskell, but it seems that the main reason why they don't start to seriously learning it, is that when they start reading some code, they feel the Perl syndrome. That is, code

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Miguel Mitrofanov
| As an example, with the takeList function I posted. I looked at it, found nothing wrong with the original, and absolutely hated your fixed version. I might have written it like this, instead: ~buildPartitions xs ns = zipWith take ns . init . scanl (flip drop) xs $ ns Maybe it's

Re: [Haskell-cafe] ACM Task for C++ and Java programmers in Haskell. How to make code faster?

2009-03-24 Thread Vasyl Pasternak
I changed the program, now it similar to the program from the wiki (http://www.haskell.org/haskellwiki/Phone_number) The version with ByteString compared to version with ordinary Strings works 3.5 times faster. (I put it to http://hpaste.org/fastcgi/hpaste.fcgi/view?id=2830) But version with

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Eugene Kirpichov
Pretty cool once you know what the function does, but I must admit I wouldn't immediately guess the purpose of the function when written in this way. 2009/3/24 Miguel Mitrofanov miguelim...@yandex.ru: | As an example, with the takeList function I posted. I looked at it, found nothing wrong

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Jake McArthur
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Miguel Mitrofanov wrote: | Maybe it's just me, but I think that | | takeList ns xs = evalState (mapM (State . splitAt) ns) xs | | or even | | takeList = evalState . map (State . splitAt) | | would be much clearer than both versions. Definitely. I

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Manlio Perillo
Jake McArthur ha scritto: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Manlio Perillo wrote: | This is right. | The problem is that often (IMHO) a function definition can be rewritten | so that it is much more readable. | | As an example, with the takeList function I posted. I looked at it,

Re: [Haskell-cafe] The votes are in!

2009-03-24 Thread John Van Enk
and that baby eating is an acceptable part of Haskell optimization Actually, yes. It's usually best used like this: data Foo = Bar {-# UNPACK #-} {-# EAT BABY #-} !Int On Tue, Mar 24, 2009 at 8:42 AM, Creighton Hogg wch...@gmail.com wrote: 2009/3/24 John Van Enk vane...@gmail.com: Is this

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Yitzchak Gale
Manlio Perillo complained about: buildPartitions xs ns = zipWith take ns . init . scanl (flip drop) xs $ ns Miguel Mitrofanov wrote: takeList = evalState . mapM (State . splitAt) Ha! Bravo! As the author of the offending zipWith/scanl version, I can say that love those State monad one-liners.

Re: [Haskell-cafe] Re: Hugs on iPhone

2009-03-24 Thread David Leimbach
2009/3/24 Rick R rick.richard...@gmail.com Correct. My point was only in the case that it would need to statically link to a GPL'd lib (which I'm not sure if such a case exists) If the gcc license suddenly decided to claim compiled items as derivative works, the IT world as we know it would

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Jake McArthur
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Manlio Perillo wrote: | With the original version, you have to follow 3 separate operations: | | Prelude let xs = [1, 2, 3, 4] :: [Int] | Prelude let ns = [3, 1] :: [Int] | Prelude let _1 = scanl (flip drop) xs ns | Prelude let _2 = init _1 | Prelude

Re: Exception handling in numeric computations (was Re: [Haskell-cafe] Use unsafePerformIO to catch Exception?)

2009-03-24 Thread Henning Thielemann
On Tue, 24 Mar 2009, Xiao-Yong Jin wrote: invMat :: Matrix - Matrix You won't be able to invert all the matrix, mathematically. And computationally, even a larger set of matrix might fail to be inverted because of the finite precision. It is relatively easier and more efficient to spot such

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Peter Verswyvelen
On Tue, Mar 24, 2009 at 7:48 PM, Jonathan Cast jonathancc...@fastmail.fmwrote: On Tue, 2009-03-24 at 19:42 +0100, Manlio Perillo wrote: But, as an example, when you read a function like: buildPartitions xs ns = zipWith take ns . init $ scanl (flip drop) xs ns that can be rewritten

Re: Exception handling in numeric computations (was Re: [Haskell-cafe] Use unsafePerformIO to catch Exception?)

2009-03-24 Thread Henning Thielemann
On Tue, 24 Mar 2009, Daniel Yokomizo wrote: If we try the other approach, we need to express the totality of invMat by restricting its domain, so we can add, for example, a phantom type to Matrix to signal it is invertible. As you need to construct the Matrix before trying to invert it you can

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Manlio Perillo
Yitzchak Gale ha scritto: [...] So the bottom line is that Manlio is right, really. It's just that Haskell is still very different than what most programmers are used to. So it does take a while to get a feeling for what is too smart. Right, you centered the problem! The problem is where to

Re: [Haskell-cafe] The votes are in!

2009-03-24 Thread FFT
I demand a recount! The one that launches the missile should have won! 2009/3/24 Eelco Lempsink ee...@lempsink.nl: The results of the Haskell logo competition are in! You can view them at

Re: [Haskell-cafe] The votes are in!

2009-03-24 Thread Ross Mellgren
Doesn't matter how many times you seq the results, the thunk has been forced. -Ross On Mar 24, 2009, at 4:45 PM, FFT wrote: I demand a recount! The one that launches the missile should have won! 2009/3/24 Eelco Lempsink ee...@lempsink.nl: The results of the Haskell logo competition are

Re: [Haskell-cafe] The votes are in!

2009-03-24 Thread Luke Palmer
On Tue, Mar 24, 2009 at 2:45 PM, FFT fft1...@gmail.com wrote: I demand a recount! The one that launches the missile should have won! I guess nobody evaluated its merits. 2009/3/24 Eelco Lempsink ee...@lempsink.nl: The results of the Haskell logo competition are in! You can view them

Re: [Haskell-cafe] The votes are in!

2009-03-24 Thread John Van Enk
Unless there's a rogue unsafeChangeVotes call in there somewhere. On Tue, Mar 24, 2009 at 4:46 PM, Ross Mellgren rmm-hask...@z.odi.ac wrote: Doesn't matter how many times you seq the results, the thunk has been forced. -Ross On Mar 24, 2009, at 4:45 PM, FFT wrote: I demand a recount!

Re: [Haskell-cafe] The votes are in!

2009-03-24 Thread Ross Mellgren
import Diebold.Unsafe (unsafeChangeVotes) ... ? -Ross On Mar 24, 2009, at 4:47 PM, John Van Enk wrote: Unless there's a rogue unsafeChangeVotes call in there somewhere. On Tue, Mar 24, 2009 at 4:46 PM, Ross Mellgren rmm- hask...@z.odi.ac wrote: Doesn't matter how many times you seq the

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Manlio Perillo
Jake McArthur ha scritto: [...] | With my function, instead, you only have to follow 1 operation: | | Prelude (head, tail) = splitAt n xs I think you are way oversimplifying your own code. ~takeList :: [Int] - [a] - [[a]] ~takeList [] _ = [] ~takeList _ [] = [] ~

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Conal Elliott
Another helpful strategy for the reader is to get smarter, i.e. to invest effort in rising to the level of the writer. Or just choose a different book if s/he prefers. - Conal On Tue, Mar 24, 2009 at 1:44 PM, Manlio Perillo manlio_peri...@libero.itwrote: Yitzchak Gale ha scritto: [...] So

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Conal Elliott
Recursion is the goto of functional programming. Also, Do not confuse what is natural with what is habitual. - Conal On Tue, Mar 24, 2009 at 1:51 PM, Manlio Perillo manlio_peri...@libero.itwrote: Jake McArthur ha scritto: [...] | With my function, instead, you only have to follow 1

Re: [Haskell-cafe] Making videos of your project

2009-03-24 Thread Don Stewart
claus.reinke: Perhaps the make a video slogan doesn't quite explain what is intended - it didn't to me!-) Reading John Udell's short article What is Screencasting? http://www.oreillynet.com/pub/a/oreilly/digitalmedia/2005/11/16/what-is-screencasting.html?page=1 gave me a better idea: the

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Manlio Perillo
Conal Elliott ha scritto: Another helpful strategy for the reader is to get smarter, i.e. to invest effort in rising to the level of the writer. Or just choose a different book if s/he prefers. - Conal This strategy is doomed to failure, unfortunately. We live in the real world,

[Haskell-cafe] Re: Exception handling in numeric computations

2009-03-24 Thread Xiao-Yong Jin
Jake McArthur j...@pikewerks.com writes: Xiao-Yong Jin wrote: | The problem is that there will be many functions using such | a function to invert a matrix, making this inversion | function return Either/Maybe or packing it in a monad is | just a big headache. I disagree. If you try to

Re: [Haskell-cafe] The votes are in!

2009-03-24 Thread John Van Enk
If any one seconds the motion, i'm picking up this part of the thread and putting it in the humor section of the haskell wiki. /jve On Tue, Mar 24, 2009 at 4:48 PM, Ross Mellgren rmm-hask...@z.odi.ac wrote: import Diebold.Unsafe (unsafeChangeVotes)... ? -Ross On Mar 24, 2009, at 4:47 PM,

[Haskell-cafe] Grouping - Map / Reduce

2009-03-24 Thread Gü?nther Schmidt
Hi, let say I got an unordered lazy list of key/value pairs like [('a', 99), ('x', 42), ('a', 33) ... ] and I need to sum up all the values with the same keys. So far I wrote a naive implementation, using Data.Map, foldl and insertWith. The result of this grouping operation, which is

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Peter Verswyvelen
Sometimes that is very hard when the writer is way smarter than the reader :-) 2009/3/24 Conal Elliott co...@conal.net Another helpful strategy for the reader is to get smarter, i.e. to invest effort in rising to the level of the writer. Or just choose a different book if s/he prefers. -

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Lutz Donnerhacke
* Manlio Perillo wrote: But this may be really a question of personal taste or experience. What is more natural? 1) pattern matching 2) recursion or 1) function composition 2) high level functions Composition of library functions is usually much more readable than hand written recursion,

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Conal Elliott
Hah! It sure is. :) On Tue, Mar 24, 2009 at 2:17 PM, Peter Verswyvelen bugf...@gmail.comwrote: Sometimes that is very hard when the writer is way smarter than the reader :-) 2009/3/24 Conal Elliott co...@conal.net Another helpful strategy for the reader is to get smarter, i.e. to invest

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Conal Elliott
The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. - George Bernard Shaw On Tue, Mar 24, 2009 at 2:11 PM, Manlio Perillo manlio_peri...@libero.itwrote: Conal Elliott ha

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Peter Verswyvelen
On Tue, Mar 24, 2009 at 10:11 PM, Manlio Perillo manlio_peri...@libero.itwrote: This strategy is doomed to failure, unfortunately. So it is the good strategy, because Haskell's slogan is avoid success at all cost :-) We live in the real world, compromises are necessary. I don't think so.

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Gregg Reynolds
On Tue, Mar 24, 2009 at 1:42 PM, Manlio Perillo manlio_peri...@libero.it wrote: But, as an example, when you read a function like: buildPartitions xs ns = zipWith take ns . init $ scanl (flip drop) xs ns that can be rewritten (argument reversed) as: takeList :: [Int] - [a] - [[a]]

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Bas van Dijk
2009/3/24 Peter Verswyvelen bugf...@gmail.com: But aren't these two definitions different algoritms? At first sight I think the second one is more efficient than the first one. Some performance numbers: -- module Main where

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Dan Piponi
Miguel Mitrofanov wrote: takeList = evalState . mapM (State . splitAt) However, ironically, I stopped using them for pretty much the same reason that Manlio is saying. Are you saying there's a problem with this implementation? It's the only one I could just read immediately. The trick is to

Re: [Haskell-cafe] Re: Exception handling in numeric computations

2009-03-24 Thread Luke Palmer
On Tue, Mar 24, 2009 at 3:14 PM, Xiao-Yong Jin xj2...@columbia.edu wrote: Jake McArthur j...@pikewerks.com writes: Xiao-Yong Jin wrote: | The problem is that there will be many functions using such | a function to invert a matrix, making this inversion | function return Either/Maybe or

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Zachary Turner
On Tue, Mar 24, 2009 at 4:11 PM, Manlio Perillo manlio_peri...@libero.itwrote: Conal Elliott ha scritto: Another helpful strategy for the reader is to get smarter, i.e. to invest effort in rising to the level of the writer. Or just choose a different book if s/he prefers. - Conal This

Re: [Haskell-cafe] Re: Exception handling in numeric computations

2009-03-24 Thread Luke Palmer
On Tue, Mar 24, 2009 at 3:28 PM, Luke Palmer lrpal...@gmail.com wrote: On Tue, Mar 24, 2009 at 3:14 PM, Xiao-Yong Jin xj2...@columbia.eduwrote: Jake McArthur j...@pikewerks.com writes: Xiao-Yong Jin wrote: | The problem is that there will be many functions using such | a function to

[Haskell-cafe] Re: Exception handling in numeric computations

2009-03-24 Thread Xiao-Yong Jin
Daniel Yokomizo daniel.yokom...@gmail.com writes: On Tue, Mar 24, 2009 at 1:27 PM, Xiao-Yong Jin xj2...@columbia.edu wrote: Henning Thielemann lemm...@henning-thielemann.de writes: Try to never use exception handling for catching programming errors! Division by zero is undefined, thus a

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Jonathan Cast
On Tue, 2009-03-24 at 22:33 +0300, Eugene Kirpichov wrote: Pretty cool once you know what the function does, but I must admit I wouldn't immediately guess the purpose of the function when written in this way. I wouldn't immediately guess the purpose of the function written in any way. I

  1   2   >