the function part of a w value probably needs to be ω #24

Closed
opened 2023-08-02 13:27:43 -04:00 by rhi · 0 comments
Owner

a binary tree is something like (in hypothetical future quox with implicits and λcase)

def0 Tag = {leaf, node}
def0 Field : Tag → ★ → ★ =
	λ t A ⇒ case t of {leaf ⇒ A; node ⇒ {o}}
def0 Body : Tag → ★ =
  	λcase {leaf ⇒ {}; node ⇒ {left, right}}
    
def0 Tree : ★ → ★ =
	λ A ⇒ (x : (t : Tag) × Field t) ⊲ 1.(Body (fst x))
    
def leaf : A → Tree A =
   	λ x ⇒ ('leaf, x) ⫽ λ()
def node: ω.(l r : Tree A) → Tree A =  -- >:(
  	λ l r ⇒ ('node, 'o) ⫽ λcase {'left ⇒ l; 'right ⇒ r}

but that's no good! we want node: 1.(l r : Tree A) → Tree A! the structure uses each subterm once, and the eliminator visits each once!!!

i have no idea what to do about this though.

a binary tree is something like (in hypothetical future quox with implicits and `λcase`) ``` def0 Tag = {leaf, node} def0 Field : Tag → ★ → ★ = λ t A ⇒ case t of {leaf ⇒ A; node ⇒ {o}} def0 Body : Tag → ★ = λcase {leaf ⇒ {}; node ⇒ {left, right}} def0 Tree : ★ → ★ = λ A ⇒ (x : (t : Tag) × Field t) ⊲ 1.(Body (fst x)) def leaf : A → Tree A = λ x ⇒ ('leaf, x) ⫽ λ() def node: ω.(l r : Tree A) → Tree A = -- >:( λ l r ⇒ ('node, 'o) ⫽ λcase {'left ⇒ l; 'right ⇒ r} ``` but that's no good! we want `node: 1.(l r : Tree A) → Tree A`! the structure uses each subterm once, and the eliminator visits each once!!! i have no idea what to do about this though.
rhi added the
language
label 2023-08-02 13:27:43 -04:00
rhi added a new dependency 2023-08-02 13:27:48 -04:00
rhi removed a dependency 2024-04-20 21:45:12 -04:00
rhi closed this issue 2024-04-20 21:45:15 -04:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: rhi/quox#24
No description provided.