Re: [Haskell-cafe] ANNOUNCE: graphviz-2999.0.0.0

2009-07-19 Thread Ivan Lazar Miljenovic
Two clarifications I'd like to add to my previous announcement (both of which were prompted by Zsolt :p ): 1. Some Attribute values take something like (Either Bool String); this is used when upstream indicates that two different types of values are allowed. Typically in this kind of

[Haskell-cafe] Re: can there be (hash-table using) O(n) version of this (I think currently) n log n algo?

2009-07-19 Thread Heinrich Apfelmus
Thomas Hartman wrote: The code below is, I think, n log n, a few seconds on a million + element list. I wonder if it's possible to get this down to O(N) by using a hashtable implemementation, or other better data structure. -- findsums locates pairs of integers in a list that add up to a

Re: [Haskell-cafe] Why is there no Zippable class? Would this work?

2009-07-19 Thread Edward Kmett
On Fri, Jul 17, 2009 at 10:37 PM, por...@porg.es wrote: 2009/7/18 Edward Kmett ekm...@gmail.com: I wrote a short blog post on this: http://comonad.com/reader/2008/zipping-and-unzipping-functors/ and one on the less powerful dual operations (less powerful because while every Haskell Functor

Re: [Haskell-cafe] is closing a class this easy?

2009-07-19 Thread Miguel Mitrofanov
On 18 Jul 2009, at 16:49, Wolfgang Jeltsch wrote: Am Samstag, 18. Juli 2009 08:58 schrieb Miguel Mitrofanov: Oops... Sorry, wrong line. Should be isAB :: forall p. p A - p B - p x Is this a well-known approach for closing classes? I have an impression that this is kinda folklore. But I

Re: [Haskell-cafe] ANNOUNCE: graphviz-2999.0.0.0

2009-07-19 Thread Brandon S. Allbery KF8NH
On Jul 19, 2009, at 04:13 , Ivan Lazar Miljenovic wrote: 1. Some Attribute values take something like (Either Bool String); this is used when upstream indicates that two different types of values are allowed. Typically in this kind of situation, the allowed String values are limited

[Haskell-cafe] Implicit concatenation in list comprehensions

2009-07-19 Thread Max Bolingbroke
Dear Cafe, For fun, I spent a few hours yesterday implement support for this syntax in GHC, originally propsed by Koen Claessen: [k, =, v, | (k, v) - [(foo, 1), (bar, 2)] [foo, =, 1, , bar, =, 2, ] This is a generalisation of list comprehensions that allows several items to be concatenated

[Haskell-cafe] Re: Problem with lazy IO

2009-07-19 Thread Maciej Piechotka
Maciej Piechotka uzytkownik2 at gmail.com writes: Hello. I've tried to combine lazy IO and parsec. The hole process is done by network. Currently I have implemented 'short parsers' so I enter them on need. To update state I have following code: parser2nntp :: Monad m = NntpParser m a

Re: [Haskell-cafe] Implicit concatenation in list comprehensions

2009-07-19 Thread Neil Mitchell
Hi Max, For fun, I spent a few hours yesterday implement support for this syntax in GHC, originally propsed by Koen Claessen: [k, =, v, | (k, v) - [(foo, 1), (bar, 2)] [foo, =, 1, , bar, =, 2, ] This is a generalisation of list comprehensions that allows several items to be

Re: [Haskell-cafe] Implicit concatenation in list comprehensions

2009-07-19 Thread Thomas Hartman
I vote for tuple sections. Very nice! I don't really see immediate places where I would use the list comprehension improvement so I guess I don't vote for that. 2009/7/19 Neil Mitchell ndmitch...@gmail.com: Hi Max, For fun, I spent a few hours yesterday implement support for this syntax in

Re: [Haskell-cafe] Implicit concatenation in list comprehensions

2009-07-19 Thread Robin Green
I really like tuple sections and I've wanted them for years. I never use comprehensions though, so I abstain from the other vote. -- Robin On Sun, 19 Jul 2009 08:18:48 -0700 Thomas Hartman tphya...@gmail.com wrote: I vote for tuple sections. Very nice! I don't really see immediate places

[Haskell-cafe] Ambiguous type variable - help!

2009-07-19 Thread phil
Hi, I'm trying to work out how to handle a choice at runtime which determines what instance of a State monad should be used. The choice will dictate the internal state of the monad so different implementations are needed for each. I've concocted a very simple example to illustrate this

Re: [Haskell-cafe] Ambiguous type variable - help!

2009-07-19 Thread Yitzchak Gale
Hi Phil, I'm trying to work out how to handle a choice at runtime which determines what instance of a State monad should be used. First of all, you should realize that you'll almost never want to do something like that in Haskell. In my opinion, if you're coming from an OO language, you

Re: [Haskell-cafe] ANN: AC-Vector, AC-Colour and AC-EasyRaster-GTK

2009-07-19 Thread Richard O'Keefe
On Jul 18, 2009, at 9:26 PM, Wolfgang Jeltsch wrote: I don’t think, it’s a good idea to have German identifiers, since Haskell’s keywords are English. Put it this way: if Haskell's keywords were in German, do you suppose I would write my Haskell code in anything but English? Does the

Re: [Haskell-cafe] Implicit concatenation in list comprehensions

2009-07-19 Thread Thomas Schilling
2009/7/19 Max Bolingbroke batterseapo...@hotmail.com Dear Cafe, For fun, I spent a few hours yesterday implement support for this syntax in GHC, originally propsed by Koen Claessen: [k, =, v, | (k, v) - [(foo, 1), (bar, 2)] [foo, =, 1, , bar, =, 2, ] Given that this can easily be

[Haskell-cafe] ANN: cautious-file 0.1.1: Ways to write a file cautiously, to avoid data loss

2009-07-19 Thread Robin Green
I'm pleased to announce the first public release of cautious-file: http://hackage.haskell.org/package/cautious-file This library currently provides a writeFile function that is intended to have three advantages over Prelude.writeFile: 1. There was a controversy a few months ago about the new

Re: [Haskell-cafe] ANN: AC-Vector, AC-Colour and AC-EasyRaster-GTK

2009-07-19 Thread Wolfgang Jeltsch
Am Sonntag, 19. Juli 2009 23:42 schrieben Sie: On Jul 18, 2009, at 9:26 PM, Wolfgang Jeltsch wrote: I don’t think, it’s a good idea to have German identifiers, since Haskell’s keywords are English. Put it this way: if Haskell's keywords were in German, do you suppose I would write my

Re: [Haskell-cafe] ANNOUNCE: graphviz-2999.0.0.0

2009-07-19 Thread Ivan Miljenovic
2009/7/20 Brandon S. Allbery KF8NH allb...@ece.cmu.edu: Shouldn't String then be replaced by a sum type?  In fact, as described this would subsume the Either as well. -- replace Either Bool String: AttrN are the strings, AltValue the bool data upstreamValue = AttrA | AttrB | AltValue Yes, as

Re: [Haskell-cafe] Problem resizing widget contained in window

2009-07-19 Thread Bit Connor
On Tue, Jul 14, 2009 at 5:46 PM, Jeff Heardjefferson.r.he...@gmail.com wrote: Now, if someone resizes the window, the GLArea does not appear to resize along with it.  Did I screw something up? You need to call the opengl glViewport function(I don't remember what the haskell binding is called)