Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.
Hi, I'd like to fmap the same function to the 2 members of a ([FilePath], [FilePath]). I think I need a bifunctor for that (it's the first time I would have to use one). Is there an instance of bifunctor for (,) ?
with a Bifunctor, you would apply two functions to two elements, which may be the same
bimap f g (a, b)
is there a shortcut operator ?
thank you !
there would also be the Traversal Control.Lens.both, if that's more your vibe
(both %~ f) (1, 2)
I think I will stick with both + simple functions but thanks for the hint