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 |
Synopsis
- data BinaryOpClassConfig = BinaryOpClassConfig {}
- data BinaryOpFieldConfig = BinaryOpFieldConfig {
- extraPatNames :: [String]
- fieldResFun :: [Exp] -> (Exp, Exp) -> Exp -> Q (Exp, [Bool])
- fieldCombineFun :: Name -> [Exp] -> Q (Exp, [Bool])
- fieldDifferentExistentialFun :: Exp -> Q Exp
- fieldLMatchResult :: Q Exp
- fieldRMatchResult :: Q Exp
- fieldFunExp :: FieldFunExp
- fieldFunNames :: [Name]
- type FieldFunExp = Map Name Name -> Type -> Q Exp
- defaultFieldFunExp :: [Name] -> FieldFunExp
- genBinaryOpClause :: BinaryOpFieldConfig -> [(Type, Kind)] -> [(Type, Kind)] -> Bool -> ConstructorInfo -> ConstructorInfo -> Q [Clause]
- genBinaryOpClass :: DeriveConfig -> BinaryOpClassConfig -> Int -> Name -> Q [Dec]
Documentation
data BinaryOpClassConfig Source #
Configuration for a binary operation type class generation on a GADT.
data BinaryOpFieldConfig Source #
Configuration for a binary operation field generation on a GADT.
BinaryOpFieldConfig | |
|
type FieldFunExp = Map Name Name -> Type -> Q Exp Source #
Type of field function expression generator.
defaultFieldFunExp :: [Name] -> FieldFunExp Source #
Default field function expression generator.
genBinaryOpClause :: BinaryOpFieldConfig -> [(Type, Kind)] -> [(Type, Kind)] -> Bool -> ConstructorInfo -> ConstructorInfo -> Q [Clause] Source #
Generate a clause for a binary operation on a GADT.
genBinaryOpClass :: DeriveConfig -> BinaryOpClassConfig -> Int -> Name -> Q [Dec] Source #
Generate a type class instance for a binary operation on a GADT.