Skip to content

Commit 06331fe

Browse files
Apply review suggestions
Co-authored by: Orestis Melkonian <melkon.or@gmail.com>
1 parent 7122057 commit 06331fe

File tree

8 files changed

+100
-101
lines changed

8 files changed

+100
-101
lines changed

lib/containers/agda/Data/Map/Maybe.agda

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# OPTIONS --erasure #-}
21

32
module Data.Map.Maybe
43
{-

lib/containers/agda/Data/Map/Prop.agda

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# OPTIONS --erasure #-}
21

32
-- | Proofs on 'Map'.
43
module Data.Map.Prop where
@@ -14,13 +13,14 @@ open import Haskell.Data.Maybe using
1413

1514
import Data.Map.Maybe as Maybe
1615
import Haskell.Prelude as List using (map)
16+
open import Data.Set using (Set)
1717
import Data.Set as Set
1818

1919
{-----------------------------------------------------------------------------
2020
Proofs
2121
involving 1 value type
2222
------------------------------------------------------------------------------}
23-
module _ {k a : Set} {{_ : Ord k}} where
23+
module _ {k a : Type} {{_ : Ord k}} where
2424

2525
--
2626
prop-member-null
@@ -210,7 +210,7 @@ module _ {k a : Set} {{_ : Ord k}} where
210210
Proofs
211211
involving keysSet
212212
------------------------------------------------------------------------------}
213-
module _ {k a : Set} {{_ : Ord k}} where
213+
module _ {k a : Type} {{_ : Ord k}} where
214214

215215
--
216216
prop-member-keysSet
@@ -355,11 +355,11 @@ module _ {k a : Set} {{_ : Ord k}} where
355355
Proofs
356356
involving withoutKeys and restrictKeys
357357
------------------------------------------------------------------------------}
358-
module _ {k a : Set} {{_ : Ord k}} where
358+
module _ {k a : Type} {{_ : Ord k}} where
359359

360360
--
361361
prop-lookup-withoutKeys
362-
: (key : k) (m : Map k a) (ks : Set.ℙ k)
362+
: (key : k) (m : Map k a) (ks : Set k)
363363
lookup key (withoutKeys m ks)
364364
≡ Maybe.filt (not (Set.member key ks)) (lookup key m)
365365
--
@@ -377,7 +377,7 @@ module _ {k a : Set} {{_ : Ord k}} where
377377

378378
--
379379
prop-lookup-restrictKeys
380-
: (key : k) (m : Map k a) (ks : Set.ℙ k)
380+
: (key : k) (m : Map k a) (ks : Set k)
381381
lookup key (restrictKeys m ks)
382382
≡ Maybe.filt (Set.member key ks) (lookup key m)
383383
--
@@ -441,7 +441,7 @@ module _ {k a : Set} {{_ : Ord k}} where
441441

442442
--
443443
prop-restrictKeys-union
444-
: (ma mb : Map k a) (ks : Set.ℙ k)
444+
: (ma mb : Map k a) (ks : Set k)
445445
restrictKeys (union ma mb) ks
446446
≡ union (restrictKeys ma ks) (restrictKeys mb ks)
447447
--
@@ -499,7 +499,7 @@ module _ {k a : Set} {{_ : Ord k}} where
499499

500500
--
501501
prop-withoutKeys-union
502-
: (ma mb : Map k a) (ks : Set.ℙ k)
502+
: (ma mb : Map k a) (ks : Set k)
503503
withoutKeys (union ma mb) ks
504504
≡ union (withoutKeys ma ks) (withoutKeys mb ks)
505505
--
@@ -531,7 +531,7 @@ module _ {k a : Set} {{_ : Ord k}} where
531531

532532
--
533533
prop-withoutKeys-difference
534-
: (m : Map k a) (ka kb : Set.ℙ k)
534+
: (m : Map k a) (ka kb : Set k)
535535
withoutKeys m (Set.difference ka kb)
536536
≡ union (withoutKeys m ka) (restrictKeys m kb)
537537
--
@@ -582,7 +582,7 @@ module _ {k a : Set} {{_ : Ord k}} where
582582

583583
--
584584
prop-withoutKeys-withoutKeys
585-
: (m : Map k a) (ka kb : Set.ℙ k)
585+
: (m : Map k a) (ka kb : Set k)
586586
withoutKeys (withoutKeys m ka) kb
587587
≡ withoutKeys m (Set.union ka kb)
588588
--
@@ -625,7 +625,7 @@ module _ {k a : Set} {{_ : Ord k}} where
625625

626626
--
627627
@0 prop-withoutKeys-intersection
628-
: (m : Map k a) (ka kb : Set.ℙ k)
628+
: (m : Map k a) (ka kb : Set k)
629629
withoutKeys m (Set.intersection ka kb)
630630
≡ union (withoutKeys m ka) (withoutKeys m kb)
631631
--

