\begin{code}
open import Prelude
open import Algebra
open import Cubical.Foundations.Everything using (isSet)
module Data.Set.Hom {ā} {š : Type ā} (latt : Semilattice š) (sIsSet : isSet š) where
open import Data.Set.Definition
open import Data.Set.Eliminators renaming (ā¦_ā§ to Ļā¦_ā§)
open Semilattice latt
module _ {A : Type a} where
\end{code}
%<*hom-ty>
\begin{code}
  ā¦_ā§ : (A ā š) ā š¦ A ā š
\end{code}
%</hom-ty>
\begin{code}
  ⦠h ā§ = Ļ⦠alg ā§
    where
    alg : Ļ A š
    alg .fst ā
 = ε
    alg .fst (x ā· xs ⨠PāØxsā© ā©) = h x ā PāØxsā©
    alg .snd .c-trunc _ = sIsSet
    alg .snd .c-com x y _ xs = sym (assoc (h x) _ _) ; cong (_ā xs) (comm (h x) _) ; assoc (h y) _ _
    alg .snd .c-dup x _ xs = sym (assoc (h x) _ _) ; cong (_ā xs) (idem (h x))
\end{code}