Re: [Haskell-cafe] object oriented technique

2011-03-31 Thread Tad Doxsee
Tillmann, Thank you for your detailed reply. It was a real eye opener. I hadn't seen anything like that before. It seems that your ShapeClass is very similar to, and plays the same role as, the Class ShapeC from my example. I wonder if that was how haskellers implemented shared functions

[Haskell-cafe] BlockedIndefinitelyOnMVar exception

2011-03-31 Thread Mitar
Hi! Is there a way to disable throwing BlockedIndefinitelyOnMVar exceptions? Because I am doing small program where I do not care if some threads block. As at the end user will have to interrupt the program anyway. Mitar ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] pool, persistent, persistent-sqlite: Space leak

2011-03-31 Thread Michael Snoyman
Good catch, that was most definitely a space leak in pool. I've uploaded version 0.0.1.1, would you mind testing? Thanks, Michael On Thu, Mar 31, 2011 at 2:52 AM, Ertugrul Soeylemez e...@ertes.de wrote: Hello Michael, hello fellow Haskellers, there seems to be a space leak in either 'pool',

[Haskell-cafe] cabal advice: library paths

2011-03-31 Thread Michael Snoyman
Hi all, I have a package[1] which uses some system libraries (Qt to be precise). On Linux (and I'm hoping Mac), it's able to use pkg-config to determine which libraries are necessary and where to find all the files. On Windows, I've been less than successful using pkg-config. However, I *was*

Re: [Haskell-cafe] Computational Physics in Haskell

2011-03-31 Thread Azeem -ul-Hasan
I am only a sophomore and haven't taken any course in Computational Physics. So what I would like will be to take a library or program with some excellent documentation and use it as a base for learning about computational physics and Haskell. This is one of the things I plan to do in

Re: [Haskell-cafe] Encoding-aware System.Directory functions

2011-03-31 Thread Ketil Malde
John Millikin jmilli...@gmail.com writes: OSX's chief weirdness is that its GUI programs swap ':' and '/' when displaying filenames. A remnant from the bad old days of MacOS 10, where : was the path separator, and / was a perfectly good character to use in filenames. -- | Try to decode a

Re: [Haskell-cafe] Encoding-aware System.Directory functions

2011-03-31 Thread Max Bolingbroke
On 31 March 2011 09:13, Ketil Malde ke...@malde.org wrote: -- | Try to decode a FilePath to Text, using the current locale encoding. If -- the filepath is invalid in the current locale, it is decoded as ASCII and -- any non-ASCII bytes are replaced with a placeholder. Why not map them to

Re: [Haskell-cafe] Iteratee, ghc 6.12/7.0 strange behaviour - epollControl: permission denied (Operation not permitted)

2011-03-31 Thread John Lato
Message: 15 Date: Mon, 28 Mar 2011 21:31:39 +0400 From: Michael A Baikov pa...@bk.ru Subject: [Haskell-cafe] Iteratee, ghc 6.12/7.0 strange behaviour - epollControl: permission denied (Operation not permitted) To: haskell-cafe@haskell.org Message-ID:

Re: [Haskell-cafe] BlockedIndefinitelyOnMVar exception

2011-03-31 Thread Edward Z. Yang
I don't know if there's a way to disable it, but you can wrap all your spawned threads with an exception handler that catches BlockedIndefinitelyOnMVar and ignores it. If the thread blocks indefinitely, it's as good as dead, so there won't be any difference in behavior. Cheers, Edward

Re: [Haskell-cafe] how to optmize this code?

2011-03-31 Thread Christian Maeder
Am 31.03.2011 05:59, schrieb Felipe Almeida Lessa: On Wed, Mar 30, 2011 at 2:39 PM, Gilberto Garciagiba@gmail.com wrote: fkSum :: Int - [Int] - Int fkSum a [] = 0 fkSum a (b) = foldl (+) 0 (filter (\x - isMultiple x b) [1..a]) Daniel Fischer and Yves Parès gave you good suggestions

Re: [Haskell-cafe] BlockedIndefinitelyOnMVar exception

2011-03-31 Thread Gregory Collins
I find this behaviour a little annoying. Sometimes I *want* the thread to block indefinitely! I.e. I want it to block until it receives a KillThread exception. Is there a better way to accomplish that without waiting on an MVar which will never fill? As a workaround what I've been doing lately is

Re: [Haskell-cafe] BlockedIndefinitelyOnMVar exception

2011-03-31 Thread Neil Brown
On 31/03/11 11:03, Gregory Collins wrote: I'm guessing the trigger condition for BlockedIndefinitelyOnMVar is blocked and mvar refcount == 1 It's not simply a reference count (the thread that's blocked forever can hold multiple references to the MVar and it's still blocked indefinitely).

Re: [Haskell-cafe] how to optmize this code?

2011-03-31 Thread Daniel Fischer
On Thursday 31 March 2011 11:45:00, Christian Maeder wrote: Since we don't have a function sum' in the Prelude (should we have it?) I think we should. I wonder what happens if you just use sum. Will the sum (based on sum' so without -DUSE_REPORT_PRELUDE) be strict enough? I don't know

Re: [Haskell-cafe] ANNOUNCE: enumerator 0.4.8

2011-03-31 Thread John Lato
Message: 7 Date: Tue, 29 Mar 2011 22:39:12 -0400 From: wren ng thornton w...@freegeek.org Subject: Re: [Haskell-cafe] ANNOUNCE: enumerator 0.4.8 To: haskell-cafe@haskell.org Message-ID: 4d9297d0.7060...@freegeek.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 3/29/11

Re: [Haskell-cafe] DSL for task dependencies

2011-03-31 Thread oliver mueller
thanks for pointing out the openshake implementation. when i remember correctly neil mitchell mentioned s.th. at the haskell implementors workshop about making shake available sometimes later. it's a bit sad to see that shake is completely off the table since it really looked good. after all...a

Re: [Haskell-cafe] Computational Physics in Haskell

2011-03-31 Thread Mihai Maruseac
On Thu, Mar 31, 2011 at 10:54 AM, Azeem -ul-Hasan aze...@live.com wrote: I am only a sophomore and haven't taken any course in Computational Physics. So what I would like will be to take a library or program with some excellent documentation and use it as a base for  learning about

Re: [Haskell-cafe] how to optmize this code?

2011-03-31 Thread Yves Parès
Just to be sure, because I am not quite familiar with the dark hairy internals of GHC: Of course, given a type signature that allows strictness to be inferred. You mean a signature with no type variables and types that are know to GHC as being strict? (Like Int - Int - Int instead of (Num a) =

Re: [Haskell-cafe] ArrowLoop and streamprocessors

2011-03-31 Thread Mario Blažević
On 11-03-30 05:29 PM, Mathijs Kwik wrote: Hi all, I'm playing around a bit with arrows (more specifically, something like a CPS style streamprocessor as described in Generalising Monads to Arrows by John Hughes). I had struggled with the same problem a year ago, and I concluded it was

Re: [Haskell-cafe] DSL for task dependencies

2011-03-31 Thread Max Bolingbroke
On 31 March 2011 12:44, oliver mueller oliver.muel...@gmail.com wrote: it's a bit sad to see that shake is completely off the table since it really looked good. I think Neil has had trouble getting permission to release the code, which is why I wrote openshake. maybe openshake can fill in

[Haskell-cafe] Parallel Haskell Digest 1

2011-03-31 Thread Eric Y. Kow
Parallel Haskell Digest === Edition 1 2011-03-31 http://www.well-typed.com/blog/52 Hello Haskellers! If you're in the mood for a HWN chaser, I'd like to introduce the first Parallel Haskell Digest, a newsletter aiming to show off all the work that's going on using parallelism

Re: [Haskell-cafe] how to optmize this code?

2011-03-31 Thread Daniel Fischer
On Thursday 31 March 2011 14:27:59, Yves Parès wrote: Just to be sure, because I am not quite familiar with the dark hairy internals of GHC: Of course, given a type signature that allows strictness to be inferred. You mean a signature with no type variables and types that are know to

Re: [Haskell-cafe] BlockedIndefinitelyOnMVar exception

2011-03-31 Thread Brandon Moore
From: Gregory Collins g...@gregorycollins.net Sent: Thu, March 31, 2011 5:03:09 AM I find this behaviour a little annoying. Sometimes I *want* the thread to block indefinitely! I.e. I want it to block until it receives a KillThread exception. Is there a better way to accomplish that

Re: [Haskell-cafe] ArrowLoop and streamprocessors

2011-03-31 Thread Matthew Steele
On Mar 30, 2011, at 5:29 PM, Mathijs Kwik wrote: So loop really doesn't seem to help here, but I couldn't find another way either to feed outputs back into the system. What I need is: Either A B ~ Either C B - A ~ C Does such a thing exist? Based on your description, it sounds to me like you

[Haskell-cafe] Haskellers in St. Louis?

2011-03-31 Thread aditya siram
Hi all, I'm looking to start a Haskell user group in St. Louis, MO. Anyone Haskellers or people interested in learning Haskell around these parts? -deech ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] ArrowLoop and streamprocessors

2011-03-31 Thread David Menendez
On Thu, Mar 31, 2011 at 11:01 AM, Matthew Steele mdste...@alum.mit.edu wrote: On Mar 30, 2011, at 5:29 PM, Mathijs Kwik wrote: So loop really doesn't seem to help here, but I couldn't find another way either to feed outputs back into the system. What I need is: Either A B ~ Either C B - A ~

Re: [Haskell-cafe] NOT Iteratee, ghc 6.12/7.0 strange behaviour -epollControl: permission denied (Operation not permitted)

2011-03-31 Thread Michael A Baikov
It works fine up to the point when makefdCallback tries to use GHC.Conc.threadWaitRead on fd So my example is simplifed in to this: import System.Posix.IO import GHC.Conc main = do fd - openFd /etc/passwd ReadOnly Nothing defaultFileFlags threadWaitRead fd-- the big bang

Re: [Haskell-cafe] NOT Iteratee, ghc 6.12/7.0 strange behaviour -epollControl: permission denied (Operation not permitted)

2011-03-31 Thread Bryan O'Sullivan
On Thu, Mar 31, 2011 at 11:19 AM, Michael A Baikov pa...@bk.ru wrote: import System.Posix.IO import GHC.Conc main = do fd - openFd /etc/passwd ReadOnly Nothing defaultFileFlags threadWaitRead fd-- the big bang happens right here. closeFd fd There were a couple of bugs in

Re: [Haskell-cafe] NOT Iteratee, ghc 6.12/7.0 strange behaviour-epollControl: permission denied (Operation not permitted)

2011-03-31 Thread Michael A Baikov
I am running 7.0.3. -Original Message- On Thu, Mar 31, 2011 at 11:19 AM, Michael A Baikov pa...@bk.ru wrote: import System.Posix.IO import GHC.Conc main = do fd - openFd /etc/passwd ReadOnly Nothing defaultFileFlags threadWaitRead fd-- the big bang happens

Re: [Haskell-cafe] BlockedIndefinitelyOnMVar exception

2011-03-31 Thread Mitar
Hi! On Thu, Mar 31, 2011 at 4:37 PM, Brandon Moore brandon_m_mo...@yahoo.com wrote: If you plan to send an exception, you must have the ThreadId saved elsewhere, which should prevent the BlockedIndefinitelyOnMVar exception. But this behavior is something they wish to remove in future versions

Re: [Haskell-cafe] BlockedIndefinitelyOnMVar exception

2011-03-31 Thread Brandon Moore
- Original Message From: Mitar mmi...@gmail.com To: Brandon Moore brandon_m_mo...@yahoo.com Cc: Gregory Collins g...@gregorycollins.net; Edward Z. Yang ezy...@mit.edu; Haskell Cafe haskell-cafe@haskell.org Sent: Thu, March 31, 2011 2:06:31 PM Subject: Re: [Haskell-cafe]

Re: [Haskell-cafe] Byte Histogram

2011-03-31 Thread Gábor Lehel
On Thu, Mar 17, 2011 at 11:14 PM, Andrew Coppin andrewcop...@btinternet.com wrote: Right. So somebody else came up with an idea similar to mine, but since nobody could agree on anything more than a rough idea, nothing actually got done...(?) Well, I also got the sense that it would be more

Re: [Haskell-cafe] how to optmize this code?

2011-03-31 Thread Ryan Ingram
On Thu, Mar 31, 2011 at 7:29 AM, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: Err, terminology problem here. Strictly speaking, a function is strict iff f _|_ = _|_ while we are talking here about evaluation strategies, so we should better have spoken of eager vs. deferred

Re: [Haskell-cafe] Encoding-aware System.Directory functions

2011-03-31 Thread Richard O'Keefe
On 31/03/2011, at 9:13 PM, Ketil Malde wrote: John Millikin jmilli...@gmail.com writes: OSX's chief weirdness is that its GUI programs swap ':' and '/' when displaying filenames. A remnant from the bad old days of MacOS 10, where : was the path separator, and / was a perfectly good

[Haskell-cafe] A maintenance command of Haskell cabal packages

2011-03-31 Thread 山本和彦
Hello cafe, Let me announce a maintenance command of Haskell cabal packages. http://www.mew.org/~kazu/proj/cab/en/ cab is a MacPorts-like maintenance command of Haskell cabal packages. Some part of this program is a wrapper to ghc-pkg and cabal. If you are always confused due to

Re: [Haskell-cafe] A maintenance command of Haskell cabal packages

2011-03-31 Thread Conrad Parker
On 1 April 2011 10:48, Kazu Yamamoto k...@iij.ad.jp wrote: Hello cafe, Let me announce a maintenance command of Haskell cabal packages.        http://www.mew.org/~kazu/proj/cab/en/ cab is a MacPorts-like maintenance command of Haskell cabal packages. Some part of this program is a

Re: [Haskell-cafe] A maintenance command of Haskell cabal packages

2011-03-31 Thread 山本和彦
whoah, it has uninstall!!! awesome! It just unregisters libraries not delete them actually. But I guess it is enough for you. The cabal-delete command does delete libraries and I'm planning to integrate cab and cabal-delete. But the author of cabal-delete is now suffering from the Tsunami in

Re: [Haskell-cafe] A maintenance command of Haskell cabal packages

2011-03-31 Thread Jason Dagit
On Thu, Mar 31, 2011 at 7:07 PM, Kazu Yamamoto k...@iij.ad.jp wrote: whoah, it has uninstall!!! awesome! It just unregisters libraries not delete them actually. But I guess it is enough for you. The cabal-delete command does delete libraries and I'm planning to integrate cab and

Re: [Haskell-cafe] A maintenance command of Haskell cabal packages

2011-03-31 Thread 山本和彦
Hello, Have you read this? http://www.reddit.com/r/haskell/related/f3ykj/ psa_use_cabaldev_to_solve_dependency_problems/ I did know this page. I will read it later. Thank you. cabal-dev is a wrapper around cabal. It creates the directory cabal-dev in your current directory when you run

Re: [Haskell-cafe] A maintenance command of Haskell cabal packages

2011-03-31 Thread Rogan Creswick
On Thu, Mar 31, 2011 at 7:19 PM, Kazu Yamamoto k...@iij.ad.jp wrote: cabal-dev is a wrapper around cabal. It creates the directory cabal-dev in your current directory when you run commands. Yes, I know. But when I typed cabal-devel install on a package directory, nothing happened. Can you

Re: [Haskell-cafe] A maintenance command of Haskell cabal packages

2011-03-31 Thread 山本和彦
Hello, cabal-dev is a wrapper around cabal. It creates the directory cabal-dev in your current directory when you run commands. Yes, I know. But when I typed cabal-devel install on a package directory, nothing happened. Can you give a specific example? Surely *something* happened :) I