-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A template haskell deriver to create Control.Newtype instances. -- -- Provides a template haskell based mechanism for deriving instances of -- djahandarie's Control.Newtype class. @package newtype-th @version 0.2 -- | This module provides a template Haskell based mechanism for deriving -- instances of the Newtype class, defined in Control.Newtype. Example -- usage: -- --
-- newtype CartesianList a = CartesianList [a] -- $(mkNewTypes [''CartesianList]) -- -- instance Monoid (CartesianList a) where -- mempty = pack [[]] -- a `mappend` b = pack [x ++ y | x <- unpack a, y <- unpack b] ---- --
-- *Main> print $ underF CartesianList (\xs -> [fold xs]) ([[[4],[5],[6]], [[1],[2]], [[0]]]) -- [[[4,1,0],[4,2,0],[5,1,0],[5,2,0],[6,1,0],[6,2,0]]] --module Control.Newtype.TH -- | Derive instances of Newtype, specified as a list of references to -- newtypes. mkNewTypes :: [Name] -> Q [Dec]