Re: [Haskell-cafe] Building 'text-icu-0.1' on Windows

2009-05-14 Thread Bryan O'Sullivan
On Thu, May 14, 2009 at 10:18 AM, Bryan O'Sullivan b...@serpentine.comwrote: If one of you has the time to dig into this and send a patch that corrects the problem, I'd welcome the help. As I'm sure you can tell, I developed text-icu on Unix, and I don't have regular enough Windows access

Re: [Haskell-cafe] Problem with text and text-icu packages

2009-05-12 Thread Bryan O'Sullivan
On Tue, May 12, 2009 at 7:16 AM, David Carter david.m.car...@gmail.comwrote: Specifically, a1.txt contains bytes 97 and 10, while a2.txt contains bytes 224 160 139 237 144 164. Have I misconstrued things, or is this a bug? It's probably a bug, and it has (I hope) already been found and

Re: [Haskell-cafe] How difficult would creating a collaborative multi-user online virtual world application be in Haskell?

2009-05-07 Thread Bryan O'Sullivan
On Thu, May 7, 2009 at 3:28 AM, Benjamin L.Russell dekudekup...@yahoo.comwrote: One question that has been coming up at the back of my mind for the past several weeks has been how difficult would it be to create a collaborative multi-user online virtual world application in Haskell. It

Re: [Haskell-cafe] Is Haskell a Good Choice for Web Applications? (ANN: Vocabulink)

2009-05-06 Thread Bryan O'Sullivan
On Wed, May 6, 2009 at 4:12 PM, Jason Dagit da...@codersbase.com wrote: While I'm thinking out loud, it would be very cool if someone wrote some articles, say for the monad reader, that follow the formula of the Effective C++ books. The last couple of times I've wanted a book like that, I

Re: [Haskell-cafe] name for monad-like structure?

2009-04-28 Thread Bryan O'Sullivan
On Tue, Apr 28, 2009 at 3:54 PM, Michael Vanier mvanie...@gmail.com wrote: I've stumbled upon a structure that is like a weaker version of a monad, one that supports return and but not =. Has anyone seen this before, and if so, does it have a standard name? That's similar to Applicative,

Re: [Haskell-cafe] Data.Binary, Data.Text and errors

2009-03-15 Thread Bryan O'Sullivan
On Sun, Mar 15, 2009 at 8:40 PM, Alexander Dunlap alexander.dun...@gmail.com wrote: I have noticed that in both Data.Binary and Data.Text (which is still experimental, but still), the decode functions can be undefined (i.e. bottom) if they encounter malformed input. For decoding Unicode,

Re: [Haskell-cafe] How to compare PortNumbers or Bug in Network.Socket?

2009-03-13 Thread Bryan O'Sullivan
On Thu, Mar 12, 2009 at 8:45 PM, Antoine Latter aslat...@gmail.com wrote: So the Ord instance is wrong for the PortNumber type? Well, maybe not wrong. It's out and out wrong. You get different results on machines of different endianness. Now, this begs the question of why not just simply use

Re: [Haskell-cafe] How to compare PortNumbers or Bug in Network.Socket?

2009-03-12 Thread Bryan O'Sullivan
On Thu, Mar 12, 2009 at 2:44 PM, Stefan Schmidt stefanschmid...@googlemail.com wrote: As a work around, I could convert two PortNumbers back to Int-Values before comparing them, but I think the ordering functions for the PortNumber-Type do not work as expected. Or am I wrong? You're right.

Re: [Haskell-cafe] ByteString in patterns

2009-03-10 Thread Bryan O'Sullivan
On Tue, Mar 10, 2009 at 3:28 PM, Manlio Perillo manlio_peri...@libero.itwrote: This seems impossible, since ByteString data constructor is not available. You can use view patterns, per http://www.serpentine.com/blog/2009/01/11/fun-with-haskell-view-patterns/

Re: [Haskell-cafe] bytestring vs. uvector

2009-03-07 Thread Bryan O'Sullivan
On Sat, Mar 7, 2009 at 10:23 PM, Alexander Dunlap alexander.dun...@gmail.com wrote: Hi all, For a while now, we have had Data.ByteString[.Lazy][.Char8] for our fast strings. Now we also have Data.Text, which does the same for Unicode. These seem to be the standard for dealing with lists of

Re: [Haskell-cafe] Re: MPI

2009-03-06 Thread Bryan O'Sullivan
On Thu, Mar 5, 2009 at 10:43 AM, FFT fft1...@gmail.com wrote: Are MPI bindings still the best way of using Haskell on Beowulf clusters? It's my feeling that the bindings stagnated, or are they just very mature? MPI itself hasn't changed in 14 years, so it's not exactly a moving target.

Re: [Haskell-cafe] ANNOUNCE: text and text-icu, fast and comprehensive Unicode support using stream fusion

