File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
src/Data/List/Relation/Binary/Permutation Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -702,6 +702,10 @@ Other minor additions
702
702
deduplicate⁻ : Any P (deduplicate Q? xs) → Any P xs
703
703
```
704
704
705
+ * The implementation of ` ↭-trans ` has been altered in
706
+ ` Data.List.Relation.Binary.Permutation.Inductive ` to avoid
707
+ adding unnecessary ` refl ` s, hence improving it's performance.
708
+
705
709
* Added new functions to ` Data.List.Relation.Binary.Permutation.Setoid ` :
706
710
``` agda
707
711
↭-prep : xs ↭ ys → x ∷ xs ↭ x ∷ ys
Original file line number Diff line number Diff line change @@ -46,14 +46,17 @@ data _↭_ : Rel (List A) a where
46
46
↭-sym (swap x y xs↭ys) = swap y x (↭-sym xs↭ys)
47
47
↭-sym (trans xs↭ys ys↭zs) = trans (↭-sym ys↭zs) (↭-sym xs↭ys)
48
48
49
+ -- A smart version of trans that avoids unnecessary `refl`s (see #1113).
49
50
↭-trans : Transitive _↭_
50
- ↭-trans = trans
51
+ ↭-trans refl ρ₂ = ρ₂
52
+ ↭-trans ρ₁ refl = ρ₁
53
+ ↭-trans ρ₁ ρ₂ = trans ρ₁ ρ₂
51
54
52
55
↭-isEquivalence : IsEquivalence _↭_
53
56
↭-isEquivalence = record
54
57
{ refl = refl
55
58
; sym = ↭-sym
56
- ; trans = trans
59
+ ; trans = ↭- trans
57
60
}
58
61
59
62
↭-setoid : Setoid _ _
You can’t perform that action at this time.
0 commit comments