Safe Haskell | Safe-Infered |
---|
Subsitute one type for another in Template Haskell Dec's, Con's and Type's. | Warning! | There are a few known issues. The types in cxt's are not subsistuted. | Additionally, the Dec's type variables are regenerated after subistution | and all explicitly kinded type variables are converted to implicitly kinded type | variables.
- sub_types_dec :: [Type] -> Dec -> Result Dec
- sub_type_dec :: Type -> Type -> Dec -> Dec
- sub_type_con :: Type -> Type -> Con -> Con
- sub_type :: Type -> Type -> Type -> Type
- has_type :: Type -> Type -> Bool
- get_cons :: Dec -> [Con]
- get_con_types :: Con -> [Type]
- update_ty_vars :: Dec -> Dec
- type Result a = Either String a
Documentation
sub_types_dec :: [Type] -> Dec -> Result DecSource
Create a new data declaration where the type variables have been subsituted with the | supplied types. Returns an error if the more types the types are provided.
sub_type_dec :: Type -> Type -> Dec -> DecSource
Substitute the a new type for an existing type in all the constructors in a Dec. | If the type to replace is missing, the function does nothing.
sub_type_con :: Type -> Type -> Con -> ConSource
Substitute the new type for the old type in the constructor
sub_type :: Type -> Type -> Type -> TypeSource
Substitute the new type for the old type in the type transform is from Uniplate
get_con_types :: Con -> [Type]Source
update_ty_vars :: Dec -> DecSource