2009-03-02 Thread Bryan O'Sullivan
On Sun, Mar 1, 2009 at 5:05 AM, Manlio Perillo manlio_peri...@libero.itwrote: This is interesting. Any plans to write a pure Haskell package, using Unicode CLDR data? http://unicode.org/cldr/ Foundational l10n work, however important it may be, is an unrewarding slog, so it's the kind of

[Haskell-cafe] ANNOUNCE: text and text-icu, fast and comprehensive Unicode support using stream fusion

2009-02-27 Thread Bryan O'Sullivan
Harper rthar...@aftereternity.co.uk Duncan Coutts duncan.cou...@worc.ox.ac.uk Bryan O'Sullivan b...@serpentine.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] ANNOUNCE: text and text-icu, fast and comprehensive Unicode support using stream fusion

2009-02-27 Thread Bryan O'Sullivan
On Fri, Feb 27, 2009 at 12:57 AM, George Pollard por...@porg.es wrote: Unfortunately it doesn’t build for me. I have libicu-dev 3.8.1 installed. Yes, as the README states, the text-icu package needs ICU 4.0. The basic text library has no such external dependencies.

Re: [Haskell-cafe] memory-efficient data type for Netflix data - UArray Int Int vs UArray Int Word8

2009-02-23 Thread Bryan O'Sullivan
2009/2/23 Kenneth Hoste kenneth.ho...@ugent.be Does anyone know why the Word8 version is not significantly better in terms of memory usage? Yes, because there's a typo on line 413 of Data/Array/Vector/Prim/BUArr.hs. How's that for service? :-) ___

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bryan O'Sullivan
On Fri, Feb 20, 2009 at 12:44 PM, Achim Schneider bars...@web.de wrote: Bulat, you are right in every aspect. You never did anything wrong. Back when you debugged your code all night long, you were only dreaming. Achim, this doesn't seem like a constructive way to respond. Bulat's already

Re: [Haskell-cafe] Hoogle and Network.Socket

2009-02-19 Thread Bryan O'Sullivan
On Wed, Feb 18, 2009 at 6:50 PM, Thomas DuBuisson thomas.dubuis...@gmail.com wrote: I recall that Niel made sure hoogle doesn't search through non-portable libraries (a shame), but I thought Network.Socket could be used on Windows and yet Hoogle does not give any results for 'socket' or any

Re: [Haskell-cafe] Race condition possible?

2009-02-14 Thread Bryan O'Sullivan
2009/2/14 Peter Verswyvelen bugf...@gmail.com If you have two streams of time/value pairs - using MVars as write-once sampling variables - and both streams are fed from another thread (e.g. timers firing), and you want to merge these two streams into a single stream with monotonic time

Re: [Haskell-cafe] Re: Why binding to existing widget toolkits doesn't make any sense

2009-01-30 Thread Bryan O'Sullivan
On Fri, Jan 30, 2009 at 1:11 PM, Antony Courtney antony.court...@gmail.comwrote: A 2-D vector graphics library such as Java2D ( or Quartz on OS/X or GDI+ on Windows ) supports things like computing tight bounding rectangles for arbitrary shapes, hit testing for determining whether a point is

Re: [Haskell-cafe] Re: Why binding to existing widget toolkits doesn't make any sense

2009-01-30 Thread Bryan O'Sullivan
Hi, Antony - It's good to see you active on here. It's not clear to me if the Cairo API in its current form supports vector-level clipping or constructive area geometry, [...] The Cairo clipping API is very PostScripty; you set up a path and then turn it into a clip region instead of

Re: [Haskell-cafe] How outdated is Hugs?

2009-01-29 Thread Bryan O'Sullivan
On Wed, Jan 28, 2009 at 3:42 PM, Duncan Coutts duncan.cou...@worc.ox.ac.ukwrote: The way I've tested it recently is to build the Setup.hs with ghc and use that to install Cabal for hugs. From then on one can use runhugs to run other Setup scripts. That's good to know, thanks.

Re: [Haskell-cafe] How outdated is Hugs?

2009-01-28 Thread Bryan O'Sullivan
On Tue, Jan 27, 2009 at 1:18 PM, Duncan Coutts duncan.cou...@worc.ox.ac.ukwrote: Not since then, no. However a lot of things work fine, especially if you use a newer Cabal version. I've been unable to figure out how to build Cabal with Hugs 2006.09.04: $ *runhugs -98 Setup configure --hugs

Re: [Haskell-cafe] Haskell not ready for Foo [was: Re: Hypothetical Haskell job in New York]

2009-01-08 Thread Bryan O'Sullivan
On Thu, Jan 8, 2009 at 10:06 AM, Don Stewart d...@galois.com wrote: Note that there even exists an FFI binding to Erlang for Haskell, so that Haskell nodes can seamlessly interact with other nodes speaking Erlang's protocol format. Actually, the erlang package doesn't use the FFI: it speaks

Re: [Haskell-cafe] Haskell not ready for Foo [was: Re: Hypothetical Haskell job in New York]

2009-01-08 Thread Bryan O'Sullivan
On Thu, Jan 8, 2009 at 1:07 PM, Manlio Perillo manlio_peri...@libero.itwrote: Another example is the multipart parser: -- | Read a multi-part message from a 'Handle'. -- Fails on parse errors. hGetMultipartBody :: String -- ^ Boundary - Handle - IO

Re: [Haskell-cafe] Will GHC finally support epoll in 2009?

2009-01-01 Thread Bryan O'Sullivan
On Wed, Dec 31, 2008 at 11:42 AM, Levi Greenspan greenspan.l...@googlemail.com wrote: Hence my question - is it likely that GHC will support epoll in 2009? Yes. I'm working on a patch at the moment. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Missing Network Functions

2008-12-28 Thread Bryan O'Sullivan
On Sun, Dec 28, 2008 at 1:38 AM, Thomas DuBuisson thomas.dubuis...@gmail.com wrote: getNthWord n bs@(PS ptr off len) = inlinePerformIO $ withForeignPtr ptr $ \ptr' - do let p = castPtr $ plusPtr ptr' off peekElemOff p n But even this low

Re: [Haskell-cafe] Missing Network Functions

2008-12-27 Thread Bryan O'Sullivan
2008/12/27 John Van Enk vane...@gmail.com Currently this only has: - htons - htonl - ntohs - ntohl This is all subsumed by the binary package (Data.Binary), where it makes a lot more sense in any instance. ___ Haskell-Cafe mailing

[Haskell-cafe] ANN: Real World Haskell, now shipping

2008-11-25 Thread Bryan O'Sullivan
Good evening - John Goerzen, Don Stewart and I are delighted to announce the availability of our book, Real World Haskell. It is 710 pages long, and published by O'Reilly Media. This is the first book to comprehensively cover modern Haskell programming. From an introduction to functional

Re: [Haskell-cafe] Can't figure out source of race condition when using System.Process

2008-11-02 Thread Bryan O'Sullivan
2008/11/2 Rafal Kolanski [EMAIL PROTECTED] Unfortunately, it also segfaults once in a while, probably indicating I have some kind of race condition ... but I can't figure out why. What is the it that segfaults? The Haskell program shouldn't, at least. That said, your code for reading from

Re: [Haskell-cafe] An irritating Parsec problem

2008-11-01 Thread Bryan O'Sullivan
On Wed, Oct 15, 2008 at 12:20 PM, Jonathan Cast [EMAIL PROTECTED]wrote: This is a bit easier if you supply the missing Applicative instance: const $ parser * eof Too verbose. parser * eof ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Network trouble: what to do?

2008-10-15 Thread Bryan O'Sullivan
On Wed, Oct 15, 2008 at 6:54 AM, Creighton Hogg [EMAIL PROTECTED] wrote: Is there a way around this that I just haven't seen, or should I write a patch to Network to add an extra constructor to SockAddr and code to handle it? Linux and Windows support Bluetooth sockets, but they have

Re: [Haskell-cafe] Restricted file reading monad

2008-10-02 Thread Bryan O'Sullivan
2008/10/1 George Pollard [EMAIL PROTECTED]: Since the ID3 tag as a whole has size information, I need to pass that into the frame-reading functions to ensure that I never read past the end of the total header. What you want for this is the environment monad, also known as the Reader monad in

[Haskell-cafe] Notes on the future of Haskell from ICFP

2008-09-26 Thread Bryan O'Sullivan
Here's a writeup I posted from the conference floor this afternoon: http://www.serpentine.com/blog/2008/09/26/some-notes-on-the-future-of-haskell-and-fp/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Doing something constructive. [Was: Climbing up the shootout...]

2008-09-24 Thread Bryan O'Sullivan
On Wed, Sep 24, 2008 at 12:31 PM, Don Stewart [EMAIL PROTECTED] wrote: Twisted (a Python asynchronous framework) is a confortable environment, but I feel concurrent Haskell is superior. Should be a lot faster, given there's compiled native code, and no global locks. The concurrent Haskell

Re: [Haskell-cafe] performance of map reduce

2008-09-19 Thread Bryan O'Sullivan
On Fri, Sep 19, 2008 at 2:31 PM, Manlio Perillo [EMAIL PROTECTED]wrote: By the way, this phrase: We allow multiple threads to read different chunks at once by supplying each one with a distinct file handle, all reading the same file here:

Re: [Haskell-cafe] readFile and closing a file

2008-09-18 Thread Bryan O'Sullivan
On Wed, Sep 17, 2008 at 6:21 AM, David Roundy [EMAIL PROTECTED] wrote: Eventually the garbage collector should close the file, I believe. That's true, but eventually could be long enough to mean never in practice. It's safest to assume that finalizers will not run at all, never mind in a

Re: [Haskell-cafe] A round of golf

2008-09-18 Thread Bryan O'Sullivan
On Thu, Sep 18, 2008 at 10:02 AM, Creighton Hogg [EMAIL PROTECTED] wrote: If this makes anyone cringe or cry you're doing it wrong, I'd actually like to hear it. Yes, that made me cry :-) Your code seems very convoluted, and quite successfully hides what it's really trying to do. Here's a

Re: [Haskell-cafe] Float instance of 'read'

2008-09-16 Thread Bryan O'Sullivan
On Tue, Sep 16, 2008 at 5:29 AM, Mauricio [EMAIL PROTECTED] wrote: Do you think 'read' (actually, 'readsPrec'?) could be made to also read the international convention (ie., read 1,5 would also work besides read 1.5)? No, as read is really intended to be a language-level tool, not

Re: the real world of Haskell books (Re: [Haskell-cafe] Online Real World Haskell, problem with Sqlite3 chapters)

2008-09-05 Thread Bryan O'Sullivan
On Fri, Sep 5, 2008 at 5:04 AM, Claus Reinke [EMAIL PROTECTED] wrote: Seriously, though, what is the RWH authors' plan for tackling the eternal frustration of Haskell book authors, a moving target? Other tech books face the same problem, which, if they sell successfully and the authors haven't

Re: [Haskell-cafe] Online Real World Haskell, problem with Sqlite3 chapters

2008-09-05 Thread Bryan O'Sullivan
On Fri, Sep 5, 2008 at 3:45 AM, david48 [EMAIL PROTECTED] wrote: In the online version of Real world Haskell, there's a problem with examples in ghci when the module Database.HDBC.Sqlite3 is imported. Oops, should be fixed now. ___ Haskell-Cafe

Re: the real world of Haskell books (Re: [Haskell-cafe] Online RealWorld Haskell, problem with Sqlite3 chapters)

2008-09-05 Thread Bryan O'Sullivan
On Fri, Sep 5, 2008 at 7:50 PM, Derek Elkins [EMAIL PROTECTED] wrote: To make what (I believe) Claus is saying more explicit and direct, add a note to the beginning of the book (or somewhere reasonably prominent) that states something along the lines [...] We will add a link to an errata site

Re: [Haskell-cafe] Linux version of ghc-6.8.3 won't intall or run for me: Floating point exception.

2008-09-04 Thread Bryan O'Sullivan
On Thu, Sep 4, 2008 at 2:24 PM, Don Stewart [EMAIL PROTECTED] wrote: I've downloaded the ghc-6.8.3-i386-unknown-linux.tar.bz2 tarball, which I expected to work on my GNU/Linux box (1.2 GHz Athlon, Debian Sarge). Was there a problem installing GHC from the Debian package system with apt?

Re: [Haskell-cafe] Re: [Haskell] Top Level -

2008-08-29 Thread Bryan O'Sullivan
On Fri, Aug 29, 2008 at 4:33 PM, Dan Weston [EMAIL PROTECTED] wrote: C++ faced this very issue by saying that with global data, uniqueness of initialization is guaranteed but order of evaluation is not. In C++ circles, this is referred to as the static initialization order fiasco, and it is a

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-26 Thread Bryan O'Sullivan
On Mon, Aug 25, 2008 at 2:28 PM, Don Stewart [EMAIL PROTECTED] wrote: I've pushed a decodeFile that does a whnf on the tail after decoding. Does this mean that there are now NFData instances for bytestrings? That would be handy. ___ Haskell-Cafe

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-26 Thread Bryan O'Sullivan
On Tue, Aug 26, 2008 at 3:04 PM, Don Stewart [EMAIL PROTECTED] wrote: No, since I can get whnf with `seq`. However, that does sound like a good idea (a patch to the parallel library? ) I suspect that patching parallel doesn't scale. It doesn't have a maintainer, so it will be slow, and the

Re: [Haskell-cafe] Real World Haskell hits a milestone

2008-08-23 Thread Bryan O'Sullivan
On Fri, Aug 22, 2008 at 1:46 PM, Daryoush Mehrtash [EMAIL PROTECTED] wrote: Are the book's sample code available for download? Not yet. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Real World Haskell hits a milestone

2008-08-22 Thread Bryan O'Sullivan
Hi, all - I'm proud to report that John, Don and I have finished the draft manuscript of our book. It is now available online in its entirety. For more details, see here: http://www.realworldhaskell.org/blog/2008/08/22/our-writing-is-now-complete/ We expect the final book to be published

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-14 Thread Bryan O'Sullivan
On Wed, Aug 13, 2008 at 5:39 PM, Tim Newsham [EMAIL PROTECTED] wrote: So am I understanding you correctly that you believe this is not a bug? That the use Data.Binary.decodeFile function leaks a file descriptor and this is proper behavior? I think he might be saying that decodeFile is not the

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-14 Thread Bryan O'Sullivan
On Wed, Aug 13, 2008 at 3:02 PM, Tim Newsham [EMAIL PROTECTED] wrote: However, I think probably the real blame here should probably go to Data.Binary which doesn't attempt to check that it has consumed all of its input after doing a decode. If decode completes and there is unconsumed data,

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-12 Thread Bryan O'Sullivan
On Tue, Aug 12, 2008 at 5:13 PM, Tim Newsham [EMAIL PROTECTED] wrote: The data type I'm storing is a Map (of maps): type DailyDb = M.Map Date Daily type InstrsDb = M.Map String DailyDb What's going on here? The default marshalling scheme that Binary uses for lists and maps (which are

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-12 Thread Bryan O'Sullivan
On Tue, Aug 12, 2008 at 5:34 PM, Tim Newsham [EMAIL PROTECTED] wrote: I tried to force the data with: loadState db = do d - decode $ B.readFile stateFile let force = sum $ M.elems $ M.size `fmap` d force `seq` atomically $ writeTVar db d and I get the same error

Re: [Haskell-cafe] Dealing with heterogeneously-typed lists?

2008-08-12 Thread Bryan O'Sullivan
2008/8/12 Leif Warner [EMAIL PROTECTED]: I know in a language like Java or C++ I might do some sort of run-time type identification, which would detect the type of each element in the list, and output it appropriately. I think I've missed a step. Why do you want to break the fields of an

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-12 Thread Bryan O'Sullivan
On Tue, Aug 12, 2008 at 6:01 PM, Tim Newsham [EMAIL PROTECTED] wrote: (my keys are dates, which are Enum). This should look at every key in every inner map. Shouldn't that be sufficient to force the entire data set (or do I have to touch the fields in the data elements too?) You might have

Re: [Haskell-cafe] ANN: Tutorial on information visualization and visual analytics in Haskell

2008-08-09 Thread Bryan O'Sullivan
On Sat, Aug 9, 2008 at 11:30 AM, Jefferson Heard [EMAIL PROTECTED] wrote: I'll be building a site around it until then, complete with compilable code examples, but I thought I would let everyone get a sneak peek at the long version of the tutorial before I'm done with it. That's a beautiful

Re: [Haskell-cafe] code review? store server, 220loc.

2008-08-04 Thread Bryan O'Sullivan
On Sat, Aug 2, 2008 at 10:13 PM, Tim Newsham [EMAIL PROTECTED] wrote: Anyone interested in critiquing some code? I'm looking for ideas for making it faster and/or simpler: http://www.thenewsh.com/%7Enewsham/store/Server5.hs The code looks fairly reasonable, although most of your strictness

Re: [Haskell-cafe] Re: www.haskell.org is currently very slow in responding to HTTP requests

2008-07-31 Thread Bryan O'Sullivan
On Wed, Jul 30, 2008 at 2:54 AM, Ashley Yakeley [EMAIL PROTECTED] wrote: Other software versions: Linux 2.4.21 (latest is 2.6.26) Apache 2.0.46 (latest is 2.2.9) MySQL 3.23.58 (latest is 5.0.51a) PHP 4.3.2 (latest is 5.2.6) MediaWiki 1.5.4 (latest is 1.12)

Re: [Haskell-cafe] blas bindings, why are they so much slower the C?

2008-06-18 Thread Bryan O'Sullivan
On Tue, Jun 17, 2008 at 9:00 PM, Anatoly Yakovenko [EMAIL PROTECTED] wrote: here is the C: #include cblas.h #include stdlib.h int main() { int size = 1024; int ii = 0; double* v1 = malloc(sizeof(double) * (size)); double* v2 = malloc(sizeof(double) * (size)); for(ii = 0; ii

Re: [Haskell-cafe] Bit streams

2008-06-18 Thread Bryan O'Sullivan
On Tue, Jun 17, 2008 at 1:05 PM, Andrew Coppin [EMAIL PROTECTED] wrote: Before I sit down and spend 3 months designing my own library from scratch, does anybody know of an existing library that allows you to do what Binary does, but with single-bit precision? The binary-strict library

Re: [Haskell-cafe] Problem building GHC 6.8.3

2008-06-18 Thread Bryan O'Sullivan
On Wed, Jun 18, 2008 at 5:28 AM, Daniel Fischer [EMAIL PROTECTED] wrote: Sorry, probably stupid questions for knowledgeable folks Not stupid at all, but possibly the wrong mailing list. glasgow-haskell-users would usually be a better place to ask. Setup: Haddock's internal GHC version must

Re: [Haskell-cafe] Re: Bit Streams

2008-06-18 Thread Bryan O'Sullivan
On Wed, Jun 18, 2008 at 11:00 AM, Adam Langley [EMAIL PROTECTED] wrote: On Wed, Jun 18, 2008 at 10:52 AM, Don Stewart [EMAIL PROTECTED] wrote: Would you recommend binary-strict over bitsyntax now? Or are none yet entirely satisfactory Probably, yes. Bitsyntax was, after all, the first Haskell

Re: [Haskell-cafe] Re: Patrick Perry's BLAS package

2008-06-08 Thread Bryan O'Sullivan
Judah Jacobson wrote: My preference is to use an autoconf script to solve that problem. (build-type: Configure in the cabal file.) That approach would not work well for BLAS. The various BLAS libraries have profoundly different performance characteristics, and you wouldn't want to get the

Re: [Haskell-cafe] [ANN] bloomfilter 1.0 - Fast immutable and mutable Bloom filters

2008-05-31 Thread Bryan O'Sullivan
David MacIver wrote: The Hashable stuff in there looks like it might be independently useful. Probably, yes. Any interest in splitting it out into an independent package or is it really intended to be something fairly specific to the Bloom filter implementation? I'll split them if there's

Re: [Haskell-cafe] Copying Arrays

2008-05-30 Thread Bryan O'Sullivan
Ketil Malde wrote: I guess this is where I don't follow: why would you need more short strings for Unicode text than for ASCII or 8-bit latin text? Because ByteString is optimised for dealing with big blobs of binary data, its performance when you split a big ByteString into a pile of words is

[Haskell-cafe] [ANN] bloomfilter 1.0 - Fast immutable and mutable Bloom filters

2008-05-30 Thread Bryan O'Sullivan
I'm pleased to announce the availability of a fast Bloom filter library for Haskell. A Bloom filter is a probabilistic data structure that provides a fast set membership querying capability. It does not give false negatives, but has a tunable false positive rate. (A false positive arises when

Re: [Haskell-cafe] Copying Arrays

2008-05-29 Thread Bryan O'Sullivan
Tom Harper wrote: I'm trying to implement some file I/O where I can read in a file to an array, but do so without having to know how much space I will need. Why not just read it into a lazy ByteString? Are you looking to use an array with elements of a different type? You could then convert

Re: [Haskell-cafe] Copying Arrays

2008-05-29 Thread Bryan O'Sullivan
Tom Harper wrote: Because I'm writing the Unicode-friendly ByteString =p Perhaps I'm not understanding. Why wouldn't you use ByteString for I/O, even if you're writing a different library? After all, ByteString's own internals use memcpy. b

Re: [Haskell-cafe] Re: Write Haskell as fast as C. [Was: Re: GHC predictability]

2008-05-16 Thread Bryan O'Sullivan
Andrew Coppin wrote: On the other hand, this is the anti-theisis of Haskell. We start with a high-level, declarative program, which performs horribly, and end up with a manually hand-optimised blob that's much harder to read but goes way faster. Buh? This is hard to read? mean n m = go 0 0

Re: [Haskell-cafe] GHC predictability

2008-05-13 Thread Bryan O'Sullivan
Darrin Thompson wrote: These tricks going into Real World Haskell? Some will, yes. For example, the natural and naive way to write Andrew's mean function doesn't involve tuples at all: simply tail recurse with two accumulator parameters, and compute the mean at the end. GHC's strictness

Re: [Haskell-cafe] MonadPlus

2008-05-09 Thread Bryan O'Sullivan
Andrew Coppin wrote: But here's a question: what is the purpose of the MonadPlus class? It gives you a way of working with monads as monoids. Consider a Parsec example: metasyntactic = text foo `mplus` text bar `mplus` text baz You'll get back whichever one matched, in left-to-right-order,

Re: [Haskell-cafe] MonadPlus

2008-05-09 Thread Bryan O'Sullivan
Andrew Coppin wrote: ...so it's a kind of choice operator? Run all actions until you get to one that succeeds and return the result from that? In the context of Parsec, yes. In the grander scheme of things, the behaviour depends on whatever is appropriate for the particular monad you're

Re: [Haskell-cafe] Ann: Win32-notify 0.1

2008-04-20 Thread Bryan O'Sullivan
Niklas Broberg wrote: So API suggestions would be most welcome! Your challenge will lie in finding an API that can be implemented efficiently on all concerned platforms. I don't know what the characteristics of the Windows or OS X notification APIs are, but if you use inotify on Linux, and you

Re: [Haskell-cafe] Parallel weirdness [new insights]

2008-04-20 Thread Bryan O'Sullivan
Bulat Ziganshin wrote: yes. multi-threaded GC is planned gor next ghc version, afair To be clear, it'll be a parallel GC, not a concurrent one. The former still stops all threads, but runs the collector on multiple cores at once. The latter performs collection while mutator threads are still

Re: [Haskell-cafe] letting go of file handles and Data.Binary

2008-04-20 Thread Bryan O'Sullivan
Ben wrote: this throws a permission denied exception, presumably because the file is still open when the removeFile is called. Yes. The file handle opened by encodeFile won't be closed until its finalizer is run. There is no guarantee that the finalizer will be run immediately. In fact, you

Re: [Haskell-cafe] letting go of file handles and Data.Binary

2008-04-20 Thread Bryan O'Sullivan
Doh! For all that I wrote about encodeFile, substitute decodeFile. You'll need to write something to force the value that you're decoding. Something like this ought to do the trick. import Data.Binary (Binary, decode) import Control.Exception (bracket) import qualified Data.ByteString.Lazy as L

Re: [Haskell-cafe] letting go of file handles and Data.Binary

2008-04-20 Thread Bryan O'Sullivan
Ben wrote: i played around with all that you suggested, and came to the conclusion that i don't understand seq! That's certainly possible, but you also got the type of your first forcing function wrong :-) strictDecodeFile :: Binary a = FilePath - (a - b) - IO () encodeFile fname dat

[Haskell-cafe] [ANN] cabal-rpm 0.4

2008-04-18 Thread Bryan O'Sullivan
I've just uploaded version 0.4 of cabal-rpm to Hackage. This is a program that generates an RPM package from a Cabal package. RPM is the package format used by several major Linux distributions. New in this version are support for GHC 6.8.2 and the Cabal 1.2 release series. Download:

Re: [Haskell-cafe] announce: Glome.hs-0.3 (Haskell raytracer)

2008-04-18 Thread Bryan O'Sullivan
Jim Snow wrote: The concurrency bug has to do with excessive memory use, and was discussed earlier here on the mailing list (search for Glome). http://hackage.haskell.org/trac/ghc/ticket/2185 Interesting. I looked at your test case. I can reproduce your problem when I build with the

Re: [Haskell-cafe] Re: Doing without IORef

2008-04-05 Thread Bryan O'Sullivan
Jinwoo Lee wrote: To summarize, embed IORef inside ReaderT and use that IORef to read/change the file path info, both in IO monad and MyState monad. Is this right? Yep. In case you ever want to multithread your program, you might want to use an MVar instead of an IORef. b

Re: [Haskell-cafe] Re: Doing without IORef

2008-04-04 Thread Bryan O'Sullivan
Jinwoo Lee wrote: I haven't used ReaderT. What are the advantages when using ReaderT instead of StateT in this case? A StateT lets you replace one IORef with another, since it gives you mutable state. A ReaderT gives you *immutable* state, so the type system guarantees that you'll always be

Re: [Haskell-cafe] Re: HDBC, character encoding

2008-04-04 Thread Bryan O'Sullivan
John Goerzen wrote: I've looked at the Data.ByteString.Internal API, and it looks like that ought to work. Oddly, the Data.ByteString.Lazy.Internal API does not seem to export enough to work with it in FFI. It doesn't usually make sense to use lazy ByteStrings directly with the FFI. Most

Re: [Haskell-cafe] Shouldn't this loop indefinitely = take (last [0..]) [0..]

2008-04-03 Thread Bryan O'Sullivan
Olivier Boudry wrote: main = do putStrLn $ show $ take (last [0..]) [0..] or simply run: take (last [0..]) [0..] in ghci, it first hang for about one minute and then starts to generate an infinite list. It's not an infinite list. It's a list of length maxBound::Int, as

Re: [Haskell-cafe] Re: Shouldn't this loop indefinitely = take (last [0..]) [0..]

2008-04-03 Thread Bryan O'Sullivan
Don Stewart wrote: Which, incidentally, also explains why Don couldn't reproduce it on a 64- bit system. There, instead of hanging for about a minute before printing out the list, it would hang for about 4 billion minutes. A billion minutes here, a billion minutes there, and pretty soon

Re: [Haskell-cafe] [GSoC] Porting HaRe to use the GHC API

2008-03-30 Thread Bryan O'Sullivan
Chaddaï Fouché wrote: My proposal for the SoC is to port HaRe (its parsing and refactoring) to use the GHC API instead of Programmatica. This is an appealing idea, and it has the kind of tight scope that makes it plausible as a summer project. Excellent! b

Re: [Haskell-cafe] Random Monad

2008-03-24 Thread Bryan O'Sullivan
Matthew Pocock wrote: On Monday 24 March 2008, Henning Thielemann wrote: On Mon, 24 Mar 2008, Matthew Pocock wrote: Who currently maintains the Random monad code? I have some patches to contribute. Do you refer to the code on the wiki? No, to the code in darcs at

Re: [Haskell-cafe] An ugly zip3 problem..

2008-03-22 Thread Bryan O'Sullivan
Michael Feathers wrote: Would Haskell's type system allow you to pass a function of arbitrary arity, discern its arity, use that information to construct the appropriate structure for iteration, and then apply it? The answer is probably yes, because almost every time I've thought that a type

Re: [Haskell-cafe] IO () and IO [()]

