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