
On Wed, Apr 7, 2010 at 11:13 AM, Bas van Dijk
I would like to propose adding a flipped variant of <$> to Data.Functor:
(<$$>) ∷ Functor f ⇒ f α → (α → β) → f β (<$$>) = flip (<$>)
It is worth doing some simple statistics: There are 5939 hackage packages in my git-repo archive. Of these, there are 10 apps which import Data.Functor directly. The number for Control.Applicative is 418. 'flip\s*<$>' is defined by 6 different packages: jlouis@jlouis-desktop:~/Projects/hackage$ git grep 'flip\s\+<\$>' | sed -e 's/:.*$//' HXQ-0.18.2.tar.gz.dir/HXQ-0.18.2/src/hxml-0.2/LLParsing.hs HXQ-0.18.2.tar.gz.dir/HXQ-0.18.2/src/hxml-0.2/LLParsing.hs action-permutations-0.0.0.0.tar.gz.dir/action-permutations-0.0.0.0/Control/Applicative/Permutation.hs curry-frontend-0.2.9.tar.gz.dir/curry-frontend-0.2.9/src/Curry/Syntax/LLParseComb.lhs curry-frontend-0.2.9.tar.gz.dir/curry-frontend-0.2.9/src/Curry/Syntax/LLParseComb.lhs ideas-0.5.8.tar.gz.dir/ideas-0.5.8/src/Text/Parsing.hs uu-parsinglib-2.3.1.tar.gz.dir/uu-parsinglib-2.3.1/src/Text/ParserCombinators/UU/Derived.hs uu-parsinglib-2.3.1.tar.gz.dir/uu-parsinglib-2.3.1/src/Text/ParserCombinators/UU/Derived.hs uu-parsinglib-2.3.1.tar.gz.dir/uu-parsinglib-2.3.1/src/Text/ParserCombinators/UU/Derived.hs uu-parsinglib-2.3.1.tar.gz.dir/uu-parsinglib-2.3.1/src/Text/ParserCombinators/UU/Derived.hs uulib-0.9.12.tar.gz.dir/uulib-0.9.12/src/UU/Parsing/Derived.hs uulib-0.9.12.tar.gz.dir/uulib-0.9.12/src/UU/Parsing/Derived.hs uulib-0.9.12.tar.gz.dir/uulib-0.9.12/src/UU/Parsing/Derived.hs uulib-0.9.12.tar.gz.dir/uulib-0.9.12/src/UU/Parsing/Derived.hs The confounder is: How many packages would have used the flipped variant had they had access to it. Personally, I wouldn't add it, but it cannot hurt since only 10 hackage packages would potentially be affected by the change. For non-hackage packages, if the hackage packages are taken as a sample, we have 0.1% of the packages affected (fewer, actually). -- J.