[Haskell-cafe] type inference and named fields

Henning Thielemann lemming at henning-thielemann.de
Mon Jun 27 12:15:23 EDT 2005

On Mon, 27 Jun 2005, Malcolm Wallace wrote:

> I can only repeat myself, that the field being updated (and
> type-converted) is only one of many, and all other fields should
> carry the same value in the updated structure as in the original.
> There is no good way to write this at the moment.  If there were no
> type-conversion, a field update would work just great.  But because
> of the conversion, one is forced to use explicit construction.

If there is some field which appears in many constructors but the type is
independent from the other ones I would think about bundling all
constructors which share the same type. The sub-alternatives could be put
into another type.

More information about the Haskell-Cafe mailing list