Builder Profunctor instance
matthewleon opened this issue · 3 comments
matthewleon commented
There should be a Profunctor instance for Builders.
hdgarrood commented
I'm not sure this is doable, actually. The problem is that, as I understand it, a Builder a b is a function a -> b which is guaranteed to use its argument exactly once, but allowing you to lmap with any old function could break that guarantee. I've haven't been able to come up with an example of this breaking things yet but I expect it can be done.
@paf31 does this sound reasonable?
matthewleon commented
@hdgarrood I see what you're saying.
paf31 commented
Something like lmap (const r) builder seems like it would cause trouble by modifying the immutable record r.