-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
What do you think of a lens to operate on a subset of fields:
multifocus :: Functor f => proxy r -> (Rec u -> f (Rec v)) -> Rec (u :++ r) -> f (Rec (v :++ r))
Ideally I expected multifocus = const unsafeCoerce but this breaks if the user creates a new record Rec v "from scratch" instead of using the Rec u provided by the lens.
For instance, it might be useful to resolve this Motor issue. And more generally this may help alleviate some problems with row-polymorphism due to the fact that it isn't obvious to GHC that adding a field then removing it always results in a record of the same type as the one we started with.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels