Re: [Haskell-cafe] The Garbage Collector Ate My Homework

2007-07-04 Thread Stefan O'Rear
On Wed, Jul 04, 2007 at 03:56:20PM +1000, Thomas Conway wrote: Well, not quite, but look at the following: 118,342,689,824 bytes allocated in the heap 144,831,738,780 bytes copied during GC (scavenged) 335,086,064 bytes copied during GC (not scavenged) 255,257,516 bytes maximum residency

Re: [Haskell-cafe] The Garbage Collector Ate My Homework

2007-07-04 Thread Tim Chevalier
[I assume this was meant to go to the list as well, so I'm adding it back to the CCs] On 7/3/07, Thomas Conway [EMAIL PROTECTED] wrote: It occurs to me that tweaking the GC parameters can probably make a big difference: is starting with a bigger heap likely to help, or more generations? My

RE: [Haskell-cafe] Sparse documentation

2007-07-04 Thread Simon Peyton-Jones
| Fortunately, some kind soul has gone through and converted the | documentation to haddock format: | http://hackage.haskell.org/trac/ghc/ticket/1410 | | So it'll all appear in the html docs in the next version. In the mean | time one can look at the haddock comments in the source: |

RE: [Haskell-cafe] Sparse documentation

2007-07-04 Thread Simon Peyton-Jones
Writing documentation for libraries is one way in which ordinary Haskell users can really contribute to the Haskell community. It's not hard to do (grab the Darcs repo, type away), and it's widely appreciated. People often don't feel qualified do to this, but documentation written by an

RE: [Haskell-cafe] Sparse documentation

2007-07-04 Thread Michael T. Richter
On Wed, 2007-04-07 at 08:03 +0100, Simon Peyton-Jones wrote: | Fortunately, some kind soul has gone through and converted the | documentation to haddock format: | http://hackage.haskell.org/trac/ghc/ticket/1410 | | So it'll all appear in the html docs in the next version. In the mean | time

Re: [Haskell-cafe] Sparse documentation

2007-07-04 Thread Jules Bean
Andrew Coppin wrote: Essentially I want to run a parser on top of a parser, and I think maybe this is the way to do it. I doubt monad transformers are the answer. I imagine you just want to one run parser over the result of the previous, which is just function composition, modulo a sensible

[Haskell-cafe] Playing with delimited continuations

2007-07-04 Thread Dan Doel
Hello, My interest was recently caught reading some of Oleg Kiselyov's material on delimited continuations, and so I decided to look into them a little closer. Don Stewart also mentioned in passing on #haskell that'd it'd be nice to have support for delimited continuations either in the

Re: [Haskell-cafe] Re: Abstraction leak

2007-07-04 Thread Philip Armstrong
On Sun, Jul 01, 2007 at 06:07:13PM +0100, Andrew Coppin wrote: I haven't actually tried, but presumably a TCP connection is represented in the same way as a file, and so has the same problems. Basically doing binary I/O seems to be one of those things that in Haskell falls into the class of

Re: [Haskell-cafe] Sparse documentation

2007-07-04 Thread Claus Reinke
Simon, if the less-talented among us (like me) want to contribute to GHC's docs -- and especially documenting the libraries -- what's the best way to go about this? I'm not too comfortable with the notion of just going into GHC's guts and Haddocking the comments, contributing patches willy-nilly

Re: [Haskell-cafe] Re: Abstraction leak

2007-07-04 Thread Donald Bruce Stewart
phil: On Sun, Jul 01, 2007 at 06:07:13PM +0100, Andrew Coppin wrote: I haven't actually tried, but presumably a TCP connection is represented in the same way as a file, and so has the same problems. Basically doing binary I/O seems to be one of those things that in Haskell falls into the

Re: [Haskell-cafe] Re: Abstraction leak

2007-07-04 Thread Thomas Conway
Anyone trying to do any of this? I've done some work in this area. I'm particularly interested in manipulating ASN.1 in haskell. Actually, my first use of Parsec was an ASN.1 parser. I'd done one previously in Spirit (the Boost C++ rip-off of parsec), but semantic actions were horrible in the

Re: [Haskell-cafe] Re: Abstraction leak

2007-07-04 Thread Donald Bruce Stewart
drtomc: Anyone trying to do any of this? I've done some work in this area. I'm particularly interested in manipulating ASN.1 in haskell. Actually, my first use of Parsec was an ASN.1 parser. I'd done one previously in Spirit (the Boost C++ rip-off of parsec), but semantic actions were

Re: [Haskell-cafe] Re: Abstraction leak

2007-07-04 Thread Philip Armstrong
On Wed, Jul 04, 2007 at 09:02:15PM +1000, Donald Bruce Stewart wrote: phil: On Sun, Jul 01, 2007 at 06:07:13PM +0100, Andrew Coppin wrote: I haven't actually tried, but presumably a TCP connection is represented in the same way as a file, and so has the same problems. Basically doing binary

Re: [Haskell-cafe] Re: Abstraction leak

2007-07-04 Thread Donald Bruce Stewart
phil: On Wed, Jul 04, 2007 at 09:02:15PM +1000, Donald Bruce Stewart wrote: phil: On Sun, Jul 01, 2007 at 06:07:13PM +0100, Andrew Coppin wrote: I haven't actually tried, but presumably a TCP connection is represented in the same way as a file, and so has the same problems. Basically

Re: [Haskell-cafe] Haskell's partial application (not currying!) versus Business Objects Gem Cutter's burning

2007-07-04 Thread Conor McBride
Hi Jules Your explanation of lambda-abstraction, dealing in full generality with both scope and multiplicity, is a good one. But it's still interesting to investigate the possibility of a privileged notation for linear abstraction, based on leaving holes in things, by way of illustrating

[Haskell-cafe] Re: Sparse documentation

2007-07-04 Thread apfelmus
Claus Reinke wrote: Simon, if the less-talented among us (like me) want to contribute to GHC's docs -- and especially documenting the libraries -- what's the best way to go about this? I'm not too comfortable with the notion of just going into GHC's guts and Haddocking the comments,

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Philip Armstrong
On Wed, Jul 04, 2007 at 09:44:13PM +1000, Donald Bruce Stewart wrote: Binary instances are pretty easy to write. For a simple data type: instance Binary Exp where put (IntE i) = do put (0 :: Word8) put i put (OpE

[Haskell-cafe] Where's the problem ?

2007-07-04 Thread Rome
Hi everyone, I write a program for fast online multiplication, this means, leading digits are computed first, so this program is able to handle real numbers. My program and Source-Code is available under http://www.romeinf04.de http://www.romeinf04.de but only with german comments, because

Re[2]: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Bulat Ziganshin
Hello Philip, Wednesday, July 4, 2007, 5:50:42 PM, you wrote: This doesn't seem to deal with endianness. Am I missing something? alternative: http://haskell.org/haskellwiki/Library/AltBinary http://haskell.org/haskellwiki/Library/Streams -- Best regards, Bulat

Re: [Haskell-cafe] Very simple parser

2007-07-04 Thread Alexis Hazell
On Tuesday 03 July 2007 09:51, Arie Peterson wrote: No, there is a 'State s' monad provided (for arbitrary state type 's'), which implements the 'get' and 'put' methods. In other words, 'State s' is an instance of the 'MonadState s' class. This terminology can be really confusing at first.

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Philip Armstrong
On Wed, Jul 04, 2007 at 06:52:08PM +0400, Bulat Ziganshin wrote: Hello Philip, Wednesday, July 4, 2007, 5:50:42 PM, you wrote: This doesn't seem to deal with endianness. Am I missing something? alternative: http://haskell.org/haskellwiki/Library/AltBinary

Re: [Haskell-cafe] Abstraction leak

2007-07-04 Thread Malcolm Wallace
Andrew Coppin [EMAIL PROTECTED] wrote: While we're on the subject... am I the first person to notice that Haskell doesn't appear to have much support for fiddling with streams of bits? See The Bits Between The Lambdas: Binary Data in a Lazy Functional Language Malcolm Wallace and Colin

Re: [Haskell-cafe] Parsers are monadic?

2007-07-04 Thread Malcolm Wallace
Claus Reinke [EMAIL PROTECTED] wrote: (b) i like my combinator grammars to be reversible, so that a single grammar specification can be used for both parsing and unparsing/pretty-printing. that means i have to define the details myself anyway. Oh cool - this is something I have

Re: [Haskell-cafe] Haskell's partial application (not currying!) versus Business Objects Gem Cutter's burning

2007-07-04 Thread Marc A. Ziegert
exercise done. :D there is still a problem with the functional dependencies. see last line of code. - marc Am Mittwoch, 4. Juli 2007 14:22 schrieb Conor McBride: {? * 10 + ?} 4 2 = 42 http://hackage.haskell.org/trac/haskell-prime/wiki/FlexiblePartialApplication (3) Exercise for

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Stefan O'Rear
On Wed, Jul 04, 2007 at 02:50:42PM +0100, Philip Armstrong wrote: The Data.Binary comes with one tool to derive these. The DrIFT preprocessor also can, as can Stefan O'Rear's SYB deriver. I just write them by hand, or use the tool that comes with the lib. More docs here,

Re: [Haskell-cafe] Where's the problem ?

2007-07-04 Thread Stefan O'Rear
On Wed, Jul 04, 2007 at 07:30:55AM -0700, Rome wrote: I write a program for fast online multiplication, this means, leading digits are computed first, so this program is able to handle real numbers. My program and Source-Code is available under http://www.romeinf04.de

Re: [Haskell-cafe] Very simple parser

2007-07-04 Thread Arie Peterson
Alexis Hazell wrote: | This may be a stupid question, but i don't understand how (indeed, if) one | can | maintain multiple states using the State monad, since 'get' etc. don't | seem | to require that one specify which particular copy of a State monad one | wishes | to 'get' from, 'put' to etc.?

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Philip Armstrong
On Wed, Jul 04, 2007 at 09:15:59PM +0400, Bulat Ziganshin wrote: Does that mean that the code is unwritten or that the documentation is unwritten. IAMFI :) of course all unwritten notes means unfinished docs. library contains more than 100 functions so it was not easy to document them all. you

[Haskell-cafe] Re: Deadlock in real number multiplication (Was: Where's the problem ?)

2007-07-04 Thread Henning Thielemann
On Wed, 4 Jul 2007, Rome wrote: I write a program for fast online multiplication, this means, leading digits are computed first, so this program is able to handle real numbers. My program and Source-Code is available under http://www.romeinf04.de http://www.romeinf04.de but only with

Re: [Haskell-cafe] Sparse documentation

2007-07-04 Thread Andrew Coppin
Simon Peyton-Jones wrote: Writing documentation for libraries is one way in which ordinary Haskell users can really contribute to the Haskell community. It’s not hard to do (grab the Darcs repo, type away), and it’s widely appreciated. People often don’t feel “qualified” do to this, but

Re: [Haskell-cafe] Sparse documentation

2007-07-04 Thread Andrew Coppin
Jules Bean wrote: Andrew Coppin wrote: Essentially I want to run a parser on top of a parser, and I think maybe this is the way to do it. I doubt monad transformers are the answer. I imagine you just want to one run parser over the result of the previous, which is just function composition,

Re: [Haskell-cafe] Haskell's partial application (not currying!) versus Business Objects Gem Cutter's burning

2007-07-04 Thread Conor McBride
Hi Marc Thanks for giving it a go! On 4 Jul 2007, at 17:33, Marc A. Ziegert wrote: exercise done. :D there is still a problem with the functional dependencies. see last line of code. - marc Looks like a good start. Quite different from the way I did it. I can assure you that it's

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Andrew Coppin
Philip Armstrong wrote: [1] Which sick application *needs* intermixed endianness? *Clearly* you've never been to Singapore... ...er, I mean, Ever tried playing with networking protocol stacks? ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Deadlock in real number multiplication (Was: Where's the problem ?)

2007-07-04 Thread Rome
A friend of mine compiled it under Linux and got: . . . 32779 : 1 1 ---32776-- 0 32780 : 1 0 ---32777-- -1 Main: Ix{Integer}.index: Index (32766) out of range ((0,32765)) If I convert every Integer into Int and use instead of the generic list functions the prelude-list functions,

Re: [Haskell-cafe] Deadlock in real number multiplication (Was: Where's the problem ?)

2007-07-04 Thread Henning Thielemann
On Wed, 4 Jul 2007, Rome wrote: A friend of mine compiled it under Linux and got: . . . 32779 : 1 1 ---32776-- 0 32780 : 1 0 ---32777-- -1 Main: Ix{Integer}.index: Index (32766) out of range ((0,32765)) If I convert every Integer into Int and use instead of the generic

Re: [Haskell-cafe] Very simple parser

2007-07-04 Thread Ilya Tsindlekht
On Thu, Jul 05, 2007 at 12:58:06AM +1000, Alexis Hazell wrote: On Tuesday 03 July 2007 09:51, Arie Peterson wrote: No, there is a 'State s' monad provided (for arbitrary state type 's'), which implements the 'get' and 'put' methods. In other words, 'State s' is an instance of the

Re[2]: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Bulat Ziganshin
Hello Philip, Wednesday, July 4, 2007, 9:41:27 PM, you wrote: I'm thinking of the elimination of the boxing of values drawn out of the input stream where possible, eg if I was writing a stream processor that folded across the values in the input stream, it would (presumably) be more

[Haskell-cafe] Parsec - collecting patches - How to contact maintainer Daan Leijen ?

2007-07-04 Thread Marc Weber
Paresc is a great piece of software. But there are some things which do bother me occasionally. A short list: Things I'd like to change: a) custom location tracking. (I've already written a patch, but I haven't tested how much speed will suffer? Which would be a nice test?) b) Add a

[Haskell-cafe] A very nontrivial parser

2007-07-04 Thread Andrew Coppin
Well, I eventually got it to work correctly... (!) My goal is to be able to stack multiple parsers one on top of the other - but be able to *change* the stack half way through parsing if needed. This I eventually succeeded in doing. The external interface is fairly simple, but the type

Re: [Haskell-cafe] A very nontrivial parser

2007-07-04 Thread Jonathan Cast
On Wednesday 04 July 2007, Andrew Coppin wrote: Well, I eventually got it to work correctly... (!) My goal is to be able to stack multiple parsers one on top of the other - but be able to *change* the stack half way through parsing if needed. This I eventually succeeded in doing. The external

Re: [Haskell-cafe] The Garbage Collector Ate My Homework

2007-07-04 Thread Tim Chevalier
On 7/3/07, Thomas Conway [EMAIL PROTECTED] wrote: Okay, so a bit of a tweak of the RTS flags, I got a DRAMATIC improvement: 239,434,077,460 bytes allocated in the heap 9,034,063,712 bytes copied during GC (scavenged) 132,748,740 bytes copied during GC (not scavenged) 226,313,736 bytes maximum

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Philip Armstrong
On Wed, Jul 04, 2007 at 07:36:11PM +0100, Andrew Coppin wrote: Philip Armstrong wrote: [1] Which sick application *needs* intermixed endianness? *Clearly* you've never been to Singapore... ...er, I mean, Ever tried playing with networking protocol stacks? No (thankfully?). Phil --

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Donald Bruce Stewart
phil: On Wed, Jul 04, 2007 at 09:44:13PM +1000, Donald Bruce Stewart wrote: Binary instances are pretty easy to write. For a simple data type: instance Binary Exp where put (IntE i) = do put (0 :: Word8) put i

[Haskell-cafe] folds with escapes

2007-07-04 Thread Michael Vanier
I'm sure this has been done a hundred times before, but a simple generalization of foldl just occurred to me and I wonder if there's anything like it in the standard libraries (I couldn't find anything). Basically, I was trying to define the any function in terms of a fold, and my first try

Re: [Haskell-cafe] folds with escapes

2007-07-04 Thread Stefan O'Rear
On Wed, Jul 04, 2007 at 04:20:20PM -0700, Michael Vanier wrote: I'm sure this has been done a hundred times before, but a simple generalization of foldl just occurred to me and I wonder if there's anything like it in the standard libraries (I couldn't find anything). Basically, I was trying

Re: [Haskell-cafe] folds with escapes

2007-07-04 Thread Michael Vanier
That's cool -- good point. takeWhile is also trivially defined in terms of foldr: takeWhile p = foldr (\x r - if p x then x:r else []) [] Can you do dropWhile in terms of foldr? I don't see how. Mike Stefan O'Rear wrote: On Wed, Jul 04, 2007 at 04:20:20PM -0700, Michael Vanier wrote: I'm

Re: [Haskell-cafe] folds with escapes

2007-07-04 Thread Stefan O'Rear
On Wed, Jul 04, 2007 at 05:08:01PM -0700, Michael Vanier wrote: That's cool -- good point. takeWhile is also trivially defined in terms of foldr: takeWhile p = foldr (\x r - if p x then x:r else []) [] Can you do dropWhile in terms of foldr? I don't see how. dropWhile cannot be

Re: [Haskell-cafe] folds with escapes

2007-07-04 Thread Daniel McAllansmith
On Thursday 05 July 2007 11:20, Michael Vanier wrote: Again, I'm sure this has been done before (and no doubt better); I'd appreciate any pointers to previous work along these lines. Takusen is, if I recall correctly, based around a generalised fold supporting accumulation and early

Re: [Haskell-cafe] Parsers are monadic?

2007-07-04 Thread Claus Reinke
(b) i like my combinator grammars to be reversible, so that a single grammar specification can be used for both parsing and unparsing/pretty-printing. that means i have to define the details myself anyway. Oh cool - this is something I have wanted for a long time. Anything

Re: [Haskell-cafe] folds with escapes

2007-07-04 Thread Guido Genzone
2007/7/4, Michael Vanier [EMAIL PROTECTED]: That's cool -- good point. takeWhile is also trivially defined in terms of foldr: takeWhile p = foldr (\x r - if p x then x:r else []) [] Can you do dropWhile in terms of foldr? I don't see how. I 'm very bad in english, sorry. Here is a

Re: [Haskell-cafe] folds with escapes

2007-07-04 Thread Donald Bruce Stewart
dm.maillists: On Thursday 05 July 2007 11:20, Michael Vanier wrote: Again, I'm sure this has been done before (and no doubt better); I'd appreciate any pointers to previous work along these lines. Takusen is, if I recall correctly, based around a generalised fold supporting accumulation

Re: [Haskell-cafe] Re: Abstraction leak

2007-07-04 Thread Donald Bruce Stewart
drtomc: On 7/4/07, Donald Bruce Stewart [EMAIL PROTECTED] wrote: Can we do a cheap bytestring binding to libxml, to avoid any initial String processing? For my part, it's not too big an issue. A version of HaXml or at least Parsec built on top of ByteString would be a good start. I know

Re: [Haskell-cafe] folds with escapes

2007-07-04 Thread Bernie Pope
On 05/07/2007, at 10:08 AM, Michael Vanier wrote: Can you do dropWhile in terms of foldr? I don't see how. Mike I considered that very question in an article I wrote for the Monad.Reader magazine: http://www.haskell.org/sitewiki/images/1/14/TMR-Issue6.pdf If you are really keen,

Re: [Haskell-cafe] Re: Abstraction leak

2007-07-04 Thread Thomas Conway
On 7/5/07, Donald Bruce Stewart [EMAIL PROTECTED] wrote: Yep. The current impl is: mmapFile :: FilePath - IO ByteString mmapFile f = mmap f = \(fp,l) - return $! PS fp 0 l mmap :: FilePath - IO (ForeignPtr Word8, Int) mmap = do ... p - mmap l fd fp -

[Haskell-cafe] System.Exit

2007-07-04 Thread Thomas Conway
Hi All, Can anyone tell me what System.Exit.exitWith is actually supposed to do? As far as I can tell, it seems to be a synonym of (return ()). Okay, I'll stop being provocative and try and be helpful. So I have a web server, which like the one in The Literature(TM), essentially has a main

Re: [Haskell-cafe] System.Exit

2007-07-04 Thread Brandon S. Allbery KF8NH
On Jul 5, 2007, at 0:04 , Thomas Conway wrote: quitHandler sok addr = do tidyUpEverything sendOkResponse sok sClose sok System.Exit.exitWith ExitSuccess All nice and simple. All except one detail: it doesn't actually work. It prints exit: ExitSuccess but the doit loop