ipso icon indicating copy to clipboard operation
ipso copied to clipboard

Detect incomplete pattern matches

Open LightAndLight opened this issue 2 years ago • 0 comments

Incomplete pattern matches aren't detected during type checking and will cause a runtime failure.

f : (| A : String, B : String |) -> String
f x =
  case x of
    A a -> a

main : IO ()
main = println <| f (B "b")

I'd like ipso to tell me when I've missed a pattern; usually it's unintentional.

Pattern match completeness is a big topic. I might want to break the feature down by type. I might also be able to separate "detecting incomplete patterns" from "calculating missing patterns".

LightAndLight avatar Feb 19 '23 02:02 LightAndLight