Created
July 14, 2022 19:09
-
-
Save rntz/a1071f42be4fde24cedecff88e8eb7c7 to your computer and use it in GitHub Desktop.
This file contains 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
import Data.List | |
interface Cat obj (0 hom: obj -> obj -> Type) where | |
id : {a: obj} -> hom a a | |
seq: {a, b, c: obj} -> hom a b -> hom b c -> hom a c | |
interface Cat (List obj) hom => Concat obj hom where | |
para: {Γ₁, Γ₂, Δ₁, Δ₂ : List obj} | |
-> hom Γ₁ Δ₁ -> hom Γ₂ Δ₂ | |
-> hom (Γ₁ ++ Γ₂) (Δ₁ ++ Δ₂) | |
interface Concat obj hom => Cartesian obj hom where | |
product: List obj -> obj | |
rename: {Γ: List obj} | |
-> (ρ: forall a. List a -> List a) | |
-> hom Γ (ρ Γ) | |
merge: {Γ: List obj} -> hom Γ [product Γ] | |
split: {Γ: List obj} -> hom [product Γ] Γ | |
fork: {Γ, Δ₁, Δ₂: List obj} | |
-> hom Γ Δ₁ -> hom Γ Δ₂ | |
-> hom Γ (Δ₁ ++ Δ₂) | |
fork f g = seq {a=Γ} (rename {Γ} (\l => l ++ l)) (para {Γ₁=Γ} f g) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment