module Data.Semigroup
    ( module Data.Magma
    , Semigroup
    , cycle
    ) where

import Data.Magma

-- | A 'Semigroup' is an associative 'Magma': @(x+y)+z = x+(y+z)@
class Magma s => Semigroup s where

instance Semigroup b => Semigroup (a -> b)

cycle :: Semigroup s => s -> s
cycle xs = let xs' = xs `op` xs' in xs'
