Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add nix shell with Agda #4

Merged
merged 7 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/agda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ jobs:

- run: agda Logic/Hurken-paradox.agda
working-directory: src

- uses: cachix/install-nix-action@v30
- run: nix develop
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
*.agdai
MAlonzo/**

flake.lock

.idea/
*.iml
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

# Agda HoTT

Mature library for HoTT: https://unimath.github.io/agda-unimath/

Rest are my naive attempts, as I understand mathematics by writing code :)

Notes in Agda about
* [Homotopy Type Theory](https://homotopytypetheory.org/book/) (based on
* [Introduction to Univalent Foundations of Mathematics with Agda](https://www.cs.bham.ac.uk/~mhe/HoTT-UF-in-Agda-Lecture-Notes/) by Martín Hötzel Escardó, ([arxiv 1911.00580](https://arxiv.org/abs/1911.00580)),
Expand All @@ -16,10 +12,22 @@ Notes in Agda about
* [Category Theory](https://ncatlab.org/nlab/show/category+theory) (based on
* CS410 Advanced Functional Programming at the University of Strathclyde by Conor McBride ([videos](https://www.youtube.com/playlist?list=PLqggUNm8QSqmeTg5n37oxBif-PInUfTJ2)), ([GH repo with code](https://github.com/pigworker/CS410-17)), ([lecture notes](https://github.com/pigworker/CS410-15/blob/master/CS410-notes.pdf)), ([GH 2018](https://github.com/pigworker/CS410-18)),
* [agda-categories](https://github.com/agda/agda-categories))
* Patterns of Functional Programming (inspired by category theory that can be found in Haskell, Scala, PureScript, Idris)
* Functional Programming (abstractions from category theory used in Haskell, Scala, PureScript, Idris)

Patters of FP can be seen as continuation of [scala_typeclassopedia](https://github.com/lemastero/scala_typeclassopedia) - this time in Agda).
Abstractions in FP can be seen as continuation of [scala_typeclassopedia](https://github.com/lemastero/scala_typeclassopedia) - this time in Agda :)

Section zio-prelude aims at formally verifying encoding from Scala library [zio-prelude](https://zio.dev/zio-prelude/) (that improve usuall encoding of FP abstractions e.g. by adding Zivariant, introducing novel definitions like ZRerf that is a generalization of optics).
[src/FP/zio-prelude](src/FP/zio-prelude) aims at formally verifying encoding from Scala library [zio-prelude](https://zio.dev/zio-prelude/) (that improve usual encoding of FP abstractions e.g. by adding Zivariant, introducing novel definitions like ZRerf that is a generalization of optics).

Category theory definitions are strict - use equality (agda-categories are parametrized by equivalence relation).

## Getting Agda

[Official install instructions](https://agda.readthedocs.io/en/latest/getting-started/installation.html)

### for Nix

If you are nix user you can get shell with recent Agda by running:

```sh
nix develop
```
20 changes: 20 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
description = "agda-hott";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, utils, ... }:
utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in rec {
devShells.default = pkgs.mkShell {
buildInputs = [
(pkgs.agda.withPackages (ps: [ ps.standard-library ]))
];
};
}
);
}
2 changes: 1 addition & 1 deletion src/FP/SimplifiedCategories/MonoidObject.agda
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ open import HoTT.Identity-Types using (refl; _≡_)
open import FP.Types using (Function)
open import TypeTheory.FunctionsProperties using (compose-id; id-compose; compose-compose; compose-assoc)
open import FP.Abstractions.Bifunctor using (Bifunctor; BifunctorProduct; BifunctorEither; BifunctorThese)
open import FP.SimplifiedCategories.Category using (Category; CategoryFunction)
open import FP.SimplifiedCategories.Category using (Category)
open import TypeTheory.Product using (_×_; ×assocLR; ×assocRL
; ×left-id; ×id-left; ×right-id; ×id-right; ×bimap)
open import TypeTheory.Sum using (_+_; +right-id; +left-id; +id-right; +id-left
Expand Down
Loading