Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure Felix.Instances.Function.Lift is typechecked #13

Merged
merged 2 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Felix/All.agda
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ import Felix.Construct.Comma
import Felix.Construct.Arrow

import Felix.Instances.Function
import Felix.Instances.Function.Lift
import Felix.Instances.Identity
24 changes: 15 additions & 9 deletions src/Felix/Instances/Function/Lift.agda
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,32 @@ open import Level
module Felix.Instances.Function.Lift (a b : Level) where

open Lift
open import Data.Product using (_,_)
open import Data.Product using (_,_; uncurry)
open import Function using (_∘_)

open import Felix.Homomorphism hiding (refl)
open import Felix.Homomorphism
open import Felix.Object

private module F {ℓ} where open import Felix.Instances.Function ℓ public
open F
import Felix.Instances.Function
open module F {ℓ} = Felix.Instances.Function ℓ
conal marked this conversation as resolved.
Show resolved Hide resolved

private
variable
A : Set a

lift₀ : ⦃ _ : Products (Set (a ⊔ b)) ⦄ → A → (⊤ F.⇾ Lift b A)
lift₀′ : A → Lift b A
lift₀′ = lift

lift₀ : A → (⊤ ⇾ Lift b A)
lift₀ n tt = lift n

lift₁ : (A F.⇾ A) → (Lift b A F.⇾ Lift b A)
lift₁ : (A ⇾ A) → (Lift b A ⇾ Lift b A)
lift₁ f (lift a) = lift (f a)

lift₂ : (A F.⇾ A F.⇾ A) → (Lift b A × Lift b A F.⇾ Lift b A)
lift₂ f (lift a , lift b) = lift (f a b)
lift₂′ : (A ⇾ A ⇾ A) → (Lift b A ⇾ Lift b A ⇾ Lift b A)
lift₂′ f (lift a) (lift b) = lift (f a b)

lift₂ : (A ⇾ A ⇾ A) → (Lift b A × Lift b A ⇾ Lift b A)
lift₂ = uncurry ∘ lift₂′

module function-lift-instances where instance

Expand Down