commit 727fa06d23cee17763553e8c703bbfcd06a6a6ce
parent 346f45333abdf8571385892aa1547d8202c213f0
Author: Robert Russell <robert@rr3.xyz>
Date: Wed, 9 Sep 2026 21:46:13 -0700
Algebra.Category: remove CatOfEndo in favor of just Dom
Diffstat:
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/src/Lude/Algebra/Category/Core.hs b/src/Lude/Algebra/Category/Core.hs
@@ -15,7 +15,6 @@ module Lude.Algebra.Category.Core (
FunctorialOn,
Endofunctorial,
EndofunctorialOn,
- CatOfEndo,
ObjArg,
preservesObj,
--
@@ -121,9 +120,6 @@ type EndofunctorialOn :: forall {i}. Cat i -> Endo i -> Constraint
class (FunctorialOn p p f) => EndofunctorialOn p f | f -> p
instance (FunctorialOn p p f) => EndofunctorialOn p f
-type CatOfEndo :: forall {i}. Endo i -> Cat i
-type CatOfEndo f = Dom f
-
type ObjArg :: forall {i} {j}. (i -> j) -> Predicate i
type ObjArg f = Obj (Dom f)
diff --git a/src/Lude/Algebra/Category/Monad.hs b/src/Lude/Algebra/Category/Monad.hs
@@ -25,17 +25,17 @@ class (Endofunctorial f) => Monadic (f :: Endo i) where
-- NOTE: We unwrap the natural transformations so we don't have to use
-- nominal Identity and Compose types.
- pure :: forall (a :: i). (ObjArg f a) => CatOfEndo f a (f a)
+ pure :: forall (a :: i). (ObjArg f a) => Dom f a (f a)
- join :: forall (a :: i). (ObjArg f a) => CatOfEndo f (f (f a)) (f a)
+ join :: forall (a :: i). (ObjArg f a) => Dom f (f (f a)) (f a)
join = bind identity \\ f `preservesObj` a
- bind :: forall (a :: i) (b :: i). (ObjArg f b) => CatOfEndo f a (f b) -> CatOfEndo f (f a) (f b)
+ bind :: forall (a :: i) (b :: i). (ObjArg f b) => Dom f a (f b) -> Dom f (f a) (f b)
bind f = join . map f
type MonadicOn :: forall {i}. Cat i -> Endo i -> Constraint
-class (Monadic f, CatOfEndo f ~ p) => MonadicOn p f
-instance (Monadic f, CatOfEndo f ~ p) => MonadicOn p f
+class (Monadic f, Dom f ~ p) => MonadicOn p f
+instance (Monadic f, Dom f ~ p) => MonadicOn p f
--------------------------------------------------------------------------------
-- Haskell