| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Pinchot.SyntaxTree.Wrappers
- wrappedInstances :: [Rule t] -> DecsQ
- singleWrappedInstance :: Rule t -> Maybe (Q Dec)
- makeWrapped :: TypeQ -> String -> Q Dec
- wrappedOpt :: String -> String -> Q Dec
- wrappedTerminal :: String -> Q Dec
- wrappedTerminals :: String -> Q Dec
- wrappedStar :: String -> String -> Q Dec
- wrappedPlus :: String -> String -> Q Dec
- wrappedWrap :: String -> String -> Q Dec
Documentation
wrappedInstances :: [Rule t] -> DecsQ Source #
Creates a Wrapped instance for each Rule and its
ancestors, if there is an instance.
Only terminal, wrap,
opt, star, and plus
get instances of Wrapped.
This must be spliced in the same module in which the syntax tree types are created; this way, no orphans are created. Since ancestors are included, you can get the entire tree of types that you need by applying this function to a single start symbol.
Example: Pinchot.Examples.SyntaxTrees.