[Agda] Shadowing definitions

Thorsten Altenkirch Thorsten.Altenkirch at nottingham.ac.uk
Sun Aug 2 15:03:01 CEST 2020



On 02/08/2020, 13:57, "Peter Thiemann" <thiemann at informatik.uni-freiburg.de> wrote:

    Hi Thorsten,

    how about stating the definition first in a module?

Maybe I misunderstand you but this doesn't seem to help. E.g. if I do

module _ where

  X : Set
  X = ⊥

module _ where

  X : Set
  X = ⊥

I get an error.

    You can use latex tricks to hide the declaration of the module as well its opening on subsequent uses.

Yes, I have been doing this using lhs2tex's %if false . One slight nuisance is that this changes the indentation of the code.

    Re switching modes in Emacs, it is possible to define such keys by adding two lines to your .emacs. Unfortunately, my Emacs Lisp is rusty so I won't give it a start right now.

Same here. __

Thorsten

    Best
    -Peter


    On 2. August 2020 at 14:16:52, Thorsten Altenkirch (thorsten.altenkirch at nottingham.ac.uk) wrote:
    > Hi guys,
    >  
    > I am currently working on my book “The Tao of Types” and I am now using literate agda and  
    > lhs2tex with agda mode . One issue is that for pedagogical reasons I like to repeat definitions  
    > but agda doesn’t allow this. Ok, I can declare the first definition as a spec which means  
    > it is ingnored by literate agda. I don’t really like this because it means that there is  
    > no type checking for the first definition. Also in some cases this doesn’t work and I have  
    > to go through all sort of tricks to make the code work. Is there a workaround, or would it  
    > be possible to allow shadowing (unsafely)?
    >  
    > Btw, another problem I have is to switch between agda-mode and latex-mode in emacs. I  
    > discovered that C-C C-n in latex mode switches to agda mode (not sure why) is there a key  
    > combination to switch from agda to latex?
    >  
    > Cheers,
    > Thorsten
    >  
    >  
    >  
    > 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.
    >  
    >  
    >  
    >  
    > _______________________________________________
    > Agda mailing list
    > Agda at lists.chalmers.se
    > https://lists.chalmers.se/mailman/listinfo/agda
    >  





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.






More information about the Agda mailing list