[Haskell-cafe] Collections library

2007-11-28 Thread Ketil Malde
Ben Franksen [EMAIL PROTECTED] writes: PS (completely off-topic, sorry): I've been using the collections library throughout the project I must say it is a lot nicer to work with I tried to Google for this, and ended up at http://hackage.haskell.org/trac/ghc/wiki/CollectionClassFramework

Re: [Haskell-cafe] Collections library

2007-11-28 Thread Adrian Hey
Ketil Malde wrote: Ben Franksen [EMAIL PROTECTED] writes: PS (completely off-topic, sorry): I've been using the collections library throughout the project I must say it is a lot nicer to work with I tried to Google for this, and ended up at

Re: [Haskell-cafe] Collections library

2007-11-28 Thread Robert Dockins
[snip] I recently withdrew from this project and offered up the libs I'd been working on as they are for a new owner. Didn't get any takers though (no surprises there!). I've always found the lack of apparent interest in all this somewhat puzzling myself. It's not as if there's no latent

Re: [Haskell-cafe] Collections library

2007-11-28 Thread Henning Thielemann
On Wed, 28 Nov 2007, Robert Dockins wrote: FWIW, I find the same phenomenon with Edison. I get very little feedback about it positive or negative; I really have no idea how many people are using it. I guess people are more willing to roll their own data structures or use the standard libs.

Re: [Haskell-cafe] Collections

