Remove special cases of genpastro
, etc.
The typechecker can almost always infer which tensor product is being used, so there's no reason to have these.
This commit is contained in:
parent
c0de1a7a94
commit
5ba5aa222a
|
@ -144,36 +144,19 @@ ProfunctorAdjunction (GenCopastro ten) (GenCotambara ten) where
|
||||||
procounit (MkCopastro h) = proextract (h id)
|
procounit (MkCopastro h) = proextract (h id)
|
||||||
|
|
||||||
|
|
||||||
export
|
|
||||||
gencopastro : GenCostrong ten q => p :-> q -> GenCopastro ten p :-> q
|
|
||||||
gencopastro f (MkCopastro h) = h f
|
|
||||||
|
|
||||||
export
|
|
||||||
ungencopastro : Tensor ten i => GenCopastro ten p :-> q -> p :-> q
|
|
||||||
ungencopastro f x = f (MkCopastro ($ x))
|
|
||||||
|
|
||||||
|
|
||||||
public export
|
public export
|
||||||
Copastro : (p : Type -> Type -> Type) -> Type -> Type -> Type
|
Copastro : (p : Type -> Type -> Type) -> Type -> Type -> Type
|
||||||
Copastro = GenCopastro Pair
|
Copastro = GenCopastro Pair
|
||||||
|
|
||||||
export
|
|
||||||
copastro : Costrong q => p :-> q -> Copastro p :-> q
|
|
||||||
copastro = gencopastro
|
|
||||||
|
|
||||||
export
|
|
||||||
uncopastro : Copastro p :-> q -> p :-> q
|
|
||||||
uncopastro = ungencopastro
|
|
||||||
|
|
||||||
|
|
||||||
public export
|
public export
|
||||||
CopastroSum : (p : Type -> Type -> Type) -> Type -> Type -> Type
|
CopastroSum : (p : Type -> Type -> Type) -> Type -> Type -> Type
|
||||||
CopastroSum = GenCopastro Either
|
CopastroSum = GenCopastro Either
|
||||||
|
|
||||||
export
|
|
||||||
copastroSum : Cochoice q => p :-> q -> CopastroSum p :-> q
|
|
||||||
copastroSum = gencopastro
|
|
||||||
|
|
||||||
export
|
export
|
||||||
uncopastroSum : CopastroSum p :-> q -> p :-> q
|
copastro : GenCostrong ten q => p :-> q -> GenCopastro ten p :-> q
|
||||||
uncopastroSum = ungencopastro
|
copastro f (MkCopastro h) = h f
|
||||||
|
|
||||||
|
export
|
||||||
|
uncopastro : Tensor ten i => GenCopastro ten p :-> q -> p :-> q
|
||||||
|
uncopastro f x = f (MkCopastro ($ x))
|
||||||
|
|
|
@ -114,39 +114,22 @@ Bifunctor ten => Profunctor p => Functor (GenTambara ten p a) where
|
||||||
map = rmap
|
map = rmap
|
||||||
|
|
||||||
|
|
||||||
export
|
|
||||||
gentambara : GenStrong ten p => p :-> q -> p :-> GenTambara ten q
|
|
||||||
gentambara @{gs} f x = MkTambara $ f $ strongl @{gs} x
|
|
||||||
|
|
||||||
export
|
|
||||||
ungentambara : Tensor ten i => Profunctor q => p :-> GenTambara ten q -> p :-> q
|
|
||||||
ungentambara f x = dimap unitr.rightToLeft unitr.leftToRight $ runTambara $ f x
|
|
||||||
|
|
||||||
|
|
||||||
public export
|
public export
|
||||||
Tambara : (p : Type -> Type -> Type) -> Type -> Type -> Type
|
Tambara : (p : Type -> Type -> Type) -> Type -> Type -> Type
|
||||||
Tambara = GenTambara Pair
|
Tambara = GenTambara Pair
|
||||||
|
|
||||||
export
|
|
||||||
tambara : Strong p => p :-> q -> p :-> Tambara q
|
|
||||||
tambara = gentambara
|
|
||||||
|
|
||||||
export
|
|
||||||
untambara : Profunctor q => p :-> Tambara q -> p :-> q
|
|
||||||
untambara = ungentambara
|
|
||||||
|
|
||||||
|
|
||||||
public export
|
public export
|
||||||
TambaraSum : (p : Type -> Type -> Type) -> Type -> Type -> Type
|
TambaraSum : (p : Type -> Type -> Type) -> Type -> Type -> Type
|
||||||
TambaraSum = GenTambara Either
|
TambaraSum = GenTambara Either
|
||||||
|
|
||||||
export
|
|
||||||
tambaraSum : Choice p => p :-> q -> p :-> TambaraSum q
|
|
||||||
tambaraSum = gentambara
|
|
||||||
|
|
||||||
export
|
export
|
||||||
untambaraSum : Profunctor q => p :-> TambaraSum q -> p :-> q
|
tambara : GenStrong ten p => p :-> q -> p :-> GenTambara ten q
|
||||||
untambaraSum = ungentambara
|
tambara @{gs} f x = MkTambara $ f $ strongl @{gs} x
|
||||||
|
|
||||||
|
export
|
||||||
|
untambara : Tensor ten i => Profunctor q => p :-> GenTambara ten q -> p :-> q
|
||||||
|
untambara f x = dimap unitr.rightToLeft unitr.leftToRight $ runTambara $ f x
|
||||||
|
|
||||||
|
|
||||||
-- Pastro
|
-- Pastro
|
||||||
|
@ -198,36 +181,20 @@ export
|
||||||
r' = mapSnd swap . assoc.rightToLeft . mapFst r . swap
|
r' = mapSnd swap . assoc.rightToLeft . mapFst r . swap
|
||||||
|
|
||||||
|
|
||||||
export
|
|
||||||
genpastro : GenStrong ten q => p :-> q -> GenPastro ten p :-> q
|
|
||||||
genpastro @{gs} f (MkPastro l m r) = dimap r l (strongl @{gs} (f m))
|
|
||||||
|
|
||||||
export
|
|
||||||
ungenpastro : Tensor ten i => GenPastro ten p :-> q -> p :-> q
|
|
||||||
ungenpastro f x = f (MkPastro unitr.leftToRight x unitr.rightToLeft)
|
|
||||||
|
|
||||||
|
|
||||||
public export
|
public export
|
||||||
Pastro : (p : Type -> Type -> Type) -> Type -> Type -> Type
|
Pastro : (p : Type -> Type -> Type) -> Type -> Type -> Type
|
||||||
Pastro = GenPastro Pair
|
Pastro = GenPastro Pair
|
||||||
|
|
||||||
export
|
|
||||||
pastro : Strong q => p :-> q -> Pastro p :-> q
|
|
||||||
pastro = genpastro
|
|
||||||
|
|
||||||
export
|
|
||||||
unpastro : Pastro p :-> q -> p :-> q
|
|
||||||
unpastro = ungenpastro
|
|
||||||
|
|
||||||
|
|
||||||
public export
|
public export
|
||||||
PastroSum : (p : Type -> Type -> Type) -> Type -> Type -> Type
|
PastroSum : (p : Type -> Type -> Type) -> Type -> Type -> Type
|
||||||
PastroSum = GenPastro Either
|
PastroSum = GenPastro Either
|
||||||
|
|
||||||
export
|
|
||||||
pastroSum : Choice q => p :-> q -> PastroSum p :-> q
|
|
||||||
pastroSum = genpastro
|
|
||||||
|
|
||||||
export
|
export
|
||||||
unpastroSum : PastroSum p :-> q -> p :-> q
|
pastro : GenStrong ten q => p :-> q -> GenPastro ten p :-> q
|
||||||
unpastroSum = ungenpastro
|
pastro @{gs} f (MkPastro l m r) = dimap r l (strongl @{gs} (f m))
|
||||||
|
|
||||||
|
export
|
||||||
|
unpastro : Tensor ten i => GenPastro ten p :-> q -> p :-> q
|
||||||
|
unpastro f x = f (MkPastro unitr.leftToRight x unitr.rightToLeft)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue