[Haskell-cafe] Cannot update a field in a record with a polymorphic type.

Ignat Insarov kindaro at gmail.com
Thu Sep 10 06:45:45 UTC 2020

Thank you all kind folks who responded.

I think a leap of reasoning has occurred and I would like to ask you
all to slow down and notice it.

Record update is special syntax.

It is not a function. It is not as general as a function. It is not
perceived nor written as a function. Ain't no lambda in it.

You may say that it desugars to a function. But as a user of the
language, I am unconcerned: desugar another way then!

Surely a function of type `C α ⇒ Y α → Y String` may assign different
strings to `y`, by consulting methods of `C`. But a record update
cannot! Neither the value `y₀` nor the type variable α are ever in the
scope of the update expression.

More information about the Haskell-Cafe mailing list