GHC records quirks - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

TheMatten

It seems like this code survives GHC parser:

fun (){a = b} = (){a = b + 1}

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

TheMatten

(same applies for [])