Re: [Haskell-cafe] Equational Reasoning goes wrong

2007-07-23 Thread Janis Voigtlaender
I am surprised that no one has mentioned David Sands' work yet in this thread. He has studied this issue extensively in the nineties (setting out from an analogous problem as the one given in Neil's original post). There are a number of papers that came out of this. The one probably most

RE: [Haskell-cafe] Optimising UTF8-CString - String marshaling, plus comments on withCStringLen/peekCStringLen

2007-07-23 Thread Bayley, Alistair
Weird... I sent this over a month ago, and was a bit puzzled as to why it didn't appear on the list. Has it been waiting for a moderator to release? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alistair Bayley Sent: 04 June 2007 09:44 To:

Re: Re[2]: [Haskell-cafe] i need wxHaskell compiled for ghc 6.6.1 on Windows

2007-07-23 Thread Neil Mitchell
Hi - native appearance I think that's pretty good these days, the native theme on Windows has been getting better and better from Gtk+ 2.6 to the current 2.10 wxHaskell used to be 10 times better than Gtk, now its about twice as good. The Gtk developers are seriously addressing some of the

[Haskell-cafe] Re: Practise fingerspelling with Haskell! (Code cleanup request)

2007-07-23 Thread apfelmus
Mirko Rahn wrote: apfelmus wrote: Note that using Peano-numbers can achieve the same effect of stopping the length calculation as soon as more than one character is different. data Nat = Zero | Succ Nat deriving (Eq, Ord) instance Num Nat where (Succ x) + y = Succ (x+y)

RE: [Haskell-cafe] Optimising UTF8-CString - String marshaling, plus comments on withCStringLen/peekCStringLen

2007-07-23 Thread Bayley, Alistair
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stefan O'Rear fromUTF8Ptr unboxes fine for me with HEAD and 6.6.1. - the chr function tests that its Int argument is less than 1114111, before constructing the Char. It'd be nice to avoid this test. You want unsafeChr

Re: [Haskell-cafe] Equational Reasoning goes wrong

2007-07-23 Thread J.N. Oliveira
Janis Voigtlaender wrote: () http://portal.acm.org/citation.cfm?doid=227699.227716 This paper cites works by L. Kott, but not his PhD thesis Des substitutions dans les systemes d'equations algebriques sur le magma (Univ. Paris VII, 1979) which is (as far as I can remember) among the

[Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-23 Thread Simon Marlow
Dan Licata wrote: Simon PJ and I are implementing view patterns, a way of pattern matching against abstract datatypes, in GHC. Our design is described here: http://hackage.haskell.org/trac/ghc/wiki/ViewPatterns If you have any comments or suggestions about this design, we'd love to hear

Re: [Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-23 Thread Jon Harrop
On Monday 23 July 2007 16:57:08 Simon Marlow wrote: Dan Licata wrote: Simon PJ and I are implementing view patterns, a way of pattern matching against abstract datatypes, in GHC. Our design is described here: http://hackage.haskell.org/trac/ghc/wiki/ViewPatterns If you have any

[Haskell-cafe] partitions of a multiset

2007-07-23 Thread Brent Yorgey
Hi all, I've written some code to generate set partitions: import Control.Arrow import Data.List -- pSet' S generates the power set of S, with each subset paired -- with its complement. -- e.g. pSet' [1,2] = [([1,2],[]),([1],[2]),([2],[1]),([],[1,2])]. pSet' :: [a] - [([a],[a])] pSet'

[Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-23 Thread apfelmus
Simon Marlow wrote: Dan Licata wrote: Simon PJ and I are implementing view patterns, a way of pattern matching against abstract datatypes, in GHC. Our design is described here: http://hackage.haskell.org/trac/ghc/wiki/ViewPatterns If you have any comments or suggestions about this design,

Re: [Haskell-cafe] In-place modification

2007-07-23 Thread Andrew Coppin
Sebastian Sylvan wrote: On 10/07/07, Andrew Coppin [EMAIL PROTECTED] wrote: Hint: If you can get readable/maintainable Haskell to run on more than one core automatically, you're onto something pretty special. ;-) Soon, have a little patience :-) See for example:

[Haskell-cafe] filterFirst

2007-07-23 Thread Alexteslin
Hi, first I like to thank all of you guys - it really helps! I am still on a same chapter with higher order functions and this function is also confusing. But before i even define this function i am getting the type error - i don't know why? So i wrote the simpler one like: filterAlpha :: (a -

[Haskell-cafe] Re: filterFirst

2007-07-23 Thread apfelmus
Alexteslin wrote: filterAlpha :: (a - Bool) - [a] - [a] filterAlpha f [] = [] filterAlpha f (x:xs) |f x= x : filterAlpha xs |otherwise = filterAlpha xs and i am getting this error message: Type error in application Expression :filterAlpha xs Type: [b]

Re: [Haskell-cafe] filterFirst

2007-07-23 Thread Jonathan Cast
On Monday 23 July 2007, Alexteslin wrote: Hi, first I like to thank all of you guys - it really helps! I am still on a same chapter with higher order functions and this function is also confusing. But before i even define this function i am getting the type error - i don't know why? So i

[Haskell-cafe] Re: [Haskell] View patterns in GHC: Request forfeedback

2007-07-23 Thread Rene de Visser
Simon PJ and I are implementing view patterns, a way of pattern matching against abstract datatypes, in GHC. Our design is described here: http://hackage.haskell.org/trac/ghc/wiki/ViewPatterns If you have any comments or suggestions about this design, we'd love to hear them. You can

Re: [Haskell-cafe] Weird ghci behaviour?

2007-07-23 Thread Dan Piponi
Ian said: Can you please give a complete testcase for the problem you're seeing? I took my test case and started deleting lines from it to simplify it. And now I'm not seeing the problem at all and I can't reproduce it, even though when I originally posted I was getting it repeatably. I'm

[Haskell-cafe] Another analogy

2007-07-23 Thread Andrew Coppin
From the guy who brought you data in Haskell is like an undead quantum cat, I present the following: If programming languages were like vehicles, C would be a Ferrari, C++ would be a Porshe, Java would be a BWM and Haskell would be a hovercraft. It doesn't even have WHEELS! There is no

Re: [Haskell-cafe] Another analogy

2007-07-23 Thread Jonathan Cast
On Monday 23 July 2007, Andrew Coppin wrote: From the guy who brought you data in Haskell is like an undead quantum cat, I present the following: If programming languages were like vehicles, C would be a Ferrari, C++ would be a Porshe, Java would be a BWM and Haskell would be a hovercraft.

Re: [Haskell-cafe] Re: [Haskell] View patterns in GHC: Request forfeedback

2007-07-23 Thread Jonathan Cast
On Monday 23 July 2007, Rene de Visser wrote: Simon PJ and I are implementing view patterns, a way of pattern matching against abstract datatypes, in GHC. Our design is described here: http://hackage.haskell.org/trac/ghc/wiki/ViewPatterns If you have any comments or suggestions about

Re: [Haskell-cafe] Another analogy

2007-07-23 Thread Brent Yorgey
On 7/23/07, Andrew Coppin [EMAIL PROTECTED] wrote: From the guy who brought you data in Haskell is like an undead quantum cat, I present the following: If programming languages were like vehicles, C would be a Ferrari, C++ would be a Porshe, Java would be a BWM and Haskell would be a

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 Jonathan Cast
On Monday 23 July 2007, Hugh Perkins wrote: 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, How do you get that Haskell has to be small?

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] filterFirst

2007-07-23 Thread Alexteslin
apfelmus wrote: Alexteslin wrote: filterAlpha :: (a - Bool) - [a] - [a] filterAlpha f [] = [] filterAlpha f (x:xs) |f x= x : filterAlpha xs |otherwise = filterAlpha xs and i am getting this error message: Type error in application Expression :filterAlpha xs

[Haskell-cafe] Re: Code and Perf. Data for Prime Finders (was: Genuine Eratosthenes sieve)

2007-07-23 Thread Dave Bayer
As an exercise, trying to understand the beautiful paper Stream Fusion From Lists to Streams to Nothing at All Duncan Coutts, Roman Leshchinskiy and Don Stewart http://www.cse.unsw.edu.au/~dons/papers/CLS07.html

[Haskell-cafe] Re: partitions of a multiset

2007-07-23 Thread DavidA
Here's the approach I would try. 1. Use Data.List.group to group your multiset, eg [1,1,2] - [[1,1],[2]] 2. Now apply your partitions function to each of the groups [[1,1],[2]] - [ [([1,1],[]), ([1],[1]), ([],[1,1])], [([2],[]), ([],[2])] ] (Actually of course, you can probably write a simpler

Re: [Haskell-cafe] filterFirst

2007-07-23 Thread Dan Weston
If you find it tedious to pass parameters that never change, remember that you can access symbols defined in the enclosing environment (closure), freeing you from passing it on each time: filterAlpha :: (a - Bool) - [a] - [a] filterAlpha f = filterAlpha' where filterAlpha' [] = []

[Haskell-cafe] Re: Frustrating experience of a wannabe contributor

2007-07-23 Thread Dave Bayer
Simon Michael simon at joyful.com writes: Hi Andreas - very good problem report, thanks. I have just cleaned up the archive links at http://www.haskell.org/haskellwiki/Mailing_lists a bit. I added the ever-excellent gmane and an overview of all archives. Ok, this list was crushing my

[Haskell-cafe] Re: Code and Perf. Data for Prime Finders (was: Genuine Eratosthenes sieve)

2007-07-23 Thread Dave Bayer
It appears that at least on gmane, my posts to this thread ended up as singletons, breaking the thread. Here are the posts: http://article.gmane.org/gmane.comp.lang.haskell.cafe/26426 http://article.gmane.org/gmane.comp.lang.haskell.cafe/26466 ___

Re: [Haskell-cafe] Another analogy

2007-07-23 Thread Andrew Wagner
Yeah, but to learn how to start the hovercraft, you have to take a 6-week training class. On 7/23/07, Hugh Perkins [EMAIL PROTECTED] wrote: 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

Re: [Haskell-cafe] Another analogy

2007-07-23 Thread Michael Vanier
I submit my own attempts for consideration: http://www.cs.caltech.edu/~mvanier/hacking/rants/cars.html Mike Andrew Coppin wrote: From the guy who brought you data in Haskell is like an undead quantum cat, I present the following: If programming languages were like vehicles, C would be a

Re: Re[2]: [Haskell-cafe] i need wxHaskell compiled for ghc 6.6.1 on Windows

2007-07-23 Thread shelarcy
Hello Eric, I found that wxc Visual Studio Project File for wxWidgets-2.4.2 is broken now. And I think that I forgot to notice some awkward point for Windows So I put newer Windows binary on my project's file space. http://sourceforge.net/project/showfiles.php?group_id=168626 On Sun, 22

Re: Re[2]: [Haskell-cafe] i need wxHaskell compiled for ghc 6.6.1 on Windows

2007-07-23 Thread shelarcy
Hellow Bulat, On Sun, 22 Jul 2007 23:20:44 +0900, Eric Kow [EMAIL PROTECTED] wrote: Please try the darcs version darcs get http://darcs.haskell.org/wxhaskell thanks. should i follow building instructions from homepage/ directory or there are another one? I don't remember if this is

[Haskell-cafe] Re: Code and Perf. Data for Prime Finders (was: Genuine Eratosthenes sieve)

2007-07-23 Thread Melissa O'Neill
Dave Bayer wrote: Here is another prime sieve. It's great to know people are still having fun with this stuff... I've added your implementation to the zipfile available at http://www.cs.hmc.edu/~oneill/code/haskell-primes.zip (FWIW, I added specializations for Int and Integer and also

Re: [Haskell-cafe] Minim interpreter

2007-07-23 Thread Chaddaï Fouché
I wrote such an interpreter though the code is quite ugly due to my lack of experience in the field as well as with Haskell... It took me the better part of two hour but mainly because I didn't use Parsec before this. I would of course be happy of any suggestion to amend it but a plain rewriting

Re: [Haskell-cafe] Re: Code and Perf. Data for Prime Finders (was: Genuine Eratosthenes sieve)

2007-07-23 Thread Neil Mitchell
Hi But for the current version of my code, there is still a bit of a performance gap between our two methods. Here are the stats I get (ghc -O3, 2.4GHz x86): Are you aware that -O3 is slower than -O2 and -O in ghc? If you want fast code then specify -O2, not -O3. Thanks Neil

Re: [Haskell-cafe] Re: Code and Perf. Data for Prime Finders (was: Genuine Eratosthenes sieve)

2007-07-23 Thread Melissa O'Neill
Neil Mitchell wrote: -O3 is slower than -O2 and -O in ghc? If you want fast code then specify -O2, not -O3. Oops. That ought to have been -O2. But from what I can tell, -O3 is harmless (at least in this case). Both invocations generate identical executables, at least for these examples

Re: [Haskell-cafe] Minim interpreter

2007-07-23 Thread Chaddaï Fouché
There was more than some bugs, and a lack of strictness that led to a stack overflow for high values of x... So here is a better version (not quite there still, but better). -- Jedaï {-# OPTIONS -fbang-patterns -funbox-strict-fields #-} module Minim (Statement (..), Test (..), Program (..), Expr

[Haskell-cafe] My Haskell ICFP '07 Programming Competition entry

2007-07-23 Thread Antoine Latter
Hello, I'd just like to call attention to a few recent blog posts containing myself and my friend Creighton's entry into the ICFP '07 programming competition. Mainly because I'm looking to find someone who knows Haskell and the contest so they can tell me where my bug is :) Also, if anyone

[Haskell-cafe] Lazy in either argument?

2007-07-23 Thread Dan Weston
I am trying to get my feet wet with Haskell threads with the following problem, inspired by a recent post (http://www.haskell.org/pipermail/haskell-cafe/2007-July/029408.html) saying that: Since there's no way to have a function be lazy in both arguments, the implicit convention is to make

Re: [Haskell-cafe] NDP documentation

2007-07-23 Thread Bulat Ziganshin
Hello Andrew, Monday, July 23, 2007, 11:50:32 PM, you wrote: Actually, I was just reading through all the Data Parallel Haskell and Nested Data Parallelism documentation. It says in several places that parallel array comprehensions are available since GHC 6.6, but they are broken; please