[Agda] how to evaluate in the current context
Thorsten Altenkirch
Thorsten.Altenkirch at nottingham.ac.uk
Tue May 12 13:51:51 CEST 2020
Hi,
I have come across this little nuisance when using agda especially when doing life hacking in lectures or talks.
I try to evaluate an expression which depends on opening some modules which I have opened in my file but agda is not aware of this. E.g.
record Stream (A : Set) : Set where
constructor _∷_
coinductive
field
hd : A
tl : Stream A
open Stream
from : ℕ → Stream ℕ
hd (from n) = n
tl (from n) = from (suc n)
And then I say C-c C-n “hd (from 0)” and agda responds
1,1-3
Not in scope:
hd at 1,1-3 (did you mean 'Stream.hd'?)
when scope checking hd
Ok I can just introduce a shed
x = {!!}
and evaluate inside there but this is a bit clumsy. Isn’t there a better way to do this?
Btw, for the same purposes I’d love to have an agda top-level! And a printer that evaluates conductive objects by mapping them to costrings…
Thorsten
P.S. Ok I can say “open Stream public” – but do I want this?
This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please contact the sender and delete the email and
attachment.
Any views or opinions expressed by the author of this email do not
necessarily reflect the views of the University of Nottingham. Email
communications with the University of Nottingham may be monitored
where permitted by law.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.chalmers.se/pipermail/agda/attachments/20200512/01d2e033/attachment.html>
More information about the Agda
mailing list