ambiguous record field (but not *that* kind of ambiguous record field)

Richard Eisenberg lists at
Mon May 16 19:09:33 UTC 2022

Hi all,

On a project I'm working on, I wish to declare something like

data Rec = MkRec { field :: forall a. SomeConstraint a => ... }

where the ... contains no mention of `a`.

Even with <>, I think there is no way to avoid the ambiguity when setting `field`. Is that correct? If so, what shall we do about it? The natural answer is somehow to write ... MkRec { field @a = ... } ... but that would break significant new syntactic ground. (Maybe it's good new syntactic ground, but it would still be very new.)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list