type student = {name:string, ID:int, courses: string list}; (* findName(n,L) produces those student records with name field n *) fun findName(n,nil) = nil | findName(n,(r:student)::rs) = if n = #name(r) then r::findName(n,rs) else findName(n,rs); (* enrollment(c,L) produces the names in those of the records on list L that have a course list including course c *) fun enrollment(c,nil) = nil | enrollment(c,(r:student)::rs) = if #courses(r) = nil then enrollment(c,rs) else if c = hd(#courses(r)) then #name(r)::enrollment(c,rs) else enrollment(c, {name = #name(r), ID = #ID(r), courses=tl(#courses(r))}::rs);