| 1 |
Installation instructions |
| 2 |
========================= |
| 3 |
|
| 4 |
Note: the full story on installing Agda libraries can be found at [readthedocs](http://agda.readthedocs.io/en/latest/tools/package-system.html). |
| 5 |
|
| 6 |
Use version v2.3 of the standard library with Agda v2.7.0 or v2.7.0.1. You can find the correct version of the library to use for different Agda versions on the [Agda Wiki](https://wiki.portal.chalmers.se/agda/Libraries/StandardLibrary). |
| 7 |
|
| 8 |
1. Navigate to a suitable directory `$HERE` (replace appropriately) where |
| 9 |
you would like to install the library. |
| 10 |
|
| 11 |
2. Download the tarball of v2.3 of the standard library. This can either be |
| 12 |
done manually by visiting the Github repository for the library, or via the |
| 13 |
command line as follows: |
| 14 |
``` |
| 15 |
wget -O agda-stdlib.tar.gz https://github.com/agda/agda-stdlib/archive/v2.3.tar.gz |
| 16 |
``` |
| 17 |
Note that you can replace `wget` with other popular tools such as `curl` and that |
| 18 |
you can replace `2.3` with any other version of the library you desire. |
| 19 |
|
| 20 |
3. Extract the standard library from the tarball. Again this can either be |
| 21 |
done manually or via the command line as follows: |
| 22 |
``` |
| 23 |
tar -zxvf agda-stdlib.tar.gz |
| 24 |
``` |
| 25 |
|
| 26 |
4. [ OPTIONAL ] If using [cabal](https://www.haskell.org/cabal/) then run |
| 27 |
the commands to install via cabal: |
| 28 |
``` |
| 29 |
cd agda-stdlib-2.3 |
| 30 |
cabal install |
| 31 |
``` |
| 32 |
|
| 33 |
5. Locate the file `$AGDA_DIR/libraries` where `$AGDA_DIR` on Ubuntu/MacOS |
| 34 |
can be found by running `agda --print-agda-app-dir`. |
| 35 |
|
| 36 |
Full details, including the various possible locations that `$AGDA_DIR` |
| 37 |
might map to, may be found in [the online documentation](https://agda.readthedocs.io/en/latest/tools/package-system.html#installing-libraries). |
| 38 |
|
| 39 |
Note that the `$AGDA_DIR` directory and the `libraries` file within it, |
| 40 |
may not exist and you may have to create them. |
| 41 |
|
| 42 |
6. Register the standard library with Agda's package system by adding |
| 43 |
the following line to `$AGDA_DIR/libraries`: |
| 44 |
``` |
| 45 |
$HERE/agda-stdlib-2.3/standard-library.agda-lib |
| 46 |
``` |
| 47 |
|
| 48 |
Now, the standard library is ready to be used either: |
| 49 |
|
| 50 |
- in your project `$PROJECT`, by creating a file |
| 51 |
`$PROJECT.agda-lib` in the project's root containing: |
| 52 |
``` |
| 53 |
depend: standard-library |
| 54 |
include: $DIRS |
| 55 |
``` |
| 56 |
where `$DIRS` is a list of directories where Agda |
| 57 |
searches for modules, for instance `.` (just the project's root). |
| 58 |
|
| 59 |
- in all your projects, by adding the following line to |
| 60 |
`$AGDA_DIR/defaults` |
| 61 |
``` |
| 62 |
standard-library |
| 63 |
``` |