[Haskell-cafe] Who manages ?

2010-11-04 Thread Peter Simons
Hi guys, a while ago, I created an account on Trac. Now, it seems that I've forgotten both the password and the e-mail address that I used at the time. I cannot log in, and I cannot make Trac send me the password either. Clearly, I need the help of a human being with administrator privileges to fi

Re: [Haskell-cafe] Functional MetaPost in 5 Steps

2008-10-28 Thread Peter Simons
Hi Robin, > [FuncMP problems with pdflatex] I have no experience whatsoever with pdflatex, I'm sorry, Funcmp works just fine for me in normal LaTeX, though. That's not exactly what you need, but from the sound of it, it might be step forward anyway. First of all, try writing the MetaPost files w

[Haskell-cafe] I/O performance drop in ghc 6.12.1

2010-01-14 Thread Peter Simons
Hi, I just updated to GHC 6.12.1, and I noticed a significant drop in I/O performance that I can't explain. The following code is a simple re-implementation of cat(1), i.e. it just echos all data from standard input to standard output: > module Main ( main ) where > > import System.IO > import Fo

[Haskell-cafe] Re: I/O performance drop in ghc 6.12.1

2010-01-14 Thread Peter Simons
Hi Svein, > Hold on, he's using hGetBuf/hPutBuf. exactly, that's what I was thinking. When a program requests that 'n' bytes ought to be read into memory at the location designated by the given 'Ptr Word8', how could GHC possibly do any encoding or decoding? That API doesn't allow for multi-byte

Re: [Haskell-cafe] ANN: wxHaskell 0.13.2

2012-01-07 Thread Peter Simons
Hi guys, > I am please to announce that wxHaskell 0.13.2 has just been uploaded > to Hackage. when I try to build the latest version on Linux/x86_64 running NixOS, I get the following error at configure time: Setup: Missing dependency on a foreign library: * Missing C library: wx_gtk2u

Re: [Haskell-cafe] How to make asynchronous I/O composable and safe?

2012-01-14 Thread Peter Simons
Hi guys, >> I'm not happy with asynchronous I/O in Haskell. It's hard to reason >> about, and doesn't compose well. > > Async I/O *is* tricky if you're expecting threads to do their own > writes/reads directly to/from sockets. I find that using a > message-passing approach for communication

Re: [Haskell-cafe] How to make asynchronous I/O composable and safe?

2012-01-14 Thread Peter Simons
Hi Daniel, > I've been trying to write networking code in Haskell too. I've also > come to the conclusion that channels are the way to go. isn't a tuple of input/output channels essentially the same as a stream processor arrow? I found the example discussed in the "arrow paper" [1] very enlight

Re: [Haskell-cafe] Installing REPA

2012-04-07 Thread Peter Simons
Hi Ben, > I've just pushed Repa 3 onto Hackage, which has a much better API > than the older versions, and solves several code fusion problems. when using the latest version of REPA with GHC 7.4.1, I have trouble building the repa-examples package: | Building repa-examples-3.0.0.1... | Prepr

Re: [Haskell-cafe] Subscriber-only lists as Maintainer contacts of Cabal packges

2012-04-07 Thread Peter Simons
Hi Joachim, > Please make sure the list is not set to subscriber only; it is an > unreasonable burden to subscribe for people who just want to send you > one question, and possibly have to contact dozends of different > package authors, e.g. as a distribution packager. +1 I have had that pro

Re: [Haskell-cafe] Installing REPA

2012-04-07 Thread Peter Simons
Hi Ben, > Please try again now. thank you very much for the quick update! Everything installs fine now. I've also packaged the latest versions for NixOS. Take care, Peter ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org

Re: [Haskell-cafe] [Haskell] JustHub 'Sherkin' Release

2012-06-15 Thread Peter Simons
Hi Chris, > Where is this functionality provided by Nix? simply run these commands # Haskell Platform 2009.2.0.2 nix-env -p ~/ghc-6.10.4 -iA haskellPackages_ghc6104.haskellPlatform # Haskell Platform 2010.2.0.0 nix-env -p ~/ghc-6.12.3 -iA haskellPackages_ghc6123.haskellPlatform # Haskell

Re: [Haskell-cafe] [Haskell] JustHub 'Sherkin' Release

2012-06-15 Thread Peter Simons
Hi Chris, > I cannot see how it can address any of the user-level Haskell package > database management and sandboxing mechanisms that I mentioned in the > announcement and subsequent emails. have you ever actually used Nix? Take care, Peter ___ H

Re: [Haskell-cafe] [Haskell] JustHub 'Sherkin' Release

2012-06-15 Thread Peter Simons
Hi Chris, > I deatiled some of my trials with Nix -- I wasn't making it up! of course, I didn't mean to imply that you were. My question was phrased poorly, I am sorry. What I meant to ask is: how much time, approximately, did you spend working with Nix? 1 hour? 10 hours? 10 days? 10 months? T

Re: [Haskell-cafe] [Haskell] JustHub 'Sherkin' Release

2012-06-17 Thread Peter Simons
Hi Chris, >> How much time, approximately, did you spend working with Nix? >> 1 hour? 10 hours? 10 days? 10 months? > > You know that it is not 10 months. actually, no. I don't know that, which is why I asked. I find it hard to get an answer from you, though. It seems strange that you keep su

Re: [Haskell-cafe] [Haskell] JustHub 'Sherkin' Release

2012-06-18 Thread Peter Simons
Hi Chris, > hub save project >project.har I am curious to see what this file looks like. Could you please post a short example of one? Take care, Peter ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/ha

Re: [Haskell-cafe] [Haskell] JustHub 'Sherkin' Release

2012-06-18 Thread Peter Simons
Hi Chris, > There is a worked out example at the bottom of the overview up on the > web site: http://justhub.org/overview thank you for the pointer, I think I found it: ^=7.4.1 List-0.4.2 fgl-5.4.2.4 hexpat-0.20.1 mtl-2.1.1 regex-base-0.93.2 regex-compat-0.95.1

Re: [Haskell-cafe] [Haskell] JustHub 'Sherkin' Release

2012-06-20 Thread Peter Simons
Hi Chris, I'm also wondering about this issue: >> - How do you handle packages that depend on system libraries? "hsdns", >> for example, requires the adns library to build. Does Hub know about >> this? Does Hub know about system-level libraries that Haskell packages need to build

Re: [Haskell-cafe] ghc-7.4 on CentOS-5.8 ?

2012-06-27 Thread Peter Simons
Hi Johannes, > ghc-7.0 is working but when I use it to compile 7.4, > it breaks with some linker error (relocation R_X86_64_PC32 ...) > it also suggests "recompile with -fPIC" but I don't see how. I seem to remember that this is a problem with the old version of GCC that's used to build the co

[Haskell-cafe] Which ghc binary does ghc-mod use?

2012-07-23 Thread Peter Simons
Hi, I am a happy user of Emacs with ghc-mod for Haskell programming. There is just one issue I've run into: I have multiple versions of GHC installed on my machine. Now, ghc-mod seems to use the GHC binary that was used to compile ghc-mod itself, but that is not the version I want it to use for sy

Re: [Haskell-cafe] Which ghc binary does ghc-mod use?

2012-07-24 Thread Peter Simons
Hi Brandon, > I think you'd have to install a separate ghc-mod binary for each one, > then, as it looks to me like ghc-mod is using ghc-as-a-library.  That > is, it actually has the compiler linked into itself. I see, thank you for the clarification. One more thing: I would like to configure

[Haskell-cafe] extensible-exceptions no longer a part of GHC 7.6.1?

2012-09-10 Thread Peter Simons
Hi, 'extensible-exceptions' used to be a part of GHC, but it appears that the package has been dropped from 7.6.1. Yet, the release notes on haskell.org don't say anything about this subject (other than TODO). Was that change intentional? Take care, Peter __

Re: [Haskell-cafe] GHC maintenance on Arch

2012-10-29 Thread Peter Simons
Hi Timothy, the Haskell community is not the right audience to be addressing these complaints to. Instead, you should be talking to the ArchLinux developers, who are responsible for packaging Haskell-related software in the [core] and [extra] repositories. I am no expert in these matters, but my g

Re: [Haskell-cafe] GHC maintenance on Arch

2012-10-30 Thread Peter Simons
Hi Vagif, > I fail to see how a fringe bleeding edge linux distro undermines a > haskell platform. Arch Linux does not comply to the Haskell Platform. That fact communicates to users of the distribution: "We, the maintainers, don't believe that HP is relevant." Clearly, this undermines the Hask

Re: [Haskell-cafe] How to determine correct dependency versions for a library?

2012-11-09 Thread Peter Simons
Hi Janek, > How to determine proper version numbers? if you know for a fact that your package works only with specific versions of its dependencies, then constrain the build to exactly those versions that you know to work. If *don't* know of any such limitations, then *don't* specify any constr

Re: [Haskell-cafe] How to determine correct dependency versions for a library?

2012-11-09 Thread Peter Simons
Hi Clark, > It's not restrictive. how can you say that by adding a version restriction you don't restrict anything? > I just don't like to claim that my package works with major versions > of packages that I haven't tested. Why does it not bother you to claim that your package can *not* be

Re: [Haskell-cafe] How to determine correct dependency versions for a library?

2012-11-11 Thread Peter Simons
Hi Clark. > I think we just use dependencies [to specify] different things. If dependency version constraints are specified as a white-list -- i.e. we include only those few versions that have been actually verified and exclude everything else --, then we take the risk of excluding *too much*. T

Re: [Haskell-cafe] How to determine correct dependency versions for a library?

2012-11-16 Thread Peter Simons
Hi Tobias, > A 1.1.4.0 build-depends: B ==2.5.* C ==3.7.* (overspecified) > B 2.5.3.0 build-depends: C ==3.* (underspecified) > C 3.7.1.0 > > Everything works nice until C-3.8.0.0 appears with incompatible changes > that break B, but not A. > > Now both A and B have to update their depende

Re: [Haskell-cafe] How to determine correct dependency versions for a library?

2012-11-16 Thread Peter Simons
Hi Tobias, >> When such a situation has arisen in the past, it's my experience >> that the author of B typically releases an update to fix the issue >> with the latest version of C: >> >> B 2.5.4.0 build-depends: C >= 3.8 >> >> So that particular conflict does hardly ever occur in practic

Re: [Haskell-cafe] Announce: Leksah 0.13.1 (a bit experimental)

2013-01-07 Thread Peter Simons
Hi Hamish, would it be possible to get an update for process-leksah that works with recent versions of the 'filepath' package? I cannot build leksah-server with GCC 7.4.2 because of this issue. Take care, Peter ___ Haskell-Cafe mailing list Haskell-Ca

Re: [Haskell-cafe] Announce: Leksah 0.13.1 (a bit experimental)

2013-01-09 Thread Peter Simons
Hi Hamish, > Features in process-leksah have been merged into process. For newer > versions of GHC leksah-server just depends on process. I trust this applies to the unreleased beta version that you just announced, right? (The latest release versions still seem to depend on process-leksah.) In

Re: [Haskell-cafe] Streaming bytes and performance

2013-03-19 Thread Peter Simons
Don Stewart writes: > Here's the final program: [...] Here is a version of the program that is just as fast: import Prelude hiding ( getContents, foldl ) import Data.ByteString.Char8 countSpace :: Int -> Char -> Int countSpace i c | c == ' ' || c == '\n' = i + 1 | oth

Re: [Haskell-cafe] Streaming bytes and performance

2013-03-19 Thread Peter Simons
Hi Don, > Compare your program (made lazy) on lazy bytestrings using file IO: [...] if I make those changes, the program runs even faster than before: module Main ( main ) where import Prelude hiding ( foldl, readFile ) import Data.ByteString.Lazy.Char8 countSpace :: Int -> Char -> In

Re: [Haskell-cafe] Streaming bytes and performance

2013-03-19 Thread Peter Simons
Hi Don, > "Using this input file stored in /dev/shm" > > So not measuring the IO performance at all. :) of course the program measures I/O performance. It just doesn't measure the speed of the disk. Anyway, a highly optimized benchmark such as the one you posted is eventually going to beat on

[Haskell-cafe] What happened to http://hackage.haskell.org/platform/2010.2.0.0/cabal/haskell-platform-2010.2.0.0.tar.gz?

2013-04-03 Thread Peter Simons
Is it just me or have some of the old Haskell Platform releases disappeared from haskell.org? The 2010.x links from http://www.haskell.org/platform/prior.html also point to non-existent pages. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org htt

Re: [Haskell-cafe] Packages in distro mentioned on hackage?

2013-04-30 Thread Peter Simons
Hi Magnus, > How does a distro get to be added like that? check out . Take care, Peter ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Array, Vector, Bytestring

2013-06-04 Thread Peter Simons
Hi Clark, > How is this a problem? > > If you're representing text, use 'text'. > If you're representing a string of bytes, use 'bytestring'. > If you want an "array" of values, think c++ and use 'vector'. the problem is that all those packages implement the exact same data type from scratch

Re: [Haskell-cafe] Array, Vector, Bytestring

2013-06-04 Thread Peter Simons
Hi Tom, > On Tue, Jun 04, 2013 at 04:01:37PM +0200, Peter Simons wrote: >> > How is this a problem? >> > >> > If you're representing text, use 'text'. >> > If you're representing a string of bytes, use 'bytestring'

Re: [Haskell-cafe] Array, Vector, Bytestring

2013-06-05 Thread Peter Simons
Hi Tom, thank you for the explanation. > I believe you are suggesting that there is redundancy in the > implementation details of these libraries, not in the APIs they > expose. I meant to say that there is redundancy in *both*. The libraries mentioned in this thread re-implement the same typ

[Haskell-cafe] Re: Updating Haskell Packages through Archlinux becoming A Pain

2010-11-16 Thread Peter Simons
Hi Mathew, > [My GHC installation breaks] when pacman updates a package using an > AUR package, which cabal refuses to install because it can break > other packages (yet the package still gets installed according to > pacman). this bug has been fixed about two weeks ago; it should no longer o

Re: [Haskell-cafe] ANN: hledger 0.13

2010-12-07 Thread Peter Simons
Hi Simon, thank you very much for your efforts. I wonder whether there is any particular reason why hledger won't build with process-1.0.1.3? Take care, Peter ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listin

Re: [Haskell-cafe] ANN: hledger 0.13

2010-12-09 Thread Peter Simons
Hi Simon, > [Are you] avoiding use of cabal-install and hackage entirely? yes, I'm trying to provide a package for hledger 0.13 that can be installed using ArchLinux's native package manager. The current version is available here: . > How did hl

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-13 Thread Peter Simons
Hi Mathieu, > Why don't you use ulimit for this job? > > $ ulimit -m 32M; ./cpsa yes, I was thinking the same thing. Relying exclusively on GHC's ability to limit run-time memory consumption feels like an odd choice for this task. It's nice that this feature exists in GHC, but it's inherently

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-14 Thread Peter Simons
Hi John, > On Mon, Dec 13, 2010 at 10:45 AM, Peter Simons wrote: > >> Relying exclusively on GHC's ability to limit run-time memory >> consumption feels like an odd choice for this task. It's nice that >> this feature exists in GHC, but it's inheren

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-15 Thread Peter Simons
Hi John, > I think the previous responder was asserting the 32M limit, not you. I believe the previous poster suggested that you use ulimit to provide a hard upper bound for run-time memory use. That 32M figure seemed to be made up out of thin air just as an example to illustrate the syntax of t

Re: [Haskell-cafe] ANNOUNCE: storable-endian

2010-12-24 Thread Peter Simons
Hi guys, >> You could use ADNS.Endian.endian from package hsdns in your Setup.hs >> to define endianness at compile time. > > Cool, it's already there! However I would not recommend to let a > low-level library depend on a higher-level one. I think it would be > cleaner to move the ADNS.Endi

[Haskell-cafe] ArchLinux binary repository available for beta testing

2011-01-11 Thread Peter Simons
Hi guys, those of you who use the ArchLinux distribution might be interested to know that a team of volunteers has put together a binary package repository that complements the set of Haskell packages that's already being distributed by ArchLinux. Subscribers of that repository can use Pacman to i

Re: [Haskell-cafe] Why is there no "splitSeperator" function in Data.List

2011-02-14 Thread Peter Simons
Hi Evan, >>> The reason it's not in Data.List is because there are a bazillion >>> different splits one might want (when I was pondering the issue >>> before Brent released it, I had collected something like 8 >>> different proposed splits), so no agreement could ever be reached. >> >> It is

Re: [Haskell-cafe] makeTokenParser + LanguageDef

2011-03-08 Thread Peter Simons
Hi Klaus, for what it's worth, you might want to consider using this package instead of Parsec: http://hackage.haskell.org/package/BNFC Take care, Peter ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/

Re: [Haskell-cafe] Crypto-api performance

2011-05-04 Thread Peter Simons
Also, it appears that crypto-api needs vast amounts of memory when compiled with optimization enabled. The latest version 0.6.1 is effectively unbuildable on my EeePC, which has only 1GB RAM. That property is fairly undesirable for a library package. Take care, Peter

Re: [Haskell-cafe] Crypto-api performance

2011-05-05 Thread Peter Simons
Hi Matthew, > While I haven't investigated myself, from seeing haskell build processes > in the past this is almost certainly not crypto-api's fault and is in > fact your linker's fault. If you are not using it already, try switching > to gold over ld, it may help. well, memory consumption sk

[Haskell-cafe] Distributions link on Hackage

2011-08-11 Thread Peter Simons
Hi, the home page of a package on Hackage links to various distributions to show which versions are available, i.e. Fedora, Debian, FreeBSD, etc. In NixOS, we have fairly up-to-date package set, and I would like to see that distribution included on Hackage. Now I wonder how to get that done? Can

