I'm currently making an ordered vector datatype and I'm trying to create operations from the data type but I get an error:
(Set (.Agda.Primitive.lsuc ℓ)) != Set
when checking that the expression A has type Set ℓ
This is the datatype
module ordered-vector (A : Set) (_<A_ : A → A → ????) where
data ordered-???? : {A : Set}→ A → ℕ → Set where
[] : {a : A} → ordered-???? a 0
_::_ : (head : A) {min : A} → {n : ℕ} → (tail : ordered-???? min n) → true (min <A head) → ordered-???? head (suc n)
And this is the operation:
[_]o???? : ∀ {ℓ} {A : Set ℓ} → A → ordered-???? A 1
[ x ]o???? = x :: []
I believe the following code is more correct for the datatype. How do I retain the correctness of the cons part of the definition?
data ordered-???? {ℓ} (A : Set ℓ) : ℕ → Set ℓ where
[] : ordered-???? A 0
_::_ : (head : A) {min : A} → {n : ℕ} → ordered-???? min n → true (min <A head) → ordered-???? head (suc n)
This is the nat module