[Haskell-cafe] Turning Monoids into Categories

Patrick Chilton chpatrick at gmail.com
Mon Jun 22 17:13:28 UTC 2015


Looks like Semi from semigroupoids:
https://hackage.haskell.org/package/semigroupoids-5.0.0.2/docs/Data-Semigroupoid.html#t:Semi

On Mon, Jun 22, 2015 at 5:51 PM, David Feuer <david.feuer at gmail.com> 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 at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150622/667f8297/attachment.html>


More information about the Haskell-Cafe mailing list