Closed matthewleon closed 6 years ago
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?
@hdgarrood I see what you're saying.
Something like lmap (const r) builder
seems like it would cause trouble by modifying the immutable record r
.
There should be a
Profunctor
instance forBuilder
s.