-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Generically compare data by their constructors -- -- Utilities for comparing data constructor tags, and TH functions for -- generating comparison definitions @package data-constructors @version 0.1.0.0 module Data.Constructors.EqC class EqC a where eqConstr = on (==) toConstr -- | Compare the outermost constructor for a datatype. Instances should -- satisfy eqConstr (C a) (K b) = True iff C=K eqConstr :: EqC a => a -> a -> Bool -- | Compare the outermost constructor for a datatype. Instances should -- satisfy eqConstr (C a) (K b) = True iff C=K eqConstr :: (EqC a, Data a) => a -> a -> Bool module Data.Constructors.TH class EqC a where eqConstr = on (==) toConstr -- | Compare the outermost constructor for a datatype. Instances should -- satisfy eqConstr (C a) (K b) = True iff C=K eqConstr :: EqC a => a -> a -> Bool -- | Compare the outermost constructor for a datatype. Instances should -- satisfy eqConstr (C a) (K b) = True iff C=K eqConstr :: (EqC a, Data a) => a -> a -> Bool -- | Derive an instance of EqC for any simple type For example, -- deriveEqC ''Either will generate: -- --
--   instance EqC (Either a b) where
--     eqConstr Left{}  Left{}  = True
--     eqConstr Right{} Right{} = True
--     eqConstr _       _       = False
--   
deriveEqC :: Name -> DecsQ