module Util.Private where

import Prelude hiding ((.), id)
import Control.Category

newtype Endo s a = Endo { Endo s a -> s a a
appEndo :: s a a }
instance Category s => Semigroup (Endo s a) where Endo f :: s a a
f <> :: Endo s a -> Endo s a -> Endo s a
<> Endo g :: s a a
g = s a a -> Endo s a
forall k (s :: k -> k -> *) (a :: k). s a a -> Endo s a
Endo (s a a
f s a a -> s a a -> s a a
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. s a a
g)
instance Category s => Monoid (Endo s a) where mempty :: Endo s a
mempty = s a a -> Endo s a
forall k (s :: k -> k -> *) (a :: k). s a a -> Endo s a
Endo s a a
forall k (cat :: k -> k -> *) (a :: k). Category cat => cat a a
id