Which may seem strange at first but I suspect the reason why it works is that () is considered a prefix constructor and so it makes sense for it to accept record update/match syntax (ignoring the fact that it is later reserved for unit)
I point this out because it could be useful for building anonymous records plugin, without reserving any special constructor name
It seems like this code survives GHC parser:
Which may seem strange at first but I suspect the reason why it works is that
()
is considered a prefix constructor and so it makes sense for it to accept record update/match syntax (ignoring the fact that it is later reserved for unit)I point this out because it could be useful for building anonymous records plugin, without reserving any special constructor name
(same applies for
[]
)