Why does the 2-tuple Functor instance only apply the function to the second element?
问题 import Control.Applicative main = print $ fmap (*2) (1,2) produces (1,4) . I would expect it it to produce (2,4) but instead the function is applied only to the second element of the tuple. Update I've basically figured this out almost straight away. I'll post my own answer in a minute.. 回答1: Let me answer this with a question: Which output do you expect for: main = print $ fmap (*2) ("funny",2) You can have something as you want (using data Pair a = Pair a a or so), but as (,) may have