unison icon indicating copy to clipboard operation
unison copied to clipboard

Match with no cases in `Void.absurdly`

Open runarorama opened this issue 1 year ago • 3 comments

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 =

runarorama avatar Feb 28 '24 17:02 runarorama

@tstat wdyt about this one?

aryairani avatar Mar 04 '24 21:03 aryairani

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.

tstat avatar Mar 05 '24 14:03 tstat

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.

atacratic avatar Mar 05 '24 16:03 atacratic