(no subject)

Jay Allen jayallen@microsoft.com
Mon, 11 Feb 2002 15:26:00 -0800

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 =3D nub (concat([[head s, last s] | s <- seg])


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]=20
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.=20

function :: [[Int]] -> [Int]=20
function seg =3D nub (concat([head s, last s | s <-
seg]) =20

Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
Haskell-Cafe mailing list