Re: [Haskell-cafe] Simple network client

2008-01-30 Thread Bryan O'Sullivan
Adam Langley wrote: On Jan 30, 2008 1:07 PM, Adam Langley [EMAIL PROTECTED] wrote: So, if I don't hear otherwise soon, I'll probably push a new version of binary-strict later on today with the interface above. It's in the darcs now, http://darcs.imperialviolet.org/binary-strict Thanks!

[Haskell-cafe] ANN: bytestringparser-0.2, a Parsec-like parser for lazy ByteStrings

2008-01-25 Thread Bryan O'Sullivan
Some time ago, Jeremy Shaw wrote a Parsec clone for lazy ByteStrings. I've been using it for a while, and have made substantial changes to it along the way. It's very fast, using the same manual unpacking trick as the binary package to keep performance nippy. It also integrates with the latest

Re: [Haskell-cafe] Draft chapters of Real World Haskell now publicly available

2008-01-23 Thread Bryan O'Sullivan
Wolfgang Jeltsch wrote: Covering reactive programming would indeed be interesting. I agree. However, we have no plans to cover this topic. I don't believe any of us has used FRP, and my impression of it as an approach is that it's not yet cooked. We already have our hands and TOC full

Re: [Haskell-cafe] Draft chapters of Real World Haskell now publicly available

2008-01-22 Thread Bryan O'Sullivan
Paul Moore wrote: I'm posting here because there doesn't seem to be an overall comment section, but the TOC seems to cover less ground than I expected. Is the TOC meant to be complete? No, it's less than a third of the whole thing. Here's the announcement from last May, including a more

[Haskell-cafe] Draft chapters of Real World Haskell now publicly available

2008-01-21 Thread Bryan O'Sullivan
John, Don and I are pleased to announce the beginning of the public beta programme for our upcoming book, Real World Haskell. For further details, please see the following blog entry: http://www.realworldhaskell.org/blog/2008/01/21/finally-the-public-beta-programme-begins/ Thanks to all of the

Re: [Haskell-cafe] Poisx select support

2008-01-16 Thread Bryan O'Sullivan
Spencer Janssen wrote: For C's void *, I'd use Ptr (). Ptr a seems to be more usual, and hews closer to the idea that it's a pointer to an opaque value. b ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Computer Science Books using Haskell

2008-01-14 Thread Bryan O'Sullivan
PR Stanley wrote: Can the list recommend books that use Haskell - or any FP language but preferably Haskell - to illustrate the principles of compilers and/or algorithms? Try Andrew Appel's Modern Compiler Implementation in ML http://www.cs.princeton.edu/~appel/modern/ml/ which, as it uses

Re: [Haskell-cafe] US Homeland Security program language security risks

2008-01-09 Thread Bryan O'Sullivan
Yitzchak Gale wrote: Perhaps Coverity's interest could be piqued if they were made aware of Haskell's emergence as an important platform in security-sensitive industries such as finance and chip design, and of the significant influence that Haskell is having on the design of all other major

Re: [Haskell-cafe] ANN: A triple of new packages for talking to the outside world

2008-01-08 Thread Bryan O'Sullivan
Adam Langley wrote: Ok, see http://www.imperialviolet.org/IncrementalGet.hs That's excellent! This is just the sort of thing one wants if getting dribs and drabs of information instead of a steady stream. For example, I need to reconstruct TCP streams from individual packets captured off the

Re: [Haskell-cafe] ANN: A triple of new packages for talking to the outside world

2008-01-07 Thread Bryan O'Sullivan
It would seem that there would be three possible outcomes from an incremental Get: - Failure: some bitstreams are just invalid and no amount of extra data will ever fix that - Complete [Result]: the last chunk of data has been processed. Maybe this should also include the remainder of

Re: [Haskell-cafe] ANN: A triple of new packages for talking to the outside world

2008-01-06 Thread Bryan O'Sullivan
Adam Langley wrote: This is mostly a cut-n-paste job from the excellent binary package which provides Data.Binary.Strict.Get - a monad which is a drop in replacement for Get, but which parses strict ByteStrings and returns an Either, Ooh, nice. We could really do with an incremental

Re: [Haskell-cafe] Re: Quanta. Was: Wikipedia on first-class object

2008-01-06 Thread Bryan O'Sullivan
Achim Schneider wrote: There is this story about some military (US afair) training a neural net to detect tanks in images, I can't find the link right now. It worked, with amazing 100% accuracy. Then they threw another batch of images at the net. It worked, with devastating 50%

[Haskell-cafe] ANN / CFP - LLVM bindings for Haskell

2008-01-03 Thread Bryan O'Sullivan
This is an early release of Haskell bindings for the popular LLVM compiler infrastructure project. If you don't know what LLVM is, it's a wonderful toybox of compiler components, from a complete toolchain supporting multiple architectures through a set of well-defined APIs and IR formats that are

Re: [Haskell-cafe] ANN / CFP - LLVM bindings for Haskell

2008-01-03 Thread Bryan O'Sullivan
Don Stewart wrote: (Hackage can't host code that uses GHC 6.8.2's language extension names yet.) {-# LANGUAGE XYZ #-} pragmas? If so, I'm pretty sure they're supported, since xmonad uses them, and is on hackage. Language pragmas in general are fine, but I believe I'm using a few that are

Re: [Haskell-cafe] ANN / CFP - LLVM bindings for Haskell

2008-01-03 Thread Bryan O'Sullivan
Ross Paterson wrote: It should be able to now. Thank you! b ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Compiler backend question

2008-01-01 Thread Bryan O'Sullivan
Peter Verswyvelen wrote: Well, I don't know about the licensing, but according to http://en.wikipedia.org/wiki/GNU_Compiler_Collection#Front_ends, a new cleaner intermediate language was created in 2005 for GCC, which might be more general? It's still very difficult to work with GCC from the

Re: [Haskell-cafe] Comments on reading two ints off Bytestring

2007-12-23 Thread Bryan O'Sullivan
Paulo J. Matos wrote: I guess the latter is the correct guess. Good guess! You can take advantage of the fact that the Maybe type is an instance of the Monad typeclass to chain those computations together, getting rid of all of the explicit case analysis. import qualified

Re: [Haskell-cafe] [OT] A nice organized collection of threads in Haskell-Cafe

2007-12-08 Thread Bryan O'Sullivan
Albert Y. C. Lai wrote: I can't blame you for being not observant. Afterall, this is precisely what I'm alluding to with everyone can haz PC [...] Please don't flame people on the list. Thank you, b ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Type error in final generator

2007-12-08 Thread Bryan O'Sullivan
Loganathan Lingappan wrote: main = do hSetBuffering stdin LineBuffering numList - processInputs foldr (+) 0 numList The type of main is understood to be IO (), so it can't return anything. You could work around this by rewriting the last line above as follows: print

Re: [Haskell-cafe] fast Array operations: foldl, drop

2007-11-29 Thread Bryan O'Sullivan
Henning Thielemann wrote: I thought operations like foldl' and drop must be very fast on arrays (especially UArray) with appropriate pointer tricks, These kinds of functions are only much use on one-dimensional arrays, which look sufficiently list-like that the ideas translate fairly

Re: [Haskell-cafe] Re: Waiting for thread to finish

2007-11-28 Thread Bryan O'Sullivan
Andrew Coppin wrote: Dan Weston wrote: Silly or not, if I compile with -threaded, I always link in the one-liner C file: char *ghc_rts_opts = -N2; Ah... you learn something useful every day! I was going to ask on IRC whether there's any way to do this - but now I don't need to bother.

Re: [Haskell-cafe] Unix (Posix) low-level device driver functionality?

2007-11-23 Thread Bryan O'Sullivan
Galchin Vasili wrote: In any case, it seems like the GHC documentation allows raw driver I/Obut when I look at the actual GHC 6.8.1 libraries I don't see low level driver functionailty. On Unix, at least, you don't need anything special to write userspace device drivers. You normally open

Re: [Haskell-cafe] expanded standard lib

2007-11-21 Thread Bryan O'Sullivan
Magnus Therning wrote: “Rubygems is source-intrusive. The require instruction is replaced by a require_gem instruction to allow for versioned dependencies. Debian and most other systems think that dealing with versioned dependencies outside of the source is a better idea.” To drag the

Re: [Haskell-cafe] expanded standard lib

2007-11-20 Thread Bryan O'Sullivan
Krzysztof Kościuszkiewicz wrote: I would advocate using a comment system that is similar to the one at http://djangobook.com/. That's an appealing idea, but the devil lies in the details. I wrote just such a comment system for draft chapters of our book, and it's seen a lot of use.

Re: [Haskell-cafe] timeout and waitForProcess

2007-11-20 Thread Bryan O'Sullivan
Tim Bauer wrote: Does anyone know if the new System.Timeout.timeout combinator can wakeup from System.Process.waitForProcess? No, this is expected behaviour per the documentation: The technique works very well for computations executing inside of the Haskell runtime system, but it doesn't

Re: [Haskell-cafe] expanded standard lib

2007-11-19 Thread Bryan O'Sullivan
Neil Mitchell wrote: - The packages seem to be of quite variable quality. Some are excellent, some are rather poor (or just not maintained any more). The problem is that only one person gets to comment on the quality of a library, the author, who is about the least objective person. Not

Re: [Haskell-cafe] WideFinder

2007-11-10 Thread Bryan O'Sullivan
Sterling Clover wrote: Maps are a good choice for parallelism because they merge efficiently, but for the iterative aspect their performance leaves a lot to be desired. This is not consistent with my observations, I must say. What I've found to dominate the benchmark are straightforward

Re: [Haskell-cafe] Re: ByteString search code available in easy-to-digest form

2007-11-09 Thread Bryan O'Sullivan
ChrisK wrote: Yeah, my code wants to open up the internals of Lazy bytestrings. Until recently this was possible toChunks, but it would be best to rewrite it for the newest Lazy representation (which comes with new shiny ghc 6.8.1). I've updated the stringsearch package on hackage so that it

Re: [Haskell-cafe] Sinus in Haskell

2007-11-09 Thread Bryan O'Sullivan
Hans van Thiel wrote: Can anybody explain the results for 1.0, 2.0 and 3.0 times pi below? It's due to rounding error in the platform's math library. You'll see the same results in most other languages that call into libm. b ___

Re: [Haskell-cafe] ANN: FileManip 0.1, an expressive file manipulationlibrary

2007-11-08 Thread Bryan O'Sullivan
Claus Reinke wrote: the somewhat pained tone of that email was because this was a library i might have liked to use, hindered by two all too typical issues. To resurrect an old thread, version 0.3.1 is now BSD3-licensed, for your hacking pleasure, and updated to work with GHC 6.8.1.

[Haskell-cafe] ByteString search code available in easy-to-digest form

2007-11-07 Thread Bryan O'Sullivan
I've packaged up the fast Boyer-Moore and Knuth-Morris-Pratt code that Chris Kuklewicz posted a few months ago: http://article.gmane.org/gmane.comp.lang.haskell.libraries/7363 The consensus at the time was that the code was not ready for rolling into the bytestring package, but now it's

Re: [Haskell-cafe] ByteString search code available in easy-to-digest form

2007-11-07 Thread Bryan O'Sullivan
Don Stewart wrote: Do we have any benchmarks, for say, 1G files, versus linear, naive (strict) search? Chris mentioned that he did, but I haven't had time to write anything benchmarky yet. b ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] The question of ByteString

2007-11-02 Thread Bryan O'Sullivan
Andrew Coppin wrote: 1. Why do I have to type ByteString in my code? Why isn't the compiler automatically performing this optimisation for me? One reason is that ByteString is stricter than String. Even lazy ByteString operates on 64KB chunks. You can see how this might lead to problems

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-11-01 Thread Bryan O'Sullivan
Ketil Malde wrote: Python used to do pretty well here compared to Haskell, with rather efficient hashes and text parsing, although I suspect ByteString IO and other optimizations may have changed that now. It still does just fine. For typical munge a file with regexps, lists, and maps

Re: [Haskell-cafe] Regex API ideas

2007-11-01 Thread Bryan O'Sullivan
ChrisK wrote: The Haskell regexp libraries actually give us something of a leg down with respect to Python and Perl. True, the pure Haskell library is not as fast as a C library. Actually, I wasn't referring to the performance of the libraries, merely to the non-stick nature of the API.

Re: [Haskell-cafe] Equality Question

2007-10-15 Thread Bryan O'Sullivan
PR Stanley wrote: is const = id? No, const is saturated with 2 arguments, id with 1. const 1 2 - 1 id 1 2 - type error b ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Filesystem questions

2007-10-14 Thread Bryan O'Sullivan
Yitzchak Gale wrote: Your library is very nice. But - it suffers from the same problem. You use unsafe IO operations to build a lazy IO list, and we all know what grief that can lead to. This is little different from the approach taken by Python's os.walk, which lazily yields the contents of

Re: [Haskell-cafe] Filesystem questions

2007-10-14 Thread Bryan O'Sullivan
Yitzchak Gale wrote: I do think that it is much better to provide IO laziness using monad transformers (or whatever) rather than unsafe IO. That's fair enough. I think it would be great if you were to turn your ideas into a library and provide a few examples of its use. b

Re: [Haskell-cafe] Filesystem questions

2007-10-13 Thread Bryan O'Sullivan
Yitzchak Gale wrote: Python also has os.walk, a very convenient functional (sort of) tool for recursing through directories. (It sounds trivial, but it is not, there are enough annoying details that this function saves huge amounts of time.) Very embarrassing that Haskell is missing this. See

Re: [Haskell-cafe] Manual constructor specialization

2007-10-09 Thread Bryan O'Sullivan
Johan Tibell wrote: I have a rope data type [...] Perhaps you should talk to Derek Elkins about his. It would be nice if we had fewer, more canonical implementations of popular data structures, instead of a proliferation of half bakery. b

Re: [Haskell-cafe] signals lib

2007-09-28 Thread Bryan O'Sullivan
brad clawsie wrote: does System.POSIX.Signals bind to OS specific real-time POSIX signal apis? (i.e., kqueue on freebsd). No, just the usual portable signals. b ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Library Process (was Building production stable software in Haskell)

2007-09-24 Thread Bryan O'Sullivan
David Menendez wrote: Using Cabal directly, I can simply run the configure/build/install process three times with different configuration options. Is this possible with systems like RPM/apt/port/etc? Yes. In the case of RPM and dpkg, we prefix a library's name with the name and version of

Re: [Haskell-cafe] Re: interaction between OS processes

2007-09-14 Thread Bryan O'Sullivan
Aaron Denney wrote: If you want expect like functionality, i.e. working for arbitrary client programs, you'll need to use pseudottys, as expect, script, screen, xterm, etc. do. I packaged up a patch for System.Posix to add this a month or three ago, but forgot to follow through on it.

Re: [Haskell-cafe] Data.Binary Endianness

2007-09-11 Thread Bryan O'Sullivan
Jules Bean wrote: For these reasons, although it is very cool, I don't think it can be recommended as a basis for long-term file format definitions. Indeed, the authors have never claimed that this is what it's for. Unfortunately, because the authors haven't *disclaimed* this as a purpose,

Re: [Haskell-cafe] Block-wise lazy sequences in Haskell

2007-09-05 Thread Bryan O'Sullivan
Henning Thielemann wrote: I thought it must be possible to define an unboxed array type with Storable elements. Yes, this just hasn't been done. There would be a few potentially tricky corners, of course; Storable instances are not required to be fixed in size, though all the precanned

Re: [Haskell-cafe] interaction between OS processes

2007-09-02 Thread Bryan O'Sullivan
Andrea Rossato wrote: Most likely, the content of s sits in a local buffer and never leaves this process, following most OS conventions and as others point out. Another process waiting for it will deadlock. Yes, I knew it was something related to the underneath OS. I'll have to study

Re: [Haskell-cafe] redirecting stdout

2007-08-30 Thread Bryan O'Sullivan
Chad Scherrer wrote: Is it possible to write a function redirect :: Handle - IO () - IO () so that redirect h action is just like action, except that all the output written to stdout now gets sent to h instead? No. The file descriptor used for IO is wired into a Handle, just as in a FILE *

Re: [Haskell-cafe] GHC 6.6.1 and SELinux issues

2007-08-29 Thread Bryan O'Sullivan
Alexander Vodomerov wrote: I've put GHC in unconfined_execmem_t and it started to work fine. But the problem is not in GHC -- it is in programs compiled by GHC. They also require exec/write memory. Only root can grant unconfined_execmem privileges, so simple user can not run binaries compiled

[Haskell-cafe] [ANN] pcap 0.3.1, for user-level network packet capture

2007-08-27 Thread Bryan O'Sullivan
I've taken over maintenance of the pcap library (an interface to libpcap, for user-level network packet capture), and released a new version. Home page: http://www.serpentine.com/software/pcap/ API docs: http://darcs.serpentine.com/pcap/dist/doc/html/pcap/ Download:

[Haskell-cafe] Re: [ANN] An efficient lazy suffix tree library

2007-08-27 Thread Bryan O'Sullivan
ChrisK wrote: That is almost certainly because the algorithm expects the source string to have a unique character at its end. Chris is correct. I'll ensure that the docs make this clear. b ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: Diagnosing stack overflow

2007-08-17 Thread Bryan O'Sullivan
Joe Buehler wrote: What is the point in building this huge thunk if it can't be evaluated without a stack overflow? It's not that there's a point to it, it's just the behaviour of foldl. Hence you shouldn't be using foldl. GHC's strictness analyser can sometimes save you from yourself if

Re: [Haskell-cafe] Diagnosing stack overflow

2007-08-16 Thread Bryan O'Sullivan
Justin Bailey wrote: I am trying to determine why my stack overflows in my medium sized program (it has several modules but maybe only 1000 LOC total). On Windows, at least, the ghcprof visualization tool doesn't work. Any suggestions besides an output trace? You shouldn't need ghcprof. Just

Re: [Haskell-cafe] When is waitForProcess not necessary?

2007-08-03 Thread Bryan O'Sullivan
Dougal Stanton wrote: I had to do this recently, so you might be interested in my approach: http://193.219.108.225/code/blogpost/BlogPost.hs The idea here is to run arbitrary text (blog posts) through Markdown and Smartypants before sending them out to the wider world. Pardon me while I

Re: [Haskell-cafe] OS swapping and haskell data structures

2007-08-01 Thread Bryan O'Sullivan
Alex Jacobson wrote: If you create a Data.Map or Data.Set larger than fits in physical memory, will OS level swapping enable your app to behave reasonably or will things just die catastrophically as you hit a memory limit? Relying on the OS to page portions of your app in and out should

Re: [Haskell-cafe] Strange behavior of executeFile

2007-07-29 Thread Bryan O'Sullivan
Krzysztof Kościuszkiewicz wrote: This works for files, but randomly fails when stdin is connected to a pipe (pstops complains that it can't seek input). GHC's file handles are backed by non-blocking file descriptors. The child process run by executeFile inherits the stdin, stdout and stderr

Re: [Haskell-cafe] Strange results when trying to create large Bool arrays.

2007-07-12 Thread Bryan O'Sullivan
Ketil Malde wrote: I'd really like to have errors on overflow, at least as an option, even if it is costly in terms of performance. Is there a Trac ticket or something for this? Not that I know of. I filed a Trac ticket against ByteString's readInt function before I noticed that read has

Re: Numbers : [Haskell-cafe] Number overflow

2007-07-12 Thread Bryan O'Sullivan
Carter T Schonwald wrote: Out of curiosity, what ever happened to the proposal a while back to refactor the Num class etc so that the operations would be grouped according to what abstract algebra notions they correspond to? The numeric prelude proposals have a wiki page:

Re: [Haskell-cafe] Strange results when trying to create large Bool arrays.

2007-07-11 Thread Bryan O'Sullivan
Richard Kelsall wrote: main = do n - getArgs = readIO . head :: IO Int a - newArray (1,n) True :: IO (IOUArray Int Bool) printf Created array 1 .. %8d \n (n::Int) :: IO () It appears to work up to quite large numbers, but then gets strange. When I give it an array size of

Re: [Haskell-cafe] haskell - db, on Solaris

2007-07-11 Thread Bryan O'Sullivan
Daniil Elovkov wrote: Would you please tell me, what would be my choice if I wanted to interact with MySql and Oracle from a Haskell program on Solaris? http://www.haskell.org/haskellwiki/Applications_and_libraries/Database_interfaces If you want to talk to MySQL, you have a few choices.

Re: [Haskell-cafe] Strange results when trying to create large Bool arrays.

2007-07-11 Thread Bryan O'Sullivan
Albert Y. C. Lai wrote: I'm just being picky here: where the underlying machine's behaviour is 2's complement binary, it (Int, +, *) is actually a tidy, well-behaved mathematical ring, isomorphic to Z / 2^n Z. Yes, naturally it wasn't until a few moments after I had sent the message that I

Re: [Haskell-cafe] haskell - db, on Solaris

2007-07-11 Thread Bryan O'Sullivan
Daniil Elovkov wrote: Yes, thanks. But the emphasis was on Solaris. I don't quite understand what is the common way to access databases on Solaris. Is it odbc? ODBC is a standard, fairly portable database interface. Since HDBC has ODBC bindings, it can in principle talk to any database that

Re: [Haskell-cafe] Data.ByteString.dropWhile

2007-07-09 Thread Bryan O'Sullivan
Donald Bruce Stewart wrote: I'd just manually write a 'tidy' loop (in the Data.ByteString style) (which would avoid all allocations), since it seems pretty useful. That would indeed be very useful to have as a library function. I've pined for Python's strip() string method (removes leading

Re: [Haskell-cafe] directory tree?

2007-06-25 Thread Bryan O'Sullivan
Chad Scherrer wrote: Now it doesn't complain about too many open files, but instead I get this runtime error: LPS *** Exception: user error (Codec.Compression.Zlib: incorrect header check) Are you sure you really have gzip files? If you're on a Linux or similar box, what does file

Re: [Haskell-cafe] directory tree?

2007-06-24 Thread Bryan O'Sullivan
Chad Scherrer wrote: What got me thinking about this is I'd like to be able to do something like this in just a couple lines of code: gunzip -c ./2*/*.z ... and feed the result into a giant lazy ByteString. Using my FileManip library, you'd do that like this. import Codec.Compression.GZip

Re: [Haskell-cafe] memory usage in repeated reading of an external program's output

2007-06-21 Thread Bryan O'Sullivan
Andrea Rossato wrote: Now I'm going to profile for memory usage: I've seen that some GC happens if you are patient enough. Yes, the process will hit a steady state of a few megabytes of heap after a short time. By the way, your program leaks ProcessHandles. b

Re: [Haskell-cafe] memory usage in repeated reading of an external program's output

2007-06-21 Thread Bryan O'Sullivan
Andrea Rossato wrote: Still I do not understand you reference to the leak problem. Could you please elaborate a bit? The runProcess function returns a ProcessHandle. If you don't call waitForProcess on that handle, you'll leak those handles. On Unix-like systems, this means you'll

Re: [Haskell-cafe] hSetBuffering woes

2007-06-17 Thread Bryan O'Sullivan
Eric wrote: I'm writing a simple HTTP server and am trying to implement the POST method. That's a rather general problem statement, indeed :-) For an application like this, I'd suggest that explicit resource management is the way to go, and that you should not be using hGetContents at

Re: [Haskell-cafe] hSetBuffering woes

2007-06-16 Thread Bryan O'Sullivan
Eric wrote: I tried to turn off buffering with the command hSetBuffering (from System.IO) but my app still blocks on hGetContents (from Data.ByteString). Does anyone know what's happening? The hGetContents function can't behave the way you want, because it's defined to return the entire

Re: [Haskell-cafe] hSetBuffering woes

2007-06-16 Thread Bryan O'Sullivan
Eric wrote: I've converted to lazy bytestrings. After reading in the bytes from a network connection I want to save them to a file but now the appendFile function blocks: Well, yes. It's presumably waiting for data from the network connection, because it wants to write out the entire

Re: [Haskell-cafe] embedded build language?

2007-06-14 Thread Bryan O'Sullivan
Greg Fitzgerald wrote: Has anyone embedded a build language in Haskell? Something like Rake http://rake.rubyforge.org/ is to Ruby, but in Haskell or any statically-typed functional language. The closest I've seen is a tiny snippet from a blog posting:

Re: [Haskell-cafe] Re: [Haskell] Who pays for *.haskell.org machines?

2007-06-13 Thread Bryan O'Sullivan
Bryan Burgers wrote: Similarly, the Perl community has a foundation, and I believe giving to it is tax-deductible. You could look in to how they do it. Setting up a 501(c)(3) foundation is a morass of paperwork. If people within the US are interested in writing tax deductible cheques, a far

Re: [Haskell-cafe] QuickCheck Arbitrary - infinite recursion on recursive GADTs?

2007-06-04 Thread Bryan O'Sullivan
Marc Weber wrote: data A = A INt | B [A] instace Arbitrary A where arbitrary = oneof [ liftM A arbitrary , liftM B arbitrary ] But now QuickCheck will propably create a test value A ( B [ A ( B [ A - no end Is there an easy QuickCheck way

Re: [Haskell-cafe] OpenGL

2007-05-30 Thread Bryan O'Sullivan
Jon Harrop wrote: Where should I go to get started with OpenGL and Haskell? Take a look at Gtk2Hs, which has OpenGL bindings. For example, see http://darcs.haskell.org/gtk2hs/demo/opengl/ b ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] New book: Real-World Haskell!

2007-05-29 Thread Bryan O'Sullivan
Jules Bean wrote: No offense to the darcs creators, but 1) Only current Haskellers use it; everyone else either uses Subversion or is migrating to it; If that is true, then they have missed the point. DVC is a real win for most workflows. We are indeed using darcs, so this discussion is a

Re: [Haskell-cafe] Slower with ByteStrings?

2007-05-26 Thread Bryan O'Sullivan
Jason Dagit wrote: I think, given my simple algorithm that means that (==) for ByteStrings is slower than (==) for String. Is this possible? Yes indeed. Over ByteStrings, (==) is implemented as a call to memcmp. For small strings, this loses by a large margin because it has to go through

Re: [Haskell-cafe] New book: Real-World Haskell!

2007-05-23 Thread Bryan O'Sullivan
Dougal Stanton wrote: That is fantastic news to hear. I realise this may be jumping the gun a bit but could you say anything about predicted timelines? Not just yet, but it will be a much faster process with three seasoned verbmonkeys at work than if we had just one. Are you starting from

Re: [Haskell-cafe] New book: Real-World Haskell!

2007-05-23 Thread Bryan O'Sullivan
I'll condense my remaining replies to this thread into a single message, to save people a little noise. Henning Thielemann: I guess there will also be some lines about how to write efficient code by using ByteString et. al.? You bet! What about a public darcs repository where people can

[Haskell-cafe] ANN: FileManip 0.1, an expressive file manipulation library

2007-05-02 Thread Bryan O'Sullivan
The FileManip package provides expressive functions and combinators for searching, matching, and manipulating files. It provides three modules. System.FilePath.Find lets you search a filesystem hierarchy efficiently: find always (extension ==? .rb) = mapM_ remove

Re: [Haskell-cafe] ANN: FileManip 0.1, an expressive file manipulation library

2007-05-02 Thread Bryan O'Sullivan
Bryan O'Sullivan wrote: The FileManip package provides expressive functions and combinators for searching, matching, and manipulating files. As seems to be my habit, I forgot something important, namely where to get FileManip from. http://hackage.haskell.org/cgi-bin/hackage-scripts/package

Re: [Haskell-cafe] ANN: FileManip 0.1, an expressive file manipulationlibrary

2007-05-02 Thread Bryan O'Sullivan
Claus Reinke wrote: i have no intention to participate in yet-another-licencing-discussion, i would just like to ask whether those limitations of your offering are an accident or intended? I didn't use the LGPL by accident. However, I might be amenable to persuasion, perhaps more so if you

Re: [Haskell-cafe] ANN: FileManip 0.1, an expressive filemanipulationlibrary

2007-05-02 Thread Bryan O'Sullivan
Claus Reinke wrote: if i wanted to use that library for anything i want to distribute, my only chance to avoid the source re-distribution and advertising clauses would be dynamic linking I believe that the magical protective properties of dynamic linking amount to no more than folklore.

Re: [Haskell-cafe] Re: Haskell version of Norvig's Python Spelling Corrector

2007-04-24 Thread Bryan O'Sullivan
Udo Stenzel wrote: There is another bug of this sort in your code. Consider incWordCount w m = M.insertWith (+) w 1 m There is no reason to evaluate the sum inside the map, instead an unevaluated thunk is put in there. Would not Data.Map.insertWith' do the trick? b

Re: [Haskell-cafe] faster factorial function via FFI?

2007-04-24 Thread Bryan O'Sullivan
Dan Weston wrote: A thing of beauty is a joy forever. Simple, fast, elegant. factorial :: Integer - Integer factorial = product . zipWith (^) . factorisedFactorial Well... The zipWith (^) should be map (uncurry (^)). And the performance of this approach is strongly dependent on the

Re: [Haskell-cafe] faster factorial function via FFI?

2007-04-24 Thread Bryan O'Sullivan
[EMAIL PROTECTED] wrote: Yes and no. Standard algorithms for computing and manipulating combinatorial-sized Integers strongly depend on the properties of your Integer implementation. Manipulating lists of prime factors can also be more efficient, because most of the numbers you deal with are

Re: [Haskell-cafe] Announce: DisTract: Distributed Bug Tracker implemented in Haskell

2007-04-23 Thread Bryan O'Sullivan
Nice. You might find Bugs Everywhere http://www.panoramicfeedback.com/opensource/ interesting for comparison. b ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] faster factorial function via FFI?

2007-04-23 Thread Bryan O'Sullivan
Dan Drake wrote: This is combinatorics, so I can't just say oh, this is small and cross it off like physicists do. :) Binary splitting is much faster than the naive approach, but still easy to understand. That's fac1 in the attached file. I ran out of time to write an efficient

Re: [Haskell-cafe] Re: Haskell version of Norvig's Python Spelling Corrector

2007-04-22 Thread Bryan O'Sullivan
Ketil Malde wrote: Hm - nobody suggested using ByteStrings yet? I wrote an independent port of Norvig's spellchecker, because I figured it would make the basis of an interesting tutorial. For such a small program, it's been quite a challenge! I started out using lazy ByteStrings,

Re: [Haskell-cafe] Re: Haskell version of Norvig's Python Spelling Corrector

2007-04-22 Thread Bryan O'Sullivan
Pete Kazmier wrote: Bryan, out of curiosity, is a non bytestring version of your code faster? No, but the difference is smaller than I expected: the lazy ByteString version is about 1.8x faster than using String. b ___ Haskell-Cafe

Re: [Haskell-cafe] Re: Haskell version of Norvig's Python Spelling Corrector

2007-04-22 Thread Bryan O'Sullivan
Bryan O'Sullivan wrote: In my profile results, I find that simply converting words to lower case accounts for a whopping 40% of time and allocation (see the attachment for my definition of the train function). COST CENTREMODULE %time %alloc lower

Re: [Haskell-cafe] Re: How Albus Dumbledore would sell Haskell

2007-04-20 Thread Bryan O'Sullivan
Derek Elkins wrote: Game search is exactly an example use in Why Functional Programming Matters (http://www.math.chalmers.se/~rjmh/Papers/whyfp.html). That paper, 23 years later, is still pretty compelling. Perhaps, it should just be modernized and somewhat expanded. I'll echo Lennart's

Re: [Haskell-cafe] Tutorial on Haskell

2007-04-16 Thread Bryan O'Sullivan
Mark T.B. Carroll wrote: I'm afraid no examples come easily to mind, though. Here's a simple one: reading a flattened graph from disk. If your flattened representation contains forward references, you have to fix them up in a strict language. In a lazy language, you can refer to elements

Re: [Haskell-cafe] Tutorial on Haskell

2007-04-16 Thread Bryan O'Sullivan
Neil Bartlett wrote: E.g. perhaps some kind of instant messaging server? Or Twitter except scalable. A twitter-alike will quite probably get people's attention. And of course anything that breaks the it's good for compilers! stereotype is to be commended :-) Also on the subject of

Re: [Haskell-cafe] newbie concatenating monad question

2007-03-24 Thread Bryan O'Sullivan
Leandro Penz wrote: My idea is to have a monad with a concatenating , so that I can: bulidStuff = do func1 func2 func3 func4 You could do this, but it's easier to take advantage of the fact that [] is an instance of MonadPlus, and just use `mplus`. b

Re: [Haskell-cafe] Partial Evaluation

2007-03-21 Thread Bryan O'Sullivan
jim burton wrote: I am reading Hudak's paper Modular Domain Specific Languages and Tools [1] and am confused by his use of the term `Partial Evaluation'. I understand it to mean supplying some but not all arguments to a function, e.g. (+3) but it seems to mean something else too. That's

Re: [Haskell-cafe] Re: Lazy IO and closing of file handles

2007-03-19 Thread Bryan O'Sullivan
Pete Kazmier wrote: I understand the intent of this code, but I am having a hard time understanding the implementation, specifically the combination of 'fix', 'flip', and 'interate'. I looked up 'fix' and I'm unsure how one can call 'flip' on a function that takes one argument. If you look

Re: [Haskell-cafe] Haskell and SSL

2007-03-17 Thread Bryan O'Sullivan
Thomas David Baker wrote: I know that darcs uses curl in a similar way for some stuff but it still feels like I'm doing the Wrong Thing. No, you're not. SSL is very complicated, which is why there are no Haskell libraries that implement or usefully wrap it. There's a proposal to write a

Re: [Haskell-cafe] Defining types (newbie)

2007-03-14 Thread Bryan O'Sullivan
John Fouhy wrote: But if I want to combine tcEqOne and tcGtThree I run into type problems, because one of them uses Strings and the other Integers. Yep. The observation you can make here is that TC is really a fancy way to write a function that takes some parameters and returns a Bool. So

Re: [Haskell-cafe] Defining types (newbie)

2007-03-13 Thread Bryan O'Sullivan
John Fouhy wrote: In Haskell, I envisage writing something like: data ThingCompare = TC Op Field This wants to be a bit more concrete: data ThingCompare = TC (a - a - Bool) (Thing - a) so that you could then have something to execute your comparison thingy: runTC :: ThingCompare - Thing -

Re: [Haskell-cafe] Performance Help

2007-03-11 Thread Bryan O'Sullivan
Dominic Steinitz wrote: Any help would be appreciated. I notice that there's not much user-accessible documentation of what you can expect GHC (or some other Haskell implementation) to do and not do with a given piece of code. For example, you have a lot of little definitions that clearly

Re: [Haskell-cafe] System.FilePath Re[2]: ANN: HSH 1.2.0

2007-03-10 Thread Bryan O'Sullivan
Bulat Ziganshin wrote: -- i've added crossposts to John Meacham and Einar Karttunen because -- you also denoted interest in new i/o library Me, too :-) just a couple of ideas: - portable async i/o which is able to work via select/epoll/... I think you mean non-blocking I/O here, right?

<    1   2   3   4   5   >