4

I am writing a trivial function in idris :

f : (a:Nat) -> (b:Nat) -> (k:(Z=(S Z))) -> (a=b)
f a b k = absurd k   --- this works

Now I want to write it using elaboration :

f : (a:Nat) -> (b:Nat) -> (k:(Z=(S Z))) -> (a=b)
f = %runElab (do
  intro' -- a
  intro' -- b
  intro' -- k
  -- now what ??
  )

I cant seem to find any way to use absurd/void and cant seem to find any documentation or example of this. Trying to use apply/fill keeps throwing errors regarding variables qquoteTy and unqTy, which are used in source code of elab (written in haskell) and i am unable to figure out anything from there.

RKS
  • 309
  • 1
  • 6
  • 1
    I posted the same question on http://groups.google.com/group/idris-lang and my question was answered there. Link to thread : https://groups.google.com/d/msg/idris-lang/hRG8gPkQ2e0/B1bBaAicBwAJ Dont know if I should accept this answer or not, because its not me who solved it. – RKS Nov 26 '16 at 20:23
  • A *concise* answer with the proper attribution to the original author would be nice! – Anton Trunov Nov 29 '16 at 15:22
  • I would do that, but there are two issues. One, my understanding of this subject is not very thorough, so if I try to summarize an explanation, I may end up distorting the facts, which might be incorrect based on interpretation. Secondly, to avoid the above problem I will have to copy the relevant part of text verbatim, but the answer contains a bit of code. I am not very sure about the rules regarding copying code from other places to here. Of course its a few lines code and maybe the author wont bother, but I can never assume that. – RKS Dec 04 '16 at 09:52

0 Answers0