Re: [Haskell-cafe] Test if a file is empty or stat in haskell

2009-03-06 Thread Anish Muttreja
On Thu, Mar 05, 2009 at 03:43:22PM -0500, Thomas DuBuisson wrote: getFileStatus, fileSize ... Great, thanks. BTW, Hoogle does not seem to  know about System.Posix.Files, though it did point me to System.IO.FileSize which would also have served the purpose. Yep, this was discussed in

Re: [Haskell-cafe] monadic MapReduce

2009-03-05 Thread Anish Muttreja
On Tue, Mar 03, 2009 at 07:27:35AM -1000, Tim Newsham wrote: How about this. Is there a reason why I can't replace the variables b and c in the type signature of mapReduce with with (IO b') and (IO c'). b and c can be any types. mapReduce :: Strategy (IO b')-- evaluation strategy for

[Haskell-cafe] Test if a file is empty or stat in haskell

2009-03-05 Thread Anish Muttreja
I am looking for a way to test if a file is empty. Something like isFileEmpty along the lines of System.Directory.doesFileExist? A function that wraps stat would also serve the purpose. I get the feeling that someone must have felt the need for this before me, but Google search not yield

Re: [Haskell-cafe] Test if a file is empty or stat in haskell

2009-03-05 Thread Anish Muttreja
On Thu, Mar 05, 2009 at 08:15:03PM +0100, Daniel Fischer wrote: Am Donnerstag, 5. März 2009 19:56 schrieb Anish Muttreja: I am looking for a way to test if a file is empty. Something like isFileEmpty along the lines of System.Directory.doesFileExist? If you're on a *nixy OS

Re: [Haskell-cafe] monadic MapReduce

2009-03-02 Thread Anish Muttreja
On Mon, Mar 02, 2009 at 04:10:41PM +0100, Manlio Perillo wrote: Anish Muttreja ha scritto: On Sun, Mar 01, 2009 at 07:25:56PM +0100, Manlio Perillo wrote: Hi. I have a function that do some IO (take a file path, read the file, parse, and return some data), and I would like to parallelize

Re: [Haskell-cafe] monadic MapReduce

2009-03-01 Thread Anish Muttreja
On Sun, Mar 01, 2009 at 07:25:56PM +0100, Manlio Perillo wrote: Hi. I have a function that do some IO (take a file path, read the file, parse, and return some data), and I would like to parallelize it, so that multiple files can be parsed in parallel. I would like to use the simple

Re: [Haskell-cafe] Re: Data.Map: Enumerating ordered subset of keys

2009-02-08 Thread Anish Muttreja
Maybe you want Data.Map.partition (\key - key = key1 key = key2) map HTH, Anish On Sun, 08 Feb 2009 23:02:37 -0800, Jared Updike jupd...@gmail.com wrote: It looks like two Map.splits will do what I need except for allowing more exact testing of = vs. (since == elements are left out of both

Re: [Haskell-cafe] type error using ghc 6.10.1, not in previous versions

2009-01-12 Thread Anish Muttreja
On Mon, Jan 12, 2009 at 07:14:36PM -0800, Tim Bauer wrote: Hi all. Under I have some old code that broke under ghc 6.10.1. Under (6.6.1), 6.8.1 (and I think 6.8.2), this compiles. import Prelude hiding(catch) import Control.Concurrent import Control.Exception(catch,throw,evaluate) async ::

[Haskell-cafe] Possible GC bug

2009-01-09 Thread Anish Muttreja
Hi, I have a program that seems to run into occasional garbage collection-related core dumps. The problem typically only occurs after the program has been running for a while and is consuming a large amount of memory (5 - 16GB). The large memory consumption is expected because the program

Re: [Haskell-cafe] Possible GC bug

2009-01-09 Thread Anish Muttreja
Thanks, I have reported a bug.I hope the stack trace is useful. Cheers, Anish On Fri, Jan 09, 2009 at 02:21:58PM -0800, Don Stewart wrote: Report it as a GHC bug to the GHC team, here: http://hackage.haskell.org/trac/ghc/newticket?type=bug if you believe it is a bug. Cheers, Don