module Calf.Computation.Power where
open import Calf.Value
open import Calf.Value.Pi
open import Calf.Computation
Ξ αΆ : (X : π±) β (X β π) β π
Ξ αΆ X A .U = (x : X) β U (A x)
Ξ αΆ X A .is-set = isSetΞ Ξ» x β A x .is-set
Ξ αΆ X A .charge c e x = A x .charge c (e x)
Ξ αΆ X A .charge/0 {e} = funExt Ξ» x β A x .charge/0 {e x}
Ξ αΆ X A .charge/+ {e} {cβ} {cβ} = funExt Ξ» x β A x .charge/+ {e x} {cβ} {cβ}
syntax Ξ αΆ X (Ξ» x β A) = [ x β X ] β A
infixr 2 _β_
_β_ : π± β π β π
X β A = [ _ β X ] β A
opaque
powlam : (X β A βΈ B) β A βΈ (X β B)
powlam e .U a x = e x .U a
powlam e .charge c a = funExt Ξ» x β e x .charge c a
powapp : A βΈ (X β B) β X β A βΈ B
powapp e x .U a = e .U a x
powapp e x .charge c a = cong (_$ x) (e .charge c a)