grisette-0.11.0.0: Symbolic evaluation as a library
Copyright(c) Sirui Lu 2024
LicenseBSD-3-Clause (see the LICENSE file)
Maintainersiruilu@cs.washington.edu
StabilityExperimental
PortabilityGHC only
Safe HaskellNone
LanguageHaskell2010

Grisette.Internal.TH.Util

Description

 
Synopsis

Documentation

tvIsMode :: TyVarBndr_ flag -> Bool Source #

Check if a type variable is of kind EvalModeTag.

tvIsNat :: TyVarBndr_ flag -> Bool Source #

Check if a type variable is of kind Nat.

tvIsStar :: TyVarBndr_ flag -> Bool Source #

Check if a type variable is of kind Type.

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.

dropLastTypeParam :: Type -> Q Type Source #

Drop the last instantiated type parameter of a type.

dropNTypeParam :: Int -> Type -> Q Type Source #

Drop the last N instantiated type parameters of a type.

classParamKinds :: Name -> Q [Kind] Source #

Get the kinds of the type parameters of a class.

allSameKind :: [TyVarBndrUnit] -> Bool Source #

Check if all type variables have the same kind.

classNumParam :: Name -> Q Int Source #

Get the number of type parameters of a class.

kindNumParam :: Kind -> Q Int Source #

Get the number of type parameters of a kind.

concatPreds :: Maybe [Pred] -> Maybe [Pred] -> Maybe [Pred] Source #

Concatenate two 'Maybe [Pred]'.

putHaddock :: Name -> String -> Q () Source #

Put a haddock comment on a declaration.

allUsedNamesMaybe :: Maybe Exp -> Set Name Source #

Get the names used in an expression.

allUsedNames :: Exp -> Set Name Source #

Get the names used in an expression.

isNonUnitTupleString :: String -> Bool Source #

Check if a string is the data constructor name of a non-unit tuple.

isNonUnitTuple :: Name -> Bool Source #

Check if a name is the data constructor name of a non-unit tuple.

integerE :: Integral a => a -> Q Exp Source #

Convert an integer to an Exp.

mangleName :: Name -> String Source #

Mangle a name string to contain only alphanumeric characters and underscores.

dataTypeHasExistential :: Name -> Q Bool Source #

Check if a data type has existential variables in constructors.