Making a datatype an instance of Functor to map on a field which is of parametric type
问题 Follow up on this question about Learn You a Haskell for Great Good . The author, at the end of Chapter 8 declares this datatype (slighly simplified, I hope it's fine) data Barry t k p = BarryV p (t k) deriving (Show) and then makes it an instance of Functor instance Functor (Barry a b) where fmap f (BarryV x y) = BarryV (f x) y then concluding There we go! We just mapped the f over the first field. Yes. The first. So my question is: what if I want to map over, say, the second field? Actually