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.Derivation.Common

Description

 
Synopsis

Documentation

data CheckArgsResult Source #

Result of checkArgs for a data type.

Constructors

CheckArgsResult 

checkArgs :: String -> Int -> Name -> Bool -> Int -> Q CheckArgsResult Source #

Check if the number of type parameters is valid for a data type, and return new names for the type variables, split into kept and arg parts.

ctxForVar :: [Type] -> Type -> Kind -> Q (Maybe Pred) Source #

Generate a context for a variable in a GADT.

data EvalModeConfig Source #

Configuration for constraints for evaluation modes tag.

  • EvalModeConstraints specifies a list of constraints for the tag, for example, we may use EvalModeBase and EvalModeBV to specify that the evaluation mode must support both base (boolean and data types) and bit vectors. This should be used when the data type uses bit vectors.
  • EvalModeSpecified specifies a that an evaluation mode tag should be specialized to a specific tag for all the instances.

extraEvalModeConstraint :: Name -> Name -> [(Type, Kind)] -> (Int, EvalModeConfig) -> Q [Pred] Source #

Generate extra constraints for evaluation modes.

extraBitSizeConstraint :: Name -> Name -> [(Type, Kind)] -> Int -> Q [Pred] Source #

Generate extra constraints for bit vectors.

extraFpBitSizeConstraint :: Name -> Name -> [(Type, Kind)] -> (Int, Int) -> Q [Pred] Source #

Generate extra constraints for floating point exponents and significands.

extraExtraMergeableConstraint :: DeriveConfig -> [ConstructorInfo] -> [(Type, Kind)] -> Q [Pred] Source #

Generate extra constraints for Mergeable instances.

extraConstraint :: DeriveConfig -> Name -> Name -> [(Type, Kind)] -> [(Type, Kind)] -> [ConstructorInfo] -> Q [Pred] Source #

Generate extra constraints for a data type.

specializeResult :: [(Int, EvalModeTag)] -> CheckArgsResult -> Q CheckArgsResult Source #

Specialize the evaluation mode tags for the CheckArgsResult.

evalModeSpecializeList :: DeriveConfig -> [(Int, EvalModeTag)] Source #

Get all the evaluation modes to specialize in the DeriveConfig.

isVarUsedInFields :: CheckArgsResult -> Name -> Bool Source #

Check if a variable is used in the fields of a constructor.