Skip to content

Instantly share code, notes, and snippets.

@copumpkin
Last active August 22, 2021 04:12
Show Gist options
  • Save copumpkin/4197012 to your computer and use it in GitHub Desktop.
Save copumpkin/4197012 to your computer and use it in GitHub Desktop.
Telescopes?
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
@timjb
Copy link

timjb commented Jul 14, 2013

So, in other words, ⟦ x ⟧ is the type of all vectors which contain their length as an element. Correct?

@copumpkin
Copy link
Author

Yeah :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment