Skip to content

Commit f448ab3

Browse files
committed
Updated to recent Agda
1 parent 0684b28 commit f448ab3

File tree

17 files changed

+54
-59
lines changed

17 files changed

+54
-59
lines changed

src/Generic/Core.agda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ mutual
5656

5757
mutual
5858
Extend : {ι β} {I : Set ι} -> Desc I β -> (I -> Set β) -> I -> Set β
59-
Extend (var i) B j = Lift (i ≡ j)
59+
Extend (var i) B j = Lift _ (i ≡ j)
6060
Extend (π i q C) B j = Extendᵇ i C q B j
6161
Extend (D ⊛ E) B j = ⟦ D ⟧ B × Extend E B j
6262

src/Generic/Examples/Data/Lift.agda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Generic.Examples.Data.Lift where
33
open import Generic.Main as Main hiding (Lift; lift; lower)
44

55
Lift : {α} β -> Set α -> Set (α ⊔ β)
6-
Lift β = readData Main.Lift
6+
Lift = readData Main.Lift
77

88
pattern lift x = !#₀ (relv x , lrefl)
99

src/Generic/Examples/Data/Maybe.agda

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ open import Generic.Main as Main hiding (Maybe; just; nothing)
55
Maybe : {α} -> Set α -> Set α
66
Maybe = readData Main.Maybe
77

8-
pattern just x = #₀ (relv x , lrefl)
9-
pattern nothing = !#₁ lrefl
8+
pattern nothing = #₀ lrefl
9+
pattern just x = !#₁ (relv x , lrefl)
1010

1111
just′ : {α} {A : Set α} -> A -> Maybe A
1212
just′ = just

src/Generic/Examples/Data/W.agda

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ module Generic.Examples.Data.W where
22

33
open import Generic.Main
44

5-
import Data.W as W
5+
data W′ {α β} (A : Set α) (B : A -> Set β) : Set (α ⊔ β) where
6+
sup′ : {x} -> (B x -> W′ A B) -> W′ A B
67

78
W : {α β} -> (A : Set α) -> (A -> Set β) -> Set (α ⊔ β)
8-
W = readData W.W
9+
W = readData W
910

1011
pattern sup x g = !#₀ (relv x , g , lrefl)
1112

src/Generic/Examples/DeriveEq.agda

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ module DeriveEqVec where
2222
test₁ : xs ≟ xs ≡ yes refl
2323
test₁ = refl
2424

25-
-- Makes Agda loop?
26-
-- test₂ : xs ≟ (2 ∷ᵥ 4 ∷ᵥ 2 ∷ᵥ []ᵥ) ≡ no _
27-
-- test₂ = refl
28-
29-
test₂ : xs == (2 ∷ᵥ 4 ∷ᵥ 2 ∷ᵥ []ᵥ) ≡ false
25+
test₂ : xs ≟ (2 ∷ᵥ 4 ∷ᵥ 2 ∷ᵥ []ᵥ) ≡ no _
3026
test₂ = refl
3127

3228
module DeriveEqD where

src/Generic/Examples/Experiment.agda

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,9 @@ module Example1 where
8181
find : {A : Set} {{x : A}} -> A
8282
find {{x}} = x
8383

84-
-- Looks like Agda can't find the instance because of the implicit lambda bug:
85-
-- `DataEq {{find}}` doesn't work.
86-
test : _≟_ {{DataEq {{λ {_} -> find}}}} arose arose ≡ yes refl
87-
test = refl
84+
-- -- Instance search cannot be used to find elements in an explicit function type
85+
-- test : _≟_ {{DataEq {{λ {_} -> find}}}} arose arose ≡ yes refl
86+
-- test = refl
8887

8988
module Example2 where
9089
-- If `A` is a parameter, then this definition would be strictly positive,

src/Generic/Examples/ReadData.agda

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ data D {α β} (A : Set α) (B : ℕ -> Set β) : ∀ {n} -> B n -> List ℕ ->
66
c₁ : {n} (y : B n) xs -> A -> D A B y xs
77
c₂ : {y : B 0} -> ( {n} (y : B n) {{xs}} -> D A B y xs) -> .(List A) -> D A B y []
88

9-
D′ : TypeOf D
9+
-- No longer works: Failed to solve the following constraints: Has bigger sort: Setω
10+
-- D′ : TypeOf D
11+
D′ : {α β} -> (A : Set α) -> (B :-> Set β) -> {n} -> B n -> List ℕ -> Set (α ⊔ β)
1012
D′ = readData D
1113

1214
unquoteDecl foldD = deriveFoldTo foldD (quote D)

src/Generic/Function/Elim.agda

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ varView D = no-var
2323
mutual
2424
Hyp : {ι β γ} {I : Set ι} {B}
2525
-> ( {i} -> B i -> Set γ) -> (D : Desc I β) -> ⟦ D ⟧ B -> Set (β ⊔ γ)
26-
Hyp {β = β} C (var i) y = Lift {ℓ = β} (C y)
26+
Hyp {β = β} C (var i) y = Lift β (C y)
2727
Hyp C (π i q D) f = Hypᵇ i C D f
2828
Hyp C (D ⊛ E) (x , y) = Hyp C D x × Hyp C E y
2929

@@ -38,8 +38,8 @@ mutual
3838
-> (D : Desc I β)
3939
-> ( {j} -> Extend D B j -> B j)
4040
-> Set (β ⊔ γ)
41-
Elim {β = β} C (var i) k = Lift {ℓ = β} (C (k lrefl))
42-
Elim C (π i q D) k = Elimᵇ i C D k
41+
Elim {β = β} C (var i) k = Lift β (C (k lrefl))
42+
Elim C (π i q D) k = Elimᵇ i C D k
4343
Elim C (D ⊛ E) k with varView D
4444
... | yes-var = {x} -> C x -> Elim C E (k ∘ _,_ x)
4545
... | no-var = {x} -> Hyp C D x -> Elim C E (k ∘ _,_ x)
@@ -85,7 +85,7 @@ module _ {ι β γ} {I : Set ι} {D₀ : Data (Desc I β)} (C : ∀ {j} -> μ D
8585
-> (e : Extend D (μ D₀) j)
8686
-> C (k e)
8787
elimExtend (var i) z lrefl = lower z
88-
elimExtend (π i q D) h p = elimExtendᵇ i D h p
88+
elimExtend (π i q D) h p = elimExtendᵇ i D h p
8989
elimExtend (D ⊛ E) h (d , e) with varView D
9090
... | yes-var = elimExtend E (h (elim d)) e
9191
... | no-var = elimExtend E (h (elimHyp D d)) e

src/Generic/Lib/Category.agda

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ open import Category.Applicative public
55
open import Category.Monad public
66

77
open RawFunctor {{...}} public
8-
open RawApplicative {{...}} hiding (_<$>_; _<$_; zipWith) renaming (_⊛_ to _<*>_) public
9-
open RawMonad {{...}} hiding (pure; _<$>_; _<$_; _⊛_; _<⊛_; _⊛>_; _⊗_; rawFunctor; zipWith) public
8+
open RawApplicative {{...}} hiding (_<$>_; _<&>_; _<$_; zip; zipWith) renaming (_⊛_ to _<*>_) public
9+
open RawMonad {{...}} hiding (pure; _<$>_; _<&>_; _<$_; _⊛_; _<⊛_; _⊛>_; _⊗_; rawFunctor; zip; zipWith) public
1010

1111
fmap = _<$>_

src/Generic/Lib/Data/List.agda

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ mapInd f (x ∷ xs) = f 0 x ∷ mapInd (f ∘ suc) xs
2727

2828
mapM : {α β} {A : Set α} {B : Set β} {M : Set β -> Set β} {{mMonad : RawMonad M}}
2929
-> (A -> M B) -> List A -> M (List B)
30-
mapM {{mMonad}} = List.mapM mMonad
30+
mapM {{mMonad}} = List.TraversableM.mapM mMonad
3131

3232
downFromTo :->-> List ℕ
3333
downFromTo n m = map (m +_) (downFrom (n ∸ m))
@@ -98,5 +98,5 @@ lookupAllConst : ∀ {α β} {A : Set α} {B : Set β} {{bEq : Eq B}} {xs : List
9898
-> B -> All (const B) xs -> Maybe (∃ (_∈ xs))
9999
lookupAllConst {xs = []} y tt = nothing
100100
lookupAllConst {xs = x ∷ xs} y (z , ys) = if y == z
101-
then just (, phere xs)
101+
then just (_ , phere xs)
102102
else second (there xs) <$> lookupAllConst y ys

0 commit comments

Comments
 (0)