Re: [Haskell-cafe] *GROUP HUG*

2011-05-25 Thread Richard O'Keefe
On 25/05/2011, at 12:41 AM, Johannes Waldmann wrote: Yves Parès limestrael at gmail.com writes: For instance, one of my friends asked me once why the operation of calculating the length of list has an O(n) complexity, since to his opinion, you could just store the size inside the list

Re: [Haskell-cafe] *GROUP HUG*

2011-05-25 Thread Tony Morris
On 24/05/11 22:41, Johannes Waldmann wrote: Then tell me, why does calculating the length of a (Haskell) list has O(n) complexity. Infiniticity aside, tail would become O(n) if you store a length with each cons cell. -- Tony Morris http://tmorris.net/

Re: [Haskell-cafe] *GROUP HUG*

2011-05-25 Thread Eugene Kirpichov
Why so? I think it wouldn't. data FList a = FNil | FCons Int a (FList a) empty = FNil len FNil = 0 len (FCons n _) = n cons x xs = FCons (1 + len xs) x xs tail (FCons _ _ xs) = xs 2011/5/24 Tony Morris tonymor...@gmail.com: On 24/05/11 22:41, Johannes Waldmann wrote: Then tell me, why does

Re: [Haskell-cafe] *GROUP HUG*

2011-05-25 Thread Tony Morris
On 25/05/11 16:46, Eugene Kirpichov wrote: data FList a = FNil | FCons Int a (FList a) empty = FNil len FNil = 0 len (FCons n _) = n cons x xs = FCons (1 + len xs) x xs tail (FCons _ _ xs) = xs My mistake, sorry. Currently looking for original reason to have accidentally come to believe

Re: [Haskell-cafe] [Haskell] ANNOUNCE: time-recurrence-0.1

2011-05-25 Thread Yitzchak Gale
I wrote: It's not a good idea for a basic time library to introduce possible crashes. At least you should provide an alternative safe interface. Similarly for toEnum. Chris Heller wrote: are you suggesting something like doing modulo arithmetic rather than calling error on undefined values?

Re: [Haskell-cafe] *GROUP HUG*

2011-05-25 Thread Henning Thielemann
Tony Morris schrieb: On 25/05/11 16:46, Eugene Kirpichov wrote: data FList a = FNil | FCons Int a (FList a) empty = FNil len FNil = 0 len (FCons n _) = n cons x xs = FCons (1 + len xs) x xs tail (FCons _ _ xs) = xs My mistake, sorry. Currently looking for original reason to have

Re: [Haskell-cafe] Code critique - Was [Maybe Int] sans Nothings

2011-05-25 Thread Henning Thielemann
Alexander Solla schrieb: buildMap :: GeneratorState1 (Map Prefix [String]) buildMap = do (mp,(pfx1,pfx2),words) - get if (Prelude.null words) then {- No more words. Return final map (adding non_word for final prefix). -}

[Haskell-cafe] Second CFP: Continuation Workshop 2011

