{-# OPTIONS --without-K --safe #-}
module Data.BoundedVec.Inefficient where
{-# WARNING_ON_IMPORT
"Data.BoundedVec.Inefficient was deprecated in v1.2.
Use Data.Vec.Bounded instead."
#-}
open import Data.Nat.Base
open import Data.List.Base
infixr 5 _∷_
data BoundedVec {a} (A : Set a) : ℕ → Set a where
[] : ∀ {n} → BoundedVec A n
_∷_ : ∀ {n} (x : A) (xs : BoundedVec A n) → BoundedVec A (suc n)
↑ : ∀ {a n} {A : Set a} → BoundedVec A n → BoundedVec A (suc n)
↑ [] = []
↑ (x ∷ xs) = x ∷ ↑ xs
fromList : ∀ {a} {A : Set a} → (xs : List A) → BoundedVec A (length xs)
fromList [] = []
fromList (x ∷ xs) = x ∷ fromList xs
toList : ∀ {a n} {A : Set a} → BoundedVec A n → List A
toList [] = []
toList (x ∷ xs) = x ∷ toList xs