module Data.Magma where import Control.Applicative -- | A 'Magma' is a set with a closed binary operation. class Magma m where op :: m -> m -> m instance Magma b => Magma (a -> b) where op = map2 op