63
63
-- inferred from a value of type Record Sig.
64
64
65
65
record Record {s} (Sig : Signature s) : Set s where
66
- eta-equality
67
66
inductive
67
+ no-eta-equality
68
68
constructor rec
69
69
field fun : Record-fun Sig
70
70
@@ -122,30 +122,32 @@ Proj (_,_≔_ Sig ℓ′ {A = A} a) ℓ {ℓ∈} with does (ℓ ≟ ℓ′)
122
122
123
123
-- Record restriction and projection.
124
124
125
+ open Record renaming (fun to fields)
126
+
125
127
infixl 5 _∣_
126
128
127
129
_∣_ : ∀ {s} {Sig : Signature s} → Record Sig →
128
130
(ℓ : Label) {ℓ∈ : ℓ ∈ Sig} → Restricted Sig ℓ ℓ∈
129
131
_∣_ {Sig = ∅} r ℓ {}
130
- _∣_ {Sig = Sig , ℓ′ ∶ A} (rec r) ℓ {ℓ∈} with does (ℓ ≟ ℓ′)
131
- ... | true = Σ.proj₁ r
132
- ... | false = _∣_ (Σ.proj₁ r ) ℓ {ℓ∈}
133
- _∣_ {Sig = Sig , ℓ′ ≔ a} (rec r) ℓ {ℓ∈} with does (ℓ ≟ ℓ′)
134
- ... | true = Manifest-Σ.proj₁ r
135
- ... | false = _∣_ (Manifest-Σ.proj₁ r ) ℓ {ℓ∈}
132
+ _∣_ {Sig = Sig , ℓ′ ∶ A} r ℓ {ℓ∈} with does (ℓ ≟ ℓ′)
133
+ ... | true = Σ.proj₁ (fields r)
134
+ ... | false = _∣_ (Σ.proj₁ (fields r) ) ℓ {ℓ∈}
135
+ _∣_ {Sig = Sig , ℓ′ ≔ a} r ℓ {ℓ∈} with does (ℓ ≟ ℓ′)
136
+ ... | true = Manifest-Σ.proj₁ (fields r)
137
+ ... | false = _∣_ (Manifest-Σ.proj₁ (fields r) ) ℓ {ℓ∈}
136
138
137
139
infixl 5 _·_
138
140
139
141
_·_ : ∀ {s} {Sig : Signature s} (r : Record Sig)
140
142
(ℓ : Label) {ℓ∈ : ℓ ∈ Sig} →
141
143
Proj Sig ℓ {ℓ∈} (r ∣ ℓ)
142
144
_·_ {Sig = ∅} r ℓ {}
143
- _·_ {Sig = Sig , ℓ′ ∶ A} (rec r) ℓ {ℓ∈} with does (ℓ ≟ ℓ′)
144
- ... | true = Σ.proj₂ r
145
- ... | false = _·_ (Σ.proj₁ r ) ℓ {ℓ∈}
146
- _·_ {Sig = Sig , ℓ′ ≔ a} (rec r) ℓ {ℓ∈} with does (ℓ ≟ ℓ′)
147
- ... | true = Manifest-Σ.proj₂ r
148
- ... | false = _·_ (Manifest-Σ.proj₁ r ) ℓ {ℓ∈}
145
+ _·_ {Sig = Sig , ℓ′ ∶ A} r ℓ {ℓ∈} with does (ℓ ≟ ℓ′)
146
+ ... | true = Σ.proj₂ (fields r)
147
+ ... | false = _·_ (Σ.proj₁ (fields r) ) ℓ {ℓ∈}
148
+ _·_ {Sig = Sig , ℓ′ ≔ a} r ℓ {ℓ∈} with does (ℓ ≟ ℓ′)
149
+ ... | true = Manifest-Σ.proj₂ (fields r)
150
+ ... | false = _·_ (Manifest-Σ.proj₁ (fields r) ) ℓ {ℓ∈}
149
151
150
152
------------------------------------------------------------------------
151
153
-- With
@@ -170,9 +172,9 @@ mutual
170
172
{a : (r : Restricted Sig ℓ ℓ∈) → Proj Sig ℓ r} →
171
173
Record (_With_≔_ Sig ℓ {ℓ∈} a) → Record Sig
172
174
drop-With {Sig = ∅} {ℓ∈ = ()} r
173
- drop-With {Sig = Sig , ℓ′ ∶ A} {ℓ} (rec r) with does (ℓ ≟ ℓ′)
174
- ... | true = rec (Manifest-Σ.proj₁ r , Manifest-Σ.proj₂ r )
175
- ... | false = rec (drop-With (Σ.proj₁ r) , Σ.proj₂ r )
176
- drop-With {Sig = Sig , ℓ′ ≔ a} {ℓ} (rec r) with does (ℓ ≟ ℓ′)
177
- ... | true = rec (Manifest-Σ.proj₁ r ,)
178
- ... | false = rec (drop-With (Manifest-Σ.proj₁ r ) ,)
175
+ drop-With {Sig = Sig , ℓ′ ∶ A} {ℓ} r with does (ℓ ≟ ℓ′)
176
+ ... | true = rec (Manifest-Σ.proj₁ (fields r) , Manifest-Σ.proj₂ (fields r) )
177
+ ... | false = rec (drop-With (Σ.proj₁ (fields r)) , Σ.proj₂ (fields r) )
178
+ drop-With {Sig = Sig , ℓ′ ≔ a} {ℓ} r with does (ℓ ≟ ℓ′)
179
+ ... | true = rec (Manifest-Σ.proj₁ (fields r) ,)
180
+ ... | false = rec (drop-With (Manifest-Σ.proj₁ (fields r) ) ,)
0 commit comments