On Tuesday, January 25, 2000 10:00 AM, Joe English [SMTP:[EMAIL PROTECTED]] wrote: > > 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. > I think it is better for the report to use a simple definition like filter/filter to illustrate the semantics. Real implemetations may then use any more efficient definition that preserves them. --brian
- 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