2011-05-25 Thread oleg
Submission deadline: June 25, 2011 Invited speakers: Mats Rooth (Cornell), Noam Zeilberger (Universite' Paris 7) There will be a tutorial session in the evening before the workshop. ACM SIGPLAN Continuation Workshop 2011 http://logic.cs.tsukuba.ac.jp/cw2011/ co-located

Re: [Haskell-cafe] *GROUP HUG*

2011-05-25 Thread Ketil Malde
Richard O'Keefe o...@cs.otago.ac.nz writes: Then tell me, why does calculating the length of a (Haskell) list has O(n) complexity. Because it is a rather rare operation and the cost of doing this would be far higher than you think. I suspect that if you store the length non-strictly, it

[Haskell-cafe] ANNOUNCE: haskell-src-exts 1.11.1

2011-05-25 Thread Niklas Broberg
Fellow Haskelleers, I'm pleased to announce the release of haskell-src-exts-1.11.1! * On hackage: http://hackage.haskell.org/package/haskell-src-exts * Via cabal: cabal install haskell-src-exts * Darcs repo: http://code.haskell.org/haskell-src-exts This major release fixes some long-standing

Re: [Haskell-cafe] Cabal upload failure

2011-05-25 Thread Niklas Broberg
Yep, works fine now, thanks! /Niklas On Tue, May 24, 2011 at 2:52 PM, Ross Paterson r...@soi.city.ac.uk wrote: Version skew problem -- I hope it's fixed now. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Function application layout

2011-05-25 Thread Jonas Almström Duregård
Hi, Would it be possible to allow this in Haskell (where applied to is some new operator or keyword): f applied to {x a;y b;z c} As an equivalent to: f (x a) (y b) (z c) Of course my intention is that the new keyword should initiate layout syntax so we can write this: f applied to x a y

Re: [Haskell-cafe] uniplate (was: code review?)

2011-05-25 Thread John Lato
From: Neil Mitchell ndmitch...@gmail.com While I'm on the topic, I recently wrote a tool that wanted to traverse deep data structures as produced by haskell-src-exts. ?I wound up with about 50 lines of case expressions and around the time my hands were literally beginning to hurt

Re: [Haskell-cafe] code review?

2011-05-25 Thread Niklas Broberg
On Tue, May 24, 2011 at 7:18 PM, Neil Mitchell ndmitch...@gmail.com wrote: Before doing a code review I always demand that the author runs over the code with HLint (http://community.haskell.org/~ndm/hlint) - they Very good point. In fact you just inspired me to finally download it and

Re: [Haskell-cafe] lambdabot hoogle

2011-05-25 Thread Jacek Generowicz
On 2011 May 25, at 05:53, Mark Wright wrote: On Wed, 25 May 2011 02:20:39 +0200, Jacek Generowicz jacek.generow...@cern.ch wrote: I have recenly installed lambdabot. Its response to *each* *and* *every* hoogle command is *always* A Hoogle error occurred. I'm hoping that someone on Cafe

Re: [Haskell-cafe] *GROUP HUG*

2011-05-25 Thread Yves Parès
So it seconds my initial point: you can't store the size because it has no sense. 2011/5/25 Ketil Malde ke...@malde.org Richard O'Keefe o...@cs.otago.ac.nz writes: Then tell me, why does calculating the length of a (Haskell) list has O(n) complexity. Because it is a rather rare

Re: [Haskell-cafe] lambdabot hoogle

2011-05-25 Thread Mark Wright
On Wed, 25 May 2011 12:22:24 +0200, Jacek Generowicz jacek.generow...@cern.ch wrote: On 2011 May 25, at 05:53, Mark Wright wrote: On Wed, 25 May 2011 02:20:39 +0200, Jacek Generowicz jacek.generow...@cern.ch wrote: I have recenly installed lambdabot. Its response to *each* *and*

Re: [Haskell-cafe] Code critique - Was [Maybe Int] sans Nothings

2011-05-25 Thread michael rice
Yes, very nice. Thanks. Michael --- On Wed, 5/25/11, Henning Thielemann schlepp...@henning-thielemann.de wrote: From: Henning Thielemann schlepp...@henning-thielemann.de Subject: Re: [Haskell-cafe] Code critique - Was [Maybe Int] sans Nothings To: michael rice nowg...@yahoo.com Cc: Haskell Cafe

Re: [Haskell-cafe] lambdabot check

2011-05-25 Thread Jacek Generowicz
Hi Mark, Thanks for your wonderfully lucid, concise and complete explanation of the problem and its solution (included below). When I apply your patch and reinstall lambabot, I now get the following problem: lambdabot check True Could not find module `ShowIO`: It is a member of the

Re: [Haskell-cafe] lambdabot hoogle

2011-05-25 Thread Jacek Generowicz
On 2011 May 25, at 13:10, Mark Wright wrote: I assume your test on OS X was with the latest hoogle version so that old issues would no longer be relevant: I would be surprised if it weren't the latest, as I started installing everything from scratch a couple of days ago. Anyway, my

[Haskell-cafe] Policy for taking over a package on Hackage

2011-05-25 Thread Ivan Lazar Miljenovic
With my wl-pprint-text package, Jason Dagit suggested to me on #haskell that it would make sense to make such a pretty-printer be class-based so that the same API could be used for String, ByteString, Text, etc. I was thinking of doing so, and in such a case it would probably make the most amount

Re: [Haskell-cafe] Policy for taking over a package on Hackage

2011-05-25 Thread Stephen Tetley
Hi Ivan Forks are good, no? The Parsec experience has suggested to me at least, that new author's capping another author's work by bumping up to a major version, causes a significant difficulties even when the original author has gone. As for wl-pprint, it was a very tidy library in its

Re: [Haskell-cafe] Function application layout

2011-05-25 Thread Brandon Allbery
2011/5/25 Jonas Almström Duregård jonas.dureg...@chalmers.se Would it be possible to allow this in Haskell (where applied to is some new operator or keyword): f applied to {x a;y b;z c} Sounds like idiom brackets to me. ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Policy for taking over a package on Hackage

2011-05-25 Thread Ivan Lazar Miljenovic
On 25 May 2011 22:17, Stephen Tetley stephen.tet...@gmail.com wrote: Hi Ivan Forks are good, no? The Parsec experience has suggested to me at least, that new author's capping another author's work by bumping up to a major version, causes a significant difficulties even when the original

Re: [Haskell-cafe] Policy for taking over a package on Hackage

2011-05-25 Thread Simon Meier
2011/5/25 Ivan Lazar Miljenovic ivan.miljeno...@gmail.com: On 25 May 2011 22:17, Stephen Tetley stephen.tet...@gmail.com wrote: Hi Ivan Forks are good, no? The Parsec experience has suggested to me at least, that new author's capping another author's work by bumping up to a major version,

Re: [Haskell-cafe] Policy for taking over a package on Hackage

2011-05-25 Thread Johan Tibell
On Wed, May 25, 2011 at 2:01 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: With my wl-pprint-text package, Jason Dagit suggested to me on #haskell that it would make sense to make such a pretty-printer be class-based so that the same API could be used for String, ByteString, Text,

Re: [Haskell-cafe] Names for pretty-printing combinators

2011-05-25 Thread Ivan Lazar Miljenovic
(Changing the subject as it's going off-topic from the original email :p) On 25 May 2011 22:45, Simon Meier iridc...@gmail.com wrote: 2011/5/25 Ivan Lazar Miljenovic ivan.miljeno...@gmail.com: Also, by clashes with Applicative, are you referring to empty and $ ?  I'm not sure if a better name

Re: [Haskell-cafe] Policy for taking over a package on Hackage

2011-05-25 Thread Ivan Lazar Miljenovic
On 25 May 2011 22:52, Johan Tibell johan.tib...@gmail.com wrote: On Wed, May 25, 2011 at 2:01 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: With my wl-pprint-text package, Jason Dagit suggested to me on #haskell that it would make sense to make such a pretty-printer be

Re: [Haskell-cafe] Policy for taking over a package on Hackage

2011-05-25 Thread Ivan Lazar Miljenovic
On 25 May 2011 23:23, Otakar Smrz otakar.s...@cmu.edu wrote: I took over the maintenance of wl-pprint since Stefan suggested it himself. I needed to include OverlappingInstances, because that was required to make better use of the library (there is a difference having this flag there, which

Re: [Haskell-cafe] lambdabot check

2011-05-25 Thread Mark Wright
On Wed, 25 May 2011 13:20:19 +0200, Jacek Generowicz jacek.generow...@cern.ch wrote: Hi Mark, Thanks for your wonderfully lucid, concise and complete explanation of the problem and its solution (included below). When I apply your patch and reinstall lambabot, I now get the following

Re: [Haskell-cafe] lambdabot hoogle

2011-05-25 Thread Gwern Branwen
On Wed, May 25, 2011 at 6:22 AM, Jacek Generowicz jacek.generow...@cern.ch wrote: I had assumed that it connected to a server. It did at one point, but Hoogle had downtime and the local hoogle command was just as good and worked offline. (Maybe my assumption was not entirely unfounded, given

Re: [Haskell-cafe] Names for pretty-printing combinators

2011-05-25 Thread Stephen Tetley
Hi Ivan empty is fine as is, obviously with a Monoid instance as well, people can choose to use mempty which removes potential name clashes. I was thinking of ($) and (+), though I was forgetting that (+) is actually ArrowPlus. If you are mostly gifting angles as notation to Applicative, maybe

Re: [Haskell-cafe] lambdabot hoogle

2011-05-25 Thread Jacek Generowicz
On 2011 May 25, at 16:41, Gwern Branwen wrote: On Wed, May 25, 2011 at 6:22 AM, Jacek Generowicz jacek.generow...@cern.ch wrote: I had assumed that it connected to a server. It did at one point, but Hoogle had downtime and the local hoogle command was just as good and worked offline.

Re: [Haskell-cafe] Function application layout

2011-05-25 Thread Jonas Almström Duregård
I don't see the similarity (from reading this: http://www.haskell.org/haskellwiki/Idiom_brackets). My suggestion is just a way of using layout to avoid parenthesis. /J 2011/5/25 Brandon Allbery allber...@gmail.com: 2011/5/25 Jonas Almström Duregård jonas.dureg...@chalmers.se Would it be

Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics

2011-05-25 Thread KQ
On Wed, 18 May 2011 20:01:48 -0700, wren ng thornton w...@freegeek.org wrote: 3. Using the web as Haskell's main method of non-command line (graphical) deployment seems to lose two of Haskell's most powerful features: its type safety, and its speed. I agree with these disagreements. Web apps

Re: [Haskell-cafe] lambdabot hoogle

2011-05-25 Thread Gwern Branwen
On Wed, May 25, 2011 at 11:08 AM, Jacek Generowicz jacek.generow...@cern.ch wrote: Quite possibly not, but it would it be too much to ask, to have the documentation mention that they need to be installed separately if you intend to use them through lambdabot? I've just added them to the

Re: [Haskell-cafe] Policy for taking over a package on Hackage

2011-05-25 Thread KQ
On Wed, 25 May 2011 05:17:46 -0700, Stephen Tetley stephen.tet...@gmail.com wrote: Hi Ivan Forks are good, no? The Parsec experience has suggested to me at least, that new author's capping another author's work by bumping up to a major version, causes a significant difficulties even when the

Re: [Haskell-cafe] Policy for taking over a package on Hackage

2011-05-25 Thread Bryan O'Sullivan
On Wed, May 25, 2011 at 5:01 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: With my wl-pprint-text package, Jason Dagit suggested to me on #haskell that it would make sense to make such a pretty-printer be class-based so that the same API could be used for String, ByteString,

Re: [Haskell-cafe] Policy for taking over a package on Hackage

2011-05-25 Thread Bryan O'Sullivan
On Wed, May 25, 2011 at 5:59 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Well, using the Char8 version. Just because you *could* do that, it doesn't mean that you *should*. It's a bad idea to use bytestrings for manipulating text, yet the only plausible reason to have wl-pprint

Re: [Haskell-cafe] Policy for taking over a package on Hackage

2011-05-25 Thread Antoine Latter
On May 25, 2011 11:08 AM, KQ qu...@sparq.org wrote: On Wed, 25 May 2011 05:17:46 -0700, Stephen Tetley stephen.tet...@gmail.com wrote: Hi Ivan Forks are good, no? The Parsec experience has suggested to me at least, that new author's capping another author's work by bumping up to a major

Re: [Haskell-cafe] Policy for taking over a package on Hackage

2011-05-25 Thread quick
Quoting Antoine Latter aslat...@gmail.com: On May 25, 2011 11:08 AM, KQ qu...@sparq.org wrote: The HackageDB could the provide this information in the description page of a package, and it could even automatically cross-reference and supplement the referred package descriptions, so that if

Re: [Haskell-cafe] Policy for taking over a package on Hackage

2011-05-25 Thread Antoine Latter
I wanted the second set because I may want to establish the link even if I'm not the maintainer of the second package. I would imagine that the second set of actions would be otherwise identical, and the link would show up on either package regardless of which set of verbs was used. Antoine On

[Haskell-cafe] uniplate and haskell-src-exts (was: Re: code review?)

2011-05-25 Thread Evan Laforge
+1 on that, I use uniplate for pretty much all my haskell-src-exts tasks these days, works like a charm! I'd love to include some standard traversal functionality in haskell-src-exts that depends on uniplate, but hesitate to do so because of HP aspirations for haskell-src-exts. Neil, what do

Re: [Haskell-cafe] code review?

2011-05-25 Thread Neil Mitchell
Hi Niklas, I use Uniplate inside HLint, and it's invaluable - there are a lot of times when List Comp + universeBi really hits the spot. +1 on that, I use uniplate for pretty much all my haskell-src-exts tasks these days, works like a charm! I'd love to include some standard traversal

Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics

2011-05-25 Thread Conal Elliott
Thanks, John. Encouraging bit of news. Please do let us know what you learn when you try. - Conal On Tue, May 24, 2011 at 1:28 AM, John Lato jwl...@gmail.com wrote: You can use gtkglext to get OpenGL support. With the official release of gtkglext-1.2.0 there's a bit of hacking involved

Re: [Haskell-cafe] lambdabot hoogle

2011-05-25 Thread Neil Mitchell
Hi Jacek, Which works swimmingly on Ubuntu, but fails on OS X, because wget seems to be hard-wired. I seem to recall that at least one of the packages that I installed over the last 2 days, automatically selected wget on Ubuntu, and curl on OS X. I see someone raised a bug for this:

Re: [Haskell-cafe] Names for pretty-printing combinators

2011-05-25 Thread Casey McCann
One drastic approach I've used in personal libraries--operator-heavy EDSLs specifically--is to define everything first with alphanumeric names, then put operators in their own modules. In some cases I'd have three such modules: One providing a minimal set of operators that don't clash with

Re: [Haskell-cafe] lambdabot hoogle

2011-05-25 Thread Jacek Generowicz
On 2011 May 25, at 21:04, Neil Mitchell wrote: Hi Jacek, Hi Neil, Any pointers to the least painful way of getting 'hoogle data' to work on OS X? Set up a shell alias so wget just calls curl? Their interfaces are different. (Though maybe there's some option which makes curl

Re: [Haskell-cafe] lambdabot hoogle

2011-05-25 Thread Jacek Generowicz
On 2011 May 25, at 17:42, Gwern Branwen wrote: On Wed, May 25, 2011 at 11:08 AM, Jacek Generowicz jacek.generow...@cern.ch wrote: I've already stumbled across mueval and hoogle as things that need to be installed separately before the full advertized features of lambdabot work. With

Re: [Haskell-cafe] Function application layout

2011-05-25 Thread Alexander Solla
2011/5/25 Jonas Almström Duregård jonas.dureg...@chalmers.se I don't see the similarity (from reading this: http://www.haskell.org/haskellwiki/Idiom_brackets). My suggestion is just a way of using layout to avoid parenthesis. This is exactly the applicative style, where idiom brackets come

Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics

2011-05-25 Thread Evan Laforge
fltk supports OpenGL on windows, X11, and OS X, though I've never used it. The thing it doesn't have is a haskell binding, but as I mentioned I just bind whatever I need when I need it and since I don't need much it's easy. Dunno if this applies in your case though. Maybe it's my NIH, but I

[Haskell-cafe] Calling a C function that returns a struct by value

2011-05-25 Thread Matthew Steele
From Haskell, I want to call a C function that returns a struct by value (rather than, say, returning a pointer). For example: typedef struct { double x; double y; } point_t; point_t polar(double theta); I can create a Haskell type Point and make it an instance of Storable easily

Re: [Haskell-cafe] Calling a C function that returns a struct by value

2011-05-25 Thread Nick Bowler
On 2011-05-25 16:19 -0400, Matthew Steele wrote: From Haskell, I want to call a C function that returns a struct by value (rather than, say, returning a pointer). For example: typedef struct { double x; double y; } point_t; point_t polar(double theta); I can create a Haskell

Re: [Haskell-cafe] lambdabot hoogle

2011-05-25 Thread Brandon Moore
From: Jacek Generowicz Sent: May 25, 2011 2:45 PM On 2011 May 25, at 17:42, Gwern Branwen wrote: On Wed, May 25, 2011 at 11:08 AM, Jacek Generowicz jacek.generow...@cern.ch wrote: I've already stumbled across mueval and hoogle as things that need to be installed separately before

Re: [Haskell-cafe] lambdabot check

2011-05-25 Thread Jacek Generowicz
On 2011 May 25, at 16:09, Mark Wright wrote: Hi Jacek, Hi Mark, Thanks once again for your excellent answer. The show module names were changed in the upgrade from show 0.3.4 to show 0.4.1.1. OK, I see that in show.cabal, ShowIO disappears from the exposed- modules section. This is

Re: [Haskell-cafe] lambdabot hoogle

2011-05-25 Thread Jacek Generowicz
On 2011 May 25, at 23:20, Brandon Moore wrote: From: Jacek Generowicz Sent: May 25, 2011 2:45 PM I feel a bit guilty about spamming the list with all my stupid problems: I would prefer to find my own way around, but if I had to dive in and rummage around the source for every problem that

Re: [Haskell-cafe] Policy for taking over a package on Hackage

2011-05-25 Thread wren ng thornton
On 5/25/11 1:56 PM, Antoine Latter wrote: On May 25, 2011 12:50 PM,qu...@sparq.org wrote: Quoting Antoine Latteraslat...@gmail.com: The only thing I'd add would be the additional actions ReplacedBy, ExtendedBy and RedesignedBy. I was actually thinking that this was the part that HackageDB

Re: [Haskell-cafe] Policy for taking over a package on Hackage

2011-05-25 Thread wren ng thornton
On 5/25/11 1:03 PM, Bryan O'Sullivan wrote: On Wed, May 25, 2011 at 5:59 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Well, using the Char8 version. Just because you *could* do that, it doesn't mean that you *should*. It's a bad idea to use bytestrings for manipulating text,

Re: [Haskell-cafe] Policy for taking over a package on Hackage

2011-05-25 Thread Ivan Lazar Miljenovic
On 26 May 2011 08:49, wren ng thornton w...@freegeek.org wrote: On 5/25/11 1:03 PM, Bryan O'Sullivan wrote: On Wed, May 25, 2011 at 5:59 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com  wrote: Well, using the Char8 version. Just because you *could* do that, it doesn't mean that you

Re: [Haskell-cafe] lambdabot hoogle

2011-05-25 Thread wren ng thornton
On 5/25/11 5:20 PM, Brandon Moore wrote: From: Jacek Generowicz Sent: May 25, 2011 2:45 PM On 2011 May 25, at 17:42, Gwern Branwen wrote: I feel a bit guilty about spamming the list with all my stupid problems: I would prefer to find my own way around, but if I had to dive in and rummage around

Re: [Haskell-cafe] Function application layout

2011-05-25 Thread Jonas Almström Duregård
Hi Alexander, This is exactly the applicative style, where idiom brackets come from. I disagree. Layout has at least two advantages over applicative here: 1) Applicative costs (at least) three additional characters per function parameter. 2) You can not have arbitrary infix operators in the

Re: [Haskell-cafe] Function application layout

2011-05-25 Thread Alexander Solla
2011/5/25 Jonas Almström Duregård jonas.dureg...@chalmers.se Hi Alexander, This is exactly the applicative style, where idiom brackets come from. I disagree. Layout has at least two advantages over applicative here: 1) Applicative costs (at least) three additional characters per function

[Haskell-cafe] [ANN] Released HSnippets, Emacs YASnippets for Haskell

2011-05-25 Thread Christophe McKeon
Just released HSnippets, Emacs YASnippet snippets for Haskell https://github.com/polypus74/HSnippets cheers, _c ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Haskell Weekly News: Issue 183

2011-05-25 Thread Daniel Santa Cruz
Welcome to issue 180 of the HWN, a newsletter covering developments in the Haskell community. This release covers the week of May 15 to 21, 2011. Announcements Janis Veigtlander announced that the 20th edition of the Haskell Communities and Activities reports is hot off the press!