Adding swap/compose functions to Data.Tuple and Data.Function

wren ng thornton wren at freegeek.org
Fri Nov 23 11:40:02 CET 2012


On 11/20/12 2:23 PM, Edward Kmett wrote:
> On Tue, Nov 20, 2012 at 2:14 PM, John Wiegley <johnw at fpcomplete.com> wrote:
>>
>>      compose :: [(a -> a)] -> a -> a
>>      compose = foldr (.) id
>>
>>      composeM :: [(a -> m a)] -> a -> m a
>>      composeM = foldr (<=<) return
>
> I would actually consider these to fall beneath the "Fairbairn threshold".
>
> The composition of them is obvious, and the suggested names already exist
> commonly in a lot of third party code for all sorts of purposes.
>
> The pain of adoption plus the annoyance of trying to find them exceeds, to
> me, the utility of adding them.

Ditto. There's nothing especially interesting/unintuitive about the 
implementation, and while it occurs it's far from common enough to be 
worth the cost. So -1 from me.

-- 
Live well,
~wren



More information about the Libraries mailing list