<div dir="auto">Gaster & Jones 1996 says</div><div dir="auto">"We consider two rows to be equivalent if they include the same fields regardless of the order in which they are listed." [section 3.2]</div><div dir="auto"><br></div><div dir="auto">But this is tricky: Figure 6 shows there is an ordering on labels, so that in effect records are compiled to tuples with left-to-right ordering of label names alphabetically.</div><div dir="auto"><br></div><div dir="auto">The User Manual says</div><div dir="auto">"<span style="font-family:-webkit-standard;font-size:medium;background-color:rgb(255,255,255)">The order of fields in a record pattern </span><i style="font-family:-webkit-standard">is</i><span style="font-family:-webkit-standard;font-size:medium;background-color:rgb(255,255,255)"> significant because it determines the order---from left to right---in which they are matched.</span>"</div><div dir="auto">In particular, a pattern match on a record with a field value `undefined` might succeed if some other field label is mentioned first in the pattern; but throw an error if it's the undefined field's label mentioned first.</div><div dir="auto"><br></div><div dir="auto">It's not difficult to expose this behaviour. Consider</div><div dir="auto"><br></div><div dir="auto">> import Hugs.Trex</div><div dir="auto">></div><div dir="auto">> x5y = (x = 5, y = 'y');   x7y = (x = 7, y = undefined)</div><div dir="auto">> z5y = (z = 5, y = 'y');   z7y = (z = 7, y = undefined)</div><div dir="auto">></div><div dir="auto">> x5y == x7y     -- returns False</div><div dir="auto">> z5y == z7y     -- throws error Prelude.undefined</div><div dir="auto"><br></div><div dir="auto">The tuples with label `z` are compiled to put that field second, regardless of the order of appearing in the expression. Then (==) applies by comparing field values in left-to-right alphabetic ordering. Field `x` is alphabetically before `y`; and the `x` values differ; so the comparison returns False without comparing the `y` values. Then in comparing the field `z` records, the `y` fields are compared first (ignoring that the `z` values differ), exposing that one `y` field is `undefined`.</div><div dir="auto"><br></div><div dir="auto">This is similar to comparing tuples</div><div dir="auto"><br></div><div dir="auto">> (5, 'y') == (7, undefined)   -- returns False</div><div dir="auto">> ('y', 5) == (undefined, 7)   -- throws error</div><div dir="auto"><br></div><div dir="auto">There seems to be some infelicity when building records:</div><div dir="auto"><br></div><div dir="auto">> f ... rho ... = (y = 'y' | rho)</div><div dir="auto"><br></div><div dir="auto">This throws strange errors depending whether `rho` includes labels that are alphabetically before `y`. Bug report incoming ...</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">AntC</div>