Re: [Haskell-cafe] Why doesn't laziness save the day here?

2010-01-05 Thread Luke Palmer
On Mon, Jan 4, 2010 at 6:31 PM, Dale Jordan da...@alum.mit.edu wrote: Can anyone explain why this is looping or point out a better way to generate an arbitrary-length random list while still being able to reuse the generator?  (I'd rather not use split since this generator doesn't support it

Re: [Haskell-cafe] Re: lawless instances of Functor

2010-01-05 Thread Luke Palmer
On Mon, Jan 4, 2010 at 7:25 PM, Maciej Piechotka uzytkown...@gmail.com wrote: On Tue, 2010-01-05 at 08:01 +0900, Derek Elkins wrote: If h . p = q . g then fmap h . fmap p = fmap q . fmap g Setting p = id gives h . id = h = q . g fmap h . fmap id = fmap q . fmap g Using fmap id = id and h = q

Re: [Haskell-cafe] Why doesn't laziness save the day here?

2010-01-05 Thread Stephen Tetley
2010/1/5 Dale Jordan da...@alum.mit.edu: The motivation for iterateR is to be able to have the ultimate consumer determine how many random values to force, but still have a single random generator used throughout the computation. Hi Dale If you want the producer and consumer to run at

[Haskell-cafe] Re: FASTER primes

2010-01-05 Thread Will Ness
Daniel Fischer daniel.is.fischer at web.de writes: Am Montag 04 Januar 2010 16:30:18 schrieb Will Ness: For me, a real smart compiler is one that would take in e.g. (sum $ take n $ cycle $ [1..m]) and spill out a straight up math formula, inside a few ifs maybe (just an aside).

[Haskell-cafe] Using Haskell to write dbus server

2010-01-05 Thread Maciej Piechotka
How to write (is it possible) a dbus server in Haskell? Regards ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: FASTER primes

2010-01-05 Thread Emil Axelsson
Will Ness skrev: Emil Axelsson emax at chalmers.se writes: For me, a real smart compiler is one that would take in e.g. (sum $ take n $ cycle $ [1..m]) and spill out a straight up math formula, inside a few ifs maybe (just an aside). (Also an aside, I couldn't resist...) Then I'm sure

Re: [Haskell-cafe] Re: FASTER primes

2010-01-05 Thread Daniel Fischer
Am Dienstag 05 Januar 2010 10:33:19 schrieb Will Ness: Such a system would probably have to distinguish, at the type level, between [1..m] ; cycle [1..m] ; take n [1..m] ; etc. These would all be not just fuctions, but parts of a type's (here list) behaviour with automatically deduced

[Haskell-cafe] Book reviews for the Journal of Functional Programming

2010-01-05 Thread S.J.Thompson
If you would be interested in reviewing books for the journal of functional programming you can find a list of currently available books at http://www.cs.kent.ac.uk/people/staff/sjt/JFP/ Please let me know if you would be interested in taking on any of these reviewing assignments. Kind

[Haskell-cafe] Re: Why doesn't laziness save the day here?

2010-01-05 Thread oleg
Dale Jordan wrote: The motivation for iterateR is to be able to have the ultimate consumer determine how many random values to force, but still have a single random generator used throughout the computation. My intuition tells me that since the infinite list is produced in finite batches,

[Haskell-cafe] Re: FASTER primes

2010-01-05 Thread Will Ness
Daniel Fischer daniel.is.fischer at web.de writes: Am Montag 04 Januar 2010 19:16:32 schrieb Will Ness: Daniel Fischer daniel.is.fischer at web.de writes: Am Montag 04 Januar 2010 13:25:47 schrieb Will Ness: Euler's sieve is sieve (p:ps) xs = h ++ sieve ps (t `minus` map

Re: [Haskell-cafe] Re: FASTER primes

2010-01-05 Thread Daniel Fischer
Am Dienstag 05 Januar 2010 14:49:58 schrieb Will Ness: ... There are two attempts to eliminate 45. I would say there are two requests to not have 45 in the output. Thers are many possible ways to phrase it. I don't see any problem here. As Melissa (and yourself, I think) have shown,

Re: [Haskell-cafe] Re: Re: Data.Ring -- Pre-announce

2010-01-05 Thread John Van Enk
For those interested, the version of data-clist without Empty is here: http://github.com/sw17ch/data-clist/tree/noEmpty http://github.com/sw17ch/data-clist/tree/noEmpty On Tue, Jan 5, 2010 at 2:53 AM, Luke Palmer lrpal...@gmail.com wrote: On Mon, Jan 4, 2010 at 1:13 PM, Maciej Piechotka

Re: [Haskell-cafe] lawless instances of Functor

2010-01-05 Thread Edward Kmett
Given fmap id = id, fmap (f . g) = fmap f . fmap g follows from the free theorem for fmap. This was published as an aside in a paper a long time back, but I forget where. -Edward Kmett On Mon, Jan 4, 2010 at 5:14 PM, Paul Brauner paul.brau...@loria.fr wrote: Hi, I'm trying to get a deep

[Haskell-cafe] Re: lawless instances of Functor

2010-01-05 Thread Heinrich Apfelmus
Dan Piponi wrote: Derek Elkins wrote: Yes, I have the same problem...Basically, I'm pretty sure the construction of that free theorem doesn't rely on any of the actual details... For a long time I've thought such a higher order free theorem must exist, and I've mentioned it to a few

[Haskell-cafe] 64-bit Bloom filters?

2010-01-05 Thread Ketil Malde
Hi, I've previously used Bloom filters on 32-bit Linux with some success. However, after upgrading to 64 bit, my Bloom filter applications crash or misbehave in random ways. So: is anybody successfully using Bloom filters on 64 bit computers? Although I'm not clear on why it would cause

[Haskell-cafe] Re: 64-bit Bloom filters?

2010-01-05 Thread Maciej Piechotka
On Tue, 2010-01-05 at 16:19 +0100, Ketil Malde wrote: Hi, I've previously used Bloom filters on 32-bit Linux with some success. However, after upgrading to 64 bit, my Bloom filter applications crash or misbehave in random ways. So: is anybody successfully using Bloom filters on 64 bit

Re: [Haskell-cafe] [Very long] (CHP?) Compressing, MD5 and big files

2010-01-05 Thread Neil Brown
Hi, Sorry for the slightly delayed reply -- I didn't have time to look through all your code and understand it until just now. Your code has one (no doubt frustratingly!) small problem, which is in the deadlocking pipeline3: Maciej Piechotka wrote: pipeline3 :: CHP () pipeline3 =

Re: [Haskell-cafe] lawless instances of Functor

2010-01-05 Thread Ryan Ingram
On Mon, Jan 4, 2010 at 3:01 PM, Derek Elkins derek.a.elk...@gmail.com wrote: So without doing funky stuff involving bottoms and/or seq, I believe that fmap id = id implies the other functor law (in this case, not in the case of the general categorical notion of functor.) So lets play with

Re: [Haskell-cafe] 64-bit Bloom filters?

2010-01-05 Thread Bryan O'Sullivan
On Tue, Jan 5, 2010 at 7:19 AM, Ketil Malde ketil+hask...@malde.orgketil%2bhask...@malde.org wrote: I've previously used Bloom filters on 32-bit Linux with some success. However, after upgrading to 64 bit, my Bloom filter applications crash or misbehave in random ways. I'll look into it. Do

[Haskell-cafe] darcs 2.4 beta 1 release

2010-01-05 Thread Reinier Lamers
Hi all, The darcs team would like to announce the immediate availability of darcs 2.4 beta 1. darcs 2.4 will contain many improvements and bugfixes compared to darcs 2.3.1. Highlights are the fast index-based diffing which is now used by all darcs commands, and the interactive hunk-splitting in

Re: [Haskell-cafe] Using Haskell to write dbus server

2010-01-05 Thread Maciej Piechotka
On Tue, 2010-01-05 at 09:37 -0800, John Millikin wrote: Why would you want to? Any conforming D-Bus client can connect to any conforming D-Bus server, so there's no particular advantage to having the same language on both ends of the connection. Additionally, there's a lot of fiddly

Re: [Haskell-cafe] Using Haskell to write dbus server

2010-01-05 Thread John Millikin
There's already three client libraries: http://hackage.haskell.org/package/dbus-client http://hackage.haskell.org/package/network-dbus http://hackage.haskell.org/package/DBus Perhaps there is some confusion? The D-Bus server, or bus, is a service which allows many-to-many communication between

Re: [Haskell-cafe] Using Haskell to write dbus delserver/del insclient exporting objects/ins

2010-01-05 Thread Maciej Piechotka
On Tue, 2010-01-05 at 10:27 -0800, John Millikin wrote: There's already three client libraries: http://hackage.haskell.org/package/dbus-client http://hackage.haskell.org/package/network-dbus http://hackage.haskell.org/package/DBus Perhaps there is some confusion? The D-Bus server, or bus,

Re: [Haskell-cafe] Using Haskell to write dbus delserver/del insclient exporting objects/ins

2010-01-05 Thread John Millikin
Ah, the issue is one of terminology. To me, server is the central bus, and client is any application which connects to the bus. Clients may send or receive any support message type. D-Bus doesn't actually have any mechanism for exporting objects; this is an abstraction, layered over the

[Haskell-cafe] Re: [darcs-users] Iteratees, streams, and mmap

2010-01-05 Thread Heinrich Apfelmus
Jason Dagit wrote: Heinrich Apfelmus wrote: How about tracking the requirement of bounded in the type system? In particular, I'm thinking of a type class class NFData a = Small a where the idea is that all types that can be stored in constant space are members of this class. For

[Haskell-cafe] Re: About Atom

2010-01-05 Thread Tom Hawkins
On Tue, Jan 5, 2010 at 7:05 PM, CK Kashyap ck_kash...@yahoo.com wrote: Hi Tom, Happy new year :) I was wondering if I could use Atom for the purpose of an x86 operating system generator? Hi Kashyap, Ironically Atom was intended to eliminate the need for operating systems -- at least on

[Haskell-cafe] unexpected behavior / bug in try . System.FilePath.Find.findWithHandler

2010-01-05 Thread Thomas Hartman
say you want to execute a find function, but abort the computation if it hits any snags, such as an unreadable directory (eg chmod -R a-r dir). Currently try . System.FilePath.Find.findWithHandler will return an exception wrapped in Right, which seems Wrong. For sure it will just get ignored if

[Haskell-cafe] Re: FASTER primes

2010-01-05 Thread Will Ness
Daniel Fischer daniel.is.fischer at web.de writes: Am Dienstag 05 Januar 2010 14:49:58 schrieb Will Ness: ... There are two attempts to eliminate 45. I would say there are two requests to not have 45 in the output. Thers are many possible ways to phrase it. You solution is

Re: [Haskell-cafe] lawless instances of Functor

2010-01-05 Thread Steffen Schuldenzucker
Brent Yorgey wrote: On Mon, Jan 04, 2010 at 11:49:33PM +0100, Steffen Schuldenzucker wrote: [...] As others have pointed out, this doesn't typecheck; but what it DOES show is that if we had a type class class Endofunctor a where efmap :: (a - a) - f a - f a then it would be

[Haskell-cafe] GHC 6.12.1 FreeBSD binaries

2010-01-05 Thread Michael Snoyman
Does anyone know what the status is of the FreeBSD binaries for the most recent GHC release? In particular, I'm looking or FreeBSD 7.2 binaries. I tried building from source, but it says I don't have iconv library. I'm not enough of a FreeBSD guy to track this one down. Thanks, Michael

[Haskell-cafe] Re: FASTER primes

2010-01-05 Thread Will Ness
Daniel Fischer daniel.is.fischer at web.de writes: So we must make sure that the list of composites that primes' consumes is not the same as that which primes'' consumes. yes that is what I had done too. Duplicated everything. Turns out, it works exactly as you told it would when using the

[Haskell-cafe] Re: FASTER primes

2010-01-05 Thread Will Ness
Daniel Fischer daniel.is.fischer at web.de writes: Am Montag 04 Januar 2010 22:25:28 schrieb Daniel Fischer: memory still grows, but much slower, in my tests, due to the much smaller GC time, it's a bit faster than the version with the original tfold. Not for larger inputs (but not

[Haskell-cafe] ANN: uuid-0.1.2

2010-01-05 Thread Mark Lentczner
Antione and I are please to announce the release of uuid-0.1.2. CHANGES: - added functions toByteString and fromByteString - added 'nil' UUID - added unit tests and benchmarks, built when configured -ftest - major speed up of to/from functions (as well as in general) - added version-3 generation

[Haskell-cafe] Seven ways to store 16 bytes

2010-01-05 Thread Mark Lentczner
In preparing the speed ups in uuid-0.1.2, I investigated various ways to store 16 bytes of data in a Haskell object. Surprisingly, storing as 4 Word32 values in a standard data type worked best for that application. I've extracted out the testing work for that and put it here:

Re: [Haskell-cafe] ANN: uuid-0.1.2

2010-01-05 Thread Antoine Latter
2010/1/5 Mark Lentczner ma...@glyphic.com: Antione and I are please to announce the release of uuid-0.1.2. Thanks for doing the heavy lifting on this one, Mark. Antoine ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Interpreting profiling results

2010-01-05 Thread Patrick LeBoutillier
On Mon, Jan 4, 2010 at 10:05 AM, Daniel Fischer daniel.is.fisc...@web.de wrote: Am Montag 04 Januar 2010 02:17:06 schrieb Patrick LeBoutillier: Hi, This question didn't get any replies on the beginners list, I thought I'd try it here... Sorry, been occupied with other things. I already

Re: [Haskell-cafe] Seven ways to store 16 bytes

2010-01-05 Thread Felipe Lessa
On Tue, Jan 05, 2010 at 04:06:09PM -0800, Mark Lentczner wrote: In preparing the speed ups in uuid-0.1.2, I investigated various ways to store 16 bytes of data in a Haskell object. Surprisingly, storing as 4 Word32 values in a standard data type worked best for that application. However, on

Re: [Haskell-cafe] Seven ways to store 16 bytes

2010-01-05 Thread Bryan O'Sullivan
2010/1/5 Mark Lentczner ma...@glyphic.com There you can find the code that tests storing 16 bytes in various ways: data InWords = WO !Word32 !Word32 !Word32 !Word32 deriving (Eq, Ord) data InList = LI [Word8] deriving (Eq, Ord) data InByteString = BS

Re: [Haskell-cafe] Seven ways to store 16 bytes

2010-01-05 Thread Felipe Lessa
On Tue, Jan 05, 2010 at 04:40:55PM -0800, Bryan O'Sullivan wrote: You've got an extra level of indirection there due to the use of data instead of newtype, so you're paying an additional boxing penalty for everything except your first case. Are you compiling with -funbox-strict-fields? I've

Re: [Haskell-cafe] Re: FASTER primes

2010-01-05 Thread Daniel Fischer
Am Mittwoch 06 Januar 2010 00:09:07 schrieb Will Ness: Daniel Fischer daniel.is.fischer at web.de writes: Am Montag 04 Januar 2010 22:25:28 schrieb Daniel Fischer: memory still grows, but much slower, in my tests, due to the much smaller GC time, it's a bit faster than the version with