| > PROPOSAL: use the filter/filter defn of partition
| 
| 
| Is the filter/filter definition semantically equivalent to:
| 
| partition p xs = foldr select ([],[]) xs
|     where
|     select x ~(ts,fs)   | p x       = (x:ts,fs)
|                       | otherwise = (ts, x:fs)
| 
| (that is, the current definition in the Library report
| with an extra twiddle added)?
| 
| Operationally, the 'foldr' version makes half as many
| calls to 'p' as the 'filter/filter' version, so the former
| may be preferable if the two are in fact semantically
| equivalent.

Yes, it's equivalent.  But the Report should say what
the *semantics* of a function are, as clearly as possible.
An implementation is free to implement that function in
any way it pleases.  There is no requirement to *implement*
partition using filter/filter.

Simon

Reply via email to