On Sunday 14 August 2011, 00:41:33, Mark Spezzano wrote: > Hi Antoine, > > The first Int field is a unique index, beginning at 1 and increasing by > 1 for each unique Node.
Then you could use that for indexing, assuming the Ord instance matches. range (MyNode x _ _ _, MyNode y _ _ _) = [x .. y] index (MyNode x _ _ _, MyNode y _ _ _) (MyNode z _ _ _) | x <= z && z <= y = z-x | otherwise = error ("Index out of range: " ++ show z) etc. > The second [Int] field is just a list of random > numbers associated with that node. > > Mark _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe