{-# OPTIONS --cubical --guardedness --safe #-}

module Data.PolyP.Universe where

open import Prelude hiding (_⟨_⟩_)
open import Data.Vec.Iterated
open import Data.Fin.Indexed

--------------------------------------------------------------------------------
--
--  The Universe of functors we're interested in.
--
--------------------------------------------------------------------------------
data Functor (n : ) : Type where
  !     : Fin n  Functor n
  _⊕_   : (F G : Functor n)  Functor n
  _⊗_   : (F G : Functor n)  Functor n
  μ⟨_⟩  : Functor (suc n)  Functor n
       : Functor n
       : Functor n

infixl 6 _⊕_
infixl 7 _⊗_

Params :   Type₁
Params = Vec Type

variable
  n m k : 
  F G : Functor n
  As Bs : Params n

---------------------------------------------------------------------------------
--
-- Interpretation
--
---------------------------------------------------------------------------------

mutual
  ⟦_⟧ : Functor n  Params n  Type
   ! i      xs = xs [ i ]
   F   G   xs =  F  xs    G  xs
   F   G   xs =  F  xs ×   G  xs
   μ⟨ F    xs = μ F xs
           xs = 
           xs = 

  record μ (F : Functor (suc n)) (As : Params n) : Type where
    pattern; inductive; constructor ⟨_⟩
    field unwrap :  F  (μ F As  As)
open μ public