Re: [Haskell-cafe] Parsers are monadic?

2007-06-30 Thread Big Chris
Hi Gregory, First post. I'm a newbie, been using Haskell for about a week and love it. Anyway, this is something I don't understand. Parsers are monadic. I can see this if the parser is reading from an input stream but if there's just a block of text can't you just have the parser call

[Haskell-cafe] Organising teams for ICFP 2007

2007-06-30 Thread Donald Bruce Stewart
Interested in competing in the ICFP 2007 programming contest -- the hackers contest of choice! http://www.icfpcontest.org There's 2000 people on this mailing list, and 350 people in #haskell, we must be able to put together a few decent teams out of that talent pool To help people get

Re: [Haskell-cafe] Abstraction leak

2007-06-30 Thread Bulat Ziganshin
Hello Andrew, Friday, June 29, 2007, 10:39:28 PM, you wrote: I'm writing a whole bunch of data compression programs. me too :) but i never used Haskell for compression itself, only for managing archives. fast compression routines are written in C++ http://www.haskell.org/bz -- Best

Re: [Haskell-cafe] Abstraction leak

2007-06-30 Thread Andrew Coppin
Bulat Ziganshin wrote: Hello Andrew, Friday, June 29, 2007, 10:39:28 PM, you wrote: I'm writing a whole bunch of data compression programs. me too :) but i never used Haskell for compression itself, only for managing archives. fast compression routines are written in C++ What,

[Haskell-cafe] Re: Abstraction leak

2007-06-30 Thread apfelmus
David Roundy wrote: On Fri, Jun 29, 2007 at 07:39:28PM +0100, Andrew Coppin wrote: Now I have a problem. It's easy enough to pass the entire data stream through an RLE decoder and feed that to the Huffman table deserialize function, and it will give be back the table. But I now have *no

Re: [Haskell-cafe] Language semantics

2007-06-30 Thread Neil Mitchell
Hi What's Uniplate? http://www-users.cs.york.ac.uk/~ndm/uniplate/ may help to answer that question. I haven't even finished understanding SYB, yet, though; I'm still mystified by how to use Data.Generics.Twins.gzipWithQ. So, I'm not at a stage where I can usefully contrast Uniplate with the

Re: [Haskell-cafe] Parsers are monadic?

2007-06-30 Thread jerzy . karczmarczuk
Big Chris writes to Gregory, who posts: ... something I don't understand. Parsers are monadic. I can see this if the parser is reading from an input stream but if there's just a block of text can't you just have the parser call itself recursively feeding the unparsed text down the recursion

Re: [Haskell-cafe] Name Decoration and Undefined References

2007-06-30 Thread Bulat Ziganshin
Hello SevenThunders, Saturday, June 30, 2007, 7:45:57 AM, you wrote: My own code is half Haskell and half C. My build process is rather complex i have the same. initially C code was compiled by gcc but finally i switched to ghc-only compilation. it's also important to use the same gcc for

Re: [Haskell-cafe] Parsers are monadic?

2007-06-30 Thread Claus Reinke
The standard, naïve approach to monadic parsing is very nice, but inefficient. So *please read* some material based on HuttonMeijer approach, but don't stay there, read something more modern, since we thereby seem to have left the phase of simple answers to simple questions;-) i'd like to raise

Re: [Haskell-cafe] advice: instantiating/duplicating modules

2007-06-30 Thread Arie Peterson
Dave Bayer wrote: I've since done some experiments with Template Haskell, and I see that Arie Peterson has suggested how you could proceed. However, are you sure that you can't find a way to get this to work in vanilla Haskell without extensions? Or, for that matter, are you sure there isn't

Re: Fwd: Re: [Haskell-cafe] avoiding command window with wxHaskell on Windows?

2007-06-30 Thread Duncan Coutts
On Fri, 2007-06-29 at 23:22 -0400, Dean Herington wrote: Date: Mon, 25 Jun 2007 20:19:50 -0400 With gtk2hs, using -optl-mwindows as a command line option for GHC lets me get rid of this window. Perhaps it will do the same for wxHaskell? Yes, that did the trick! Thanks a lot! But now

Re: [Haskell-cafe] ANNOUNCE: hiccup, a toy tcl impersonator in haskell

2007-06-30 Thread Christoph Bauer
Hi, some time ago I started a Tcl-C compiler in Haskell. It should compile Tcl code to an Tcl extension. http://wiki.tcl.tk/17385 http://88.198.17.44/~fridolin/tclc/ (darcs) Few tests (e.g. recursive from shootout) are much faster than Tcl (original) interpreter but a lot of tests are slower.

Re: [Haskell-cafe] Parsers are monadic?

2007-06-30 Thread Philippa Cowderoy
On Sat, 30 Jun 2007, Claus Reinke wrote: for all that i like monadic programming in general, i often feel that it is biased towards handling only the success path well, by offering built-in support for a single continuation only. Certainly one path gets privileged over the others, I don't

Re: [Haskell-cafe] Parsers are monadic?

2007-06-30 Thread Dave Bayer
On Jun 30, 2007, at 6:31 AM, Claus Reinke wrote: has anyone else had similar experiences with expressive limitations of monadic programming? things that one might be able to work around, but that don't feel as natural or simple as they should be? things that one hasn't been able to express at

Re: [Haskell-cafe] XmlSerializer.deserialize?

2007-06-30 Thread Hugh Perkins
Still struggling with this. If anyone has any constructive ideas? I guess it's not really easy otherwise someone would have come up with a solution by now ;-) The issue is the line in makeConstrM'' where we're trying to read (Data a = a) from (String). read doesnt work, because read needs a

Re: [Haskell-cafe] Parsers are monadic?

2007-06-30 Thread Claus Reinke
Have you used Parsec? i read about it when it came out, but i've always defined my own combinators. in case you wonder, there are two reasons for this: (a) the approximation of parsers as monads is close enough that a simple type Parser m a = StateT String m a gives us the basic

Re: Fwd: Re: [Haskell-cafe] avoiding command window with wxHaskell on Windows?

2007-06-30 Thread Esa Ilari Vuokko
On 6/30/07, Duncan Coutts [EMAIL PROTECTED] wrote: On Fri, 2007-06-29 at 23:22 -0400, Dean Herington wrote: Date: Mon, 25 Jun 2007 20:19:50 -0400 With gtk2hs, using -optl-mwindows as a command line option for GHC lets me get rid of this window. Perhaps it will do the same for wxHaskell?

[Haskell-cafe] Re: Parsers are monadic?

2007-06-30 Thread Eric
Gregory Propf gregorypropf at yahoo.com writes: First post. I'm a newbie, been using Haskell for about a week and love it. Anyway, this is something I don't understand. Parsers are monadic. I can see this if the parser is reading from an input stream but if there's just a block of text can't

Re: [Haskell-cafe] avoiding command window with wxHaskell on Windows?

2007-06-30 Thread Dean Herington
At 8:13 PM +0300 6/30/07, Esa Ilari Vuokko wrote: On 6/30/07, Duncan Coutts [EMAIL PROTECTED] wrote: On Fri, 2007-06-29 at 23:22 -0400, Dean Herington wrote: Date: Mon, 25 Jun 2007 20:19:50 -0400 With gtk2hs, using -optl-mwindows as a command line option for GHC lets me get rid of this

Re: [Haskell-cafe] avoiding command window with wxHaskell on Windows?

2007-06-30 Thread Claus Reinke
For the application I'm building, besides being able to launch it as above, I want also to be able to invoke it (normally from a command line). A program so invoked can interact with its invoker, and the invoker awaits the program's completion and gets its termination status. From what Esa

[Haskell-cafe] Re: Parsers are monadic?

2007-06-30 Thread Eric
Eric devnull1999 at yahoo.com writes: Looks as if others may be answering questions you didn't ask. I should read more carefully before posting: Big Chris did answer your question, though phrased differently than I did. --Eric ___ Haskell-Cafe

[Haskell-cafe] Read-only functions in State Monad

2007-06-30 Thread Ken Takusagawa
I'd like to have a state monad with the feature that I can somehow annotate using the type system that some functions are only going to read the state and not modify it. Such read-only functions are only permitted to call other read-only functions, whereas state-modifying functions can call both

Re: [Haskell-cafe] Re: Parsers are monadic?

2007-06-30 Thread Gregory Propf
Thanks, that was helpful. I didn't realize that there were pure functional monads. -- Monadic just means a calculation using a mathematical structure called a monad. All impure calculations in Haskell are monadic, but not all monadic

Re: [Haskell-cafe] Read-only functions in State Monad

2007-06-30 Thread Twan van Laarhoven
Ken Takusagawa wrote: I'd like to have a state monad with the feature that I can somehow annotate using the type system that some functions are only going to read the state and not modify it. Such read-only functions are only permitted to call other read-only functions, whereas state-modifying

[Haskell-cafe] sha1 implementation thats only 12 times slower then C

2007-06-30 Thread Anatoly Yakovenko
So I tried implementing a more efficient sha1 in haskell, and i got to about 12 times slower as C. The darcs implementation is also around 10 to 12 times slower, and the crypto one is about 450 times slower. I haven't yet unrolled the loop like the darcs implementation does, so I can still get

Re: [Haskell-cafe] Read-only functions in State Monad

2007-06-30 Thread Benja Fallenstein
Hi Ken, 2007/7/1, Ken Takusagawa [EMAIL PROTECTED]: I'd like to have a state monad with the feature that I can somehow annotate using the type system that some functions are only going to read the state and not modify it. I would suggest declaring a MonadReader instance for State, and writing

Re: [Haskell-cafe] Name Decoration and Undefined References

2007-06-30 Thread SevenThunders
Bulat Ziganshin-2 wrote: Hello SevenThunders, Saturday, June 30, 2007, 7:45:57 AM, you wrote: My own code is half Haskell and half C. My build process is rather complex i have the same. initially C code was compiled by gcc but finally i switched to ghc-only compilation. it's also

Re: [Haskell-cafe] sha1 implementation thats only 12 times slower then C

2007-06-30 Thread Donald Bruce Stewart
aeyakovenko: So I tried implementing a more efficient sha1 in haskell, and i got to about 12 times slower as C. The darcs implementation is also around 10 to 12 times slower, and the crypto one is about 450 times slower. I haven't yet unrolled the loop like the darcs implementation does, so