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] 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

[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] 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

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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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

[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] 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.

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] 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] 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] 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-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] 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] 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] 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] [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] 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] 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

[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] 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%

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-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] 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] 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] vector stream fusion, inlining and compilation time

2010-03-09 Thread Bryan O'Sullivan
On Tue, Mar 9, 2010 at 11:53 AM, Conal Elliott co...@conal.net wrote: I think Jake is referring to my vector-space package. He did the work of writing 171 INLINE pragmas, covering lots of methods and standalone function defs. I'm simultaneously grateful for the effort and repelled by the

Re: [Haskell-cafe] Bytestrings and [Char]

2010-03-23 Thread Bryan O'Sullivan
2010/3/23 Iustin Pop iu...@k1024.org I agree with the principle of correctness, but let's be honest - it's (many) orders of magnitude between ByteString and String and Text, not just a few percentage points… Well, your benchmarks are highly suspect. See below. Data.ByteString.Lazy.UTF8

Re: [Haskell-cafe] Bytestrings and [Char]

2010-03-24 Thread Bryan O'Sullivan
On Wed, Mar 24, 2010 at 5:48 AM, Stephen Tetley stephen.tet...@gmail.comwrote: I rather doubt a valuable set of type classes that is suitable for all containers exists, I'm afraid. I don't think it's so clear cut. Stepanov's Elements of Programming lays out a pretty clear (and familiar to

Re: [Haskell-cafe] GHC vs GCC

2010-03-26 Thread Bryan O'Sullivan
On Fri, Mar 26, 2010 at 10:46 AM, Rafael Cunha de Almeida almeida...@gmail.com wrote: During a talk with a friend I came up with two programs, one written in C and another in haskell. Your Haskell code builds a huge thunked accumulator value, so of course it's slow (put bang patterns on all

Re: [Haskell-cafe] benchmarking pure code

2010-03-31 Thread Bryan O'Sullivan
On Wed, Mar 31, 2010 at 4:12 AM, Paul Brauner paul.brau...@loria.fr wrote: Thank you, I will look at that. But it seems that criterion uses NFData no? I do not know of anything wrong with NFData. What you're seeing is much more likely to be a bug in either the benchmarking library you're

Re: [Haskell-cafe] What is the consensus about -fwarn-unused-do-bind ?

2010-04-09 Thread Bryan O'Sullivan
On Fri, Apr 9, 2010 at 6:44 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: As of 6.12.1, the new -fwarn-unused-do-bind warning is activated with -Wall. This is based off a bug report by Neil Mitchell: http://hackage.haskell.org/trac/ghc/ticket/3263 . However, does it make

Re: [Haskell-cafe] why does Data.Text.Lazy.IO.readFile return the internal type Data.Text.Lazy.Internal.Text, when Data.Text.IO.readFile returns plain IO Data.Text.Text?

2010-04-30 Thread Bryan O'Sullivan
On Fri, Apr 30, 2010 at 3:14 PM, Daniel Fischer daniel.is.fisc...@web.dewrote: Yes, I understood it so that he wanted to convert from Data.Text.Lazy.Internal.Text to Data.Text.Lazy.Text. It's the same type. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Database connection pool

2010-05-06 Thread Bryan O'Sullivan
On Wed, May 5, 2010 at 10:51 PM, Michael Snoyman mich...@snoyman.comwrote: * When a connection is released, is goes to the end of the pool, so connections get used evenly (not sure if this actually matters in practice). In practice, you're better off letting idle connections stay that way,

Re: [Haskell-cafe] Performance Issue

2010-05-18 Thread Bryan O'Sullivan
On Tue, May 18, 2010 at 9:30 AM, Richard Warburton richard.warbur...@gmail.com wrote: A colleague of mine pointed out that ghc wasn't performing as he expected when optimising some code. I wonder if anyone could offer any insight as to why its not noting this common subexpression: GHC

Re: [Haskell-cafe] Performance Issue

2010-05-18 Thread Bryan O'Sullivan
On Tue, May 18, 2010 at 9:43 AM, Richard Warburton richard.warbur...@gmail.com wrote: Is there any way to encourage it to do so, for example compilation flags? No. It would be difficult for the compiler to see when CSE is or is not safe to apply, and so it doesn't have any code to perform

Re: [Haskell-cafe] Efficient string construction

2010-06-03 Thread Bryan O'Sullivan
On Thu, Jun 3, 2010 at 9:16 AM, Daniel Fischer daniel.is.fisc...@web.dewrote: String can be quite memory efficient. As a stupid example, length (replicate 1000 'a') will need less memory than the equivalents using ByteString or Text. Actually, this will be fused with Data.Text, and

Re: [Haskell-cafe] Data.ByteString.Lazy.hPut and timeouts?

2010-06-03 Thread Bryan O'Sullivan
On Wed, Jun 2, 2010 at 7:55 PM, Jeremy Shaw jer...@n-heptane.com wrote: I know that some OSes provide a per socket timeout that I can set in my application code (instead of a system-wide timeout that can only be set by root). But that does not seem like a very portable solution.

Re: [Haskell-cafe] Re: How does one get off haskell?

2010-06-18 Thread Bryan O'Sullivan
On Fri, Jun 18, 2010 at 9:59 AM, Edward Z. Yang ezy...@mit.edu wrote: I think I can second this comment. I'm inclined to disagree. It's precisely when the code is in a state of constant upheaval that I want the type system to be pointing out my dumb errors.

Re: [Haskell-cafe] data.binary get reading beyond end of input bytestring?

2010-07-29 Thread Bryan O'Sullivan
On Wed, Jul 28, 2010 at 8:38 PM, Max Cantor mxcan...@gmail.com wrote: I have a similar issue, I think. The problem with attoparsec is it only covers the unmarshalling side, writing data to disk still requires manually marshalling values into ByteStrings. Data.Binary with Data.Derive provide

Re: [Haskell-cafe] data.binary get reading beyond end of input bytestring?

2010-07-29 Thread Bryan O'Sullivan
On Thu, Jul 29, 2010 at 10:55 AM, Jason Dagit da...@codersbase.com wrote: Given those constructors for Result, how will you decode a sequence lazily? I deliberately left incremental results out of the attoparsec API, because it's a burrito-filled spacesuit of worms. The problem is that

Re: [Haskell-cafe] Preview the new haddock look and take a short survey

2010-08-04 Thread Bryan O'Sullivan
On Wed, Aug 4, 2010 at 2:11 AM, Magnus Therning mag...@therning.org wrote: On Wed, Aug 4, 2010 at 06:00, Mark Lentczner ma...@glyphic.com wrote: The Haddock team has spent the last few months revamping the look of the generated output. We're pretty close to done, but we'd like to get the

Re: [Haskell-cafe] Re: [Haskell] Re: state of HaXml?

2007-01-10 Thread Bryan O'Sullivan
Taral wrote: For a read-only operation, this shouldn't matter, however on some platforms an open file handle can prevent deletion of the file. You'd be referring to Windows, then, where you can't rename or remove a file if someone has opened it. A partial defence against this is to pass

Re: [Haskell-cafe] hs-plugins on ghc6.6?

2007-01-18 Thread Bryan O'Sullivan
Adam Megacz wrote: Has anybody been able to get hs-plugins to work with ghc6.6? Don made some updates to it after 6.6 was released (see the darcs repo), but I can't build it due to what looks like a bug in the GHC install process (the wrong one of two incompatible versions of Typeable.h gets

Re: [Haskell-cafe] Strings in Haskell

2007-01-23 Thread Bryan O'Sullivan
Tim Docker wrote: I'm not aware of any ongoing haskell work in finance, other that some private work being done by Alain Cremieux, reported in the HCAR. Lennart Augustsson works for Credit Suisse, using a Haskell DSEL to generate financial models for execution by clusters running Excel.

Re: [Haskell-cafe] Announce: Package rdtsc for reading IA-32 time stamp counters

2007-01-23 Thread Bryan O'Sullivan
John Meacham wrote: I would think this would be how the haskell 98 standard library CPUTime is implemented, is it not? No. System.CPUTime gives you an approximate idea of the amount of CPU time your process, and all its threads, have used. The rdtsc instruction gives you a snapshot of the

Re: [Haskell-cafe] How did you stumble on Haskell?

2007-01-29 Thread Bryan O'Sullivan
Bob Davison wrote: I thought calculus was about differentiation and integration and was very surprised to discover that there were such things as 'predicate calculus', 'propositional calculus', and various flavours of 'lambda calculus'. The stuff involving rates of change, integration, and

Re: [Haskell-cafe] Write Yourself a Scheme in 48 Hours

2007-02-01 Thread Bryan O'Sullivan
Shannon -jj Behrens wrote: I'm going through the Write Yourself a Scheme in 48 Hours http://halogen.note.amherst.edu/~jdtang/scheme_in_48/tutorial/overview.html tutorial. I like it a lot, but I have some concerns. Are the exercises in the tutorial known to be solvable by mere mortals? The

Re: [Haskell-cafe] Re: Very fast loops. Now!

2007-02-12 Thread Bryan O'Sullivan
David Roundy wrote: I'm rather curious (if you're sill interested) how this'll be affected by the removal of the division from the inner loop. e.g. go :: Double - Double - Int - IO () go !x !y !i | i == 10 = printf %.6f\n (x+y) | otherwise = go

[Haskell-cafe] Call for testers: using Cabal to build RPMs

2007-02-20 Thread Bryan O'Sullivan
I've got a branch of Cabal that adds a new command, rpm, that lets you build an RPM package with a single invocation: runhaskell Setup.*hs rpm I've tested this pretty extensively with GHC 6.6, and I'm quite happy with it, but if there are other users of RPM-based distros out there, I'd

Re: [Haskell-cafe] Re: process

2007-02-23 Thread Bryan O'Sullivan
Dougal Stanton wrote: If it basically works, what goes wrong in my programm? Maybe something to do with compiler flags? No. This isn't even a Haskell-related problem, in all likelihood. Bidirectional interaction with another process over a pipe, particularly when the other process is

Re: [Haskell-cafe] Re: process

2007-02-23 Thread Bryan O'Sullivan
Bryan O'Sullivan wrote: Just because *your* end of each pipe is a line-buffered file handle has no bearing on the *other* process's management of its pair of endpoints. For example, on a Unix-like system, the other process's stdio will block-buffer stdin and stdout by default if it finds

Re: [Haskell-cafe] How to build a generic spreadsheet?

2007-02-23 Thread Bryan O'Sullivan
Greg Fitzgerald wrote: I want to write a program where a user would update a bunch of variables, and everything that depends on those variables (and nothing else) are recalculated. http://sigfpe.blogspot.com/2006/11/from-l-theorem-to-spreadsheet.html

Re: [Haskell-cafe] Using loop fusion for writing efficent high-level code Re[2]: [Haskell] [Fwd: Re: Computer Language Shootout]

2007-02-28 Thread Bryan O'Sullivan
Bulat Ziganshin wrote: can you please provide examples of such code? I'd recommend taking a look at the new binary package. It's very cleanly written, and mostly easy to understand. It's also easy to see where the optimisations have been made. The only part that might induce sudden

Re: [Haskell-cafe] Proposal: simple interface to libraries Haddock

2007-03-02 Thread Bryan O'Sullivan
David House wrote: I'm proposing something simple that should make it easier for both Haskell programmers and Haskell tool writers to find the documentation for a function. Like this? http://haskell.org/hoogle/?q=map b ___ Haskell-Cafe

Re: [Haskell-cafe] Very Basic IO question

2007-03-02 Thread Bryan O'Sullivan
Joe Olivas wrote: However, changing 'putStrLn' to 'putStr' does not do what I would expect. The prompt doesn't get displayed until after there is input: This isn't a Haskell issue per se. The runtime is putting stdout into line-buffered mode, so you need to import System.IO and use hFlush

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

[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] 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

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

[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] 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.

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!

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] 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] 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] 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] 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] 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] [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] 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] 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] 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] [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

  1   2   3   4   5   >