Copyright | (c) Sirui Lu 2024 |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | siruilu@cs.washington.edu |
Stability | Experimental |
Portability | GHC only |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Grisette.Internal.TH.Util
Description
Synopsis
- occName :: Name -> String
- constructorInfoToType :: DatatypeInfo -> ConstructorInfo -> Q Type
- tvIsMode :: TyVarBndr_ flag -> Bool
- tvIsNat :: TyVarBndr_ flag -> Bool
- tvIsStar :: TyVarBndr_ flag -> Bool
- tvIsStarToStar :: TyVarBndr_ flag -> Bool
- substDataType :: DatatypeInfo -> Map Name Type -> DatatypeInfo
- reifyDatatypeWithFreshNames :: Name -> Q DatatypeInfo
- singleParamClassParamKind :: Name -> Q Kind
- binaryClassParamKind :: Name -> Q Kind
- getTypeWithMaybeSubst :: TyVarBndrUnit -> Maybe Type -> Q Type
- dropLastTypeParam :: Type -> Q Type
- dropNTypeParam :: Int -> Type -> Q Type
- classParamKinds :: Name -> Q [Kind]
- allSameKind :: [TyVarBndrUnit] -> Bool
- classNumParam :: Name -> Q Int
- kindNumParam :: Kind -> Q Int
- concatPreds :: Maybe [Pred] -> Maybe [Pred] -> Maybe [Pred]
- putHaddock :: Name -> String -> Q ()
Documentation
constructorInfoToType :: DatatypeInfo -> ConstructorInfo -> Q Type Source #
Convert a ConstructorInfo
to a Type
of the constructor.
tvIsMode :: TyVarBndr_ flag -> Bool Source #
Check if a type variable is of kind EvalModeTag
.
tvIsStarToStar :: TyVarBndr_ flag -> Bool Source #
Check if a type variable is of kind 'Data.Kind.Type -> Data.Kind.Type'.
substDataType :: DatatypeInfo -> Map Name Type -> DatatypeInfo Source #
Substitute the type variables in a DatatypeInfo
with the given
substitution map.
reifyDatatypeWithFreshNames :: Name -> Q DatatypeInfo Source #
Reify a datatype with fresh type variable names.
singleParamClassParamKind :: Name -> Q Kind Source #
Get the kind of the single type parameter of a class.
binaryClassParamKind :: Name -> Q Kind Source #
Get the kind of the binary type parameter of a class.
getTypeWithMaybeSubst :: TyVarBndrUnit -> Maybe Type -> Q Type Source #
Get a type with a possible substitution.
dropNTypeParam :: Int -> Type -> Q Type Source #
Drop the last N instantiated type parameters of a type.
allSameKind :: [TyVarBndrUnit] -> Bool Source #
Check if all type variables have the same kind.