[Haskell-cafe] Turning Monoids into Categories

David Feuer david.feuer at gmail.com
Mon Jun 22 16:51:48 UTC 2015

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)

David Feuer

More information about the Haskell-Cafe mailing list