hs-- Endo :: (a -> a) -> Endo a newtype Endo a = Endo { appEndo :: a -> a }
tstype Endo<T> = (x: T) => T;
hsinstance Semigroup a => Semigroup (Endo a) where Endo f <> Endo g = Endo (f . g)
hsinstance Monoid (Endo a) where mempty = Endo id