You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Language.R.HExp.HExp has a wrong comment: "Because this is in fact a GADT, the use of named record fields is not possible here. Named record fields give rise to functions for whom it is not possible to assign a reasonable type (existentially quantified type variables would escape)."
Ghc does in fact have some support for named fields of gads:
dataTyawhereCon::Numa=>{tag::a} -> TyIntf::Tya->Tya
f Con { tag = n } =Con { tag = n +1 }
-- g = tag -- `g` being illegal doesn't make `f` and `Con` illegal
I suggest either (A) adding the selectors and removing the comment, or (B) changing the comment to:
Named record fields are not used here because they are too limited for GADTs. Specifically, selector functions are not produced. That is, f List{cons = x } = g x would be allowed, but f = g . cons would produce an error Cannot use record selector ‘cons’ as a function due to escaped type variables Probable fix: use pattern-matching syntax instead
The text was updated successfully, but these errors were encountered:
Language.R.HExp.HExp has a wrong comment: "Because this is in fact a GADT, the use of named record fields is not possible here. Named record fields give rise to functions for whom it is not possible to assign a reasonable type (existentially quantified type variables would escape)."
Ghc does in fact have some support for named fields of gads:
I suggest either (A) adding the selectors and removing the comment, or (B) changing the comment to:
Named record fields are not used here because they are too limited for GADTs. Specifically, selector functions are not produced. That is,
f List{cons = x } = g x
would be allowed, butf = g . cons
would produce an errorCannot use record selector ‘cons’ as a function due to escaped type variables Probable fix: use pattern-matching syntax instead
The text was updated successfully, but these errors were encountered: