Skip to content

Commit 489aeb8

Browse files
committed
Global: porting classes from formal-prelude
1 parent aa62ce6 commit 489aeb8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1578
-300
lines changed

Class/Allable.agda

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
{-# OPTIONS --cubical-compatible #-}
12
module Class.Allable where
23

34
open import Class.Allable.Core public
4-
open import Class.Allable.Instance public
5+
open import Class.Allable.Instances public

Class/Allable/Core.agda

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# OPTIONS --cubical-compatible #-}
12
module Class.Allable.Core where
23

34
open import Class.Prelude
Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
module Class.Allable.Instance where
1+
{-# OPTIONS --cubical-compatible #-}
2+
module Class.Allable.Instances where
23

34
open import Class.Prelude
45
open import Class.Allable.Core
@@ -18,20 +19,4 @@ instance
1819
Allable-Maybe .All = M.All
1920

2021
Allable-List⁺ : Allable {ℓ} List⁺
21-
Allable-List⁺ .All P = All P ∘ toList
22-
23-
private
24-
open import Class.Decidable
25-
open import Class.HasOrder
26-
27-
_ : ∀[ x ∈ List ℕ ∋ 123 ∷ [] ] x > 0
28-
_ = auto
29-
30-
_ : ∀[ x ∈ just 42 ] x > 0
31-
_ = auto
32-
33-
_ : ∀[ x ∈ nothing ] x > 0
34-
_ = auto
35-
36-
_ : ¬∀[ x ∈ just 0 ] x > 0
37-
_ = auto
22+
Allable-List⁺ .All P = All P ∘ L⁺.toList

Class/Anyable.agda

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
{-# OPTIONS --cubical-compatible #-}
12
module Class.Anyable where
23

34
open import Class.Anyable.Core public
4-
open import Class.Anyable.Instance public
5+
open import Class.Anyable.Instances public

Class/Anyable/Core.agda

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# OPTIONS --cubical-compatible #-}
12
module Class.Anyable.Core where
23

34
open import Class.Prelude
Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
module Class.Anyable.Instance where
1+
{-# OPTIONS --cubical-compatible #-}
2+
module Class.Anyable.Instances where
23

34
open import Class.Prelude
45
open import Class.Anyable.Core
@@ -18,17 +19,4 @@ instance
1819
Anyable-Maybe .Any = M.Any
1920

2021
Anyable-List⁺ : Anyable {ℓ} List⁺
21-
Anyable-List⁺ .Any P = Any P ∘ toList
22-
23-
private
24-
open import Class.Decidable
25-
open import Class.HasOrder
26-
27-
_ : ∃[ x ∈ List ℕ ∋ 123 ∷ [] ] x > 0
28-
_ = auto
29-
30-
_ : ∃[ x ∈ just 42 ] x > 0
31-
_ = auto
32-
33-
_ : ∄[ x ∈ nothing ] x > 0
34-
_ = auto
22+
Anyable-List⁺ .Any P = Any P ∘ L⁺.toList

Class/Applicative/Instances.agda

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ instance
4949
-- Applicative-∃Vec : Applicative (∃ ∘ Vec)
5050
-- Applicative-∃Vec = λ where
5151
-- .pure x → 1 , pure x
52-
-- ._<*>_ (n , xs) (m , ys) → {! (n ⊔ m) , zipWith _$_ xs ys -- (+ zipWith-⊔ lemma) !}
52+
-- ._<*>_ (n , xs) (m , ys) →
53+
-- {! (n ⊔ m) , zipWith _$_ xs ys (+ zipWith-⊔ lemma) !}
5354

5455
private module M where
5556
open import Reflection.TCM.Syntax public

Class/Coercions.agda

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{-# OPTIONS --cubical-compatible #-}
2+
module Class.Coercions where
3+
4+
open import Class.Prelude
5+
6+
infix -1 _↝_
7+
record _↝_ (A : Type ℓ) (B : Type ℓ′) : Typeω where
8+
field to : A B
9+
syntax to {B = B} = to[ B ]
10+
open _↝_ ⦃...⦄ public
11+
12+
tos : ⦃ A ↝ B ⦄ List A ↝ List B
13+
tos .to = map to
14+
15+
infix -1 _⁇_↝_
16+
record _⁇_↝_ (A : Type ℓ) (P : Pred A ℓ′) (B : Type ℓ′) : Typeω where
17+
field toBecause : (x : A) .{_ : P x} B
18+
syntax toBecause x {p} = ⌞ x ⊣ p ⌟
19+
open _⁇_↝_ ⦃...⦄ public

Class/DecEq/Core.agda

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{-# OPTIONS --without-K #-}
1+
{-# OPTIONS --cubical-compatible #-}
22
module Class.DecEq.Core where
33

44
open import Class.Prelude
@@ -20,3 +20,6 @@ open DecEq ⦃...⦄ public
2020
DecEq¹ = DecEq ¹
2121
DecEq² = DecEq ²
2222
DecEq³ = DecEq ³
23+
24+
Irrelevant⇒DecEq : Irrelevant A DecEq A
25+
Irrelevant⇒DecEq ∀≡ ._≟_ = yes ∘₂ ∀≡

Class/Decidable.agda

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ module Class.Decidable where
33

44
open import Class.Decidable.Core public
55
open import Class.Decidable.Instances public
6+
open import Class.Decidable.WithoutK public

0 commit comments

Comments
 (0)