Closed davidweichiang closed 1 year ago
@ccshan Do you have time to review instead? I think this is an easy one.
@ccshan Do you have time to review instead? I think this is an easy one.
Hi hi, thanks. Your code is fine! I noticed that |
was not required between consecutive branches, but I think it should be. If you don't mind, let me make it required here.
Thanks! I realized later that it is possible for the -c option to generate datatypes with zero cases. Towards the end of making the compiler accept its own -c output, I wonder if we should allow data Foo = ;
.
FWIW, in GHC Haskell it's notated data Foo
and case e of {}
case e of {}
always raises an exception, right? Also it seems to require -XEmptyCase.
It was already a type error for case to have zero cases (I think because type inference wouldn't know what to do with zero cases), but now it's also a parse error. It's also a parse error for data to have zero constructors in the first place.
Closes #52.