| 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 | None |
| Language | Haskell2010 |
Grisette.Internal.TH.Ctor.UnifiedConstructor
Description
Documentation
makeUnifiedCtorWith :: [Name] -> (String -> String) -> Name -> Q [Dec] Source #
Generate smart constructors to create unified values with provided name transformer.
For a type T mode a b c with constructors T1, T2, etc., this function
will generate smart constructors with the name transformed, e.g., given the
name transformer (name -> "mk" ++ name), it will generate mkT1, mkT2,
mkT2, etc.
The generated smart constructors will contruct values of type
GetData mode (T mode a b c).
makePrefixedUnifiedCtor Source #
Arguments
| :: [Name] | |
| -> String | Prefix for generated wrappers |
| -> Name | The type to generate the wrappers for |
| -> Q [Dec] |
Generate smart constructors to create unified values.
For a type T mode a b c with constructors T1, T2, etc., this function
will generate smart constructors with the given prefix, e.g., mkT1, mkT2,
etc.
The generated smart constructors will contruct values of type
GetData mode (T mode a b c).
Arguments
| :: [Name] | |
| -> [String] | Names for generated wrappers |
| -> Name | The type to generate the wrappers for |
| -> Q [Dec] |
Generate smart constructors to create unified values.
For a type T mode a b c with constructors T1, T2, etc., this function
will generate smart constructors with the given names.
The generated smart constructors will contruct values of type
GetData mode (T mode a b c).
Generate smart constructors to create unified values.
For a type T mode a b c with constructors T1, T2, etc., this function
will generate smart constructors with the names decapitalized, e.g.,
t1, t2, etc.
The generated smart constructors will contruct values of type
GetData mode (T mode a b c).