Skip to content

Commit 29d782b

Browse files
committed
Use Overture
1 parent ff18db1 commit 29d782b

File tree

5 files changed

+58
-127
lines changed

5 files changed

+58
-127
lines changed

cheshire.agda-lib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: cheshire
2-
depend: standard-library
2+
depend: standard-library overture
33
include: src
44

55
flags:

flake.lock

Lines changed: 30 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 11 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,23 @@
22
description = "Yet another category theory library";
33

44
inputs = {
5-
nixpkgs.url = "github:NixOS/nixpkgs/release-25.11";
6-
utils.url = "github:numtide/flake-utils";
7-
stdlib-classes = {
8-
url = "github:agda/agda-stdlib-classes/v2.3";
9-
flake = false;
10-
};
11-
stdlib-meta = {
12-
url = "github:agda/agda-stdlib-meta/v2.3";
13-
flake = false;
14-
};
5+
overture.url = "sourcehut:~madnat/overture";
6+
nixpkgs.follows = "overture/nixpkgs";
7+
utils.follows = "overture/utils";
158
};
169

1710
outputs = inputs@{ self, nixpkgs, utils, ... }:
1811
(utils.lib.eachDefaultSystem (system:
1912
let
2013
pkgs = import nixpkgs {
2114
inherit system;
22-
overlays = [ self.overlays.default ];
15+
overlays = [ inputs.overture.overlays.default ];
2316
};
2417
agdaWithLibraries = pkgs.agda.withPackages (p: [
25-
p.standard-library p.standard-library-classes p.standard-library-meta
18+
p.overture
19+
p.standard-library
20+
p.standard-library-classes
21+
p.standard-library-meta
2622
]);
2723

2824
in {
@@ -52,7 +48,8 @@
5248
everythingFile = "./src/Everything.agda";
5349

5450
buildInputs = with pkgs.agdaPackages; [
55-
standard-library standard-library-classes standard-library-meta
51+
standard-library
52+
overture
5653
];
5754

5855
meta = {
@@ -61,53 +58,5 @@
6158
};
6259
};
6360
}
64-
)) // {
65-
overlays = rec {
66-
packages = final: prev: {
67-
agdaPackages = prev.agdaPackages.overrideScope (
68-
finalAgda: prevAgda: {
69-
standard-library-classes = final.agdaPackages.mkDerivation {
70-
pname = "standard-library-classes";
71-
version = "2.3";
72-
src = inputs.stdlib-classes;
73-
74-
everythingFile = "./standard-library-classes.agda";
75-
libraryFile = "agda-stdlib-classes.agda-lib";
76-
77-
buildInputs = with final.agdaPackages; [
78-
standard-library
79-
];
80-
81-
meta = with final.lib; {
82-
description = "Type-classes for the Agda standard library";
83-
homepage = "https://github.com/agda/agda-stdlib-classes";
84-
license = licenses.mit;
85-
};
86-
};
87-
88-
standard-library-meta = final.agdaPackages.mkDerivation {
89-
pname = "standard-library-meta";
90-
version = "2.3";
91-
src = inputs.stdlib-meta;
92-
93-
everythingFile = "standard-library-meta.agda";
94-
libraryFile = "agda-stdlib-meta.agda-lib";
95-
96-
buildInputs = with final.agdaPackages; [
97-
standard-library standard-library-classes
98-
];
99-
100-
meta = with final.lib; {
101-
description = "Meta-programming utilities for Agda";
102-
homepage = "https://github.com/agda/agda-stdlib-meta";
103-
license = licenses.mit;
104-
};
105-
};
106-
}
107-
);
108-
};
109-
110-
default = packages;
111-
};
112-
};
61+
));
11362
}

src/Cheshire/Core.agda

Lines changed: 16 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2,76 +2,35 @@
22

33
module Cheshire.Core where
44

5+
import Overture
6+
open import Overture
7+
hiding (module Func; module ×; _⊎_)
8+
renaming (refl to ≡-refl; sym to ≡-sym; trans to ≡-trans) public
59
import Algebra
610

7-
open Algebra using (Op₁; Op₂)
8-
9-
module 𝕃 where
10-
open import Level renaming (Level to t) public
11-
1211
open 𝕃 using (_⊔_) public
13-
14-
module 𝟘 where
15-
import Data.Empty as 𝟘0ℓ
16-
open import Data.Empty.Polymorphic renaming (⊥ to t) public
17-
18-
module 𝟙 where
19-
import Data.Unit as 𝟙0ℓ
20-
open import Data.Unit.Polymorphic renaming (⊤ to t; tt to tt-lift) public
21-
pattern tt = 𝕃.lift 𝟙0ℓ.tt
22-
23-
module Rel₀ where
24-
open import Relation.Nullary public
25-
26-
module Rel₁ where
27-
open import Relation.Unary hiding (∅; U) public
28-
open import Relation.Unary.Polymorphic public
29-
30-
module Rel₂ where
31-
open import Relation.Binary public hiding (Setoid)
32-
open import Relation.Binary.PropositionalEquality public
33-
34-
open Rel₂ using (Rel) public
35-
36-
module Setoid where
37-
open import Relation.Binary.Bundles using () renaming (Setoid to t) public
38-
import Relation.Binary.Reasoning.Setoid as SetoidR
39-
module Reasoning {s₁ s₂} (S : t s₁ s₂) = SetoidR S
40-
41-
lift : {c ℓ} (o r : 𝕃.t) t c ℓ t (o 𝕃.⊔ c) (r 𝕃.⊔ ℓ)
42-
lift o r S = record
43-
{ Carrier = 𝕃.Lift o Carrier
44-
; _≈_ = λ where
45-
(𝕃.lift x) (𝕃.lift y) 𝕃.Lift r (x ≈ y)
46-
; isEquivalence = record
47-
{ refl = 𝕃.lift (Rel₂.IsEquivalence.refl (t.isEquivalence S))
48-
; sym = λ where
49-
(𝕃.lift eq) 𝕃.lift (Rel₂.IsEquivalence.sym (t.isEquivalence S) eq)
50-
; trans = λ where
51-
(𝕃.lift eq) (𝕃.lift eq′) 𝕃.lift (Rel₂.IsEquivalence.trans (t.isEquivalence S) eq eq′)
52-
}
53-
} where open t S
12+
open Algebra using (Op₁; Op₂)
5413

5514
module Func where
56-
open import Function.Bundles renaming (Func to t) public
57-
open import Function.Relation.Binary.Setoid.Equality public
15+
open Overture using (module Func)
16+
open Func public
5817

5918
module _ {c ℓ} (S : Setoid.t c ℓ) where
6019
open Setoid.t S renaming (Carrier to X; _≈_ to eq)
6120

6221
unary : {f : Op₁ X} Algebra.Congruent₁ eq f S ⟶ₛ S
63-
unary {f} _ .t.to = f
64-
unary cong .t.cong = cong
22+
unary {f} _ .Func.t.to = f
23+
unary cong .Func.t.cong = cong
6524

6625
module _ {c ℓ} (S : Setoid.t c ℓ) where
6726
open Setoid.t S renaming (Carrier to X; _≈_ to eq; isEquivalence to isEq)
6827

6928
binary : {f : Op₂ X} Algebra.Congruent₂ eq f S ⟶ₛ (S ⇨ S)
70-
binary {f} eq .t.to = λ x record
29+
binary {f} eq .Func.t.to = λ x record
7130
{ to = λ y f x y
7231
; cong = eq (Rel₂.IsEquivalence.refl isEq)
7332
}
74-
binary eq .t.cong = λ x≈y _ eq x≈y (Rel₂.IsEquivalence.refl isEq)
33+
binary eq .Func.t.cong = λ x≈y _ eq x≈y (Rel₂.IsEquivalence.refl isEq)
7534

7635
module _ {c ℓ} (m : Algebra.Magma c ℓ) where
7736
open Algebra.Magma m renaming (setoid to S)
@@ -81,12 +40,11 @@ module Func where
8140

8241
open Func using (_⟨$⟩_; _⟶ₛ_; _⇨_) public
8342

84-
module Function where
85-
open import Function renaming (_∘_ to _⊙_) public
86-
87-
open Function using (case_of_; case_returning_of_; const; flip; _on_; _$_) public
43+
open Function
44+
using (case_of_; case_returning_of_; const; flip; _on_; _$_)
45+
renaming (_∘_ to _⊙_) public
8846

89-
record Quiver o ℓ : Set (𝕃.suc (o ⊔ ℓ)) where
47+
record Quiver o ℓ : Set (𝕃.suc (o 𝕃.⊔ ℓ)) where
9048
no-eta-equality
9149
constructor mk⇒
9250
infix 4 _⇒_
@@ -109,7 +67,7 @@ _[_,_] : (𝒬 : Quiver o ℓ) → Rel (𝒬 .Ob) ℓ
10967
{-# DISPLAY Hom 𝒬 A B = 𝒬 [ A , B ] #-}
11068
{-# DISPLAY Quiver._⇒_ 𝒬 A B = 𝒬 [ A , B ] #-}
11169

112-
record Equivalence (𝒬 : Quiver o ℓ) (e : 𝕃.t) : Set (o ⊔ ℓ ⊔ 𝕃.suc e) where
70+
record Equivalence (𝒬 : Quiver o ℓ) (e : 𝕃.t) : Set (o 𝕃.⊔ ℓ 𝕃.⊔ 𝕃.suc e) where
11371
infix 4 _≈_
11472
open Quiver 𝒬 using (_⇒_)
11573
field

src/Cheshire/Homomorphism/Signatures.agda

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ open import Cheshire.Core
44

55
module Cheshire.Homomorphism.Signatures where
66

7-
open Function using (_⊙_)
8-
97
private
108
variable
119
o ℓ o′ ℓ′ o″ ℓ″ : 𝕃.t

0 commit comments

Comments
 (0)