Turning Monoids into Categories

Is there a newtype defined in some normal sort of place for turning Monoids into Categories? I'm looking for something like this: newtype ConstConst m a b = ConstConst m instance Monoid m => Category (ConstConst m) where id = ConstConst mempty ConstConst x . ConstConst y = ConstConst (x <> y) Thanks, David Feuer

Looks like Semi from semigroupoids:
https://hackage.haskell.org/package/semigroupoids-5.0.0.2/docs/Data-Semigrou...
On Mon, Jun 22, 2015 at 5:51 PM, David Feuer
Is there a newtype defined in some normal sort of place for turning Monoids into Categories? I'm looking for something like this:
newtype ConstConst m a b = ConstConst m
instance Monoid m => Category (ConstConst m) where id = ConstConst mempty ConstConst x . ConstConst y = ConstConst (x <> y)
Thanks, David Feuer _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe

Thanks. That looks like the right thing. It's kind of a strange name
for it though, without the context. Basically,
Semi m = Constant . Constant m
I wonder if something similar by a different name might fit in transformers.
On Mon, Jun 22, 2015 at 1:13 PM, Patrick Chilton
Looks like Semi from semigroupoids: https://hackage.haskell.org/package/semigroupoids-5.0.0.2/docs/Data-Semigrou...
On Mon, Jun 22, 2015 at 5:51 PM, David Feuer
wrote: Is there a newtype defined in some normal sort of place for turning Monoids into Categories? I'm looking for something like this:
newtype ConstConst m a b = ConstConst m
instance Monoid m => Category (ConstConst m) where id = ConstConst mempty ConstConst x . ConstConst y = ConstConst (x <> y)
Thanks, David Feuer _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
participants (2)
-
David Feuer
-
Patrick Chilton