@@ -10,8 +10,8 @@ module Data.Container.Combinator where
1010
1111open import Level using (Level; _⊔_; lower)
1212open import Data.Empty.Polymorphic using (⊥; ⊥-elim)
13- open import Data.Product.Base as P using (_,_; <_,_>; proj₁; proj₂; ∃)
14- open import Data.Sum.Base as S using ([_,_]′)
13+ open import Data.Product.Base as Product using (_,_; <_,_>; proj₁; proj₂; ∃)
14+ open import Data.Sum.Base as Sum using ([_,_]′)
1515open import Data.Unit.Polymorphic.Base using (⊤)
1616import Function.Base as F
1717
@@ -58,25 +58,25 @@ module _ {s₁ s₂ p₁ p₂} (C₁ : Container s₁ p₁) (C₂ : Container s
5858 _∘_ .Position = ◇ C₁ (Position C₂)
5959
6060 to-∘ : ∀ {a} {A : Set a} → ⟦ C₁ ⟧ (⟦ C₂ ⟧ A) → ⟦ _∘_ ⟧ A
61- to-∘ (s , f) = ((s , proj₁ F.∘ f) , P .uncurry (proj₂ F.∘ f) F.∘′ ◇.proof)
61+ to-∘ (s , f) = ((s , proj₁ F.∘ f) , Product .uncurry (proj₂ F.∘ f) F.∘′ ◇.proof)
6262
6363 from-∘ : ∀ {a} {A : Set a} → ⟦ _∘_ ⟧ A → ⟦ C₁ ⟧ (⟦ C₂ ⟧ A)
64- from-∘ ((s , f) , g) = (s , < f , P .curry (g F.∘′ any) >)
64+ from-∘ ((s , f) , g) = (s , < f , Product .curry (g F.∘′ any) >)
6565
6666-- Product. (Note that, up to isomorphism, this is a special case of
6767-- indexed product.)
6868
6969 infixr 2 _×_
7070
7171 _×_ : Container (s₁ ⊔ s₂) (p₁ ⊔ p₂)
72- _×_ .Shape = Shape C₁ P .× Shape C₂
73- _×_ .Position = P .uncurry λ s₁ s₂ → (Position C₁ s₁) S .⊎ (Position C₂ s₂)
72+ _×_ .Shape = Shape C₁ Product .× Shape C₂
73+ _×_ .Position = Product .uncurry λ s₁ s₂ → (Position C₁ s₁) Sum .⊎ (Position C₂ s₂)
7474
75- to-× : ∀ {a} {A : Set a} → ⟦ C₁ ⟧ A P .× ⟦ C₂ ⟧ A → ⟦ _×_ ⟧ A
75+ to-× : ∀ {a} {A : Set a} → ⟦ C₁ ⟧ A Product .× ⟦ C₂ ⟧ A → ⟦ _×_ ⟧ A
7676 to-× ((s₁ , f₁) , (s₂ , f₂)) = ((s₁ , s₂) , [ f₁ , f₂ ]′)
7777
78- from-× : ∀ {a} {A : Set a} → ⟦ _×_ ⟧ A → ⟦ C₁ ⟧ A P .× ⟦ C₂ ⟧ A
79- from-× ((s₁ , s₂) , f) = ((s₁ , f F.∘ S .inj₁) , (s₂ , f F.∘ S .inj₂))
78+ from-× : ∀ {a} {A : Set a} → ⟦ _×_ ⟧ A → ⟦ C₁ ⟧ A Product .× ⟦ C₂ ⟧ A
79+ from-× ((s₁ , s₂) , f) = ((s₁ , f F.∘ Sum .inj₁) , (s₂ , f F.∘ Sum .inj₂))
8080
8181-- Indexed product.
8282
@@ -87,7 +87,7 @@ module _ {i s p} (I : Set i) (Cᵢ : I → Container s p) where
8787 Π .Position = λ s → ∃ λ i → Position (Cᵢ i) (s i)
8888
8989 to-Π : ∀ {a} {A : Set a} → (∀ i → ⟦ Cᵢ i ⟧ A) → ⟦ Π ⟧ A
90- to-Π f = (proj₁ F.∘ f , P .uncurry (proj₂ F.∘ f))
90+ to-Π f = (proj₁ F.∘ f , Product .uncurry (proj₂ F.∘ f))
9191
9292 from-Π : ∀ {a} {A : Set a} → ⟦ Π ⟧ A → ∀ i → ⟦ Cᵢ i ⟧ A
9393 from-Π (s , f) = λ i → (s i , λ p → f (i , p))
@@ -108,15 +108,15 @@ module _ {s₁ s₂ p} (C₁ : Container s₁ p) (C₂ : Container s₂ p) where
108108 infixr 1 _⊎_
109109
110110 _⊎_ : Container (s₁ ⊔ s₂) p
111- _⊎_ .Shape = (Shape C₁ S .⊎ Shape C₂)
111+ _⊎_ .Shape = (Shape C₁ Sum .⊎ Shape C₂)
112112 _⊎_ .Position = [ Position C₁ , Position C₂ ]′
113113
114- to-⊎ : ∀ {a} {A : Set a} → ⟦ C₁ ⟧ A S .⊎ ⟦ C₂ ⟧ A → ⟦ _⊎_ ⟧ A
115- to-⊎ = [ P .map S .inj₁ F.id , P .map S .inj₂ F.id ]′
114+ to-⊎ : ∀ {a} {A : Set a} → ⟦ C₁ ⟧ A Sum .⊎ ⟦ C₂ ⟧ A → ⟦ _⊎_ ⟧ A
115+ to-⊎ = [ Product .map Sum .inj₁ F.id , Product .map Sum .inj₂ F.id ]′
116116
117- from-⊎ : ∀ {a} {A : Set a} → ⟦ _⊎_ ⟧ A → ⟦ C₁ ⟧ A S .⊎ ⟦ C₂ ⟧ A
118- from-⊎ (S .inj₁ s₁ , f) = S .inj₁ (s₁ , f)
119- from-⊎ (S .inj₂ s₂ , f) = S .inj₂ (s₂ , f)
117+ from-⊎ : ∀ {a} {A : Set a} → ⟦ _⊎_ ⟧ A → ⟦ C₁ ⟧ A Sum .⊎ ⟦ C₂ ⟧ A
118+ from-⊎ (Sum .inj₁ s₁ , f) = Sum .inj₁ (s₁ , f)
119+ from-⊎ (Sum .inj₂ s₂ , f) = Sum .inj₂ (s₂ , f)
120120
121121-- Indexed sum.
122122
0 commit comments