[Haskell-cafe] type inference and named fields

Christian Maeder maeder at tzi.de
Fri Jun 24 05:02:33 EDT 2005

Malcolm Wallace wrote:
> Whereas in the named field example, the rhs expression
>     v {field1=Void}
> does indeed have the type
>     Fields Void
> as declared in the signature.  The expression explicitly converts all
> the relevant interior fields to Void.  At least, that is how it could
> appear to a naive programmer like me :-)

If v has a second field with the same type of field1, do you really
expect that field2 is silently casted to the new type of field1? (This
would be unsafe)


More information about the Haskell-Cafe mailing list