Phobos orthogonality [Was: Re: quickSort]

Jonathan M Davis jmdavisProg at gmx.com
Wed Sep 14 15:07:41 PDT 2011


On Wednesday, September 14, 2011 14:36 bearophile wrote:
> Jonathan M Davis:
> > So, basically, you just want to shorten your code by wrapping array(func)
> > in a afunc function, and you think that this happens enough with map and
> > filter enough to merit putting these functions into Phobos.
> 
> There is also the point 3) that you have not seen, plus the notes about
> Haskell Prelude design.

I did see it. I read your entire post, and I don't see anything that IMHO 
justifies adding amap or afilter.

Yes, I can see why you would want to have and use amap and afilter. They 
aren't worthless. But they just don't add enough value to be worth adding to 
Phobos. And I'd be very surprised if Andrei disagreed with me based on what 
he's said about similar stuff. It was an uphill battle just to get him to 
allow drop to be added to std.range, and that actually allows code to be 
written in a different style, whereas amap and afilter pretty much just reduce 
the number of characters that a particular statement requires. Yes, the 
resulting code may look cleaner, but that's it. There's no real functional 
difference in the resulting code. It just doesn't add enough value to make it 
into Phobos.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list