Why not allow empty record updates?

wagnerdm at seas.upenn.edu wagnerdm at seas.upenn.edu
Tue Nov 15 21:50:06 CET 2011


Quoting Yitzchak Gale <gale at sefer.org>:

> Yes. The translation of record updates given in the Report
> makes perfect sense for {}. It is only forbidden by
> "n >= 1", but no reason is given for that restriction.

It doesn't make sense to me. The translation explodes a value into a  
case statement over its constructors; what constructors do you use  
when you don't know the type of the value?

When n >= 1, you know the type of the value by looking where the field  
came from, and hence which constructors to use in the case statement.

~d



More information about the Glasgow-haskell-users mailing list