Is there any reason to not add an instance of IsLabel, import GHC.OverloadedLabels, for Label? A suitable instance, for example, is:
instance l ~ l' => IsLabel (l :: Symbol) (Label l') where
fromLabel = Label
This could then be combined with the RebindableSyntax extension, allowing labels to be written simply as #s, for example, which would be translated to:
and used in the context where a Label was expected would cause that instance to be selected. I've added this to OpenRecords.hs (HEAD) and did some simple tests, so far seems to work as expected.
Is there any reason to not add an instance of IsLabel, import GHC.OverloadedLabels, for Label? A suitable instance, for example, is:
This could then be combined with the RebindableSyntax extension, allowing labels to be written simply as #s, for example, which would be translated to:
and used in the context where a Label was expected would cause that instance to be selected. I've added this to OpenRecords.hs (HEAD) and did some simple tests, so far seems to work as expected.