lib/containers/agda/Data/Set/Prop.agda

+29-30
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# OPTIONS --erasure #-}
21

32
-- | Proofs on 'Set'.
43
module Data.Set.Prop where
@@ -13,7 +12,7 @@ open import Haskell.Data.Set
1312
Properties
1413
Basic
1514
------------------------------------------------------------------------------}
16-
module _ {a : Set} {{_ : Ord a}} where
15+
module _ {a : Type} {{_ : Ord a}} where
1716

1817
--
1918
prop-null-empty
@@ -26,11 +25,11 @@ module _ {a : Set} {{_ : Ord a}} where
2625
Properties
2726
https://en.wikipedia.org/wiki/Boolean_algebra_(structure)
2827
------------------------------------------------------------------------------}
29-
module _ {a : Set} {{_ : Ord a}} where
28+
module _ {a : Type} {{_ : Ord a}} where
3029

3130
--
3231
prop-union-idem
33-
: {sa : a}
32+
: {sa : Set a}
3433
union sa sa
3534
≡ sa
3635
--
@@ -46,7 +45,7 @@ module _ {a : Set} {{_ : Ord a}} where
4645

4746
--
4847
prop-union-assoc
49-
: {sa sb sc : a}
48+
: {sa sb sc : Set a}
5049
union (union sa sb) sc
5150
≡ union sa (union sb sc)
5251
--
@@ -66,7 +65,7 @@ module _ {a : Set} {{_ : Ord a}} where
6665

6766
--
6867
prop-union-sym
69-
: {sa sb : a}
68+
: {sa sb : Set a}
7069
union sa sb
7170
≡ union sb sa
7271
--
@@ -83,7 +82,7 @@ module _ {a : Set} {{_ : Ord a}} where
8382

8483
--
8584
prop-union-absorb
86-
: {sa sb : a}
85+
: {sa sb : Set a}
8786
union sa (intersection sa sb)
8887
≡ sa
8988
--
@@ -100,7 +99,7 @@ module _ {a : Set} {{_ : Ord a}} where
10099

101100
--
102101
prop-union-identity
103-
: {sa : a}
102+
: {sa : Set a}
104103
union sa empty
105104
≡ sa
106105
--
@@ -117,7 +116,7 @@ module _ {a : Set} {{_ : Ord a}} where
117116

118117
--
119118
prop-union-intersection-distribute
120-
: {sa sb sc : a}
119+
: {sa sb sc : Set a}
121120
union sa (intersection sb sc)
122121
≡ intersection (union sa sb) (union sa sc)
123122
--
@@ -139,7 +138,7 @@ module _ {a : Set} {{_ : Ord a}} where
139138

140139
--
141140
prop-intersection-idem
142-
: {sa : a}
141+
: {sa : Set a}
143142
intersection sa sa
144143
≡ sa
145144
--
@@ -155,7 +154,7 @@ module _ {a : Set} {{_ : Ord a}} where
155154

156155
--
157156
prop-intersection-assoc
158-
: {sa sb sc : a}
157+
: {sa sb sc : Set a}
159158
intersection (intersection sa sb) sc
160159
≡ intersection sa (intersection sb sc)
161160
--
@@ -175,7 +174,7 @@ module _ {a : Set} {{_ : Ord a}} where
175174

176175
--
177176
prop-intersection-sym
178-
: {sa sb : a}
177+
: {sa sb : Set a}
179178
intersection sa sb
180179
≡ intersection sb sa
181180
--
@@ -192,7 +191,7 @@ module _ {a : Set} {{_ : Ord a}} where
192191

193192
--
194193
prop-intersection-absorb
195-
: {sa sb : a}
194+
: {sa sb : Set a}
196195
intersection sa (union sa sb)
197196
≡ sa
198197
--
@@ -209,7 +208,7 @@ module _ {a : Set} {{_ : Ord a}} where
209208

210209
--
211210
prop-intersection-union-distribute
212-
: {sa sb sc : a}
211+
: {sa sb sc : Set a}
213212
intersection sa (union sb sc)
214213
≡ union (intersection sa sb) (intersection sa sc)
215214
--
@@ -230,7 +229,7 @@ module _ {a : Set} {{_ : Ord a}} where
230229

231230
--
232231
prop-intersection-empty-right
233-
: {sa : a}
232+
: {sa : Set a}
234233
intersection sa empty
235234
≡ empty
236235
--
@@ -247,7 +246,7 @@ module _ {a : Set} {{_ : Ord a}} where
247246

