| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Language.Haskell.Tools.Rewrite.Create.Types
Description
Generation of type-level AST fragments for refactorings.
The bindings defined here create a the annotated version of the AST constructor with the same name.
For example, mkTyForall creates the annotated version of the TyForall AST constructor.
- mkForallType :: [TyVar] -> Type -> Type
- mkTypeVar' :: Name -> TyVar
- mkCtxType :: Context -> Type -> Type
- mkFunctionType :: Type -> Type -> Type
- mkTupleType :: [Type] -> Type
- mkUnboxedTupleType :: [Type] -> Type
- mkListType :: Type -> Type
- mkParArrayType :: Type -> Type
- mkTypeApp :: Type -> Type -> Type
- mkInfixTypeApp :: Type -> Operator -> Type -> Type
- mkParenType :: Type -> Type
- mkTypeVar :: Name -> TyVar
- mkKindedTypeVar :: Name -> Kind -> TyVar
- mkVarType :: Name -> Type
- mkKindedType :: Type -> Kind -> Type
- mkBangType :: Type -> Type
- mkLazyType :: Type -> Type
- mkUnpackType :: Type -> Type
- mkNoUnpackType :: Type -> Type
- mkWildcardType :: Type
- mkNamedWildcardType :: Name -> Type
- mkSpliceType :: Splice -> Type
- mkQuasiQuoteType :: QuasiQuote -> Type
- mkPromotedIntType :: Integer -> Type
- mkPromotedStringType :: String -> Type
- mkPromotedConType :: Name -> Type
- mkPromotedListType :: [Type] -> Type
- mkPromotedTupleType :: [Type] -> Type
- mkPromotedUnitType :: Type
- mkContext :: Assertion -> Context
- mkClassAssert :: Name -> [Type] -> Assertion
- mkInfixAssert :: Type -> Operator -> Type -> Assertion
- mkImplicitAssert :: Name -> Type -> Assertion
- mkTupleAssertion :: [Assertion] -> Assertion
Generation of types
mkTypeVar' :: Name -> TyVar Source #
Simplified creation of type variables
mkTupleType :: [Type] -> Type Source #
Tuple types ( (a,b) )
mkUnboxedTupleType :: [Type] -> Type Source #
Unboxed tuple types ( (#a,b#) )
mkListType :: Type -> Type Source #
List type with special syntax ( [a] )
mkParArrayType :: Type -> Type Source #
Parallel array type ( [:a:] )
mkParenType :: Type -> Type Source #
Type surrounded by parentheses ( (T a) )
mkKindedTypeVar :: Name -> Kind -> TyVar Source #
Creates a type variable with kind specification ( t :: * )
mkBangType :: Type -> Type Source #
Strict type marked with !.
mkLazyType :: Type -> Type Source #
Lazy type marked with ~. (Should only be used if Strict or StrictData language extension is used)
mkUnpackType :: Type -> Type Source #
Strict type marked with UNPACK pragma. (Usually contains the bang mark.)
mkNoUnpackType :: Type -> Type Source #
Strict type marked with UNPACK pragma. (Usually contains the bang mark.)
mkWildcardType :: Type Source #
A wildcard type ( _ ) with -XPartialTypeSignatures
mkNamedWildcardType :: Name -> Type Source #
A named wildcard type ( _t ) with -XPartialTypeSignatures
mkSpliceType :: Splice -> Type Source #
A Template Haskell splice type ( $(genType) ).
mkQuasiQuoteType :: QuasiQuote -> Type Source #
A Template Haskell quasi-quote type ( [quoter| ... ] ).
mkPromotedIntType :: Integer -> Type Source #
Numeric value promoted to the kind level.
mkPromotedStringType :: String -> Type Source #
String value promoted to the kind level.
mkPromotedConType :: Name -> Type Source #
A data constructor value promoted to the kind level.
mkPromotedListType :: [Type] -> Type Source #
A list of elements as a kind.
mkPromotedTupleType :: [Type] -> Type Source #
A tuple of elements as a kind.
mkPromotedUnitType :: Type Source #
Kind of the unit value ().
Generation of contexts
Generation of assertions
mkInfixAssert :: Type -> Operator -> Type -> Assertion Source #
Infix class assertion, also contains type equations ( a ~ X y )
mkImplicitAssert :: Name -> Type -> Assertion Source #
Creates an assertion for implicit parameter binding ( ?cmp :: a -> a -> Bool )
mkTupleAssertion :: [Assertion] -> Assertion Source #
Creates a list of assertions ( (Eq a, Show a) )