Skip to content

Example: Joinable Red Black Tree in Decalf#51

Open
runmingl wants to merge 7 commits intomainfrom
example/rbt-decalf
Open

Example: Joinable Red Black Tree in Decalf#51
runmingl wants to merge 7 commits intomainfrom
example/rbt-decalf

Conversation

@runmingl
Copy link
Copy Markdown
Member

This should supersede #34 by porting everything from calf to decalf.

Comment on lines +93 to +130
≤⟨ (
{! !}
-- ≤⁻-mono {Π _ λ _ → cost} {cost} (bind cost (mapreduce _ _ _ t₁ f g z ∥ mapreduce _ _ _ t₂ f g z))
-- {λ (s₁ , s₂) →
-- bind cost (f a) λ b →
-- bind cost (g b s₂) λ s₃ →
-- funext
-- $ λ-mono-≤⁻ λ (s₁ , s₂) →
-- ≤⁻-mono (bind cost (f a)) $ λ-mono-≤⁻ λ b →
-- ≤⁻-mono (bind cost (g b s₂)) $ λ-mono-≤⁻ λ s₃ →
-- g-bound {s₁} {s₃}
) ⟩
≤⟨ bind-monoʳ-≤⁻ ((mapreduce/seq _ _ _ t₁ f g z) ∥ (mapreduce/seq _ _ _ t₂ f g z)) (λ (s₁ , s₂) →
bind-monoʳ-≤⁻ (f a) (λ b →
bind-monoʳ-≤⁻ (g b s₂) (λ s₃ → g-bound))) ⟩
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem we ran into earlier can (and should) be solved via bind-monoʳ-≤⁻ and bind-monoˡ-≤⁻.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants