Re: [Haskell-cafe] Collection of objects?

2006-11-17 Thread Henk-Jan van Tuyl
On Fri, 17 Nov 2006 20:04:22 +0100, Steve Schafer <[EMAIL PROTECTED]> wrote: myList = [(Integer 42), (Character 'a'), (Float 3.14159)] You can leave out the parentheses, making even simpler: myList = [Integer 42, Character 'a', Float 3.14159] -- Met vriendelijke groet, Henk-Jan van Tuyl

Re: [Haskell-cafe] Collection of objects?

2006-11-17 Thread Steve Schafer
On Fri, 17 Nov 2006 18:36:30 +0100, you wrote: >But I need something which is heterogeneous and non-fixed length. I'm >used do Java, and this switch to functional languages is very strange to >me. So, to be clear, I need something like LinkedList in java. In an attempt to leverage your existing

Re: [Haskell-cafe] Collection of objects?

2006-11-17 Thread Valentin Gjorgjioski
On 17.11.2006 19:08 Donn Cave wrote: On Fri, 17 Nov 2006, Valentin Gjorgjioski wrote: ... But I need something which is heterogeneous and non-fixed length. I'm used do Java, and this switch to functional languages is very strange to me. So, to be clear, I need something like LinkedList in ja

Re: [Haskell-cafe] Collection of objects?

2006-11-17 Thread Matthias Fischmann
i have cut-and-pasted the last few postings into the wiki: http://haskell.org/haskellwiki/Heterogenous_collections it'is very ad hoc, but i hope it helps those who bump into it a little. and it's easier to edit and improve than a mailing list thread. (-: matthias signature.asc Description:

Re: Re: [Haskell-cafe] Collection of objects?

2006-11-17 Thread Nicolas Frisby
Depending on your needs and your comfort level with fancier types, the existential approach to ADTs might solve your problem. The following code is a demonstration you can cut-and-paste-and-run. This is example akin to upcasting in Java to an interface that lets you print things. That way you kno

Re: [Haskell-cafe] Collection of objects?

2006-11-17 Thread Robert Dockins
On Nov 17, 2006, at 12:36 PM, Valentin Gjorgjioski wrote: Is some kind of collection of object with different types in Haskell exist? Except the tuples, which have fixed length. I find this * Tuples heterogeneous, lists homogeneous. * Tuples have a fixed length, or at least their lengt

Re: [Haskell-cafe] Collection of objects?

2006-11-17 Thread Henning Thielemann
On Fri, 17 Nov 2006, Valentin Gjorgjioski wrote: > Is some kind of collection of object with different types in Haskell exist? > Except the tuples, which have fixed length. > I find this > >* Tuples heterogeneous, lists homogeneous. >* Tuples have a fixed length, or at least their length

Re: [Haskell-cafe] Collection of objects?

2006-11-17 Thread Donn Cave
On Fri, 17 Nov 2006, Valentin Gjorgjioski wrote: ... > But I need something which is heterogeneous and non-fixed length. I'm > used do Java, and this switch to functional languages is very strange to > me. So, to be clear, I need something like LinkedList in java. I looked in a couple of on-line

Re: [Haskell-cafe] Collection of objects?

2006-11-17 Thread Matthias Fischmann
this is not exactly what you are looking for, but it contains a link to HList: http://www.haskell.org/haskellwiki/Extensible_record and then there is the follow-up work to HList, an OO library written in Haskell: http://homepages.cwi.nl/~ralf/OOHaskell/ it's quite a challenging read if yo

Re: [Haskell-cafe] Collection of objects?

2006-11-17 Thread Kurt Hutchinson
On 11/17/06, Valentin Gjorgjioski <[EMAIL PROTECTED]> wrote: But I need something which is heterogeneous and non-fixed length. You're looking for HList: http://homepages.cwi.nl/~ralf/HList/ Kurt ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org