First off, I would like to make you all aware that I'm very new to Haskell, so to increase knowledge etc, I've been trying out questions and I'm pretty stuck on one. I think I'm nearly there but some more experienced advice would be appreciated. Here's the question:

A sporting team is represented by it's name and the amount of points they scored in their last games like so ("Newcastle",[3,3,3,0]). This data is modelled by the type definitions:

type TName = String type Points = [Int] type Team = (TName,Points)

From this I have to define the following function that orders one team higher than another if their points sum is greater:

sortPoints :: [Team] -> [Team]

This is what I've tried:

sortPoints :: [Team] -> [Team] sortPoints [_,()] -> [] sortPoints [_,(x:xs)] -> sum[x|x<-xs]

Once I get to here, I'm not too sure how to go about adding the conditions to check the points sum, any pointers would be greatly appreciated as I'm still coming to terms with a lot of Haskell features.

Thanks for your time.