{-# OPTIONS --cubical-compatible --safe #-}
module Data.Star.List where
open import Data.Star.Nat
open import Data.Unit
open import Relation.Binary.Construct.Always using (Always)
open import Relation.Binary.Construct.Constant using (Const)
open import Relation.Binary.Construct.Closure.ReflexiveTransitive
List : ∀ {a} → Set a → Set a
List A = Star (Const A) tt tt
[] : ∀ {a} {A : Set a} → List A
[] = ε
infixr 5 _∷_
_∷_ : ∀ {a} {A : Set a} → A → List A → List A
_∷_ = _◅_
sum : List ℕ → ℕ
sum = fold (Star Always) _+_ zero