Safe Haskell | None |
---|
- expand_and_specialize :: Name -> Name -> Q [Dec]
- expand_and_specialize_syns :: Name -> Name -> Q [Dec]
- expand_and_specialize' :: Maker -> DecRenamer -> ConstrRenamer -> Name -> Name -> Q [Dec]
- newtype ConstructorName = ConstructorName {}
- newtype TypeName = TypeName {
- runTypeName :: Name
- type DecRenamer = [Type] -> TypeName -> Result TypeName
- type ConstrRenamer = [Type] -> Con -> Con
- mk_new_dec_name :: [Type] -> TypeName -> Result TypeName
- 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])
- type Result a = Either String a
Main Interface
expand_and_specialize :: Name -> Name -> Q [Dec]Source
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' :: Maker -> DecRenamer -> ConstrRenamer -> Name -> Name -> Q [Dec]Source
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.
Helper Types
newtype ConstructorName Source
Renamer Interface
type ConstrRenamer = [Type] -> Con -> ConSource
Stock Renamers
id_constr_renamer :: [Type] -> Con -> ConSource
Default Con renamer
Utils ... Pretend these are not here
sub_dec_and_rename :: ConstrRenamer -> Dec -> [Type] -> Result DecSource
create_dec_from_type :: (Functor m, Monad m, MonadState [Dec] m, MonadReader Config m, MonadError String m) => DecRenamer -> ConstrRenamer -> Type -> m TypeSource
get_con_vars :: Con -> [Type]Source
get_ty_vars :: Dec -> [TyVarBndr]Source
concat_type_names :: [Type] -> StringSource
run_state' :: ErrorStateT e [a1] r m a -> r -> m (Either e a, [a1])Source