| > 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
- Haskell 98: partition; and take,drop,splitAt Simon Peyton-Jones
- Re: Haskell 98: partition; and take,drop,splitAt Chris Okasaki
- Re: Haskell 98: partition; and take,drop,splitAt Joe English
- RE: Haskell 98: partition; and take,drop,splitAt Brian Boutel
- Re: Haskell 98: partition; and take,drop,splitAt Simon Peyton-Jones
- Re: Haskell 98: partition; and take,drop,splitAt Ralf Hinze
- Re: Haskell 98: partition; and take,drop,splitAt Jan-Willem Maessen
- RE: Haskell 98: partition; and take,drop,splitAt Simon Peyton-Jones
- RE: Haskell 98: partition; and take,drop,split... Ch. A. Herrmann
- RE: Haskell 98: partition; and take,drop,splitAt Simon Peyton-Jones
- RE: Haskell 98: partition; and take,drop,split... Koen Claessen
- RE: Haskell 98: partition; and take,drop,splitAt Simon Peyton-Jones
- FW: Haskell 98: partition; and take,drop,splitAt Simon Peyton-Jones
- Re: FW: Haskell 98: partition; and take,drop,s... Fergus Henderson
- Re: FW: Haskell 98: partition; and take,dr... George Russell