Proposal: Add conspicuously missing Functor instances for tuples

Henning Thielemann lemming at henning-thielemann.de
Mon Jan 18 22:10:46 UTC 2016


On Mon, 18 Jan 2016, Ryan Scott wrote:

> WriterT (and Writer) don't quite capture what I need. With WriterT,
> you have to tack on that extra m type parameter, and when you just
> specialize it to Identity, it only serves as an extra hoop to jump
> through to dig out the state. The prescence of the m type parameter
> also prevents me from easily modifying the state with a Bifunctor
> instance, whereas tuples have no such obstacle.

Is it important to achieve this with Bifunctor functions? You could write 
a state changing function, or add it to 'transformers', or define your own 
Writer as an independent type like it was in mtl initially.

> It's a minor difference, but an important one when I decide which data 
> structure to reach for.

Sure, but if you want a certain behaviour then a custom type is better 
than putting so much overloading to a standard (tuple) type, isn't it?


More information about the Libraries mailing list