0 | module Data.Container
2 | import public Data.Product
3 | import public Data.Coproduct
4 | import public Data.Sigma
5 | import public Data.Category.Ops
7 | import Proofs.Congruence
8 | import Proofs.Extensionality
15 | record Container where
22 | %pair Container req res
26 | (:-) : Type -> Type -> Container
27 | (:-) x y = (!>) x (const y)
32 | CUnit = Unit :- Unit
36 | CNeutral : Container
37 | CNeutral = Unit :- Void
41 | (+) : (c1, c2 : Container) -> Container
42 | (+) c1 c2 = (!>) (c1.req + c2.req) (choice c1.res c2.res)
46 | (⊗) : (c1, c2 : Container) -> Container
47 | (⊗) c1 c2 = (x : c1.req * c2.req) !> c1.res x.π1 * c2.res x.π2
51 | record Ex (cont : Container) (ty : Type) where
54 | ex2 : cont.res ex1 -> ty
59 | record ExEq {a : Container} {b : Type} (c1, c2 : Ex a b) where
61 | pex1 : c1.ex1 === c2.ex1
62 | pex2 : (v : a.res c1.ex1) ->
65 | b2 = c2.ex2 (rewrite__impl a.res (sym pex1) v)
69 | 0 exEqToEq : ExEq c1 c2 -> c1 === c2
70 | exEqToEq {c1 = MkEx x1 x2} {c2 = MkEx y1 y2} (MkExEq x y) =
71 | cong2Dep MkEx x (funExt $
y)