From: Brian H. <bh...@sp...> - 2005-11-25 04:11:50
|
On Fri, 25 Nov 2005, Jonathan Roewen wrote: > IMO, Array.filter should return an array of the same size. Reason: > whilst arrays are mutable, they are not resizable. Which makes the usefullness of this function deeply questionable, I agree. > > Then it's just a specialised Array.map. > > let filter pred = map (fun elt -> if pred elt then Some elt else None);; This is simple enough, I don't see why a new library function is needed. The changing size version is complicated enough I don't want to be constantly recoding it. Brian |