
2 Dec
2009
2 Dec
'09
7:47 p.m.
I am looking for a function f::Eq a => [a]->[a] that takes a list and returns the longest initial segment of the list for which all the elements are distinct. For example f [2,3,6,4,3,5] = [2,3,6,4]. I didn't see anything that matched using Hoogle, but I thought this might be a common enough operation that this function might exists somewhere in the standard packages.