grisette-0.12.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.Derive

Description

 
Synopsis

Documentation

derive :: [Name] -> [Name] -> Q [Dec] Source #

Derive the specified classes for a data type with the given name.

See deriveWith for more details.

deriveWith :: DeriveConfig -> [Name] -> [Name] -> Q [Dec] Source #

Derive the specified classes for a data type with the given name.

Support the following classes for both vanilla data types and GADTs.

Note that the following type classes cannot be derived for GADTs with existential type variables.

allClasses0 :: [Name] Source #

All the classes that can be derived for GADTs.

This includes:

allClasses01 :: [Name] Source #

All the classes that can be derived for GADT functors.

This includes all the classes in allClasses0 and allClasses1.

allClasses012 :: [Name] Source #

All the classes that can be derived for GADT functors.

This includes all the classes in allClasses0, allClasses1, and allClasses2.

basicClasses0 :: [Name] Source #

Basic classes for GADTs.

This includes:

These classes can be derived for most GADTs.

basicClasses01 :: [Name] Source #

Basic classes for GADT functors.

This includes all the classes in basicClasses0 and basicClasses1.

basicClasses012 :: [Name] Source #

Basic classes for GADT functors.

This includes all the classes in basicClasses0 and basicClasses1 and basicClasses2.

noExistentialClasses0 :: [Name] Source #

Classes that can only be derived for GADTs without existential type variables.

This includes:

concreteOrdClasses0 :: [Name] Source #

Concrete ordered classes that can be derived for GADTs that

  • uses unified evaluation mode, or
  • does not contain any symbolic variables.

This includes:

  • Ord (will fail to derive if the type contains any symbolic variables)
  • UnifiedSymOrd

hashableClasses0 :: [Name] Source #

Hashable classes that can be derived for GADTs.

This includes:

  • Hashable (will fail to derive if the type contains any symbolic variables)

noExistentialClasses1 :: [Name] Source #

*1 classes that can only be derived for GADT functors without existential type variables.

This includes:

concreteOrdClasses1 :: [Name] Source #

*1 concrete ordered classes that can be derived for GADT functors that

  • uses unified evaluation mode, or
  • does not contain any symbolic variables.

This includes:

hashableClasses1 :: [Name] Source #

Hashable classes that can be derived for GADT functors.

This includes:

  • Hashable1 (will fail to derive if the type contains any symbolic variables)

noExistentialClasses2 :: [Name] Source #

*2 classes that can only be derived for GADT functors without existential type variables.

This includes:

concreteOrdClasses2 :: [Name] Source #

*2 concrete ordered classes that can be derived for GADT functors that

  • uses unified evaluation mode, or
  • does not contain any symbolic variables.

This includes:

hashableClasses2 :: [Name] Source #

Hashable classes that can be derived for GADT functors.

This includes:

  • Hashable2 (will fail to derive if the type contains any symbolic variables)

showClasses :: [Name] Source #

Show classes that can be derived for GADTs.

This includes:

pprintClasses :: [Name] Source #

PPrint classes that can be derived for GADTs.

This includes:

evalSymClasses :: [Name] Source #

EvalSym classes that can be derived for GADTs.

This includes:

extractSymClasses :: [Name] Source #

ExtractSym classes that can be derived for GADTs.

This includes:

substSymClasses :: [Name] Source #

SubstSym classes that can be derived for GADTs.

This includes:

allSymsClasses :: [Name] Source #

AllSyms classes that can be derived for GADTs.

This includes:

eqClasses :: [Name] Source #

Eq classes that can be derived for GADTs.

This includes:

ordClasses :: [Name] Source #

Ord classes that can be derived for GADTs.

This includes:

  • Ord (will fail to derive if the type contains any symbolic variables)
  • Ord1 (will fail to derive if the type contains any symbolic variables)
  • Ord2 (will fail to derive if the type contains any symbolic variables)

symOrdClasses :: [Name] Source #

SymOrd classes that can be derived for GADTs.

This includes:

symEqClasses :: [Name] Source #

SymEq classes that can be derived for GADTs.

This includes:

unifiedSymOrdClasses :: [Name] Source #

UnifiedSymOrd classes that can be derived for GADTs.

This includes:

unifiedSymEqClasses :: [Name] Source #

UnifiedSymEq classes that can be derived for GADTs.

This includes:

mergeableClasses :: [Name] Source #

Mergeable classes that can be derived for GADTs.

This includes:

nfDataClasses :: [Name] Source #

NFData classes that can be derived for GADTs.

This includes:

hashableClasses :: [Name] Source #

Hashable classes that can be derived for GADTs.

This includes:

  • Hashable (will fail to derive if the type contains any symbolic variables)
  • Hashable1 (will fail to derive if the type contains any symbolic variables)
  • Hashable2 (will fail to derive if the type contains any symbolic variables)

toSymClasses :: [Name] Source #

ToSym classes that can be derived for GADTs.

This includes:

toConClasses :: [Name] Source #

ToCon classes that can be derived for GADTs.

This includes:

serialClasses :: [Name] Source #

Serial classes that can be derived for GADTs.

This includes:

filterExactNumArgs :: Int -> [Name] -> [Name] Source #

Filter classes that accepts type constructors with exactly n arguments.

filterLeqNumArgs :: Int -> [Name] -> [Name] Source #

Filter classes that accepts type constructors with at most n arguments.