248247
--
249248
prop-intersection-empty-left
250-
: {sa : a}
249+
: {sa : Set a}
251250
intersection empty sa
252251
≡ empty
253252
--
@@ -265,11 +264,11 @@ module _ {a : Set} {{_ : Ord a}} where
265264
Properties
266265
involving difference
267266
------------------------------------------------------------------------------}
268-
module _ {a : Set} {{_ : Ord a}} where
267+
module _ {a : Type} {{_ : Ord a}} where
269268

270269
--
271270
prop-intersection-difference
272-
: {sa sb : a}
271+
: {sa sb : Set a}
273272
intersection sb (difference sa sb)
274273
≡ empty
275274
--
@@ -291,7 +290,7 @@ module _ {a : Set} {{_ : Ord a}} where
291290

292291
--
293292
prop-disjoint-difference
294-
: {sa sb : a}
293+
: {sa sb : Set a}
295294
disjoint sb (difference sa sb)
296295
≡ True
297296
--
@@ -300,7 +299,7 @@ module _ {a : Set} {{_ : Ord a}} where
300299

301300
--
302301
prop-union-difference
303-
: {sa sb : a}
302+
: {sa sb : Set a}
304303
union (difference sa sb) sb
305304
≡ union sa sb
306305
--
@@ -323,7 +322,7 @@ module _ {a : Set} {{_ : Ord a}} where
323322

324323
--
325324
prop-difference-union-x
326-
: {sa sb sc : a}
325+
: {sa sb sc : Set a}
327326
difference (union sa sb) sc
328327
≡ union (difference sa sc) (difference sb sc)
329328
--
@@ -347,7 +346,7 @@ module _ {a : Set} {{_ : Ord a}} where
347346

348347
--
349348
prop-deMorgan-difference-intersection
350-
: {sa sb sc : a}
349+
: {sa sb sc : Set a}
351350
difference sa (intersection sb sc)
352351
≡ union (difference sa sb) (difference sa sc)
353352
--
@@ -369,7 +368,7 @@ module _ {a : Set} {{_ : Ord a}} where
369368

370369
--
371370
prop-deMorgan-difference-union
372-
: {sa sb sc : a}
371+
: {sa sb sc : Set a}
373372
difference sa (union sb sc)
374373
≡ intersection (difference sa sb) (difference sa sc)
375374
--
@@ -393,27 +392,27 @@ module _ {a : Set} {{_ : Ord a}} where
393392
Properties
394393
involving isSubsetOf
395394
------------------------------------------------------------------------------}
396-
module _ {a : Set} {{_ : Ord a}} where
395+
module _ {a : Type} {{_ : Ord a}} where
397396

398397
-- | The 'empty' set is a subset of every set.
399398
prop-isSubsetOf-empty
400-
: {sa : a}
399+
: {sa : Set a}
401400
isSubsetOf empty sa ≡ True
402401
--
403402
prop-isSubsetOf-empty {sa} =
404403
prop-intersection→isSubsetOf empty sa prop-intersection-empty-left
405404

406405
-- | 'isSubsetOf' is reflexive
407406
prop-isSubsetOf-refl
408-
: {sa : a}
407+
: {sa : Set a}
409408
isSubsetOf sa sa ≡ True
410409
--
411410
prop-isSubsetOf-refl {sa} =
412411
prop-intersection→isSubsetOf sa sa prop-intersection-idem
413412

414413
-- | 'isSubsetOf' is antisymmetric
415414
prop-isSubsetOf-antisym
416-
: {sa sb : a}
415+
: {sa sb : Set a}
417416
isSubsetOf sa sb ≡ True
418417
isSubsetOf sb sa ≡ True
419418
sa ≡ sb
@@ -440,7 +439,7 @@ module _ {a : Set} {{_ : Ord a}} where
440439

441440
-- | 'isSubsetOf' is transitive
442441
prop-isSubsetOf-trans
443-
: {sa sb sc : a}
442+
: {sa sb sc : Set a}
444443
isSubsetOf sa sb ≡ True
445444
isSubsetOf sb sc ≡ True
446445
isSubsetOf sa sc ≡ True
@@ -471,7 +470,7 @@ module _ {a : Set} {{_ : Ord a}} where
471470

472471
--
473472
prop-isSubsetOf-intersection
474-
: {sa sb : a}
473+
: {sa sb : Set a}
475474
isSubsetOf (intersection sa sb) sb ≡ True
476475
--
477476
prop-isSubsetOf-intersection {sa} {sb} =
@@ -487,7 +486,7 @@ module _ {a : Set} {{_ : Ord a}} where
487486

488487
--
489488
prop-isSubsetOf-difference
490-
: {sa sb : a}
489+
: {sa sb : Set a}
491490
isSubsetOf (difference sa sb) sa ≡ True
492491
--
493492
prop-isSubsetOf-difference {sa} {sb} =

lib/containers/agda/EverythingContainers.agda

-4
This file was deleted.

0 commit comments

Comments
 (0)