I am wanting to sort a list of tuples by the first and then the second item in the tuple. So [(1,2),(4,2),(2,5)] would become [(1,2),(2,5),(4,2)] I am attempting to use the Sorty function but don't seem to be having much luck
tuplesort :: [(a,b)] -> [(a,b)]
tuplesort [(_,_)] = sortBy (comparing fst) -- this is an attempt to organise by the first element in the tuple
Any help would be much appreciated