unison
unison copied to clipboard
Match with no cases in `Void.absurdly`
This used to work:
Void.absurdly : '{e} Void ->{e} a
Void.absurdly v = match !v with
But no longer compiles:
I expected some patterns after a match / with or cases but I didn't find any.
There aren't any cases though, so this seems like an oversight.
The following used to also work, but no longer does:
Void.absurd : Void -> a
Void.absurd x =
@tstat wdyt about this one?
A match with no cases sounds good to me, and I expect the pattern match coverage checking code to work without modification. So, I think the parser just needs to be changed to allow this.
I've got a feeling I may have originally added the absurd/absurdly definitions by temporarily hacking the compiler locally in order to allow it. Not fully confident of my memory there. But I definitely remember that match statements with no cases were not allowed back at that point.