Fwd: Two Proposals
wadler at inf.ed.ac.uk
Wed Oct 12 10:39:29 CEST 2011
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 <giorgidze at gmail.com> 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.
More information about the Glasgow-haskell-users