Re[2]: [Haskell-cafe] Text search

2005-05-17 Thread Bulat Ziganshin
Hello Gracjan, Monday, May 16, 2005, 4:00:33 PM, you wrote: GP Unless you have very repetitive data and/or tiny alphabet, it is GP actually quite efficient, as the expected length of prefixes that need GP to be checked before a mismatch can be determined is small. GP GP At least, I was

RE: Re[2]: [Haskell-cafe] Text search

2005-05-17 Thread Bayley, Alistair
From: Bulat Ziganshin [mailto:[EMAIL PROTECTED] if you really need KMP, you can find it at http://haskell.org/hawiki/RunTimeCompilation find (isSuffixOf needle) (inits haystack) find (isPrefixOf needle) (tails haystack) if you need an index - add it with zip: find (isPrefixOf

[Haskell-cafe] Re: Unexported functions are evil

2005-05-17 Thread Peter Simons
Thanks for your opinions everybody! Ketil Malde writes: I guess you could sometimes have name clashes as well? I was afraid about those for the longest time too, but in practice name clashes curiously enough hardly ever occur -- in my experience. The problem only arises when you actually

Re: [Haskell-cafe] Data types and Haskell classes

2005-05-17 Thread Jens Blanck
How would I introduce number classes that are extended with plus and minus infinity? I'd like to have polymorphism over these new classes, something like a signature f :: (Real a, Extended a b) = b - b which clearly is not part of the current syntax, but I hope you get the picture.

Re: [Haskell-cafe] Text search

2005-05-17 Thread Scott Kathy
On 2005 May 16 Monday 08:00, Gracjan Polak wrote: Ketil Malde wrote: While the result isn't exactly the same, I suspect using isPrefixOf and tails would be more efficient. I need the data before and including my needle. When the haystack gets large, the beautiful find (isSuffixOf

[Haskell-cafe] RE: Haskell-Cafe Digest, Vol 21, Issue 31

2005-05-17 Thread Atwood, John Wesley
Date: Wed, 11 May 2005 17:22:25 -0400 (Eastern Standard Time) From: S. Alexander Jacobson [EMAIL PROTECTED] Subject: [Haskell-cafe] subRegex bug? Am I misunderstanding the regex docs? *MyMod subRegex (mkRegex \\. ) foo.bar blah foo*** Exception: Text.Regex.Posix.regcomp: error in pattern

RE: [Haskell-cafe] RE: Haskell-Cafe Digest, Vol 21, Issue 31

2005-05-17 Thread Bayley, Alistair
From: Atwood, John Wesley [mailto:[EMAIL PROTECTED] Under my Linux install, with ghc6.4, it doesn't throw an exception, but also doesn't return a correct result; it returns Just []. Under WindowsXP, ghc6.4, I get the exception you get; under hugs, it can't find subRegex, but matchRegex

Re: [Haskell-cafe] Text search

2005-05-17 Thread Donn Cave
You can get efficiency, the desired data, and deal with infinite strings by using a function that is like 'inits' but which returns the initial strings in reversed order. reversed_inits = scanl (flip (:)) find (isPrefixOf (reverse needle)) (reversed_inits haystack) If I may ask

Re: [Haskell-cafe] Re: Unexported functions are evil

2005-05-17 Thread Iavor Diatchki
Hello, On 17 May 2005 12:09:35 +0200, Peter Simons [EMAIL PROTECTED] wrote: Iavor Diatchki writes: [...] in practice this is likely to often lead to recursive modules [...] Why is that? My intuition would say that the exact opposite is true: a more fine-grained set of modules is

[Haskell-cafe] Bit fiddling

2005-05-17 Thread Florian Weimer
I'm toying a bit with Haskell and wondering what's the best way to implement bit fiddling. Most of my applications involve serializing and deserializing small blobs (IP packets, for instance), and after browsing the GHC library documentation, I'm not sure which appraoch I should use. That's why

Re: [Haskell-cafe] Bit fiddling

2005-05-17 Thread robert dockins
Probably you have seen this already, but I thought I'd mention it on the off-chance you missed it: http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data.Bits.html http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data.Word.html Probably you'll want to think about an IOUArray

Re: [Haskell-cafe] Bit fiddling

2005-05-17 Thread robert dockins
If you want C compatibility, you need http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data.Array.Storable.html which is similar. You then use the withStorableArray to call out to your C functions. Florian Weimer wrote: * robert dockins: Probably you have seen this already, but I

Re: [Haskell-cafe] Text search

2005-05-17 Thread Scott Turner
On 2005 May 17 Tuesday 11:44, Donn Cave wrote: You can get efficiency, the desired data, and deal with infinite strings. reversed_inits = scanl (flip (:)) find (isPrefixOf (reverse needle)) (reversed_inits haystack) With get efficiency, I was comparing this program which is linear

Re: [Haskell-cafe] Bit fiddling

2005-05-17 Thread Florian Weimer
* robert dockins: If you want C compatibility, you need http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data.Array.Storable.html which is similar. You then use the withStorableArray to call out to your C functions. Looks exactly like what I need. I'll give it a try and come

Re: [Haskell-cafe] Bit fiddling

2005-05-17 Thread Thomas Hallgren
Hi, Florian Weimer wrote: I'm toying a bit with Haskell and wondering what's the best way to implement bit fiddling. Most of my applications involve serializing and deserializing small blobs (IP packets, for instance), and after browsing the GHC library documentation, I'm not sure which appraoch

[Haskell-cafe] Haskell-related Job Posting, Portland OR area

2005-05-17 Thread Isaac Jones
Galois Connections does most of its development in Haskell, and this job may involve some Haskell development, so I felt it was on topic for this list. Senior Test Engineer Galois Connections, Inc., located near Portland, Oregon, designs and develops high confidence software for critical

[Haskell-cafe] Re: Unexported functions are evil

2005-05-17 Thread Peter Simons
Iavor Diatchki writes: Do you have an concrete example which illustrates this point? [...] consider a file A.hs that defines some data type T and exports a function f that is defined in terms of a private function g. Now if we place g in a file called Private.hs then A needs to