diprism / perpl

The PERPL Compiler
MIT License
10 stars 5 forks source link

Check special cases for `<>` #76

Closed davidweichiang closed 2 years ago

davidweichiang commented 2 years ago

It all seems to work, but the FGG has nonterminals like <Unit>.0, and even the Unit type has <Unit>.0=() as its sole inhabitant.

davidweichiang commented 2 years ago

Additionally, @ccshan asks in #71 whether the special cases for handling <> are really needed. Partly the answer should have been that the special cases eliminate weird things like .0 but apparently I did not do that correctly.

davidweichiang commented 2 years ago

OK, I think the only weird thing is that () and <()> have different types with the same string representation. I plan to try the Haskell way of writing types which will resolve this, but I'm leaving this issue here as a reminder to check whether special cases for <> can be eliminated.