Opened 13 months ago

Closed 5 months ago

#12243 closed feature request (fixed)

RebindableSyntax and OverloadedLabels

Reported by: htebalaka Owned by: adamgundry
Priority: normal Milestone: 8.2.1
Component: Compiler Version: 8.0.1
Keywords: ORF Cc: adamgundry
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: overloadedrecflds/should_run/T12243
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D2708
Wiki Page:

Description

Should these extensions work together? I wasn't able to come up with a good motivating example; I was playing around with lenses, and thought a more restrictive class definition might aid type inference, though it turned out in that particular case it didn't. In the general case I think it might still be useful.

I didn't see any discussion on this, and it seemed like maybe it's an oversight.

Change History (4)

comment:1 Changed 13 months ago by adamgundry

Cc: adamgundry added
Keywords: ORF added

I think this makes sense, although it's hard to think of use cases (perhaps something involving interpreting labels with higher-rank types?). You're right that it is simply an oversight.

comment:2 Changed 11 months ago by adamgundry

Milestone: 8.2.1
Owner: set to adamgundry

A reddit discussion made me realise that there are some use cases for this. In particular, the translation of overloaded labels to IsLabel may introduce ambiguous type variables, which could be avoided using a more restrictive fromLabel (e.g. constraining it to be a field selector, one we have OverloadedRecordFields). Essentially, rebindable syntax makes it possible to choose a single IsLabel instance for an entire module.

comment:3 Changed 5 months ago by adamgundry

Differential Rev(s): Phab:D2708
Status: newpatch
Test Case: overloadedrecflds/should_run/T12243

I've implemented this as part of my reworking of OverloadedLabels described in https://github.com/ghc-proposals/ghc-proposals/pull/6

comment:4 Changed 5 months ago by adamgundry

Resolution: fixed
Status: patchclosed
Note: See TracTickets for help on using tickets.