| Copyright | (c) 2024 GYELD GMBH |
|---|---|
| License | Apache 2.0 |
| Maintainer | [email protected] |
| Stability | develop |
| Safe Haskell | None |
| Language | GHC2021 |
GeniusYield.Types.Blueprint.TH
Description
Template Haskell utilities to work with blueprint file. It is useful to see generated Template Haskell code which can be done via -ddump-splices GHC flag. You may combine this with -ddump-to-file to save the output to a file. If you are using cabal, see this answer on where one can find dumped splice files.
Synopsis
- makeBPTypes :: FilePath -> Q [Dec]
- uponBPTypes :: FilePath -> Q [Dec]
Documentation
makeBPTypes :: FilePath -> Q [Dec] #
Generate types corresponding to definitions in the blueprint file.
Type names are generated by prefixing with BP and sanitizing the definition id, where unsupported characters are replaced by underscores.
uponBPTypes :: FilePath -> Q [Dec] #
After having spliced makeBPTypes, following adds data related instances (ToData, FromData, etc.) and applyParamsToBPValidator_ValidatorName, scriptFromBPSerialisedScript utility function.
EXAMPLE:
$(makeBPTypes "path/to/bluprint.json") $(uponBPTypes "path/to/blueprint.json")