Does anyone know why Idris 2 can’t figure this out? I have to explicitly tell it that xs matches _::_, even though it knows xs can’t match Nil (because it’s in the wrong case)
(This also happens with case..of)
was working on for Aya?
For this specific issue, you might need to help Idris along by matching on the implicit `n` parameter. This might let you remove the redundant case. https://twitter.com/OwoTizusa/status/1461181965923725317…
so the top definition works, but if I try to match on the implicit parameter (last') Idris yells at me because `n` is only accessible at compile time :(
Ohhhh so idris erases implicit variables by default I think. Ie. you can't match on them if they are erased at runtime! I believe there is a way to make these usable at runtime though, lemme check.
On I think it is just `{n : Nat} -> Vect (S n) a -> a` - it's the lowercase, auto-generalised variables it automatically sets to be 'erased' (ie. to a 0 multiplicity).
Yeah agreed! Might be good feedback to give in the Idris discord (they have a channel about error messages), or on the issue tracker? Not sure how receptive they are though. I only know this stuff because I'm familiar with the approach… never actually used Idris 2 myself 😳