Closed conklech closed 10 years ago
First, thanks for this. This is clearly the right way to provide a lens-compatible iso. In general, though...
Is this a useful definition? I'm honestly not sure, which is why it is distinguished by living in a zombie commented out state. We do export cast
, so the potential user is not stranded, but losing the definition didn't impact me at all. So we can add a profunctors dependency to support this definition, or we could make rIso
part of the documentation.
If we pick up a profunctors
dependency for other reasons, then this is a nice thing for vinyl
to define.
...you're right. We've always exported cast
, and rIso
is dramatically less useful than cast
. Sorry, my brain wasn't turned on.
The use case for rIso
does seem a bit improbable. Perhaps libraryA
uses Rec '["foo" ::: t, "bar" ::: t]
and libraryB
uses Rec '["bar" ::: t, "foo" ::: t]
and you want to interoperate between them?
Casting should suffice for records which have different order, I think... Is there any other use-case we'd like to address?
I'm going to close this for now, but it should be reopened if more evidence for rIso
's usefulness comes to light.
The lens removal (#23) left
rIso
commented out, so you can't actually do anything with the knowledge thatr1 :~: r2
. (Edit: This is of course wrong; you cancast
both ways.)To export a
lens
-compatible Iso', we need to incur a dependency onprofunctors
. (See the lens wiki.) Alternately, we could exportcast
. (Edit: We've always exportedcast
.)