Re: [Haskell-cafe] License of CloudHaskell code write by Haskell language.

2012-10-16 Thread Edsko de Vries
Hi, The version of Cloud Haskell you cite is a prototype. I recommend you use the 'distributed-process' package instead; it is licensed under BSD3. Edsko ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] I would like a clarification about Enumerators and Iteratees, please :)

2012-10-16 Thread Alfredo Di Napoli
Hi guys, I've started playing with Iteratee and Enumerators: very cool and addictive stuff. I have wrote this simple code: https://gist.github.com/3899017 In a nutshell, it gives back the number of occurences for a single char in case the argument passed from the command line is a single char,

Re: [Haskell-cafe] I would like a clarification about Enumerators and Iteratees, please :)

2012-10-16 Thread Gregory Collins
You have a space leak in countCharBS. Put a bang pattern on your accumulator. On Tue, Oct 16, 2012 at 2:46 PM, Alfredo Di Napoli alfredo.dinap...@gmail.com wrote: Hi guys, I've started playing with Iteratee and Enumerators: very cool and addictive stuff. I have wrote this simple code:

Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-10-16 Thread Jake McArthur
On Mon, Oct 15, 2012 at 11:29 PM, Dan Doel dan.d...@gmail.com wrote: I'm uncertain where this, compositional means written as the composition of functions, thing started. But it is not what I, and I'm sure any others mean by the term, compositional. You're right. It's a rather recent, as far

Re: [Haskell-cafe] forkProcess, forkIO, and multithreaded runtime

2012-10-16 Thread Michael Snoyman
On Mon, Oct 15, 2012 at 6:30 PM, Joey Hess j...@kitenet.net wrote: Michael Snoyman wrote: I think I have a misunderstanding of how forkProcess should be working. Ultimately this relates to some bugs in the development version of keter, but I've found some behavior in a simple test program

Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-10-16 Thread AUGER Cédric
Le Tue, 16 Oct 2012 07:35:34 +0530, damodar kulkarni kdamodar2...@gmail.com a écrit : @Jake In my opinion, this is not as nice as the do-notation version, but at least it's compositional: That's an important point you have made, as Haskellers value code composition so much. If code

Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-10-16 Thread AUGER Cédric
Le Tue, 16 Oct 2012 09:51:29 -0400, Jake McArthur jake.mcart...@gmail.com a écrit : On Mon, Oct 15, 2012 at 11:29 PM, Dan Doel dan.d...@gmail.com wrote: I'd be down with putting join in the class, but that tends to not be terribly important for most cases, either. Join is not the most

Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-10-16 Thread Daniel Peebles
Although I agree that Functor should be a superclass of Monad, the two methods of the Monad typeclass _are_ sufficient to make any instance into a Functor in a mechanical/automatic way. The language may not know it, but return/bind is equivalent in power to fmap/return/join. Apart from bind being

Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-10-16 Thread AUGER Cédric
Le Tue, 16 Oct 2012 11:22:08 -0400, Daniel Peebles pumpkin...@gmail.com a écrit : Although I agree that Functor should be a superclass of Monad, the two methods of the Monad typeclass _are_ sufficient to make any instance into a Functor in a mechanical/automatic way. The language may not know

Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-10-16 Thread Dan Doel
On Tue, Oct 16, 2012 at 10:37 AM, AUGER Cédric sedri...@gmail.com wrote: join IS the most important from the categorical point of view. In a way it is natural to define 'bind' from 'join', but in Haskell, it is not always possible (see the Monad/Functor problem). As I said, from the

Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-10-16 Thread AUGER Cédric
Le Tue, 16 Oct 2012 11:58:44 -0400, Dan Doel dan.d...@gmail.com a écrit : On Tue, Oct 16, 2012 at 10:37 AM, AUGER Cédric sedri...@gmail.com wrote: join IS the most important from the categorical point of view. In a way it is natural to define 'bind' from 'join', but in Haskell, it is not

Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-10-16 Thread Brandon Allbery
On Tue, Oct 16, 2012 at 1:19 PM, AUGER Cédric sedri...@gmail.com wrote: What do you mean by demonstrate? If you do not want to fit the mathematical presentation, then I have nothing to demonstrate, you have your point of view, I have mine and they differ. Now, if you want to I think the

Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-10-16 Thread David Thomas
I think the version below (with a Functor or Applicative superclass) is clearly the right answer if we were putting the prelude together from a clean slate. You can implement whichever is easiest for the particular monad, use whichever is most appropriate to the context (and add optimized

Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-10-16 Thread Simon Thompson
Not sure I really have anything substantial to contribute, but it's certainly true that if you see a - m b as a generalisation of the usual function type, a - b, then return generalises the identity and kleisli generalises function composition. This makes the types pretty memorable (and

Re: [Haskell-cafe] forkProcess, forkIO, and multithreaded runtime

2012-10-16 Thread Alexander Kjeldaas
On 15 October 2012 09:47, Michael Snoyman mich...@snoyman.com wrote: Hi all, I think I have a misunderstanding of how forkProcess should be working. Ultimately this relates to some bugs in the development version of keter, but I've found some behavior in a simple test program which I

Re: [Haskell-cafe] forkProcess, forkIO, and multithreaded runtime

2012-10-16 Thread Donn Cave
Since we're talking about forkIO here - not forkOS - is it possible to control the use of OS threads to avoid this problem? As I understand it, the problem is with real OS threads. A program running entirely in multiple `green' threads will fork to the same set of threads in the same state,

Re: [Haskell-cafe] forkProcess, forkIO, and multithreaded runtime

2012-10-16 Thread Richard O'Keefe
The problems with forkProcess really are not Haskell's fault. You will find warnings in the documentation for C's fork(): There are limits to what you can do in the child process. To be totally safe you should restrict yourself to only executing async-signal safe

Re: [Haskell-cafe] forkProcess, forkIO, and multithreaded runtime

2012-10-16 Thread Mike Meyer
On Tue, 16 Oct 2012 21:55:44 +0200 Alexander Kjeldaas alexander.kjeld...@gmail.com wrote: There are variants of this, but the meta-problem is that at the point in time when you call forkProcess, you must control all threads, ensuring that *all invariants hold*. Thus no locks held, no thread

Re: [Haskell-cafe] Issue building ghc on NetBSD/amd64

2012-10-16 Thread lhagan
On Mon, Oct 15, 2012 at 8:51 PM, Chatsiri Ratana insider...@gmail.comwrote: Should be not include intermediate C by call .hc file? It should be using flags as below. ./configure --build=x86_64-unknown-netbsd --host=x86_64-unknown-netbsd --target=x86_64-unknown-netbsd Change flag in

Re: [Haskell-cafe] Issue building ghc on NetBSD/amd64

2012-10-16 Thread Donn Cave
Quoth lhagan lhaga...@gmail.com, Just tried changing the flag in build.mk, but I get the same error. Also, I'm pretty sure I need the --enable-hc-boot flag. Without it, I get: configure: error: GHC is required unless bootstrapping from .hc files. Unless I've missed a whole lot of progress on

Re: [Haskell-cafe] License of CloudHaskell code write by Haskell language.

2012-10-16 Thread Chatsiri Ratana
On Tue, Oct 16, 2012 at 6:20 PM, Edsko de Vries edskodevr...@gmail.comwrote: Hi, The version of Cloud Haskell you cite is a prototype. I recommend you use the 'distributed-process' package instead; it is licensed under BSD3. Edsko Hello All, I finding issues for forking project in