Skip to content

Commit 35253c8

Browse files
authored
Level polymorphism for Algebra.Construct.Zero and Algebra.Module.Construct.Zero (#1323)
1 parent d7d3d69 commit 35253c8

File tree

3 files changed

+30
-27
lines changed

3 files changed

+30
-27
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Non-backwards compatible changes
2020
* The internal build utilities package `lib.cabal` has been renamed
2121
`agda-stdlib-utils.cabal` to avoid potential conflict or confusion.
2222
Please note that the package is not intended for external use.
23+
* The module `Algebra.Construct.Zero` and `Algebra.Module.Construct.Zero` are now level-polymorphic, each taking two implicit level parameters.
2324

2425
Deprecated modules
2526
------------------

src/Algebra/Construct/Zero.agda

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,53 +13,54 @@
1313

1414
{-# OPTIONS --without-K --safe #-}
1515

16-
module Algebra.Construct.Zero where
16+
open import Level using (Level)
17+
18+
module Algebra.Construct.Zero {c ℓ : Level} where
1719

1820
open import Algebra.Bundles
19-
open import Data.Unit
20-
open import Level using (Level; 0ℓ)
21+
open import Data.Unit.Polymorphic
2122

2223
------------------------------------------------------------------------
2324
-- Raw bundles
2425

25-
rawMagma : RawMagma 0ℓ 0ℓ
26+
rawMagma : RawMagma c ℓ
2627
rawMagma = record { Carrier = ⊤ ; _≈_ = λ _ _ ⊤ }
2728

28-
rawMonoid : RawMonoid 0ℓ 0ℓ
29+
rawMonoid : RawMonoid c ℓ
2930
rawMonoid = record { Carrier = ⊤ ; _≈_ = λ _ _ ⊤ }
3031

31-
rawGroup : RawGroup 0ℓ 0ℓ
32+
rawGroup : RawGroup c ℓ
3233
rawGroup = record { Carrier = ⊤ ; _≈_ = λ _ _ ⊤ }
3334

3435
------------------------------------------------------------------------
3536
-- Bundles
3637

37-
magma : Magma 0ℓ 0ℓ
38+
magma : Magma c ℓ
3839
magma = record { Carrier = ⊤ ; _≈_ = λ _ _ ⊤ }
3940

40-
semigroup : Semigroup 0ℓ 0ℓ
41+
semigroup : Semigroup c ℓ
4142
semigroup = record { Carrier = ⊤ ; _≈_ = λ _ _ ⊤ }
4243

43-
band : Band 0ℓ 0ℓ
44+
band : Band c ℓ
4445
band = record { Carrier = ⊤ ; _≈_ = λ _ _ ⊤ }
4546

46-
commutativeSemigroup : CommutativeSemigroup 0ℓ 0ℓ
47+
commutativeSemigroup : CommutativeSemigroup c ℓ
4748
commutativeSemigroup = record { Carrier = ⊤ ; _≈_ = λ _ _ ⊤ }
4849

49-
semilattice : Semilattice 0ℓ 0ℓ
50+
semilattice : Semilattice c ℓ
5051
semilattice = record { Carrier = ⊤ ; _≈_ = λ _ _ ⊤ }
5152

52-
monoid : Monoid 0ℓ 0ℓ
53+
monoid : Monoid c ℓ
5354
monoid = record { Carrier = ⊤ ; _≈_ = λ _ _ ⊤ }
5455

55-
commutativeMonoid : CommutativeMonoid 0ℓ 0ℓ
56+
commutativeMonoid : CommutativeMonoid c ℓ
5657
commutativeMonoid = record { Carrier = ⊤ ; _≈_ = λ _ _ ⊤ }
5758

58-
idempotentCommutativeMonoid : IdempotentCommutativeMonoid 0ℓ 0ℓ
59+
idempotentCommutativeMonoid : IdempotentCommutativeMonoid c ℓ
5960
idempotentCommutativeMonoid = record { Carrier = ⊤ ; _≈_ = λ _ _ ⊤ }
6061

61-
group : Group 0ℓ 0ℓ
62+
group : Group c ℓ
6263
group = record { Carrier = ⊤ ; _≈_ = λ _ _ ⊤ }
6364

64-
abelianGroup : AbelianGroup 0ℓ 0ℓ
65+
abelianGroup : AbelianGroup c ℓ
6566
abelianGroup = record { Carrier = ⊤ ; _≈_ = λ _ _ ⊤ }

src/Algebra/Module/Construct/Zero.agda

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,61 +10,62 @@
1010

1111
{-# OPTIONS --without-K --safe #-}
1212

13-
module Algebra.Module.Construct.Zero where
13+
open import Level
14+
15+
module Algebra.Module.Construct.Zero {c ℓ : Level} where
1416

1517
open import Algebra.Bundles
1618
open import Algebra.Module.Bundles
17-
open import Data.Unit
18-
open import Level
19+
open import Data.Unit.Polymorphic
1920

2021
private
2122
variable
2223
r s ℓr ℓs : Level
2324

24-
leftSemimodule : {R : Semiring r ℓr} LeftSemimodule R 0ℓ 0ℓ
25+
leftSemimodule : {R : Semiring r ℓr} LeftSemimodule R c ℓ
2526
leftSemimodule = record
2627
{ Carrierᴹ =
2728
; _≈ᴹ_ = λ _ _
2829
}
2930

30-
rightSemimodule : {S : Semiring s ℓs} RightSemimodule S 0ℓ 0ℓ
31+
rightSemimodule : {S : Semiring s ℓs} RightSemimodule S c ℓ
3132
rightSemimodule = record
3233
{ Carrierᴹ =
3334
; _≈ᴹ_ = λ _ _
3435
}
3536

3637
bisemimodule :
37-
{R : Semiring r ℓr} {S : Semiring s ℓs} Bisemimodule R S 0ℓ 0ℓ
38+
{R : Semiring r ℓr} {S : Semiring s ℓs} Bisemimodule R S c ℓ
3839
bisemimodule = record
3940
{ Carrierᴹ =
4041
; _≈ᴹ_ = λ _ _
4142
}
4243

43-
semimodule : {R : CommutativeSemiring r ℓr} Semimodule R 0ℓ 0ℓ
44+
semimodule : {R : CommutativeSemiring r ℓr} Semimodule R c ℓ
4445
semimodule = record
4546
{ Carrierᴹ =
4647
; _≈ᴹ_ = λ _ _
4748
}
4849

49-
leftModule : {R : Ring r ℓr} LeftModule R 0ℓ 0ℓ
50+
leftModule : {R : Ring r ℓr} LeftModule R c ℓ
5051
leftModule = record
5152
{ Carrierᴹ =
5253
; _≈ᴹ_ = λ _ _
5354
}
5455

55-
rightModule : {S : Ring s ℓs} RightModule S 0ℓ 0ℓ
56+
rightModule : {S : Ring s ℓs} RightModule S c ℓ
5657
rightModule = record
5758
{ Carrierᴹ =
5859
; _≈ᴹ_ = λ _ _
5960
}
6061

61-
bimodule : {R : Ring r ℓr} {S : Ring s ℓs} Bimodule R S 0ℓ 0ℓ
62+
bimodule : {R : Ring r ℓr} {S : Ring s ℓs} Bimodule R S c ℓ
6263
bimodule = record
6364
{ Carrierᴹ =
6465
; _≈ᴹ_ = λ _ _
6566
}
6667

67-
⟨module⟩ : {R : CommutativeRing r ℓr} Module R 0ℓ 0ℓ
68+
⟨module⟩ : {R : CommutativeRing r ℓr} Module R c ℓ
6869
⟨module⟩ = record
6970
{ Carrierᴹ =
7071
; _≈ᴹ_ = λ _ _

0 commit comments

Comments
 (0)