<div dir="ltr"><div>This should work:</div><div><br></div><div>contradiction : .⊥ → A<br>contradiction ()<br><br>head : (xs : List A) .(nn : ¬ Null xs) → A<br>head (x ∷ _) _ = x<br>head [] nn = contradiction (nn isNull)</div><div><br></div><div>/ Ulf<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 21, 2020 at 10:47 PM <<a href="mailto:mechvel@scico.botik.ru">mechvel@scico.botik.ru</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Please,<br>
how to fix the following example with irrelevancy denotation?<br>
<br>
module _ {A : Set α}<br>
where<br>
data Null : List A → Set α where isNull : Null []<br>
<br>
head : (xs : List A) .(nn : ¬ Null xs) → A<br>
head (x ∷ _) _ = x<br>
head [] nn = contradiction isNull _ -- ?<br>
<br>
test : ∀ {xs} (nn nn' : ¬Null xs) → head xs nn ≡ head xs nn'<br>
test _ _ = refl<br>
<br>
The second pattern in `head` cannot be skipped,<br>
but I do not find how to fix it.<br>
<br>
Thanks,<br>
<br>
------<br>
Sergei<br>
_______________________________________________<br>
Agda mailing list<br>
<a href="mailto:Agda@lists.chalmers.se" target="_blank">Agda@lists.chalmers.se</a><br>
<a href="https://lists.chalmers.se/mailman/listinfo/agda" rel="noreferrer" target="_blank">https://lists.chalmers.se/mailman/listinfo/agda</a><br>
</blockquote></div>