2 ms·
partition p xs = foldr (select p) ([],[]) xs select p x ~(ts,fs) | p x = (x:ts,fs) | otherwise = (ts, x:fs) That is the entirety
by dddbbb 7y ago
partition p xs = foldr (select p) ([],[]) xs
select p x ~(ts,fs) | p x = (x:ts,fs)
| otherwise = (ts, x:fs)
That is the entirety of `partition` in the standard library.