| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Vectors made up entirely of unique elements (setoid equality) |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 8 |
|
| 9 |
open import Relation.Binary.Core using (Rel) |
| 10 |
open import Relation.Binary.Bundles using (Setoid) |
| 11 |
|
| 12 |
module Data.Vec.Relation.Unary.Unique.Setoid {a ℓ} (S : Setoid a ℓ) where |
| 13 |
|
| 14 |
open Setoid S renaming (Carrier to A) |
| 15 |
|
| 16 |
open import Data.Vec.Base |
| 17 |
import Data.Vec.Relation.Unary.AllPairs as AllPairsM |
| 18 |
open import Level using (_⊔_) |
| 19 |
open import Relation.Unary using (Pred) |
| 20 |
open import Relation.Nullary.Negation using (¬_) |
| 21 |
|
| 22 |
|
| 23 |
------------------------------------------------------------------------ |
| 24 |
-- Definition |
| 25 |
|
| 26 |
private |
| 27 |
Distinct : Rel A ℓ |
| 28 |
Distinct x y = ¬ (x ≈ y) |
| 29 |
|
| 30 |
open import Data.Vec.Relation.Unary.AllPairs.Core Distinct public |
| 31 |
renaming (AllPairs to Unique) |
| 32 |
|
| 33 |
open import Data.Vec.Relation.Unary.AllPairs {R = Distinct} public |
| 34 |
using (head; tail) |