Re: [Haskell-cafe] Efficient parallel regular expressions

2008-11-05 Thread Krasimir Angelov
Hi Martijn, If you are brave to start implementing DFA with all required optimisations then you might want to look at: http://www.ontotext.com/gate/japec.html This is a compiler for language called JAPE. In the language you define a set of rules where the right hand side is a regular expression

Re: [Haskell-cafe] Making 'community' server our social network

2008-11-05 Thread Wolfgang Jeltsch
Am Montag, 3. November 2008 02:43 schrieb Maurí­cio: Hi, I've beeing doing something with darcs that is so great that, although I'm sure a lot of people are already doing the same, I think it would be nice to share with you. I did 'cd ~' and then: darcs initialize darcs add .emacs

Re: [Haskell-cafe] pure programs

2008-11-05 Thread Alberto G. Corona
A performance improvement could be the caching of responses based on computation costs and number of accesses. This functionality can be implemented a general module that may be used to wrap any pure program if needed. This is something that only pure programs can ever do. And the haskell type

[Haskell-cafe] Re: Problems with strictness analysis?

2008-11-05 Thread Achim Schneider
Derek Elkins [EMAIL PROTECTED] wrote: well-known anti-patterns I'm wondering why there are so miraculously well-known. Could it be the dedicated wiki page titled DONTDOTHAT!!!one! that lists them all? -- (c) this sig last receiving data processing entity. Inspect headers for copyright

[Haskell-cafe] Re: pure programs

2008-11-05 Thread Achim Schneider
Jason Dusek [EMAIL PROTECTED] wrote: Can these components can be Haskell functions without IO in their signatures? Sure. You might, for example, abstract networking out of your web server and thus end up with a function of type serve :: [HTTPRequest] - [HTTPResponse] that lazily maps its

RE: [Haskell-cafe] Memory efficiency questions for real-time graphics

2008-11-05 Thread Tobias Bexelius
I believe Svein is thinking of render-to-texture which indeed could be used to emulate Stream-Out functionality (but with reduced performance of course). This is also hardware specific and was still not supported on the first GPU's. From: Sebastian Sylvan

RE: [Haskell-cafe] pure programs

2008-11-05 Thread Mitchell, Neil
System.Info is broken. os has the wrong type. And the wrong value! I have not installed mingw32 on this machine, mingw32 isn't even an os... /me has goal of having os on Linux report wine1.1.7 Thanks Neil == Please

Re: [Haskell-cafe] Re: Automatic parallelism in Haskell, similar to make -j4?

2008-11-05 Thread Austin Seipp
Excerpts from Chad Scherrer's message of Tue Nov 04 21:34:01 -0600 2008: Does anyone have any thought what it would take to get this going? Chad Currently, franchise supports building in parallel with a -j flag, but the code could definitely be optimized (in my experience, running with

[Haskell-cafe] Re: Problems with strictness analysis?

2008-11-05 Thread Achim Schneider
Henning Thielemann [EMAIL PROTECTED] wrote: Achim Schneider schrieb: Derek Elkins [EMAIL PROTECTED] wrote: well-known anti-patterns I'm wondering why there are so miraculously well-known. Could it be the dedicated wiki page titled DONTDOTHAT!!!one! that lists them all? There

Re: [Haskell-cafe] Re: Problems with strictness analysis?

2008-11-05 Thread Luke Palmer
On Wed, Nov 5, 2008 at 4:33 AM, Achim Schneider [EMAIL PROTECTED] wrote: I know that I, coming from a C/Scheme POV, in the beginning attributed much magic to Haskell's inner workings and assumed, because of the general wizardly air of the whole language, avg to run in O(n) time and constant

Re: [Haskell-cafe] foldl vs foldl'

2008-11-05 Thread Nicolas Pouillard
Excerpts from daniel.is.fischer's message of Wed Nov 05 00:37:47 +0100 2008: Am Mittwoch, 5. November 2008 00:08 schrieb Daryoush Mehrtash: Are there cases (function or list) where the result of foldl (or foldr)would be different that foldl' (or foldr')? thanks, daryoush Simple

Re: [Haskell-cafe] Re: Problems with strictness analysis?

2008-11-05 Thread Claus Reinke
Haskell's great strength is its equational semantics. I would like Haskell programmers to think equationally, mathematically, rather than operationally, when writing Haskell programs. If I were to teach a course in Haskell, I would like to launch off of denotational semantics, hopefully without

Re: [Haskell-cafe] Re: Problems with strictness analysis?

2008-11-05 Thread Henning Thielemann
Achim Schneider schrieb: Henning Thielemann [EMAIL PROTECTED] wrote: There was http://www.haskell.org/haskellwiki/Things_to_avoid which has been renamed to the more friendly Haskell programming tips I was rather thinking of a list of performance pitfalls and laziness tarpits,

Re: [Haskell-cafe] Efficient parallel regular expressions

2008-11-05 Thread roger peppe
On Tue, Nov 4, 2008 at 6:44 PM, i wrote: i'm sorry if this is obviously wrong (i haven't used Text.Regex), but can't you do this with submatches? rights or wrongs of regexps aside, i just checked that the above approach *is* feasible with Text.Regex here's some code: module

Re: [Haskell-cafe] Efficient parallel regular expressions

2008-11-05 Thread roger peppe
On Wed, Nov 5, 2008 at 1:56 PM, Martijn van Steenbergen [EMAIL PROTECTED] wrote: I think I'll try roger's (private) eek, bitten by reply to sender only again! i had intended to send to the list too. ___ Haskell-Cafe mailing list

[Haskell-cafe] Re: Problems with strictness analysis?

2008-11-05 Thread Achim Schneider
Luke Palmer [EMAIL PROTECTED] wrote: On Wed, Nov 5, 2008 at 4:33 AM, Achim Schneider [EMAIL PROTECTED] wrote: I know that I, coming from a C/Scheme POV, in the beginning attributed much magic to Haskell's inner workings and assumed, because of the general wizardly air of the whole

[Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-05 Thread Achim Schneider
roger peppe [EMAIL PROTECTED] wrote: On Wed, Nov 5, 2008 at 1:56 PM, Martijn van Steenbergen [EMAIL PROTECTED] wrote: I think I'll try roger's (private) eek, bitten by reply to sender only again! i had intended to send to the list too. I recommend using a newsreader and connecting it

[Haskell-cafe] Re: Problems with strictness analysis?

2008-11-05 Thread Achim Schneider
Henning Thielemann [EMAIL PROTECTED] wrote: Achim Schneider schrieb: Henning Thielemann [EMAIL PROTECTED] wrote: There was http://www.haskell.org/haskellwiki/Things_to_avoid which has been renamed to the more friendly Haskell programming tips I was rather thinking of a list

Re: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-05 Thread Henning Thielemann
Johannes Waldmann schrieb: using strings (inside a program) to represent structured data is wrong (*). of course you need strings for interfacing the outside world, but the microsecond they get on the inside, they should be tokenized and parsed away into something useful (= an abstract

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-11-05 Thread Ketil Malde
Old threads never die: Tim Newsham [EMAIL PROTECTED] writes: Chunk = { length :: Word8 elems :: [Elem] -- 0..255 repetitions } Chunks = [Chunk] -- terminated with the first 0 length Chunk I tried my hand at the encoding above:

Re: [Haskell-cafe] Re: Problems with strictness analysis?

2008-11-05 Thread Henning Thielemann
Achim Schneider schrieb: Derek Elkins [EMAIL PROTECTED] wrote: well-known anti-patterns I'm wondering why there are so miraculously well-known. Could it be the dedicated wiki page titled DONTDOTHAT!!!one! that lists them all? There was http://www.haskell.org/haskellwiki/Things_to_avoid

Re: [Haskell-cafe] Efficient parallel regular expressions

2008-11-05 Thread Martijn van Steenbergen
Hello everyone, Thank you all for your comments! Those are some very useful ideas. I think I'll try roger's (private) and ChrisK's suggestion first: using the match groups. I'm not sure if the match groups inside the individual regexes will cause much trouble, but we'll see. I imagine I'll

[Haskell-cafe] Proposal for associated type synonyms in Template Haskell

2008-11-05 Thread Thomas van Noort
Hello, Recently, we released a library on Hackage for generic rewriting (package rewriting if you are curious). The user of the library is expected to define type class instances to enable rewriting on his or her own datatypes. As these instances follow the datatype declarations closely, we

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-11-05 Thread Ketil Malde
Ketil Malde [EMAIL PROTECTED] writes: Doing 'x - decodeFile /dev/zero Well, it turns out 'decodeFile' needs to -- or does, anyway -- check whether the file is empty. Replacing it with a combination of 'decode' and 'readFile' solved the problem. Thanks to Saizan and the other people hanging

Re: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-05 Thread Nicolas Pouillard
Excerpts from ajb's message of Wed Nov 05 03:59:03 +0100 2008: G'day all. Hi, Quoting Achim Schneider [EMAIL PROTECTED]: Considering that he's talking about a mud, I figure the grammar is a quite straightforward command = l[eft] | r[ight] | ... | t[ake] item | c[ast] spell That

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-11-05 Thread Krasimir Angelov
On Wed, Aug 13, 2008 at 1:18 AM, Don Stewart [EMAIL PROTECTED] wrote: instance Binary a = Binary [a] where put l = put (length l) mapM_ put l get= do n - get :: Get Int replicateM n get Of course I changed this as well. Now it is: instance (Ord k,

[Haskell-cafe] Writing an IRC bot, problems with plugins

2008-11-05 Thread Alexander Foremny
Hello, Community. I already bothered #haskell a few times with the very same problem and always got interesting responses. But I seem to have always simplified my problem too much ending up with an helpful answer to my (simplified) problem, but not with a real solution. Thus I'm giving the

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-11-05 Thread Krasimir Angelov
I had the same problem (stack overflow). The solution was to change the = operator in the Get monad. Currently it is: m = k = Get (\s - let (a, s') = unGet m s in unGet (k a) s') but I changed it to: m = k = Get (\s - case unGet m s of

[Haskell-cafe] HOpenGL wiki link to documentation is broken

2008-11-05 Thread Jefferson Heard
I suspect this has to do with the latest GHC not including it by default, but the HOpenGL wiki's documentation links are broken. -- Jeff ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] foldl vs foldl'

2008-11-05 Thread Daryoush Mehrtash
Lets assume we don't have undefined in the list, are there functions (or properties in the function) that would cause foldl to have different results than foldl'? daryoush On Tue, Nov 4, 2008 at 3:37 PM, Daniel Fischer [EMAIL PROTECTED]wrote: Am Mittwoch, 5. November 2008 00:08 schrieb

Re: [Haskell-cafe] foldl vs foldl'

2008-11-05 Thread Jonathan Cast
On Wed, 2008-11-05 at 10:01 -0800, Daryoush Mehrtash wrote: Lets assume we don't have undefined in the list, are there functions (or properties in the function) that would cause foldl to have different results than foldl'? If the function is partial on some elements of the list. (3 /), for

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-11-05 Thread Don Stewart
kr.angelov: I had the same problem (stack overflow). The solution was to change the = operator in the Get monad. Currently it is: m = k = Get (\s - let (a, s') = unGet m s in unGet (k a) s') but I changed it to: m = k = Get (\s - case unGet m s of

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-11-05 Thread Don Stewart
kr.angelov: On Wed, Aug 13, 2008 at 1:18 AM, Don Stewart [EMAIL PROTECTED] wrote: instance Binary a = Binary [a] where put l = put (length l) mapM_ put l get= do n - get :: Get Int replicateM n get Of course I changed this as well. Now it is:

Re: [Haskell-cafe] pure programs

2008-11-05 Thread Jason Dusek
Jules Bean [EMAIL PROTECTED] wrote: Jason Dusek wrote: Though that seems reasonable, it is not, in general, true. For example,System.Info.osis generally treated as pure, though it is not. It's not clear to me how to disambiguate these born again values from really pure values.

[Haskell-cafe] Strictness problems with Control.Event?

2008-11-05 Thread Brian Troutwine
I'm attempting to use Control.Event to limit HTTP requests made by a dippy little scraper I'm constructing to once per second but I think, maybe, that the Events are not being evaluated. First, some imports. import qualified Data.ByteString as B import qualified Data.ByteString.Char8 as C

[Haskell-cafe] Undefined symbols base_DataziTuple_ZxxxT_con_info

2008-11-05 Thread dmitry shkurko
Hello everyone, I am trying to compile my program, but during the linking phase I see errors like: (.text+0x66dd7):fake: undefined reference to `base_DataziTuple_Z110T_con_info Library libHSbase.a contains symbols base_DataziTuple_ZxxxT_con_info for xxx =62. It look like I hit some compiler

Re: [Haskell-cafe] Undefined symbols base_DataziTuple_ZxxxT_con_info

2008-11-05 Thread Bulat Ziganshin
Hello dmitry, Wednesday, November 5, 2008, 10:46:20 PM, you wrote: (.text+0x66dd7):fake: undefined reference to `base_DataziTuple_Z110T_con_info looks like you omitted --make on cmdline. without this switch, ghc don't automaticaly links in packages used in you program. alternatively you may

Re: [Haskell-cafe] Writing an IRC bot, problems with plugins

2008-11-05 Thread Don Stewart
alexanderforemny: My general idea is to have the main application listening to the network socket and then calling all the plugins on each incoming message. Therefore I maintain a list of plugin states in the main application's state and on each incoming message I call a function

Re: [Haskell-cafe] view patterns

2008-11-05 Thread Cale Gibbard
2008/11/5 Cetin Sert [EMAIL PROTECTED]: interactive:1:4: Warning: Pattern match(es) are overlapped In the definition of `emp': emp ((has - True)) = ... emp ((has - False)) = ... Why do I get this error in ghc or when I try to compile a file

Re: [Haskell-cafe] foldl vs foldl'

2008-11-05 Thread Derek Elkins
On Wed, 2008-11-05 at 10:01 -0800, Daryoush Mehrtash wrote: Lets assume we don't have undefined in the list, are there functions (or properties in the function) that would cause foldl to have different results than foldl'? The only difference in the definition of foldl and foldl' is a seq so

Re: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-05 Thread Richard O'Keefe
On 6 Nov 2008, at 1:25 am, Johannes Waldmann wrote: using strings (inside a program) to represent structured data is wrong (*). +1 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] ANNOUNCE: Haddock version 2.4.0

2008-11-05 Thread David Waern
-- Haddock 2.4.0 A new version of Haddock, the Haskell documentation tool, is out. This is a later version than the one shipped with GHC 6.10.1, which is version 2.3.0. That version will not be released on

Re: [Haskell-cafe] Re: Problems with strictness analysis?

2008-11-05 Thread Luke Palmer
On Wed, Nov 5, 2008 at 1:24 AM, Claus Reinke [EMAIL PROTECTED] wrote: How can we support analysis of time and space complexity without expanding ourselves into the complicated dirty world of operational thinking? equational /= denotational Nonetheless, Haskell has equational semantics

Re[2]: [Haskell-cafe] Re: Problems with strictness analysis?

2008-11-05 Thread Bulat Ziganshin
Hello Luke, Thursday, November 6, 2008, 2:34:36 AM, you wrote: The example being discussed in this thread is a good one: sum [1..10^8] + length [1..10^8] With Haskell's semantics, we know we can write this as: let xs = [1..10^8] in sum xs + length xs But it causes a change in memory

Re: [Haskell-cafe] Re: Problems with strictness analysis?

2008-11-05 Thread Claus Reinke
equational /= denotational Nonetheless, Haskell has equational semantics which are derived from its denotational ones. But when I said equational semantics I really meant something more like equations :-). Unlike Standard ML, for instance, Haskell does not have standard semantics - a

Re: [Haskell-cafe] pure programs

2008-11-05 Thread Conal Elliott
Hi Jason, To help me understand your question, would you be unhappy with the following structure? -- runnable main = interact f -- composable f = ... The discipline is to use interact (or another combinator) to wrap a functional/composable/pure component like f into an

Re: Re: [Haskell-cafe] Problems with strictness analysis?

2008-11-05 Thread Kim-Ee Yeoh
Luke Palmer-2 wrote: I would like to know or to develop a way to allow abstract analysis of time and space complexity. In the same way that type inference and strictness analysis can be seen as instances of abstract interpretation, so can complexity inference. I agree that the interplay

Re: [Haskell-cafe] Re: Problems with strictness analysis?

2008-11-05 Thread wren ng thornton
Luke Palmer wrote: The example being discussed in this thread is a good one: sum [1..10^8] + length [1..10^8] With Haskell's semantics, we know we can write this as: let xs = [1..10^8] in sum xs + length xs But it causes a change in memory *complexity*, so in some sense these two