[Haskell-cafe] Simple FAST lazy functional primes

2009-11-01 Thread Will Ness
First, here it is: primes = 2: 3: sieve 0 primes' 5 primes' = tail primes sieve k (p:ps) x = [x | x<-[x,x+2..p*p-2], and [(x`rem`p)/=0 | p<-take k primes']] ++ sieve (k+1) ps (p*p+2) (thanks to Leon P.Smith for his brilliant idea of directly generating the spans of odds in

Re: [Haskell-cafe] Base classes can be _ELIMINATED_ with interfaces

2009-11-01 Thread Shelby Moore
Shelby Moore wrote: > ...A "type class" is a polymorphic > (relative to data type) interface, and the polymorphism is strictly > parameterized for the client/consumer of the interface, i.e. the data type > is known to the function that inputs the interface AT COMPILE TIME. >...A problem with virtu

Re: [Haskell-cafe] hackage is down.

2009-11-01 Thread scooter . phd
Untenable for many "corporate" users administratively prohibited from running any P2P software. First really creative use of a DHT I've seen in 6 years, kudos. --Original Message-- From: Shelby Moore Sender: haskell-cafe-boun...@haskell.org To: haskell-cafe@haskell.org ReplyTo: she...@co

[Haskell-cafe] Re: Haskell Weekly News: Issue 137 - October 31, 2009

2009-11-01 Thread Benjamin L . Russell
On Fri, 30 Oct 2009 21:38:25 -0700 (PDT), jfred...@gmail.com wrote: > > ... a new version of > haskell-mode for the lesser of two editors ^^ > > [...] > > haskell-mode 2.5. Svein Ove Aas [14]announced a new version of > haskell-mode for that other 'edit

Re: [Haskell-cafe] Re: Suggested algorithm to control upper bound of space "leaks"

2009-11-01 Thread Shelby Moore
> Thus my analysis so far is Haskell has it correct, and I am suggesting the > missing optimization is to let us automatically put an upper bound on the > space non-determinism (the topic of this thread), then the programmer can > optimize beyond that with... Arghh, the mailing list web archive di

Re: [Haskell-cafe] Re: Suggested algorithm to control upper bound of space "leaks"

2009-11-01 Thread Shelby Moore
This is an opportunity cost minimization problem: http://www.haskell.org/pipermail/haskell-cafe/2009-November/068435.html One of the worst (most unoptimized and conflated) solutions is to force some determinism at the low-level language architecture specifically targetted to achieve determinism i

Re: [Haskell-cafe] hackage is down.

2009-11-01 Thread Shelby Moore
Opportunity cost minimization problem: >> No no no! Why not download the normal (signed) cabal list from the >> DHT (and optionally directly from hackage.haskell.org)? These are all >> the packages that would appear on the website. Why serve any other >> content? All nodes in the DHT may check

Re: [Haskell-cafe] Base classes can be _ELIMINATED_ with interfaces

2009-11-01 Thread Shelby Moore
The "style" of OOP is irrelevant, and if one means by "style" the conflation of the interface with the data and/or use of virtual (runtime) base class inheritance and the style of that induces, then it is an architectural mistake: http://www.haskell.org/pipermail/haskell-cafe/2009-November/068433.

Re: [Haskell-cafe] How to fulfill the "code-reuse" destiny of OOP?

2009-11-01 Thread Shelby Moore
Magicloud wrote: > I am not saying that the code has to be in OO style. When I say OO is > general, I mean I am thinking in OO style. This reflects on modeling, > program structure, even code organization. > Style is how we present things. I think that is less important than > how we think about th

[Haskell-cafe] Base classes can be _ELIMINATED_ with interfaces

2009-11-01 Thread Shelby Moore
I was correct before, except I conflated the word "extended" with "eliminated" in my mind: http://lambda-the-ultimate.org/node/1277#comment-51723 The most robust solution to Tim Sweeney's problem is to rethink what a "class" should be: http://www.haskell.org/haskellwiki/?title=Why_Haskell_matter

Re: [Haskell-cafe] Bulding a library for C users on OS X

2009-11-01 Thread Manuel M T Chakravarty
Chris Eidhof: I'm trying to call a Haskell function from C, on OS X. There's an excellent post [1] by Tomáš Janoušek that explains how to do this on Linux. However, on OS X, it's different. First of all, it looks like the -no-hs-main flag is ignored, because I get the following error: > gh

Re: [Haskell-cafe] hackage is down.

2009-11-01 Thread ??????? ??????
No no no! Why not download the normal (signed) cabal list from the DHT (and optionally directly from hackage.haskell.org)? These are all the packages that would appear on the website. Why serve any other content? All nodes in the DHT may check and make sure the file (or fragment) being serve

Re: [Haskell-cafe] hackage is down.

2009-11-01 Thread Thomas DuBuisson
> + Distributed hackage is DHT network. A DHT has been discussed before on IRC, glad to hear more people voicing the thought. > + Everything is PGP-signed. Yes, that would certainly be needed and also came up in our discussion. > + Everyone can push package into network, everyone can rate pack

Re: [Haskell-cafe] hackage is down.

2009-11-01 Thread ??????? ??????
After some discussion in hask...@conference.jabber.ru, I've got this ideas: + Distributed hackage is DHT network. + Everything is PGP-signed. + Everyone can push package into network, everyone can rate package (malicious / SPAM / unstable / stable / etc). + User maintains list of trusted peopl

Re: [Haskell-cafe] How to fulfill the "code-reuse" destiny of OOP?

2009-11-01 Thread Magicloud Magiclouds
I am not saying that the code has to be in OO style. When I say OO is general, I mean I am thinking in OO style. This reflects on modeling, program structure, even code organization. Style is how we present things. I think that is less important than how we think about things. On Sun, Nov 1, 2009

Re: [Haskell-cafe] Applicative but not Monad

2009-11-01 Thread Conor McBride
On 2 Nov 2009, at 00:11, Ross Paterson wrote: On Sun, Nov 01, 2009 at 04:20:18PM +, Conor McBride wrote: On 31 Oct 2009, at 10:39, Conor McBride wrote: I have an example, perhaps not a datatype: tomorrow-you-will-know Elaborating, one day later, if you know something today, you can ar

[Haskell-cafe] Re: ANN: haskell-mode 2.6

2009-11-01 Thread Svein Ove Aas
On Sun, Nov 1, 2009 at 8:20 PM, Svein Ove Aas wrote: > Fellow haskellers: > > Haskell-mode 2.6 has been released. > > * By web: http://projects.haskell.org/haskellmode-emacs/ > * By darcs: http://code.haskell.org/haskellmode-emacs/ > Since there appears to be some confusion: Indentation is now /o

Re: [Haskell-cafe] Applicative but not Monad

2009-11-01 Thread Ross Paterson
On Sun, Nov 01, 2009 at 04:20:18PM +, Conor McBride wrote: > On 31 Oct 2009, at 10:39, Conor McBride wrote: > >I have an example, perhaps not a datatype: > >tomorrow-you-will-know > > Elaborating, one day later, > > if you know something today, you can arrange to know it tomorrow > if wil

Re: [Haskell-cafe] hackage is down.

2009-11-01 Thread Henning Thielemann
Jochem Berndsen schrieb: On Sun, Nov 01, 2009 at 07:58:00AM -0600, Thomas Hartman wrote: http://hackage.haskell.org Hackage is down currently, I am seeding the torrent by mauke from IRC on http://mauke.ath.cx/tmp/2009-10-19-hackage-archive.torrent Cool, is this the beginning of distribut

Re: [Haskell-cafe] hackage is down.

2009-11-01 Thread Daniel van den Eijkel
you saved my day! thanks, daniel Jochem Berndsen schrieb: On Sun, Nov 01, 2009 at 07:58:00AM -0600, Thomas Hartman wrote: http://hackage.haskell.org Hackage is down currently, I am seeding the torrent by mauke from IRC on http://mauke.ath.cx/tmp/2009-10-19-hackage-archive.torrent C

Re: [Haskell-cafe] ghci REPL output under Haskell Platform on Mac OS X

2009-11-01 Thread Mark Lentczner
On Nov 1, 2009, at 1:05 PM, Henning Thielemann wrote: I had a similar problem with Haskeline and an too old version of terminfo. I assume Haskeline is used by your GHC instead of readline. Aha! That led me to find it: I had TERM set to 'ansi'. ghci + Haskeline works find if TERM is set to an

Re: [Haskell-cafe] Re: Experiments with defunctionalization, church-encoding and CPS

2009-11-01 Thread David Menendez
On Sun, Nov 1, 2009 at 12:31 PM, Heinrich Apfelmus wrote: > David Menendez wrote: >> On Sun, Nov 1, 2009 at 7:12 AM, Heinrich Apfelmus >> wrote: >>> Even then, the results are mixed. The Church-encoding shines in GHCi as >>> it should, but loses its advantage when the code is being compiled. I >>

Re: [Haskell-cafe] Applicative but not Monad

2009-11-01 Thread David Menendez
On Sun, Nov 1, 2009 at 11:20 AM, Conor McBride wrote: > On 31 Oct 2009, at 10:39, Conor McBride wrote: >> On 30 Oct 2009, at 16:14, Yusaku Hashimoto wrote: >> >>> Hello cafe, >>> Do you know any data-type which is Applicative but not Monad? >> >> [can resist anything but temptation] >> >> I have a

Re: [Haskell-cafe] hSeek in Windows

2009-11-01 Thread Svein Ove Aas
On Sun, Nov 1, 2009 at 9:44 PM, Philippos Apolinarius wrote: > To make a long story short, the program compiles, but does not run. This is > interesting, because when Clean compiles an input/output operation it > certainly executes it. In any case, what I should do in order to make file > opera

[Haskell-cafe] Re: ANN: haskell-mode 2.6

2009-11-01 Thread Svein Ove Aas
On Sun, Nov 1, 2009 at 8:20 PM, Svein Ove Aas wrote: > Fellow haskellers: > > Haskell-mode 2.6 has been released. > Make that 2.6.1. Naturally, I broke something, but I think I'm about out of things to break now. -- Svein Ove Aas ___ Haskell-Cafe maili

Re: [Haskell-cafe] Applicative but not Monad

2009-11-01 Thread Henning Thielemann
Yusaku Hashimoto schrieb: > Hello cafe, > Do you know any data-type which is Applicative but not Monad? Here you also find an example: http://www.haskell.org/haskellwiki/Applicative_functor ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://w

Re: [Haskell-cafe] ghci REPL output under Haskell Platform on Mac OS X

2009-11-01 Thread Henning Thielemann
Mark Lentczner schrieb: > My ghci installation has a very annoying behavior: When it takes input, > the result is displayed on the same line as the input, overwriting the > prompt and input. Viz.: > > [1015] : ghci > GHCi, version 6.10.4: http://www.haskell.org/ghc/ :? for help > Loa

Re: [Haskell-cafe] hackage is down.

2009-11-01 Thread Don Stewart
I'd say, community -> dcoutts, Igloo, ijo...@galois.com hackage.haskell.org/darcs.haskell.org -> {dons,heinele...@galois.com ndmitchell: > For future reference, if Hackage or community is down where should > that be reported to? > > On Sun, Nov 1, 2009 at 7:01

Re: [Haskell-cafe] hackage is down.

2009-11-01 Thread Neil Mitchell
For future reference, if Hackage or community is down where should that be reported to? On Sun, Nov 1, 2009 at 7:01 PM, Don Stewart wrote: > This has been reported to the sysadmins. > > tphyahoo: >> http://hackage.haskell.org >> ___ >> Haskell-Cafe mail

Re: [Haskell-cafe] hSeek in Windows

2009-11-01 Thread Neil Mitchell
Hi Philippos, The secret is there in the error message: "seek operations on text-moddles are not allowed on this platform" You need to set your file in to binary mode, with hSetBinaryMode (http://haskell.org/hoogle/?hoogle=hSetBinaryMode) or openBinaryFile (http://haskell.org/hoogle/?hoogle=openB

[Haskell-cafe] hSeek in Windows

2009-11-01 Thread Philippos Apolinarius
As many people guess, I am trying to port programs from Clean 1.3 to Haskell (and also to Clean 2.2, which is easier, but not much easier). Late Professor Wellesley wrote an interesting data base manager in Clean 1.3 that I would like to see in Haskell and Clean 2.2. However, when I tried to imp

[Haskell-cafe] ANN: haskell-mode 2.6

2009-11-01 Thread Svein Ove Aas
Fellow haskellers: Haskell-mode 2.6 has been released. * By web: http://projects.haskell.org/haskellmode-emacs/ * By darcs: http://code.haskell.org/haskellmode-emacs/ This is mainly a bugfix release; to anyone using haskell-indentation, the big news will be that it no longer under some circumsta

Re: [Haskell-cafe] hackage is down.

2009-11-01 Thread Don Stewart
This has been reported to the sysadmins. tphyahoo: > http://hackage.haskell.org > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Ca

Re: [solved] Re: [Haskell-cafe] Calling Haskell from C, Linking with gcc?

2009-11-01 Thread Chris Eidhof
I can confirm that, if you follow the steps on the wiki, you'll end up with a working Mac application. Excellent work John, thanks very much! -chris On 30 okt 2009, at 00:53, John Velman wrote: It's taken 21 days with interruptions, but I finally posted a tutorial with details of what I di

Re: [Haskell-cafe] Experiments with defunctionalization, church-encoding and CPS

2009-11-01 Thread Derek Elkins
On Tue, Oct 13, 2009 at 4:44 AM, Eugene Kirpichov wrote: > I took a toy problem - find the first node satisfying a predicate in a > binary tree, started with a naive Maybe-based implementation - and > experimented with 3 ways of changing the program: >  - Church-encode the Maybe >  - Convert the p

[Haskell-cafe] Re: Experiments with defunctionalization, church-encoding and CPS

2009-11-01 Thread Heinrich Apfelmus
David Menendez wrote: > On Sun, Nov 1, 2009 at 7:12 AM, Heinrich Apfelmus > wrote: >> Even then, the results are mixed. The Church-encoding shines in GHCi as >> it should, but loses its advantage when the code is being compiled. I >> guess we have to look at the core if we want to know what exactl

Re: [Haskell-cafe] Re: Experiments with defunctionalization, church-encoding and CPS

2009-11-01 Thread David Menendez
On Sun, Nov 1, 2009 at 7:12 AM, Heinrich Apfelmus wrote: > Even then, the results are mixed. The Church-encoding shines in GHCi as > it should, but loses its advantage when the code is being compiled. I > guess we have to look at the core if we want to know what exactly is > going on. What optimi

Re: [Haskell-cafe] Re: Newcomers question

2009-11-01 Thread David Menendez
On Sun, Nov 1, 2009 at 11:09 AM, b1g3ar5 wrote: > OK, I understand that now but I've got a supplimentary question. > > If I put: > > instance Eq b => Eq (a -> b) where >    (==) = liftA2 (Prelude.==) You don't need the "Prelude." here. > to do the Eq part I get another error: > >    Couldn't mat

Re: [Haskell-cafe] Re: Newcomers question

2009-11-01 Thread Alexander Dunlap
The type of liftA2 :: Applicative f =>(a -> b -> c) -> f a -> f b -> f c. Thus, the type of liftA2 (==) :: (Eq b, Applicative f) => f b -> f b -> f Bool. In your case, f :: a -> b, so liftA2 (==) :: (Eq b) => (a -> b) -> (a -> b) -> (a -> Bool). (==) takes two arguments, so you're left with the typ

Re: [Haskell-cafe] Applicative but not Monad

2009-11-01 Thread Conor McBride
Hi On 31 Oct 2009, at 10:39, Conor McBride wrote: Hi On 30 Oct 2009, at 16:14, Yusaku Hashimoto wrote: Hello cafe, Do you know any data-type which is Applicative but not Monad? [can resist anything but temptation] I have an example, perhaps not a datatype: tomorrow-you-will-know Elabora

[Haskell-cafe] Re: Newcomers question

2009-11-01 Thread b1g3ar5
OK, I understand that now but I've got a supplimentary question. If I put: instance Eq b => Eq (a -> b) where (==) = liftA2 (Prelude.==) to do the Eq part I get another error: Couldn't match expected type `Bool' against inferred type `a -> Bool' In the expression: liftA2

Re: [Haskell-cafe] ANN: mecha-0.0.2

2009-11-01 Thread Serguey Zefirov
http://iat.ubalt.edu/summers/math/platsol.htm and http://hyperfun.org/wiki/doku.php?id=frep:main CSG on implicitly specified surfaces (F(r)=0) and volumes (F(r)>=0). Min(F,G) is a union, max(F,G) is an intersection. 2009/11/1 Tom Hawkins : >> Neat!  What a cool idea. >>> data Solid = Solid (Vecto

Re: [Haskell-cafe] ANN: mecha-0.0.2

2009-11-01 Thread Tom Hawkins
> Neat!  What a cool idea. > >> data Solid = Solid (Vector -> Bool) > > With a type like this, how is it possible to make solids without hard edges? Now the only way is to create a new primitive. In the future I want to have blended versions of the set operations to apply fillets or bevels at the

Re: [Haskell-cafe] hackage is down.

2009-11-01 Thread Jochem Berndsen
On Sun, Nov 01, 2009 at 07:58:00AM -0600, Thomas Hartman wrote: > http://hackage.haskell.org Hackage is down currently, I am seeding the torrent by mauke from IRC on http://mauke.ath.cx/tmp/2009-10-19-hackage-archive.torrent Cheers, Jochem -- Jochem Berndsen | joc...@functor.nl | joc...@牛在田里.co

[Haskell-cafe] Monad Comprehensions

2009-11-01 Thread Günther Schmidt
Hi all, once again I find myself merely scratching the surface of the power of Haskell, which is exciting and frustrating at the same time. While real world demands require me to find / develop solutions quickly (abstractions for querying data sets) I keep catching glimpses of all this po

[Haskell-cafe] hackage is down.

2009-11-01 Thread Thomas Hartman
http://hackage.haskell.org ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] ANNOUNCE: dbus-core 0.5 and dbus-client 0.1

2009-11-01 Thread Pasqualino "Titto" Assini
I think that we should institute an award for "best documented haskell package" and yours would be my first choice. Congratulations, titto 2009/10/30 John Millikin : > These are pure-Haskell client libraries for using the D-Bus protocol. > D-Bus is heavily used for inter-applicati

[Haskell-cafe] ATTN: Singapore based Haskellers - Singapore FP Users Group First Meeting

2009-11-01 Thread Max Cantor
We are organizing a Functional Programming Users Group in Singapore and our first meeting is Monday, November 2nd at 6 pm. We will meet initially in the Lobby of 8 Shenton Way. Map: http://bit.ly/1PzqlB -or- http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=8+Shenton+Way,+Sing

[Haskell-cafe] Re: Experiments with defunctionalization, church-encoding and CPS

2009-11-01 Thread Heinrich Apfelmus
Eugene Kirpichov wrote: > I took a toy problem - find the first node satisfying a predicate in a > binary tree, started with a naive Maybe-based implementation - and > experimented with 3 ways of changing the program: > - Church-encode the Maybe > - Convert the program into CPS > - Defunctionali