{-# OPTIONS --cubical-compatible --safe #-}
module Data.Vec.Reflection where
import Data.List.Base as List
open import Data.Vec.Base
open import Reflection.AST.Term
open import Reflection.AST.Argument
`Vector : Term → Term → Term
`Vector `A `n = def (quote Vec) (1 ⋯⟅∷⟆ `A ⟨∷⟩ `n ⟨∷⟩ List.[])
`[] : Term
`[] = con (quote []) (2 ⋯⟅∷⟆ List.[])
infixr 5 _`∷_
_`∷_ : Term → Term → Term
_`∷_ x xs = con (quote _∷_) (3 ⋯⟅∷⟆ x ⟨∷⟩ xs ⟨∷⟩ List.[])
pattern `[]` = con (quote []) (_ ∷ _ ∷ [])
pattern _`∷`_ x xs = con (quote _∷_) (_ ∷ _ ∷ _ ∷ x ⟨∷⟩ xs ⟨∷⟩ _)