你能帮我处理这段代码吗?我想提取每个元组中最后一个元素的导师,并用它来对整个列表进行排序。
import Data.List
type CourseData = [(String,String,String,String,String)]
l :: CourseData
--list contains name of student, year, programme and personal tutor
l = [("fondi","201202378","2012","Bsc280"," tautology"),
("fondi","201202378","2012","Bsc280"," tautology"),
("Sylvee","200801245","2008","Bsc209","puma"),
("dijeje","201307845","2013","Bsc205","tautology"),
("heron","201002567","2010","Bsc280","setlhako"),
("slow","201198746","2011","Bsc205"," mampu"),
("Sylvee","201198746","2008","bsc209"," puma"),
("Sylvee","201198746","2008","bsc209"," puma")]
sortByTutor :: CourseData ->String -> [String]
sortByTutor list =sort[tutor|(name,id,year,prog,tutor)<-list ]
当我使用上述方法时,它只返回排序的导师列表。我可以改变什么以便它返回根据导师姓名排序的整个列表?