-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Create specialized types from polymorphic ones using TH -- -- Very Alpha. Minimal Testing. @package specialize-th @version 0.0.0.8 module Language.Haskell.TH.Specialize -- | Expand all the type syn's and create specialize types for any -- polymorphic types. All of the new specialized declarations are -- returned, along with the original dec with subbed types and a new -- name. The first Name is the name of the Dec to create specialize -- instances for. The second Name, is the new name for the Dec. use -- mk_new_dec_name for the Dec renaming and id_constr_renamer for the -- constructor renaming. expand_and_specialize :: Name -> Name -> Q [Dec] expand_and_specialize_syns :: Name -> Name -> Q [Dec] -- | Expand all the type syn's and create specialize types for any -- polymorphic types. All of the new specialized declarations are -- returned, along with the original dec with subbed types and a new -- name. The first Name is the name of the Dec to create specialize -- instances for. The second Name, is the new name for the Dec. The -- DecRenamer and ConstrRenamer are used to rename Dec's and Con's -- respectively. expand_and_specialize' :: Maker -> DecRenamer -> ConstrRenamer -> Name -> Name -> Q [Dec] newtype ConstructorName ConstructorName :: Name -> ConstructorName runConstructorName :: ConstructorName -> Name newtype TypeName TypeName :: Name -> TypeName runTypeName :: TypeName -> Name type DecRenamer = [Type] -> TypeName -> Result TypeName type ConstrRenamer = [Type] -> Con -> Con -- | Default Dec renamer mk_new_dec_name :: [Type] -> TypeName -> Result TypeName -- | Default Con renamer id_constr_renamer :: [Type] -> Con -> Con sub_dec_and_rename :: ConstrRenamer -> Dec -> [Type] -> Result Dec create_dec_from_type :: (Functor m, Monad m, MonadState [Dec] m, MonadReader Config m, MonadError String m) => DecRenamer -> ConstrRenamer -> Type -> m Type find_con :: ConstructorName -> Dec -> Result Con get_con_vars :: Con -> [Type] get_ty_vars :: Dec -> [TyVarBndr] concat_type_names :: [Type] -> String rename_dec :: [Type] -> Dec -> Result Dec run_state' :: ErrorStateT e [a1] r m a -> r -> m (Either e a, [a1]) -- | A result for partial functions type Result a = Either String a instance Show ConstructorName instance Eq ConstructorName instance Show TypeName instance Eq TypeName instance (Monad m, Error e) => Monad (ErrorStateT e s r m) instance (Monad m, Error e) => MonadState s (ErrorStateT e s r m) instance (Monad m, Error e) => MonadError e (ErrorStateT e s r m) instance Functor m => Functor (ErrorStateT e s r m) instance (Monad m, Error e) => MonadPlus (ErrorStateT e s r m) instance (Monad m, Error e) => MonadReader r (ErrorStateT e s r m) instance MonadTrans (ErrorStateT String Universe Config) instance Newtype TypeName Name instance Newtype ConstructorName Name