Resolve name collsion of `first` and `second` by Control.Arrow and Data.Bifunctor
Wolfgang Jeltsch
wolfgang-it at jeltsch.info
Wed May 9 12:59:46 UTC 2018
Am Mittwoch, den 09.05.2018, 13:49 +0200 schrieb Henning Thielemann:
> On Wed, 9 May 2018, Wolfgang Jeltsch wrote:
>
> >
> > Eric Mertens wrote:
> >
> > In modern code it should be fairly rare to import
> > Control.Arrow.
> >
> >
> > Edward Kmett wrote:
> >
> > […] in an attempt to help lead people away from Control.Arrow.
> >
> >
> > I’m irritated. Can someone explain what is wrong about
> > Control.Arrow?
>
> I think there is nothing wrong about Arrow, but people abused
> Arrow.first and Arrow.second for plain function arrow and now we have
> Bifunctor which is the more appropriate abstraction for most uses of
> 'first' and 'second'. (Though I guess that most uses need no
> abstraction at all.)
I think using Bifunctor.first and Bifunctor.second is as much an abuse
as using Arrow.first and Arrow.second. When using Arrow you specialize
the arrow type to (->), but when using Bifunctor you specialize the
bifunctor type to (,).
All the best,
Wolfgang
More information about the Libraries
mailing list