Fwd: [Haskell-cafe] Parsing in Practice

2005-10-19 Thread Tomasz Zielonka
[Sending it again to haskell-cafe] On 10/18/05, Tom Hawkins [EMAIL PROTECTED] wrote: I am writing a parser for a big, ugly, standard language and I need to decide between using either Happy or Parsec. I wrote a parser for a big, ugly, non-standard language - Transact-SQL from MSSQL. I

Re: [Haskell-cafe] FPS lib

2005-10-19 Thread Krasimir Angelov
2005/10/19, Donald Bruce Stewart [EMAIL PROTECTED]: kr.angelov: Hello Guys, I tried my own version of PackedStrings and the results are very nice. It is entirely based on ByteArray# and Int#. I have made two tests: Elapsed time | | FastPackedString | PackedString |

[Haskell-cafe] Typeclasses and GADT [Was: Regular Expressions without GADTs]

2005-10-19 Thread oleg
Ralf Hinze wrote: To me replacing a GADT by class and instance declarations seems the wrong way round. We should not forget that the DT in GADT stands for `data type'. Francois Pottier enumerated some problems with type inference of GADT code during his ICFP'05 invited talk. Various

Re: [Haskell-cafe] FPS lib

2005-10-19 Thread Benjamin Franksen
On Tuesday 18 October 2005 12:12, Krasimir Angelov wrote: ByteArray# can be passed to C functions as well. The only problem is with mmap which cann't be implemented with arrays. mmap returns a pointer to the mapped file which is outside the Haskell heap. Wouldn't there be problems, too, with C

Re: [Haskell-cafe] FPS lib

2005-10-19 Thread Krasimir Angelov
Hello Guys, I tried my own version of PackedStrings and the results are very nice. It is entirely based on ByteArray# and Int#. I have made two tests: --import StringUtils.PackedString as PS import Data.FastPackedString as PS main = test1 [] 100 --main = test2 [] 100 test1 xs 0 =

Re: [Haskell-cafe] Regular Expressions without GADTs

2005-10-19 Thread Bruno Oliveira
Hello Conor, I personally think GADTs are a great idea, don't get me wrong. I am not arguing that we should all start programming using on a Church encoding. Neither I am arguing that this encoding can replace GADTs in all cases. Nevertheless, I believe that knowing about this encoding, in the

[Haskell-cafe] Parsec vs ReadP

2005-10-19 Thread Sebastian Sylvan
Can anyone briefly compare these two parsing-libraries? In short, which one is better? /S -- Sebastian Sylvan +46(0)736-818655 UIN: 44640862 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] RE: [Haskell] reader-like IO, parents of threads

2005-10-19 Thread Simon Marlow
Certainly, adding hooks to forkIO is possible. Also, providing thread local data directly is something we could do quite easily (and efficiently) in GHC. Cheers, Simon On 18 October 2005 19:12, Frederik Eaton wrote: What about adding support for hooks in forkIO? These could be useful

RE: [Haskell-cafe] FPS lib

2005-10-19 Thread Simon Marlow
On 19 October 2005 01:08, Donald Bruce Stewart wrote: However, on my machine: OpenBSD/Pentium-M 1.6G/ghc-6.5 -O Elapsed time:FPS Simon's PackedString Krasimir's test11.966s (40M) 2.151s (36M) 2.235s (36M) test2

RE: [Haskell-cafe] FPS lib

2005-10-19 Thread Simon Marlow
On 18 October 2005 21:04, John Meacham wrote: On Tue, Oct 18, 2005 at 10:39:24AM +0300, Einar Karttunen wrote: On 18.10 10:44, Bulat Ziganshin wrote: 2) as i say you before, i need to sort filenames in windows fashion (case-ignoring), so if you will include case-ignoring comparision

RE: [Haskell-cafe] Prebuilt FPS for Windows

2005-10-19 Thread Simon Marlow
On 18 October 2005 17:01, Joel Reymont wrote: Since I cannot build Data.FastPackedString on Windows (ghc crashes) and it's the only library I really depend on, would someone have a pre-built version or let me know how I can build it without Cabal? A workaround for that crashing problem is to

Re: [Haskell-cafe] Parsec

2005-10-19 Thread Christian Maeder
Hi, So far I did not regret using Parsec for a huge language (like CASL http://www.tzi.de/cofi). Compared to other combinator parser libraries, I think, it is best documented and the fastest (if used sensibly). Error reporting could be better, but it is already better than that of happy.

Re: [Haskell-cafe] Regular Expressions without GADTs

2005-10-19 Thread Ross Paterson
On Tue, Oct 18, 2005 at 05:51:13PM +0100, Conor McBride wrote: | Neither Oleg nor Bruno translated my code; they threw away my | structurally recursive on-the-fly automaton and wrote combinator parsers | instead. That's why there's no existential, etc. The suggestion that | removing the GADT

Re: [Haskell-cafe] Zlib bindings

2005-10-19 Thread Joel Reymont
Well, I just coded this. Feedback is welcome! One thing that I found interesting is that I actually have to allocate 4 bytes to pass the long into compress/uncompress. I thought that I could somehow obtain the address of the Haskell variable but this does not seem to be possible.

Re: [Haskell-cafe] Regular Expressions without GADTs

2005-10-19 Thread Conor McBride
[EMAIL PROTECTED] wrote: I suspect that once you start producing values with the relevant properties (as I do) rather than just consuming them (as Oleg and Bruno do), the GADT method might work out a little neater. Actually, the code is pretty much your original code, with downcased

Re: [Haskell-cafe] Regular Expressions without GADTs

2005-10-19 Thread Ross Paterson
On Wed, Oct 19, 2005 at 03:17:41PM +0100, Conor McBride wrote: I was just about to send, when up popped Ross's program, which does give me a datatype, including just enough extra stuff to support functoriality. data RegExp tok a = Zero | One a | Check (tok - a) (tok - Bool)

[Haskell-cafe] getServiceEntry: does not exist on Windows

2005-10-19 Thread Joel Reymont
Folks, I have a silly Windows issue: *** Exception: getServiceEntry: does not exist (no such service entry) I connect thusly and don't see myself using any services. I also do not have this issue on Mac OSX. Any ideas? I googled for this issue but don't even know if there's a protocols

[Haskell-cafe] Re: getServiceEntry: does not exist on Windows

2005-10-19 Thread Joel Reymont
I'm running this code at the ghci prompt by loading foo.hs and then running main. Don't know if this helps. On Oct 19, 2005, at 4:35 PM, Joel Reymont wrote: *** Exception: getServiceEntry: does not exist (no such service entry) [...] connect :: HostName - Int - IO Handle connect h p =

[Haskell-cafe] Re: getServiceEntry: does not exist on Windows

2005-10-19 Thread Joel Reymont
I checked my Windows protocol file in system32/drivers/etc and it has tcp 6 TCP # Transmission control protocol Still, I get the following: Prelude Network.BSD.getProtocolNumber tcp *** Exception: getServiceEntry: does not exist (no such service entry) Any tips? Thanks,

[Haskell-cafe] Re: getServiceEntry: does not exist on Windows

2005-10-19 Thread Joel Reymont
This fails also but the C call to getprotobyname succeeds. Prelude Network.BSD.getProtocolByName tcp *** Exception: getServiceEntry: does not exist (no such service entry) On Oct 19, 2005, at 4:51 PM, Joel Reymont wrote: I checked my Windows protocol file in system32/drivers/etc and it has

Re[2]: [Haskell-cafe] FPS lib

2005-10-19 Thread Bulat Ziganshin
Hello John, Wednesday, October 19, 2005, 4:23:00 AM, you wrote: JM can we add Data.PackedString and my PackedString (in the jhc repo) to JM the testing lineup? JM actually, is the test code available somewhere? i think, that larger testsuite for string-implementation libraries need to be

Re: [Haskell-cafe] Regular Expressions without GADTs

2005-10-19 Thread Ross Paterson
On Wed, Oct 19, 2005 at 03:17:41PM +0100, Conor McBride wrote: It's nice that the syntax of regular expressions survives, but it has been somewhat spun in favour of the functionality required in the example. I'm not sure about that either -- the existential coding supports elimination too, if

Re: [Haskell-cafe] Parsec vs ReadP

2005-10-19 Thread John Meacham
On Wed, Oct 19, 2005 at 11:40:27AM +0200, Sebastian Sylvan wrote: Can anyone briefly compare these two parsing-libraries? In short, which one is better? I like the ideas behind ReadP much more. if one were to write a feature-complete parser based on its model I think it would be ideal.

Re: [Haskell-cafe] FPS lib

2005-10-19 Thread John Meacham
On Wed, Oct 19, 2005 at 11:36:03AM +0100, Simon Marlow wrote: I believe I stole your UTF-8 code for my Data.PackedString.UTF8 version (which Don uploaded here http://www.cse.unsw.edu.au/~dons/packedstring.tar.gz). It might be slightly modified though; in my version I wanted to support

Re: [Haskell-cafe] FastString a misnomer

2005-10-19 Thread John Meacham
FastString seems to be a misnomer for this library. what it provides is a fast _byte array_ with a lot of useful operations, but it does not provide strings since it does not enforce character encodings in the type system, which would be vital for a real FastString library. In any case, just had

Re: [Haskell-cafe] FPS lib

2005-10-19 Thread Donald Bruce Stewart
bulatz: Hello John, Wednesday, October 19, 2005, 4:23:00 AM, you wrote: JM can we add Data.PackedString and my PackedString (in the jhc repo) to JM the testing lineup? JM actually, is the test code available somewhere? i think, that larger testsuite for string-implementation

[Haskell-cafe] Re: [Haskell] Read Instances for Data.Map and Data.Set

2005-10-19 Thread Donald Bruce Stewart
mai99dgf: Hi folks, I was really annoyed by the fact that for Data.Map and Data.Set are no Read instances declared, but Show instances are! I believe there should be some kind of unwritten rule that in the standart lib the Show and Read instances come pairwise and are fully compatible.