2007-06-25 Thread Andrew Coppin
Lennart Augustsson wrote: If you don't run into graphs you are either solving very peculiar problems, or you don't recognize them when you see them. They are everywhere. I see lots of *trees*, but no general graphs. (As in, *data* structures having cycles in them. My *code* is often

Re: [Haskell-cafe] Collections

2007-06-25 Thread Thomas Schilling
On 25 jun 2007, at 20.38, Andrew Coppin wrote: Lennart Augustsson wrote: If you don't run into graphs you are either solving very peculiar problems, or you don't recognize them when you see them. They are everywhere. I see lots of *trees*, but no general graphs. (As in, *data*

Re: [Haskell-cafe] Collections

2007-06-23 Thread Lennart Augustsson
If you don't run into graphs you are either solving very peculiar problems, or you don't recognize them when you see them. They are everywhere. On 6/22/07, Andrew Coppin [EMAIL PROTECTED] wrote: Dan Piponi wrote: Andrew said: True enough - but that's a rather specific task. I'm still not

Re: [Haskell-cafe] Collections

2007-06-22 Thread Lennart Augustsson
It's not that broken, It was designed by people from the FP community. :) On 6/21/07, Andrew Coppin [EMAIL PROTECTED] wrote: Brent Yorgey wrote: OK, I don't even understand that syntax. Have they changed the Java language spec or something? Yes. As of version 5 (or 1.5, or

Re: [Haskell-cafe] Collections

2007-06-22 Thread ajb
G'day. Quoting Andrew Coppin [EMAIL PROTECTED]: True enough - but that's a rather specific task. There are a lot of rather specific tasks out there. Cheers, Andrew Bromage ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Collections

2007-06-22 Thread Andrew Coppin
Dan Piponi wrote: Andrew said: True enough - but that's a rather specific task. I'm still not seeing vast numbers of other uses for this... Graphs are one of the most ubiquitous structures in the whole of computer science. Whether you're representing dataflows, or decoding error-correcting

Re: [Haskell-cafe] Collections

2007-06-22 Thread Andrew Coppin
Lennart Augustsson wrote: It's not that broken, It was designed by people from the FP community. :) OMG... A Java feature designed by people who know stuff about stuff? Next thing they'll implement real multiple inheritance or something... ;-) ___

Re: [Haskell-cafe] Collections

2007-06-22 Thread Andrew Coppin
Calvin Smith wrote: Andrew Coppin wrote: True enough - but that's a rather specific task. I'm still not seeing vast numbers of other uses for this... You can see lots of applications for graphs at the following page: http://www.graph-magics.com/practic_use.php I see a pattern here - these

Re: [Haskell-cafe] Collections

2007-06-22 Thread Dan Piponi
Andrew said: I see *trees* around the place a lot, but not general graphs. A link discussing the application of graph theory for each of the examples I gave. In each case the structure used is not a tree. http://citeseer.ist.psu.edu/wiberg96codes.html

Re: [Haskell-cafe] Collections

2007-06-21 Thread Andrew Coppin
Tillmann Rendel wrote: Andrew Coppin wrote: [...] type (a,b) [...] That's a rather special type; I haven't seen anything remotely like it in any other language. This type isn't that special in Haskell (apart from being syntax-sugared), it could be defined as data Pair a b = Pair a b

Re: [Haskell-cafe] Collections

2007-06-21 Thread Brent Yorgey
public class PairA, B { public A fst; public B snd; public Pair(A fst, B snd) { this.fst = fst; this.snd = snd; } } OK, I don't even understand that syntax. Have they changed the Java language spec or something? Yes. As of version 5 (or 1.5, or whatever you want to

Re: [Haskell-cafe] Collections

2007-06-21 Thread Andrew Coppin
Brent Yorgey wrote: OK, I don't even understand that syntax. Have they changed the Java language spec or something? Yes. As of version 5 (or 1.5, or whatever you want to call it), Java has parametric polymorphism. Do a Google search for Java generics. OMG - they actually added

Re: [Haskell-cafe] Collections

2007-06-21 Thread Calvin Smith
Andrew Coppin wrote: Dan Piponi wrote: On 6/20/07, Andrew Coppin [EMAIL PROTECTED] wrote: Yes... graph and network are virtually synonymous. I'm still wondering what you'd use a network for in a computer program. Writing a Haskell compiler. True enough - but that's a rather specific task.

Re: [Haskell-cafe] Collections

2007-06-21 Thread Tillmann Rendel
Andrew Coppin wrote: I don't even understand that... :-S Ok, I'll try to explain it: I represent sets by their characteristic function, wich returns True for members of the set, and False for other values. type Set a = a - Bool For example, the set of numbers containing only 42 is

Re: [Haskell-cafe] Collections

2007-06-20 Thread Jens Fisseler
On Tue, 19 Jun 2007, Andrew Coppin wrote: Maybe it's just a culture thing then... In your typical OOP language, you spend five minutes thinking now, what collection type shall I use here? before going on to actually write the code. In Haskell, you just go OK, so I'll put a list here... I

Re: [Haskell-cafe] Collections

2007-06-20 Thread Andrew Coppin
David House wrote: Andrew Coppin writes: Data.Graph -- graph type What would you use that for? (And what does it do?) It's for graphs, in the graph-theory [1] sense. Yes, I realise that. (I'm not a graph theory expert, but I'm aware of the subject.) But what kind of thing

Re[2]: [Haskell-cafe] Collections

2007-06-20 Thread Bulat Ziganshin
Hello Chaddai, Wednesday, June 20, 2007, 3:14:54 PM, you wrote: Well lists are really useful, but I don't think all Haskell programmers are like you, in fact I think only the enthusiast newbies (like.. you maybe ?) only use lists without asking themselves if there is not a data structure

Re: [Haskell-cafe] Collections

2007-06-20 Thread Lennart Augustsson
I don't think the collection type (a,b) is best thought of as a loop. Neither is a (non-trivial) tree. On 6/20/07, Andrew Coppin [EMAIL PROTECTED] wrote: Derek Elkins wrote: On Tue, 2007-06-19 at 18:49 -0400, Brandon S. Allbery KF8NH wrote: Haskell is, in many ways, a descendant of Lisp.

Re: [Haskell-cafe] Collections

2007-06-20 Thread Andrew Coppin
Derek Elkins wrote: On Tue, 2007-06-19 at 18:49 -0400, Brandon S. Allbery KF8NH wrote: Haskell is, in many ways, a descendant of Lisp. This does tend to lead to lists being *the* collection type, in my experience: sure, others get used, but lists are the ones you see in examples and

Re: [Haskell-cafe] Collections

2007-06-20 Thread Nicolas Frisby
Just a couple of examples: many non-trivial program analyses (like optimizations or type-inference) rely on viewing the AST as a graph. Graph reduction is an evaluation paradigm, and I'm guessing that a (specification-oriented) interpreter might use a graph. On 6/20/07, Andrew Coppin [EMAIL

Re: [Haskell-cafe] Collections

2007-06-20 Thread Albert Y. C. Lai
Andrew Coppin wrote: But what kind of thing would you use a general graph for? (Rather than some more specific custom data type.) Representing networks. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Collections

2007-06-20 Thread Andrew Coppin
Albert Y. C. Lai wrote: Andrew Coppin wrote: But what kind of thing would you use a general graph for? (Rather than some more specific custom data type.) Representing networks. Yes... graph and network are virtually synonymous. I'm still wondering what you'd use a network for in a computer

Re: [Haskell-cafe] Collections

2007-06-20 Thread Andrew Coppin
Lennart Augustsson wrote: I don't think the collection type (a,b) is best thought of as a loop. True. That's a rather special type; I haven't seen anything remotely like it in any other language. Neither is a (non-trivial) tree. Erm... Depends on your idea of loop I suppose. A tree

Re: [Haskell-cafe] Collections

2007-06-20 Thread Thomas Conway
On 6/21/07, Andrew Coppin [EMAIL PROTECTED] wrote: Lennart Augustsson wrote: I don't think the collection type (a,b) is best thought of as a loop. True. That's a rather special type; I haven't seen anything remotely like it in any other language. Is it that special? How is it different to

Re: [Haskell-cafe] Collections

2007-06-20 Thread Jon Harrop
On Wednesday 20 June 2007 20:04:25 Andrew Coppin wrote: Lennart Augustsson wrote: I don't think the collection type (a,b) is best thought of as a loop. True. That's a rather special type; I haven't seen anything remotely like it in any other language. Are you referring to a 2-tuple/pair?

Re: [Haskell-cafe] Collections

2007-06-20 Thread Dan Piponi
On 6/20/07, Andrew Coppin [EMAIL PROTECTED] wrote: Yes... graph and network are virtually synonymous. I'm still wondering what you'd use a network for in a computer program. Writing a Haskell compiler. http://en.wikibooks.org/wiki/Haskell/Graph_reduction -- Dan

Re: [Haskell-cafe] Collections

2007-06-20 Thread Tillmann Rendel
Andrew Coppin wrote: [...] type (a,b) [...] That's a rather special type; I haven't seen anything remotely like it in any other language. This type isn't that special in Haskell (apart from being syntax-sugared), it could be defined as data Pair a b = Pair a b The equivalent of this

[Haskell-cafe] Collections

2007-06-19 Thread Andrew Coppin
When I was at university, we learned a programming language known as Smalltalk. I was rather good at it. [Ironically, making small talk is one of the things I do worst IRL! But anyway, back to the topic...] In Smalltalk, there is a wide selection of collection types, all with different

Re: [Haskell-cafe] Collections

2007-06-19 Thread Tomasz Zielonka
On Tue, Jun 19, 2007 at 07:26:20PM +0100, Andrew Coppin wrote: However, Haskell only has 1 type of collection: linked lists. (And only single-linked at that.) While other normal programming languages spend huge amounts of effort trying to select exactly the right collection type for the

Re: [Haskell-cafe] Collections

2007-06-19 Thread Jon Harrop
I'm not a Haskell guru but I think I can answer this... On Tuesday 19 June 2007 19:26:20 Andrew Coppin wrote: In Smalltalk, there is a wide selection of collection types, all with different facilities and efficiency trade offs. There is bag, set, list, array, ordered list, dictionary, hash

Re: [Haskell-cafe] Collections

2007-06-19 Thread Spencer Janssen
On Tue, 19 Jun 2007 19:26:20 +0100 Andrew Coppin [EMAIL PROTECTED] wrote: When I was at university, we learned a programming language known as Smalltalk. I was rather good at it. [Ironically, making small talk is one of the things I do worst IRL! But anyway, back to the topic...] In

Re: [Haskell-cafe] Collections

2007-06-19 Thread Adam Turoff
On 6/19/07, Andrew Coppin [EMAIL PROTECTED] wrote: However, Haskell only has 1 type of collection: linked lists. (And only single-linked at that.) While other normal programming languages spend huge amounts of effort trying to select exactly the right collection type for the task in hand,

Re: [Haskell-cafe] Collections

2007-06-19 Thread Nicolas Frisby
I don't know where you got the notion that such structures are not available in Haskell. There are many efficient data structures in the libraries. Lists are not magical, just popular, natural, and traditional. Specialized data structures are always important. Take a look at the Data.* modules

Re: [Haskell-cafe] Collections

2007-06-19 Thread David House
Andrew Coppin writes: However, Haskell only has 1 type of collection: linked lists. (And only single-linked at that.) Woah there, what about: Data.Map -- lookup tables Data.Array -- lookup tables with enumerated keys. Mutable interfaces are also available. Data.Sequence -- two-ended

Re: [Haskell-cafe] Collections

2007-06-19 Thread Jens Fisseler
On Tue, 19 Jun 2007, Andrew Coppin wrote: In Smalltalk, there is a wide selection of collection types, all with different facilities and efficiency trade offs. There is bag, set, list, array, ordered list, dictionary, hash table, weak array, etc. A whole menagerie of collection types.

Re: [Haskell-cafe] Collections

2007-06-19 Thread Andrew Coppin
Adam Turoff wrote: - Data.Map (more commonly known as 'dictionaries') Ah yes, I've heard about this one. - Data.HashTable (same idea, different runtime characteristics) Well, you learn something every day... (And that, of course, is the reason for asking questions in the first place!)

Re: [Haskell-cafe] Collections

2007-06-19 Thread Andrew Coppin
Nicolas Frisby wrote: I don't know where you got the notion that such structures are not available in Haskell. There are many efficient data structures in the libraries. Lists are not magical, just popular, natural, and traditional. Specialized data structures are always important. Mmm, OK.

Re: [Haskell-cafe] Collections

2007-06-19 Thread Alex Queiroz
Hallo, On 6/19/07, Andrew Coppin [EMAIL PROTECTED] wrote: However, Haskell only has 1 type of collection: linked lists. (And only single-linked at that.) While other normal programming languages spend huge amounts of effort trying to select exactly the right collection type for the task in

Re: [Haskell-cafe] Collections

2007-06-19 Thread Albert Y. C. Lai
Take a look at http://www.haskell.org/ghc/docs/latest/html/libraries/index.html There are more elsewhere. I am actually amazed that we have a comprehensive, widely-distributed package for graphs and graph algorithms. I can't say the same about other programming communities (they tend to

Re: [Haskell-cafe] Collections

2007-06-19 Thread Andrew Coppin
Jens Fisseler wrote: The equivalent of Haskell's list data type would be the array type of most imperative or object-oriented languages. Both are some sort of basic collection type, good for their own sake, but if you want more specialized collection types, you have to implement them.

Re: [Haskell-cafe] Collections

2007-06-19 Thread Andrew Coppin
*Albert Y. C. Lai wrote: * I am actually amazed that we have a comprehensive, widely-distributed package for graphs and graph algorithms. I can't say the same about other programming communities (they tend to re-implement it every time). Yeah... pitty the documentation isn't more

Re: [Haskell-cafe] Collections

2007-06-19 Thread Lennart Augustsson
I'm afraid I must agree with you a little. Many people use lists when a different data structure would have been better. It's a pity, because Haskell provides a large number of different data structures. On 6/19/07, Andrew Coppin [EMAIL PROTECTED] wrote: Jens Fisseler wrote: The equivalent

Re: [Haskell-cafe] Collections

2007-06-19 Thread David House
Andrew Coppin writes: Data.Graph -- graph type What would you use that for? (And what does it do?) It's for graphs, in the graph-theory [1] sense. The referenced page gives a list of example problems in the area, most of which are very practical. [1]:

Re: [Haskell-cafe] Collections

2007-06-19 Thread Brandon S. Allbery KF8NH
On Jun 19, 2007, at 16:23 , Andrew Coppin wrote: Jens Fisseler wrote: The equivalent of Haskell's list data type would be the array type of most imperative or object-oriented languages. Both are some sort of basic collection type, good for their own sake, but if you want more specialized

Re: [Haskell-cafe] Collections

2007-06-19 Thread David House
Andrew Coppin writes: Maybe it's just a culture thing then... In your typical OOP language, you spend five minutes thinking now, what collection type shall I use here? before going on to actually write the code. In Haskell, you just go OK, so I'll put a list here... The design stage of

Re: [Haskell-cafe] Collections

2007-06-19 Thread Derek Elkins
On Tue, 2007-06-19 at 18:49 -0400, Brandon S. Allbery KF8NH wrote: On Jun 19, 2007, at 16:23 , Andrew Coppin wrote: Jens Fisseler wrote: The equivalent of Haskell's list data type would be the array type of most imperative or object-oriented languages. Both are some sort of basic

Re: [Haskell-cafe] Collections

2007-06-19 Thread Creighton Hogg
A lot of people have had comments on this thread, but I have a off-hand question: what data types are required by the 98 standard? I figured it was just lists tuples because they have syntactic support, but is that true? Thanks, Creighton ___

Re: [Haskell-cafe] Collections

2007-06-19 Thread Stefan O'Rear
On Tue, Jun 19, 2007 at 06:42:22PM -0500, Creighton Hogg wrote: A lot of people have had comments on this thread, but I have a off-hand question: what data types are required by the 98 standard? I figured it was just lists tuples because they have syntactic support, but is that true?