[Haskell-cafe] Re: Difference in Runtime but no explanation

2009-12-16 Thread Johann Höchtl
On Dec 15, 10:45 pm, Daniel Fischer daniel.is.fisc...@web.de wrote: Am Dienstag 15 Dezember 2009 21:43:46 schrieb Johann Höchtl: Please describe for me as a beginner, why there _is_ a difference: 1. does len (x:xs) l = l `seq` len xs (l+1) vs. len xs $! (l+1) expand into sthg.

Re: [Haskell-cafe] Re: Optimizing Parsec 3 -- was: Wiki software?

2009-12-16 Thread Stephen Tetley
2009/12/16 Jason Dusek jason.du...@gmail.com: What is the relationship between the Parsec API, Applicative and Alternative? Is the only point of overlap `|`? Hello everyone, Lots of functions in Text.ParserCombinators.Parsec.Combinator can be defined with only with an obligation on

[Haskell-cafe] changelogs for packages on Hackage

2009-12-16 Thread Valery V. Vorotyntsev
It would be nice if Hackage displayed ``recent changes'' of a package. [severity: wishlist] You see, I am subscribed to the ``hackage - recent additions'' feed [http://hackage.haskell.org/packages/archive/recent.rss] and receive entries that look like this: Cabal 1.8.0.2 Added by

Re: [Haskell-cafe] Re: Allowing hyphens in identifiers

2009-12-16 Thread Daniel Fischer
Am Mittwoch 16 Dezember 2009 07:56:26 schrieb Colin Paul Adams: Daniel == Daniel Fischer daniel.is.fisc...@web.de writes: Daniel Now, would you be interested in a transformation the other Daniel way round, so that you can read other people's code in Daniel your preferred style?

Re: [Haskell-cafe] Boxed Mutable Arrays

2009-12-16 Thread Serguey Zefirov
2009/12/16 Matt Morrow moonpa...@gmail.com: What are peoples' thoughts on this? http://hackage.haskell.org/trac/ghc/ticket/650#comment:16 I think it won't get any better. Either we have O(log(N)) updates because we have to update hierarchical structure to speed up GC scanning (to get it to

[Haskell-cafe] Re: Allowing hyphens in identifiers

2009-12-16 Thread Jon Fairbairn
Daniel Fischer daniel.is.fisc...@web.de writes: Am Dienstag 15 Dezember 2009 03:04:43 schrieb Richard O'Keefe: On Dec 14, 2009, at 5:11 PM, Daniel Fischer wrote: 1. I wasn't playing in the under_score vs. camelCase game, just proposing a possible reason why the camelCase may have been

Re: [Haskell-cafe] Re: Allowing hyphens in identifiers

2009-12-16 Thread Ketil Malde
Jon Fairbairn jon.fairba...@cl.cam.ac.uk writes: As one of the early Haskellers, I definitely preferred underscores, because my intuition told me that it was closer in appearance to normal English¹ text, [1] and quite a high proportion of other natural languages. Which makes me wonder -

Re: [Haskell-cafe] Re: Allowing hyphens in identifiers

2009-12-16 Thread Colin Paul Adams
Ketil == Ketil Malde ke...@malde.org writes: [1] and quite a high proportion of other natural languages. Ketil Which makes me wonder - might there be a (natural) language Ketil bias as well? Sure. Different languages have different orthographical traditions. IMHO a project

Re: [Haskell-cafe] Re: Optimizing Parsec 3 -- was: Wiki software?

2009-12-16 Thread Jason Dusek
2009/12/16 Stephen Tetley stephen.tet...@gmail.com: 2009/12/16 Jason Dusek jason.du...@gmail.com: What is the relationship between the Parsec API, Applicative and Alternative? Is the only point of overlap `|`? Lots of functions in Text.ParserCombinators.Parsec.Combinator can be defined

Re: [Haskell-cafe] Re: Optimizing Parsec 3 -- was: Wiki software?

2009-12-16 Thread Stephen Tetley
Hi Jason UU parsing somewhat invented the Applicative style - it defined the usual combinators from Control.Applicative ($), (*), (*), (*) etc. but didn't have an 'Applicative' type class. By obligation, I mean relying only on the Applicative class for the derived operations, here manyTill,

Re: [Haskell-cafe] Boxed Mutable Arrays

2009-12-16 Thread Jan-Willem Maessen
On Dec 16, 2009, at 5:50 AM, Serguey Zefirov wrote: 2009/12/16 Matt Morrow moonpa...@gmail.com: What are peoples' thoughts on this? http://hackage.haskell.org/trac/ghc/ticket/650#comment:16 I think it won't get any better. Either we have O(log(N)) updates because we have to update

Re: [Haskell-cafe] changelogs for packages on Hackage

2009-12-16 Thread Bas van Dijk
On Wed, Dec 16, 2009 at 10:18 AM, Valery V. Vorotyntsev valery...@gmail.com wrote: It would be nice if Hackage displayed ``recent changes'' of a package. Yes I wish for this too. These are the hackage tickets on this: Add Changelog summary feature to sdist

Re: [Haskell-cafe] changelogs for packages on Hackage

2009-12-16 Thread Duncan Coutts
On Wed, 2009-12-16 at 11:18 +0200, Valery V. Vorotyntsev wrote: It would be nice if Hackage displayed ``recent changes'' of a package. [severity: wishlist] You see, I am subscribed to the ``hackage - recent additions'' feed [http://hackage.haskell.org/packages/archive/recent.rss] and receive

Re: [Haskell-cafe] changelogs for packages on Hackage

2009-12-16 Thread Daniel Fischer
Am Mittwoch 16 Dezember 2009 14:45:18 schrieb Duncan Coutts: On Wed, 2009-12-16 at 11:18 +0200, Valery V. Vorotyntsev wrote: It would be nice if Hackage displayed ``recent changes'' of a package. [severity: wishlist] You see, I am subscribed to the ``hackage - recent additions'' feed

Re: [Haskell-cafe] Re: Allowing hyphens in identifiers

2009-12-16 Thread Colin Paul Adams
Daniel == Daniel Fischer daniel.is.fisc...@web.de writes: Daniel As a pre-alpha version: Daniel Daniel module Main (main) where Daniel import Data.Char (isUpper, isLower, toLower) Daniel main :: IO () main =

[Haskell-cafe] openFd under -threaded gets interrupted

2009-12-16 Thread Mitar
Hi! I am using such code: fd - openFd device ReadWrite Nothing OpenFileFlags { append = False, noctty = True, exclusive = False, nonBlock = True, trunc = False } And if I compile my program with -threaded option I always get such error: interrupted (Interrupted system call) But without

Re: [Haskell-cafe] Re: Allowing hyphens in identifiers

2009-12-16 Thread Duncan Coutts
On Wed, 2009-12-16 at 14:12 +, Colin Paul Adams wrote: I don't think it's practical to edit all the .cabal packages as they come in to say: ghc-options: -F -pgmF hspp and cabal install does not recognize this line if I add to to my ~/.cabal/config file. Duncan, is there a way

Re: [Haskell-cafe] Re: Allowing hyphens in identifiers

2009-12-16 Thread Colin Adams
2009/12/16 Duncan Coutts duncan.cou...@googlemail.com: On Wed, 2009-12-16 at 14:12 +, Colin Paul Adams wrote: I don't think it's practical to edit all the .cabal packages as they come in to say:     ghc-options: -F -pgmF hspp and cabal install does not recognize this line if I add to

Re: [Haskell-cafe] Haskell and memoization

2009-12-16 Thread michael rice
Thanks all, OK, so this definition of fib fib 0 = 1 fib 1 = 1 fib n = fib (n-1) + fib (n-2) would involve a lot of recomputation for some large n, which memoization would eliminate? Michael --- On Wed, 12/16/09, michael rice nowg...@yahoo.com wrote: From: michael rice nowg...@yahoo.com

Re: [Haskell-cafe] Re: Allowing hyphens in identifiers

2009-12-16 Thread Daniel Fischer
Am Mittwoch 16 Dezember 2009 15:12:31 schrieb Colin Paul Adams: I tried it. I'm not all that happy with the resulting uncameling. For instance, Database.HaskellDB.Sql.PostgreSQL goes to Database.Haskell_dB.Sql.Postgre_sQL which is uglier than before. Oy. Didn't think of that. If you

Re: [Haskell-cafe] Haskell and memoization

2009-12-16 Thread Daniel Fischer
Am Mittwoch 16 Dezember 2009 15:49:54 schrieb michael rice: Thanks all, OK, so this definition of fib fib 0 = 1 fib 1 = 1 fib n = fib (n-1) + fib (n-2) would involve a lot of recomputation for some large n, Where large can start as low as 20; 60 would be out of reach. which memoization

Re: [Haskell-cafe] Re: Allowing hyphens in identifiers

2009-12-16 Thread Colin Paul Adams
Daniel == Daniel Fischer daniel.is.fisc...@web.de writes: Daniel Database.Haskell_DB.Sql.Postgre_SQL Actually, I would be semi-happy with Database.Haskell-DB.Sql.Postgre-SQL (obviously we need an option whether to use hypens or underscores. I prefer hyphens.) Daniel Data.Bits.shiftL

Re: [Haskell-cafe] changelogs for packages on Hackage

2009-12-16 Thread Valery V. Vorotyntsev
Valery V. Vorotyntsev wrote: It would be nice if Hackage displayed ``recent changes'' of a package. [severity: wishlist] You see, I am subscribed to the ``hackage - recent additions'' feed [http://hackage.haskell.org/packages/archive/recent.rss] and receive entries that look like this:

Re: [Haskell-cafe] Re: Allowing hyphens in identifiers

2009-12-16 Thread Ben Millwood
On Wed, Dec 16, 2009 at 2:55 PM, Daniel Fischer daniel.is.fisc...@web.de wrote: unCamel :: String - String unCamel ('':cs) = '' : inTag cs unCamel (a:b:c:cs)    | isLower a isUpper b isLower c = a : '_' : toLower b : c : unCamel cs unCamel (a:bs@(b:cs))    | isLower a isUpper b    = a :

Re: [Haskell-cafe] Re: Allowing hyphens in identifiers

2009-12-16 Thread Daniel Fischer
Am Mittwoch 16 Dezember 2009 16:08:43 schrieb Colin Paul Adams: Daniel Database.Haskell_DB.Sql.Postgre_SQL Actually, I would be semi-happy with Database.Haskell-DB.Sql.Postgre-SQL (obviously we need an option whether to use hypens or underscores. I prefer hyphens.) That's no problem.

Re: [Haskell-cafe] Re: Allowing hyphens in identifiers

2009-12-16 Thread Daniel Fischer
Am Mittwoch 16 Dezember 2009 16:45:01 schrieb Ben Millwood: On Wed, Dec 16, 2009 at 2:55 PM, Daniel Fischer daniel.is.fisc...@web.de wrote: unCamel :: String - String unCamel ('':cs) = '' : inTag cs unCamel (a:b:c:cs)    | isLower a isUpper b isLower c = a : '_' : toLower b : c :

Re: Re[6]: [Haskell-cafe] Boxed Mutable Arrays

2009-12-16 Thread Don Stewart
brad.larsen: On Tue, Dec 15, 2009 at 11:33 AM, Serguey Zefirov sergu...@gmail.com wrote: If the number of buckets was fixed, one could use an array of STRefs to lists.  I believe this would avoid the bug from Ticket #650? now i see what you mean. no, i mean trivial transformation. #650 says

[Haskell-cafe] Re: changelogs for packages on Hackage

2009-12-16 Thread Maurí­cio CA
Some packages have a changelog file in them that we could display, though most don't. Debian policy requires changelogs of standard format. Most packages use a well known version control system (darcs, mercurial etc.). Cabal also has fields helping identifying where in vcs history are each

Re[8]: [Haskell-cafe] Boxed Mutable Arrays

2009-12-16 Thread Bulat Ziganshin
Hello Don, Wednesday, December 16, 2009, 7:27:29 PM, you wrote: The bug described in Ticket #650, AFAICS, prevents implementation of a reasonable, generic hash table in Haskell. :-( You can certainly implement it, it just requires that you increase the heap size to a bit bigger than your

[Haskell-cafe] Design question

2009-12-16 Thread hask...@kudling.de
Hi, i am not quite sure how to do this in the most elegant way: I have some data structures: data A = A Double data B = B Double data C = C Double ... and i want to allow only a subset in another data structure, so i did something like this:     data SubSet = SubSetA A | SubSetC C and use it

[Haskell-cafe] Design question

2009-12-16 Thread Jeff Wheeler
On Wed, Dec 16, 2009 at 10:40 AM, hask...@kudling.de hask...@kudling.de wrote: 1) Is the way i define and use SubSet, the only/valid way to define subsets? 2) What's the best way to make doSomethingElse polymorphic? I'm not very familiar with them, so I'm not sure if it's totally applicable,

Re: Re[6]: [Haskell-cafe] Boxed Mutable Arrays

2009-12-16 Thread Brad Larsen
On Wed, Dec 16, 2009 at 11:27 AM, Don Stewart d...@galois.com wrote: [...] The bug described in Ticket #650, AFAICS, prevents implementation of a reasonable, generic hash table in Haskell.  :-( You can certainly implement it, it just requires that you increase the heap size to a bit bigger

Re: [Haskell-cafe] Design question

2009-12-16 Thread Sean Leather
Hi Lenny, i am not quite sure how to do this in the most elegant way: I have some data structures: data A = A Double data B = B Double data C = C Double ... and i want to allow only a subset in another data structure, so i did something like this: data SubSet = SubSetA A |

Re: [Haskell-cafe] Boxed Mutable Arrays

2009-12-16 Thread Edward Kmett
On Tue, Dec 15, 2009 at 12:00 PM, Gregory Collins g...@gregorycollins.netwrote: Bulat Ziganshin bulat.zigans...@gmail.com writes: now i see what you mean. no, i mean trivial transformation. #650 says about slow GC. why it's slow? because once you made any update to the array, the entire

[Haskell-cafe] parallel and distributed haskell?

2009-12-16 Thread Scott A. Waterman
It looks like there was a recent hackathon focusing on implementing distributed haskell. http://hackage.haskell.org/trac/ghc/wiki/HackPar I feel there is quite a bit of latent interest in the subject here, but relatively little active development (compared to erlang, clojure, etc.) Can

Re: [Haskell-cafe] parallel and distributed haskell?

2009-12-16 Thread Don Stewart
tswaterman: It looks like there was a recent hackathon focusing on implementing distributed haskell. http://hackage.haskell.org/trac/ghc/wiki/HackPar I feel there is quite a bit of latent interest in the subject here, but relatively little active development (compared to erlang,

Re: [Haskell-cafe] Re: Optimizing Parsec 3 -- was: Wiki software?

2009-12-16 Thread Iavor Diatchki
Hi everyone, While you are discussing performance of parsing combinator libraries, I though I'd mention parsimony, available from Hackage. It has as good performance as parsec v2 but it also has support for different buffer types (e.g., byte strings, including support for utf8 decoding, etc)

[Haskell-cafe] Broken GHC doc links

2009-12-16 Thread Edward Z. Yang
Hello, I think the recent GHC 6.12 release broke all of the old links to Haddock documentation; as of writing Hoogle still points to the wrong Haddock docs and stuff like: http://www.haskell.org/ghc/staging/docs/latest/html/libraries/mtl/Control-Monad-Cont.html is now 404ing despite being the

Re: [Haskell-cafe] Broken GHC doc links

2009-12-16 Thread Mitar
Hi! On Wed, Dec 16, 2009 at 8:08 PM, Edward Z. Yang ezy...@mit.edu wrote: As the W3C would say, Cool URLs don't Change.  Can we at least setup redirects to the new pages? I second that. I have to manually fix URLs from Google results now all the time. Mitar

Re: [Haskell-cafe] parallel and distributed haskell?

2009-12-16 Thread Bulat Ziganshin
Hello Scott, Wednesday, December 16, 2009, 10:21:51 PM, you wrote: Can anyone involved give a quick overview (or pointers to one)? GHC has great support for SMP systems. there is further work on parallel libraries and i believe that it was main part of HackPar. there are good serialization

Re: [Haskell-cafe] Boxed Mutable Arrays

2009-12-16 Thread Richard Kelsall
Brad Larsen wrote: I have considered using Data.IntMap to implement a sort of faux hash table, e.g., introduce a Hashable class, and then use an IntMap to lists of Hashable. The result would be a pure, persistent ``hash table''. In such a case, however, lookup/insert/delete operations would

Re: [Haskell-cafe] Boxed Mutable Arrays

2009-12-16 Thread Edward Kmett
On Wed, Dec 16, 2009 at 2:42 PM, Richard Kelsall r.kels...@millstream.comwrote: Brad Larsen wrote: I have considered using Data.IntMap to implement a sort of faux hash table, e.g., introduce a Hashable class, and then use an IntMap to lists of Hashable. The result would be a pure,

[Haskell-cafe] Reading from a process

2009-12-16 Thread Mitar
Hi! I would like to make an one-directional inter-process communication in a way that one process is printing out read-compatible Haskell data types and Haskell program is reading them from a pipe. I would like to make a function which would return Nothing if there is no data type in a pipe or

Re: [Haskell-cafe] Design question

2009-12-16 Thread Luke Palmer
On Wed, Dec 16, 2009 at 9:40 AM, hask...@kudling.de hask...@kudling.de wrote: Hi, i am not quite sure how to do this in the most elegant way: I have some data structures: data A = A Double data B = B Double data C = C Double ... and i want to allow only a subset in another data

Re: [Haskell-cafe] parallel and distributed haskell?

2009-12-16 Thread Don Stewart
bulat.ziganshin: Hello Scott, Wednesday, December 16, 2009, 10:21:51 PM, you wrote: Can anyone involved give a quick overview (or pointers to one)? GHC has great support for SMP systems. there is further work on parallel libraries and i believe that it was main part of HackPar. there

[Haskell-cafe] Re: parallel and distributed haskell?

2009-12-16 Thread Johann Höchtl
On Dec 16, 8:21 pm, Scott A. Waterman tswater...@gmail.com wrote: It looks like there was a recent hackathon focusing on implementing   distributed haskell.    http://hackage.haskell.org/trac/ghc/wiki/HackPar I feel there is quite a bit of latent interest in the subject here, but

Re: [Haskell-cafe] Reading from a process

2009-12-16 Thread Jason Dusek
2009/12/16 Mitar mmi...@gmail.com: The problem is that I do not like this approach. And it does not look nice. For example I am reading byte per byte and appending it to the end. Then the problem is that if process is sending garbage faster then Haskell can consume it Haskell stays in

Re: [Haskell-cafe] Reading from a process

2009-12-16 Thread Mitar
Hi! On Wed, Dec 16, 2009 at 11:25 PM, Jason Dusek jason.du...@gmail.com wrote:  The what is a solid, terminating criterion for garbage? How do  you know this stream of bytes is no good or has gone as far as  you can allow it to go? Use that criterion in `slurpInput`. Criterion for garbage is

[Haskell-cafe] Re: Re: Allowing hyphens in identifiers

2009-12-16 Thread Ben Franksen
Daniel Fischer wrote: Am Montag 14 Dezember 2009 01:44:16 schrieb Richard O'Keefe: Where is it written that aesthetic judgements are _entirely_ a matter of personal preference? I think you could find that written in many texts on aesthetic relativism. Doesn't matter, though. Of course,

[Haskell-cafe] Haskell arrays

2009-12-16 Thread michael rice
Based upon docs I've looked at, Haskell seems to store both an array element value AND its index/indices, whereas most languages just store the value and find its location in memory through mapping calculations. Is it true? Michael ___

Re: [Haskell-cafe] Haskell arrays

2009-12-16 Thread Daniel Peebles
It doesn't store both, but does provides a flexible indexing strategy (that allows indices to be non-trivial values). What docs suggest that it stores both? On Wed, Dec 16, 2009 at 10:38 PM, michael rice nowg...@yahoo.com wrote: Based upon docs I've looked at, Haskell seems to store both an

Re: [Haskell-cafe] Haskell arrays

2009-12-16 Thread michael rice
http://www.zvon.org/other/haskell/Outputarray/array_f.html Example 7 (and others) Input: array ('a','c') [('a',AAA),('b',BBB),('c',CCC)] ! 'b' Output: BBB Maybe it's just the notation that makes it LOOK like the indices are also getting stored? Michael --- On Wed, 12/16/09, Daniel

Re: [Haskell-cafe] Haskell arrays

2009-12-16 Thread Ivan Lazar Miljenovic
michael rice nowg...@yahoo.com writes: Maybe it's just the notation that makes it LOOK like the indices are also getting stored? Yup; that's just the String representation of an array using lists. -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com

Re: [Haskell-cafe] Haskell arrays

2009-12-16 Thread Gregory Crosswhite
The point of the array function is just that it lets you initialize the elements of the array in any order you want rather than sequentially; that's why you need to specify the index as well as the element. It isn't indicating that the indices are being stored in addition to the elements.

Re: [Haskell-cafe] Reading from a process

2009-12-16 Thread Jason Dusek
2009/12/16 Mitar mmi...@gmail.com: On Wed, Dec 16, 2009 at 11:25 PM, Jason Dusek jason.du...@gmail.com wrote: Criterion for garbage is that it is not readable with read and that not because there would be not enough data available. It seems that I will need to do buffer filling and reading at