Extensible Records seems to be pruning fields and failing to compile

Others have noticed in the past that type aliases to extensible records don’t seem to be fully supported:

and are generally considered best applied in practice when used (directly, it seems, not via alias) in function type signatures.

I applied this to your Ellie and it compiles:
https://ellie-app.com/gpmHmb9bGBxa1
(I also changed your view function to confirm that it “works”.)

You can also see that the type alias is still being used, just not in the subInit signature anymore. So such type aliases are at least partly usable.

I don’t know if this should be considered a bug, or just a known limitation of how extensible records are intended to be used. But at least you can get the desired effect in your design if you avoid the alias.

1 Like