-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A Groupoid class -- -- A groupoid is structure consisting of a set of elements (here a -- Haskell type) and a binary operator (in present case the function -- gappend). -- -- It is comparable to the Monoid typeclass, but there is no obligation -- that the set supports a neutral element (mempty in Data.Monoid). -- -- In geometry, bounding boxes (represented as two points - bottom-left -- corner and top-right corner) give an example where a groupoid may be -- more satisfying than a monoid. The union operation on bounding boxes -- is essential to track the extent of shapes after their -- superimposition. To fit bounding box union into the Monoid typeclass -- one can do a clever trick representing mempty with the bottom-left -- corner at positive infinity and the top-right corner at negative -- infinity, the standard implementation of union which uses min and max -- will still proceed to identify the extreme corners correctly. This is -- nice enough if the bounding box coordinates are represented by -- Doubles, but a problem if they are Ints (say representing grid -- coordinates) - one might decide it is better simply to consider -- concrete bounding boxes and not their empty/infinite cousins. @package groupoid @version 0.1.0 -- | Groupoid - a set with a binary operator, more general than monoid as -- there is no obligation to have a neutral element (i.e mempty in -- Data.Monoid). module Data.Groupoid class Groupoid a gappend :: Groupoid a => a -> a -> a gconcat :: Groupoid a => [a] -> a instance Groupoid (Last a) instance Groupoid (First a) instance Groupoid a => Groupoid (Maybe a) instance Num a => Groupoid (Product a) instance Num a => Groupoid (Sum a) instance Groupoid Any instance Groupoid All instance Groupoid (Endo a) instance Groupoid a => Groupoid (Dual a) instance Groupoid Ordering instance (Groupoid a, Groupoid b, Groupoid c, Groupoid d, Groupoid e) => Groupoid (a, b, c, d, e) instance (Groupoid a, Groupoid b, Groupoid c, Groupoid d) => Groupoid (a, b, c, d) instance (Groupoid a, Groupoid b, Groupoid c) => Groupoid (a, b, c) instance (Groupoid a, Groupoid b) => Groupoid (a, b) instance Groupoid () instance Groupoid (a -> a) instance Groupoid [a]