2008-03-12 Thread Bryan O'Sullivan
Lennart Augustsson wrote: Yes, I wish Haskell had a 1-tuple. The obvious syntax is already taken, but I could accept something different, like 'One a'. Python's one-tuple syntax is (1,). The obvious difficulty with adapting this notation to Haskell lies in how one might write the constructor

Re: [Haskell-cafe] [GSoC] A data parallel physics engine

2008-03-10 Thread Bryan O'Sullivan
Roman Cheplyaka wrote: I have not very deep knowledge about both NDP and physics engines. I've done some physics simulation work for games. One could certainly learn enough to be able to write a straightforward implementation in that time. Broadphase collision detection is easy; narrowphase

Re: [Haskell-cafe] Starting Haskell with a web application

2008-03-05 Thread Bryan O'Sullivan
Jonathan Gardner wrote: Where do I get started in writing a web app with Haskell? I am looking more for a framework like Pylons and less like Apache, if that helps. The closest we currently have to a web framework is Happs (http://happs.org/), but it uses the kitchen sink of advanced and

Re: [Haskell-cafe] Starting Haskell with a web application

2008-03-05 Thread Bryan O'Sullivan
Don Stewart wrote: Perhaps it is time for a haskell web apps wiki page, if there isn't one, outlining the approaches, Indeed. In addition to the code you mention, people like Adam Langley and Johan Tibbell are taking on corners of the web app problem space in a more modern context. It's

Re: [Haskell-cafe] Generating a random list

2008-02-29 Thread Bryan O'Sullivan
Milos Hasan wrote: so let's say I want to generate a list of N random floats. The elegant way of doing it would be to create an infinite lazy list of floats and take the first N, but for N = 1,000,000 or more, this overflows the stack. The reason is apparently that the take function is not

Re: [Haskell-cafe] Stack overflow

2008-02-27 Thread Bryan O'Sullivan
On Feb 27, 2008, at 3:02 AM, Grzegorz Chrupala wrote: I was getting stack overflows when using Data.Binary with a few other datastructures so I decided to try this option. I hacked a Data.Binary.Strict module which is basically a copy and paste of Data.Binary, [...] We've recently hit the

[Haskell-cafe] Bay Area talk tomorrow, on concurrent/parallel Haskell

2008-02-27 Thread Bryan O'Sullivan
Satnam Singh of Microsoft Research will be speaking about concurrent and parallel programming at Stanford tomorrow. Details here: http://www.realworldhaskell.org/blog/2008/02/28/stanford-haskell-talk-2008-02-28/ b ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Bryan O'Sullivan
Donn Cave wrote: But in Haskell, you cannot read a file line by line without writing an exception handler, because end of file is an exception! Ah, yet another person who has never found System.IO.hIsEOF :-) Whereas in C or Python you would check the return value of read against zero or an

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Bryan O'Sullivan
Stefan O'Rear wrote: Well... that's what I meant by break horribly. Buh? That behaviour makes perfect sense to me. b ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Bryan O'Sullivan
Stefan O'Rear wrote: I'll bet that breaks horribly in the not-so-corner case of /dev/tty. Actually, it doesn't. It seems to do a read behind the scenes if the buffer is empty, so it blocks until you type something. b ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Why is this so inefficient?

2008-02-05 Thread Bryan O'Sullivan
Jefferson Heard wrote: I thought this was fairly straightforward, but where the marked line finishes in 0.31 seconds on my machine, the actual transpose takes more than 5 minutes. I know it must be possible to read data in haskell faster than this. I took a look into this, writing a similar,

Re: [Haskell-cafe] reading from the cdrom drive on Red Hat

2008-02-01 Thread Bryan O'Sullivan
Adam Langley wrote: The error you are seeing comes from the operating system. No, it's the Haskell runtime turning a -1 return from read into an exception. You need to call hIsEOF to check whether you've hit EOF, then break out of the loop. b

Re: [Haskell-cafe] Poor libraries documentation

2008-01-30 Thread Bryan O'Sullivan
Neil Mitchell wrote: For a start, its probably a good idea to mention that cos is an abbreviation of cosine (most people will know, but its handy to state it). Secondly, and much more importantly, it should state whether these measurements are in degrees or radians. It should also state

Re: [Haskell-cafe] Simple network client

2008-01-30 Thread Bryan O'Sullivan
Peter Verswyvelen wrote: Then I tried the seq hack to force the handle opened by readFile to be closed, but that did not seem to work either. For example, the following still gave access denied: main = do cs - readFile L:/Foo.txt writeFile L:/Foo.txt $ seq (length cs) cs This is

Re: [Haskell-cafe] Simple network client

2008-01-30 Thread Bryan O'Sullivan
Adam Langley wrote: Also, if you want the above approach (read a bit, see if it's enough), see IncrementalGet in the binary-strict package which is a Get with a continuation monad that stops when it runs out of bytes and returns a continuation that you can give more data to in the future.

<    1   2   3   4   5   >