
Ask yourself what the type of "head s, last s" is in the exp portion of the comprehension. In fact, it's not a valid Haskell expression, unless you convert it into a list or a tuple. What you actually want is: function seg = nub (concat([[head s, last s] | s <- seg]) -J- Jay Allen Technical Lead, DSV Internet Client "The good news is that in 1995 we will have a good operating system and programming language; the bad news is that they will be Unix and C++." - Richard Gabriel -----Original Message----- From: Phil Haymen [mailto:phaymen@yahoo.com] Sent: Saturday, February 09, 2002 11:09 AM To: haskell-cafe@haskell.org Subject: (no subject) hi,I have a function, using list comprehension to pick out the head and last elements from a list of lists and output this into a list without duplicates. It doesn't work. I want to know what is the error. function :: [[Int]] -> [Int] function seg = nub (concat([head s, last s | s <- seg]) __________________________________________________ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (1)
-
Jay Allen