@@ -34,10 +34,25 @@ instance
3434 Bifunctor-Σ .bimap′ = ×.map
3535
3636-- ** non-dependent version
37- record Bifunctor (F : Type a → Type b → Type (a ⊔ b)) : Type (lsuc (a ⊔ b)) where
37+ Type[_∣_↝_] : ∀ ℓ ℓ′ ℓ″ → Type _
38+ Type[ ℓ ∣ ℓ′ ↝ ℓ″ ] = Type ℓ → Type ℓ′ → Type ℓ″
39+
40+ Level↑² = Level → Level → Level
41+
42+ Type↑² : Level↑² → Typeω
43+ Type↑² ℓ↑² = ∀ {ℓ ℓ′} → Type[ ℓ ∣ ℓ′ ↝ ℓ↑² ℓ ℓ′ ]
44+
45+ variable
46+ ℓ↑² : Level → Level → Level
47+
48+ record Bifunctor (F : Type↑² ℓ↑²) : Typeω where
3849 field
3950 bimap : ∀ {A A′ : Type a} {B B′ : Type b} → (A → A′) → (B → B′) → F A B → F A′ B′
4051
52+ -- record Bifunctor {a}{b} (F : Type a → Type b → Type (a ⊔ b)) : Type (lsuc (a ⊔ b)) where
53+ -- field
54+ -- bimap : ∀ {A A′ : Type a} {B B′ : Type b} → (A → A′) → (B → B′) → F A B → F A′ B′
55+
4156 map₁ : ∀ {A A′ : Type a} {B : Type b} → (A → A′) → F A B → F A′ B
4257 map₁ f = bimap f id
4358 _<$>₁_ = map₁
@@ -50,16 +65,15 @@ record Bifunctor (F : Type a → Type b → Type (a ⊔ b)) : Type (lsuc (a ⊔
5065
5166open Bifunctor ⦃...⦄ public
5267
53- map₁₂ : ∀ {F : Type a → Type a → Type a} {A B : Type a}
54- → ⦃ Bifunctor F ⦄
55- → (A → B) → F A A → F B B
68+ map₁₂ : ∀ {F : Type↑² ℓ↑²} ⦃ _ : Bifunctor F ⦄ →
69+ (∀ {a} {A B : Type a} → (A → B) → F A A → F B B)
5670map₁₂ f = bimap f f
5771_<$>₁₂_ = map₁₂
5872infixl 4 _<$>₁₂_
5973
6074instance
61- Bifunctor-× : Bifunctor {a}{b} _×_
75+ Bifunctor-× : Bifunctor _×_
6276 Bifunctor-× .bimap f g = ×.map f g
6377
64- Bifunctor-⊎ : Bifunctor {a}{b} _⊎_
78+ Bifunctor-⊎ : Bifunctor _⊎_
6579 Bifunctor-⊎ .bimap = ⊎.map
0 commit comments