Re: [Haskell-cafe] Off-topic: Mathematics

2011-08-30 Thread Peter Simons
Hi Andrew, > I know of several places where I can ask maths questions and half a > dozen people will take guesses at what the correct solution might be. > I haven't yet found anywhere where I can say "when would a > chi-squared test be more appropriate than a KS test?" and get an > informed,

Re: [Haskell-cafe] ANN: cabal-ghci 0.1

2011-09-09 Thread Peter Simons
Hi Etienne, > Here is a helpful package I wrote to ease the development of projects > using cabal. thank you very much for this helpful tool! I notice that Haddock has trouble parsing the documentation: http://hackage.haskell.org/packages/archive/cabal-ghci/0.1/logs/failure/ghc-7.2 Is tha

Re: [Haskell-cafe] problem with cabal install MissingH-1.1.1.0

2011-09-22 Thread Peter Simons
Hi Mariano, > I'm with mac OS X lion, ghc version 7.2.1 and when a i try to install > MissingH version 1.1.1.0 it fails with [...] that version of MissingH compiles fine on Linux, so I reckon the problem you're seeing is in some way specific to Darwin. Your best bet of getting a fix would be to

Re: [Haskell-cafe] [ANNOUNCEMENT] xmobar 0.14

2011-12-10 Thread Peter Simons
Hi Jose, > I'm happy to announce the release of xmobar 0.14. previous versions of xmobar used to compile fine with GHC 6.10.4, but the new version no longer does: src/Parsers.hs:163:52: Couldn't match expected type `Char' against inferred type `[Char]' Expected type: GenPa

Re: [Haskell-cafe] [ANNOUNCEMENT] xmobar 0.14

2011-12-11 Thread Peter Simons
Hi Jose, > Peter, would using parsec 3.x be an acceptable solution to you? well, we can link xmobar with parsec 3.x on NixOS. The situation is tricky, though, because the latest version of parsec that we have, 3.1.2, doesn't compile with GHC 6.10.4 anymore, so we'd have to use some older version

Re: [Haskell-cafe] [ANNOUNCEMENT] xmobar 0.14

2011-12-11 Thread Peter Simons
Hi Antoine, > What errors are you getting compiling with GHC 6.10.4? If its a small > thing I certainly don't mind patching things. I am sorry, my previous statement was inaccurate. Parsec 3.1.2 compiles fine, but the 'text' library -- on which Parsec depends -- does not. We can probably avoid

Re: [Haskell-cafe] Announce: The Haskell Platform 2011.4

2011-12-18 Thread Peter Simons
Hi guys, > We're pleased to announce the release of the Haskell Platform: a > single, standard Haskell distribution for everyone. Haskell Platform 2011.4 is fully supported on NixOS . Take care, Peter ___ Haskell-Cafe mailing lis

[Haskell-cafe] Re: Haskell Speed

2005-12-23 Thread Peter Simons
Daniel Carrera writes: > http://shootout.alioth.debian.org/ > > It looks like Haskell doesn't do very well. It seems to be > near the bottom of the pile in most tests. Is this due to > the inherent design of Haskell or is it merely the fact that > GHC is young and hasn't had as much time to

[Haskell-cafe] Re: Haskell Speed

2005-12-23 Thread Peter Simons
Daniel Carrera writes: > If the results could be trusted, they would be useful. > You could balance the expected loss in performance > against other factors (e.g. speed of development). How do you measure the time it takes to come up with a QuickSort algorithm that, implemented in Haskell, cru

[Haskell-cafe] Re: Haskell Speed

2005-12-23 Thread Peter Simons
Daniel Carrera writes: > when I have a simple algorithm and performance is an > issue [...] I'd use C. You don't have to. You can write very fast programs in Haskell. I never really finished the article I wanted to write about this subject, but the fragment I have might be interesting or even

[Haskell-cafe] Re: Haskell Speed

