简体   繁体   English

防止开发 agda 破坏基本标准库的使用?

[英]Preventing development agda from breaking basic standard library usage?

I'm working with the development version of agda, which is now incompatible with the basic standard library version 1.3.我正在使用 agda 的开发版本,它现在与基本标准库版本 1.3 不兼容。

wmacmil@w:~/.agda$ agda --version
Agda version 2.6.2-41b6b25

A basic failure.agda file,一个基本的 failure.agda 文件,

module failure where 

open import Data.String 

fails:失败:

Checking failure (/home/wmacmil/agdaFall2019/constructiveTypeTheoriesNLSem/TT_course/agda_files/failure.agda).
 Checking Data.String (/home/wmacmil/agdaStdLib/agda-stdlib-1.3/src/Data/String.agda).
  Checking Data.String.Base (/home/wmacmil/agdaStdLib/agda-stdlib-1.3/src/Data/String/Base.agda).
   Checking Data.List.Extrema (/home/wmacmil/agdaStdLib/agda-stdlib-1.3/src/Data/List/Extrema.agda).
    Checking Data.List.Membership.Propositional.Properties (/home/wmacmil/agdaStdLib/agda-stdlib-1.3/src/Data/List/Membership/Propositional/Properties.agda).
     Checking Data.List.Membership.Setoid.Properties (/home/wmacmil/agdaStdLib/agda-stdlib-1.3/src/Data/List/Membership/Setoid/Properties.agda).
Killed

How can I run two version at once?如何一次运行两个版本? And how can I run the experimental version of of the stdlib to avoid this?以及如何运行 stdlib 的实验版本来避免这种情况? Are there any other tricks someone would suggest?有人会建议其他任何技巧吗?

Also, will someone with >1500 reputation make agda-stdlib a tag?另外,声誉大于 1500 的人会将 agda-stdlib 标记为标签吗?

As noted in the description of the standard library, you need to use the experimental branch of the library if you are working with the master branch of Agda.如标准库的描述中所述,如果您使用的是 Agda 的master分支,则需要使用该库的experimental分支。 You can get it by cloning the github repository at https://github.com/agda/agda-stdlib and doing git checkout experimental .您可以通过在https://github.com/agda/agda-stdlib克隆 github 存储库并执行git checkout experimental Experimental 来获取它。

To automatically switch between versions of libraries when you switch Agda versions, you can have multiple libraries files as described in the user manual :要在切换 Agda 版本时自动切换库版本,您可以拥有多个libraries文件,如用户手册中所述

To be found by Agda a library file has to be listed (with its full path) in a libraries file要被 Agda 找到,必须在库文件中列出库文件(及其完整路径)

AGDA_DIR/libraries-VERSION, or if that doesn't exist AGDA_DIR/libraries AGDA_DIR/libraries-VERSION,或者如果不存在 AGDA_DIR/libraries

where VERSION is the Agda version (for instance 2.5.1).其中 VERSION 是 Agda 版本(例如 2.5.1)。 The AGDA_DIR defaults to ~/.agda on unix-like systems and C:\\Users\\USERNAME\\AppData\\Roaming\\agda or similar on Windows, and can be overridden by setting the AGDA_DIR environment variable. AGDA_DIR 在类 Unix 系统上默认为 ~/.agda,在 Windows 上默认为 C:\\Users\\USERNAME\\AppData\\Roaming\\agda 或类似的,并且可以通过设置 AGDA_DIR 环境变量来覆盖。

Alternatively, you can have a single libraries file and check out the right version of the library when you switch Agda versions.或者,您可以拥有一个libraries文件,并在切换 Agda 版本时检查libraries的正确版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM