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<Object> in java.
I looked in a couple of on-line tutorials, thinking I would quickly find something about this, but -- maybe in my haste I missed something. Objective CAML documentation gets right to it, I wonder if we're assuming prior exposure to strongly typed functional languages? Anyway, you need to define a type that accounts for the types you want to support - data Object = IntObject Int | StringObject String objectString :: Object -> String objectString (IntObject v) = show v objectString (StringObject v) = v main = mapM (putStrLn . objectString) [(IntObject 7), (StringObject "eight")] Donn Cave, [EMAIL PROTECTED] _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe