Re: Proposal: alpha-rename the type signatures of foldl, foldl', and scanl to be consistent with foldr and scanr

Johan Tibell <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc,gmane.comp.lang.haskell.libraries
Message-ID <CAK-tuPb7MQCNU3a3JD649jT4Vh+h07+MDPo4GYf_1fhaBzXg=Q@mail.gmail.com>
On Sun, Oct 14, 2012 at 12:00 PM, Gábor Lehel <[email protected]> wrote:
> On Sun, Oct 14, 2012 at 8:47 PM, Dan Burton <[email protected]> wrote:
>> At the risk of useless bikeshedding... might I suggest "r" as a mnemonic for
>> "result"?
>>
>> foldl :: (a -> r -> r) -> r -> [a] -> r
>> foldr :: (r -> a -> r) -> r -> [a] -> r
>>
>> -- Dan Burton
>
> 'r' is the version I originally used myself (see reddit). But then you
> have to change the foldrs too, and quite possibly a lot of other
> functions, and get dragged into a big discussion over when is 'r' a
> better mnemonic than 'b' and when is it not.
>
> Simply swapping 'a' and 'b' in the left folds captures most of the
> benefit for least cost.
>
> Same goes for most of the other suggestions I have seen (I don't find
> the existing signatures actively confusing, merely suboptimal), but if
> sentiment is overwhelmingly in favor of making further changes I can
> be swayed. For now I wanted to propose a minimal change with the best
> chance of attracting a broad consensus.

+1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.