Last active
August 22, 2021 04:12
-
-
Save copumpkin/4197012 to your computer and use it in GitHub Desktop.
Telescopes?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Telescope where | |
open import Function | |
open import Data.Unit | |
open import Data.Product | |
open import Data.Nat | |
open import Data.Vec | |
infixr 6 _∷_ | |
data Telescope (F : Set) : Set₁ where | |
[] : Telescope F | |
_∷_ : (A : F → Set) (As : Telescope (Σ F A)) → Telescope F | |
⟦_⟧ : ∀ {F} → Telescope F → Set | |
⟦_⟧ {F} [] = F | |
⟦ A ∷ As ⟧ = ⟦ As ⟧ | |
x : Telescope ⊤ | |
x = (λ _ → ℕ) ∷ (λ { (_ , n) → Vec ℕ n }) ∷ (λ { ((_ , n) , xs) → n ∈ xs }) ∷ [] | |
q : ⟦ x ⟧ | |
q = ((tt , 3) , (0 ∷ 3 ∷ 0 ∷ [])) , there here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So, in other words,
⟦ x ⟧
is the type of all vectors which contain their length as an element. Correct?