Fwd: Two Proposals

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Fwd: Two Proposals

Philip Wadler
George,  Thanks very much for this.  I like your suggestion, which
fits the logical structure perfectly; and you've suggested a neat way
around the ugliness of 'group groupBy'.  I also note that if we aren't
so worried about not introducing new keywords, that 'then group' could
become 'group'.  Yours,  -- P

On Mon, Oct 10, 2011 at 11:21 PM, George Giorgidze <[hidden email]> wrote:

> A quick thought that came to me after hoogling [a] -> [[a]].
> The first four functions in the search result are named after what they
> return (noun in plural) rather than what they do (verb). I am talking about
> inits, permutations, subsequence and tails.
> So I thought the following syntax might work as well if (as it is already
> common) grouping functions are named after  what they return.
> then       f
> then       f by e
> then group f
> then group f by e
> For example the following code fragments read well:
> then group inits
> then group permutations
> then group subsequences
> then group tails
> Here we use the special identifier group as a verb.
> I have not told you about the fifth result of the hoogling, the groupWith
> function. The following really looks ugly:
> then group groupWith by e
> But following the aforementioned naming convention the groupWith function
> could as well be named as equals. Now this reads well:
> then group equals by e
> Cheers, George

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users