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