This should be a quick one :)
Let's say I've got a function like this:
def sort: List[Int] => List[Int]
and I want to parallelize it in a function called sortPar. Originally I'd thought that I'd need to do this:
def sortPar: List[Int] => List[Int] = ls => sort(ls.par).toList
but of course that's not possible since sort expects a list rather than a ParSeq. After some time playing around with it I came up with this solution, but I'm not too sure about it:
def sortPar: List[Int] => List[Int] = ls => sort(ls).par.toList
Does this achieve anything in terms of runtime? I get no red crosses in eclipse so I assume it should work, but I don't know if it actually sorts in parallel.
Many thanks Curtis
sortParon your own.sortas-is.