Debian Codegraph @

src/Data/List/Relation/Unary/AllPairs/Core.agda

raw
1 ------------------------------------------------------------------------
2 -- The Agda standard library
3 --
4 -- Lists where every pair of elements are related (symmetrically)
5 ------------------------------------------------------------------------
6
7 -- Core modules are not meant to be used directly outside of the
8 -- standard library.
9
10 -- This module should be removable if and when Agda issue
11 -- https://github.com/agda/agda/issues/3210 is fixed
12
13 {-# OPTIONS --cubical-compatible --safe #-}
14
15 open import Relation.Binary.Core using (Rel)
16
17 module Data.List.Relation.Unary.AllPairs.Core
18 {a ℓ} {A : Set a} (R : Rel A ℓ) where
19
20 open import Level
21 open import Data.List.Base
22 open import Data.List.Relation.Unary.All
23
24 ------------------------------------------------------------------------
25 -- Definition
26
27 -- AllPairs R xs means that every pair of elements (x , y) in xs is a
28 -- member of relation R (as long as x comes before y in the list).
29
30 infixr 5 _∷_
31
32 data AllPairs : List A → Set (a ⊔ ℓ) where
33 [] : AllPairs []
34 _∷_ : ∀ {x xs} → All (R x) xs → AllPairs xs → AllPairs (x ∷ xs)