mapRecordField
Serge D. Mechveliani
mechvel at botik.ru
Sat Nov 22 06:29:39 EST 2008
People,
ghc-6.10.1 says it provides a `sugar' syntax for records:
wild-card patterns, punning, and field disambiguation.
For example, I write fam {opAttrs = cp $ opAttrs fam}
to map the function cp to the field opAttrs in the record fam.
The best expression for this could be
mapField opAttrs cp fam,
with an intended library function mapField -- which does not agree
with Haskell types.
But as GHC takes care to provide a language extension for records,
maybe it could introduce mapField as the language construct and
as a reserved word?
Also I do not know, maybe, something like fam {opAttrs = cp opAttrs}
is possible now?
Thank you in advance for your explanation,
-----------------
Serge Mechveliani
mechvel at botik.ru
More information about the Glasgow-haskell-bugs
mailing list