2005-12-25 Thread Peter Simons
Paul Moore writes: > It would be interesting to see standalone code for wcIOB > (where you're allowed to assume that any helpers you > need, like your block IO library, are available from the > standard library). This would help in comparing the > "obviousness" of the two approaches. A simpl

[Haskell-cafe] Re: Haskell Speed

2005-12-25 Thread Peter Simons
Tomasz Zielonka writes: >> wc :: String -> (Int, Int, Int) >> wc file = ( length (lines file) >> , length (words file) >> , length file >> ) > > I have a crazy idea: what if we computed all three length > applications concurrently, with the RTS preempting the

[Haskell-cafe] Re: binary IO

2005-12-27 Thread Peter Simons
Joel Reymont writes: > I would challenge everyone with a fast IO library to plug > it into the timeleak code, run it under a profiler and > post the results (report + any alarms). My guess is that you would learn more if _you_ would plug the different IO libraries into your test code. I'm cert

[Haskell-cafe] Re: binary IO

2005-12-27 Thread Peter Simons
Joel Reymont writes: > I will have to leave this for a while. I apologize but > I'm more than a bit frustrated at the moment and it's not > fair of me to take it out on everybody else. Never mind. Haskell has a very high potential for frustrating newcomers. I went through the exact same experi

[Haskell-cafe] Re: binary IO

2005-12-29 Thread Peter Simons
Bulat Ziganshin writes: > your BlockIO library is great, but it's usage is limited > to very specific sutuations - when we can save pass state > between processing of individual bytes In my experience, any other approach to I/O is slow. If you don't have an explicit state between processing of

[Haskell-cafe] Re: Haskell Speed

2005-12-29 Thread Peter Simons
Albert Lai writes: > For almost a decade, most (I dare claim even all) Pascal > and C compilers were "three-pass" or "two-pass". It means > perhaps the compiler reads the input two or three times > [...], or perhaps the compiler reads the input once, > produces an intermediate form and saves

[Haskell-cafe] Re: binary IO

2005-12-30 Thread Peter Simons
Hi Bulat, >> general-purpose binary I/O library for Haskell. > > where i can find it? the module is available here: http://cryp.to/blockio/fast-io.html http://cryp.to/blockio/fast-io.lhs The article is incomplete and a bit messy, but the code works fine. Feedback and ideas for improvemen

[Haskell-cafe] Re: [Haskell] Re: Streams: the extensible I/O library

2006-02-06 Thread Peter Simons
Hey Bulat, I tried removing the "import System.Win32", but unfortunately it only got me so far: | Examples$ ghc -i.. -O2 -funbox-strict-fields --make wc.hs -o wc | Chasing modules from: wc.hs | [ 1 of 16] Compiling System.FD( ../System/FD.hs, ../System/FD.o ) | | /tmp/ghc9376_0.hc:6

[Haskell-cafe] file upload with Network.CGI

2004-08-26 Thread Peter Simons
Has anyone managed to process the results of a "file upload" formular, such as Choose a file: ..., with Network.CGI successfully? I have tried it, but it appears that the library can't handle the "multipart/form-data" encoding -- is that possible? I'll appreciate any suggestions how

[Haskell-cafe] Re: file upload with Network.CGI

2004-08-27 Thread Peter Simons
Glynn Clements writes: > About the only functions in Network.CGI which might be > useful for processing file uploads are getQueryString and > getCgiVars, neither of which are exported. Fortunately, another reader of this list has written the necessary parsers already and sent me a copy of the

[Haskell-cafe] Re: Tutorial about low-level I/O in Haskell

2004-10-12 Thread Peter Simons
Ferenc Wagner writes: > Pretty neat. Wouldn't it be a nice addition to the > Tutorials section on the Haskell Bookshelf? Thank you. I certainly wouldn't mind having a link from haskell.org to it. Neither would I mind having a link to the BlockIO library itself, but in the past I couldn't seem t

[Haskell-cafe] Re: Silly I/O question

2004-09-28 Thread Peter Simons
John Goerzen writes: > That failed, though, because getContents closes the file > after it's been completely read (ugh -- why?). getContents reads from standard input: you can't seek on that stream. Just think of "cat String -> IO () printTimes n msg = sequence_ (replicate n (putStr msg))

[Haskell-cafe] Re: Silly I/O question

2004-09-28 Thread Peter Simons
John Goerzen writes: > But the block I/O in Haskell makes no sense to me (how do > I allocate a Ptr type block thingy)? With mallocArray. Block I/O is difficult, though. >> You might want to write a function that copies the file >> _once_ and then just call that function several times. >

[Haskell-cafe] State monad strictness (was: ... abysmal Language Shootout results)

2004-09-30 Thread Peter Simons
How can anyone stay away from such a deliciously pointless waste of time as implementing a wc(1) derivate? :-) Here is my attempt: > import IO > > type Count = Int > data CountingState = ST !Bool !Count !Count !Count > deriving (Show) > > initCST = ST True 0 0

[Haskell-cafe] Tutorial about low-level I/O in Haskell

2004-10-05 Thread Peter Simons
Hi, while polishing a small library of mine, I ended up writing a tutorial about the use of hGetBufNonBlocking and the related Foreign.* functions you need to do fast, block-oriented I/O in Haskell. There is something to be said for literate programming. Using recent topics for inspiration, the t

[Haskell-cafe] Re: OCaml list sees abysmal Language Shootout results

2004-10-07 Thread Peter Simons
Keith Wansbrough writes: > Count me as a vote for the better-but-slightly-slower wc. How about the attached program? On my machine it faster than Tomasz's version, and I think it's still a fairly clean source code. Using some random large file for input, I got these results with time(1): real

[Haskell-cafe] Re: OCaml list sees abysmal Language Shootout results

2004-10-07 Thread Peter Simons
Josef Svenningsson writes: > What *is* true is that it is difficult to write good > performance I/O in any of the *implementations* that we > have. GHC has everything you need to do fast I/O in Haskell. If you use hGetBufNonBlocking with 'Ptr a', you have essentially the performance of read(2)

Re: [Haskell-cafe] Re: OCaml list sees abysmal Language Shootout results

2004-10-08 Thread Peter Simons
Ketil Malde writes: > Couldn't readFile et al. provide the standard interface, > but use hGetBuf tricks (e.g. from your 'wc' entry) behind > the curtains? No amount of hGetBuf'ing will speed the program up if the problem is the algorithm. I/O comes _sequentially_, and every program that doesn'

[Haskell-cafe] Re: Subsequence near solved hopefully

2004-10-17 Thread Peter Simons
Sam Mason writes: > Just to muddy the water a bit. . . What happens if the > second string is infinite? This version should do it: isSubSeq :: (Eq a) => [a] -> [a] -> Bool isSubSeq [] _= True isSubSeq _ []= False isSubSeq (x:xs) (y:ys) | x == y= isSubSeq xs ys | oth

[Haskell-cafe] Stream processors

2004-10-21 Thread Peter Simons
Hi, I have run across the following idiom several times in the last few weeks: Some part of my program reads input from a 'Handle' and repeatedly calls a "stream processor" to incrementally compute some result, say an SHA1 hash, for example. All my stream processors can be reduced to the followin

[Haskell-cafe] Re: Stream processors

2004-10-21 Thread Peter Simons
Ben Rudiak-Gould writes: > Must contexts be used in a single-threaded manner? If so, > I would expect this interface: > start :: IO ctx > feed :: ctx -> Buffer -> IO () > commit :: ctx -> IO a 'feed' cannot have this signature because it needs to update the context. > If

[Haskell-cafe] Re: Stream processors

2004-10-21 Thread Peter Simons
K P SCHUPKE writes: > This is the interface I came up with (and its fairly efficient): > data IList a i e = ICons i i (a i e) (IList a i e) | INil Isn't that an interface for doing fast I/O rather than for writing stream processors? If I look at the consumer: > wc :: List l Word8 => l Word8 -

[Haskell-cafe] Re: Stream processors

2004-10-21 Thread Peter Simons
K P SCHUPKE writes: > Okay, maybe I misunderstood, I thought by stream > processors you meant functions of the type: > process :: [a] -> [a] No, my stream processors currently have the API I described in my initial posting. What I was wondering is whether there is a more general API that

[Haskell-cafe] Re: Stream processors

2004-10-21 Thread Peter Simons
Ben Rudiak-Gould writes: >> > start :: IO ctx >> > feed :: ctx -> Buffer -> IO () >> > commit :: ctx -> IO a >> 'feed' cannot have this signature because it needs to >> update the context. > Sure it can -- it's just like writeIORef :: IORef a -> a -> IO (). I guess it's moo

[Haskell-cafe] Re: Stream processors

2004-10-21 Thread Peter Simons
K P SCHUPKE writes: > My point was... using the IO library I posted which > abstracts the buffer management, you can treat the IO as > a simple list... Do you happen to have a ready-to-run word-counting example for me which is based on your library? I've tried to compile the code you posted, b

[Haskell-cafe] Re: Stream processors

2004-10-21 Thread Peter Simons
Ben Rudiak-Gould writes: > I'm not arguing about generality; I simply don't > understand how your interface is supposed to be used. > E.g.: > do ctx <- start >ctx1 <- feed ctx array1 >[...] Note my original definition: type Buffer = (Ptr Word8, Int) data StreamPro

[Haskell-cafe] Re: Stream processors

2004-10-21 Thread Peter Simons
Jeremy Shaw writes: > Here is a some code I scraped off the net a while ago, > though I can't seem to find the origin anymore. I _think_ it is from part of Fudgets library: http://www.cs.chalmers.se/Cs/Research/Functional/Fudgets/ Thanks for posting it, though, this implementation is rather

[Haskell-cafe] Re: Stream processors

2004-10-21 Thread Peter Simons
Ben Rudiak-Gould writes: > bar :: StreamProc ctx a -> IO (a,a) > bar sp = do > ctx <- start sp > (ptr1,n1) <- ... > (ptr2,n2) <- ... > ctx1 <- feed sp ctx (ptr1,n1) > ctx2 <- feed sp ctx (ptr2,n2) > val1 <- commit sp ctx1 > val2 <- commit sp ctx2 > ret

[Haskell-cafe] Are handles garbage-collected?

2004-10-23 Thread Peter Simons
What happens when a System.IO.Handle falls out of scope without being explicitly hClosed? Is that a resource leak? Or will the RTS close the handle for me? Peter ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/has

[Haskell-cafe] Re: Are handles garbage-collected?

2004-10-24 Thread Peter Simons
Tomasz Zielonka writes: > AFAIK, Handles have finalisers which close them, but I > don't know if GHC triggers garbage collection when file > descriptors run out. If not, you will have problems if > you manage to run out of fds between GCs. Thank you for answering. Now there is only one probl

[Haskell-cafe] Re: Are handles garbage-collected?

2004-10-24 Thread Peter Simons
Remi Turk writes: >> Assuming I could _not_ use 'bracket', 'withFile', >> 'finally' or any of the other usual scope-guarding >> techniques [...] > Refactoring comes to the mind... ;) I wish that were possible! I use bracket-style resource allocation wherever I can, but in this case the Handl

[Haskell-cafe] Re: Are handles garbage-collected?

2004-10-24 Thread Peter Simons
Marcin 'Qrczak' Kowalczyk writes: > It does not necessarily make bracket unavailable. Just > put it somewhere outside, when it's known when the file > will need to be closed. The problem is that there is a gap of coverage, so to speak. It works like this in my code: input -> iodriver --> con

[Haskell-cafe] Re: Are handles garbage-collected?

2004-10-24 Thread Peter Simons
Keean Schupke writes: >> The _result_ of a rather complex computation > return a function that returns the handle. The idea is good. :-) You'll find my other posting explains that a bit more: My main driver doesn't know about the handle; that's just one more entry in the state of the connecti

[Haskell-cafe] Re: Are handles garbage-collected?

2004-10-26 Thread Peter Simons
oleg writes: > It seems you don't need to store the whole state in MVar: > it's enough to store a `clean-up' action. Yes, that is good advice, I'll do that. Thank you, Oleg. Peter ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.or

[Haskell-cafe] Re: exitFailure under forkProcess

2004-10-26 Thread Peter Simons
John Goerzen writes: > (progname): forkProcess: uncaught exception Quoting from the documentation: forkProcess :: IO () -> IO ProcessID [...] On success, forkProcess returns the child's ProcessID to the parent process; in case of an error, an exception is thrown. What I assume is happ

[Haskell-cafe] Re: exitFailure under forkProcess

2004-10-26 Thread Peter Simons
John, just to avoid any possible confusion: I emailed my reply to you and posted it to the list as well, but unfortunately I hit the wrong button so that my mail to you doesn't _say_ that it is a carbon copy. Sorry about the mess. By the way: It's good to know I'm not the only one wrestling with

[Haskell-cafe] Re: Processing of large files

2004-11-01 Thread Peter Simons
Alexander N Kogan writes: > I'm newbie and I don't understand how to process large > files in haskell with constant memory requirements. Read and process the file in blocks: http://cryp.to/blockio/docs/tutorial.html Peter ___ Haskell-Cafe mailing

[Haskell-cafe] Re: www.haskell.org -> applications -> HWS-WP

2004-11-02 Thread Peter Simons
Benjamin Franksen writes: > Do you guys have any idea where to get the sources for > the HWS (with or without plugins)? I _think_ the latest version is here: http://cvs.sourceforge.net/viewcvs.py/haskell-libs/libs/hws-wp/ You'll have to fetch it with CVS: cvs -d:pserver:[EMAIL PROTECTED]

[Haskell-cafe] Re: Processing of large files

2004-11-02 Thread Peter Simons
John Goerzen writes: >> Read and process the file in blocks: > I don't think that would really save much memory [...] Given that the block-oriented approach has constant space requirements, I am fairly confident it would save memory. > and in fact, would likely just make the code a lot more

  1   2   >