|
| 1 | +--- |
| 2 | +title: ast.ts |
| 3 | +nav_order: 1 |
| 4 | +parent: Modules |
| 5 | +--- |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +<h2 class="text-delta">Table of contents</h2> |
| 10 | + |
| 11 | +- [AST (interface)](#ast-interface) |
| 12 | +- [Options (interface)](#options-interface) |
| 13 | +- [defaultOptions (constant)](#defaultoptions-constant) |
| 14 | +- [lenses (constant)](#lenses-constant) |
| 15 | +- [constructors (function)](#constructors-function) |
| 16 | +- [data (function)](#data-function) |
| 17 | +- [folds (function)](#folds-function) |
| 18 | +- [prisms (function)](#prisms-function) |
| 19 | +- [setoid (function)](#setoid-function) |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +# AST (interface) |
| 24 | + |
| 25 | +**Signature** |
| 26 | + |
| 27 | +```ts |
| 28 | +export interface AST<A> extends Reader<Options, A> {} |
| 29 | +``` |
| 30 | + |
| 31 | +# Options (interface) |
| 32 | + |
| 33 | +**Signature** |
| 34 | + |
| 35 | +```ts |
| 36 | +export interface Options { |
| 37 | + /** the name of the field used as tag */ |
| 38 | + tagName: string |
| 39 | + /** the name prefix used for pattern matching functions */ |
| 40 | + foldName: string |
| 41 | + /** the name used for the input of pattern matching functions */ |
| 42 | + matcheeName: string |
| 43 | + /** |
| 44 | + * the pattern matching handlers can be expressed as positional arguments |
| 45 | + * or a single object literal `tag -> handler` |
| 46 | + */ |
| 47 | + handlersStyle: { type: 'positional' } | { type: 'record'; handlersName: string } |
| 48 | + encoding: 'literal' | 'fp-ts' |
| 49 | +} |
| 50 | +``` |
| 51 | + |
| 52 | +# defaultOptions (constant) |
| 53 | + |
| 54 | +**Signature** |
| 55 | + |
| 56 | +```ts |
| 57 | +export const defaultOptions: Options = ... |
| 58 | +``` |
| 59 | + |
| 60 | +# lenses (constant) |
| 61 | + |
| 62 | +**Signature** |
| 63 | + |
| 64 | +```ts |
| 65 | +export const lenses: { [K in keyof Options]: Lens<Options, Options[K]> } = ... |
| 66 | +``` |
| 67 | + |
| 68 | +# constructors (function) |
| 69 | + |
| 70 | +**Signature** |
| 71 | + |
| 72 | +```ts |
| 73 | +export const constructors = (d: M.Data): AST<Array<ts.Node>> => ... |
| 74 | +``` |
| 75 | + |
| 76 | +# data (function) |
| 77 | + |
| 78 | +**Signature** |
| 79 | + |
| 80 | +```ts |
| 81 | +export const data = (d: M.Data): AST<Array<ts.Node>> => ... |
| 82 | +``` |
| 83 | + |
| 84 | +# folds (function) |
| 85 | + |
| 86 | +**Signature** |
| 87 | + |
| 88 | +```ts |
| 89 | +export const folds = (d: M.Data): AST<Array<ts.FunctionDeclaration>> => ... |
| 90 | +``` |
| 91 | + |
| 92 | +# prisms (function) |
| 93 | + |
| 94 | +**Signature** |
| 95 | + |
| 96 | +```ts |
| 97 | +export const prisms = (d: M.Data): AST<Array<ts.Node>> => ... |
| 98 | +``` |
| 99 | + |
| 100 | +# setoid (function) |
| 101 | + |
| 102 | +**Signature** |
| 103 | + |
| 104 | +```ts |
| 105 | +export const setoid = (d: M.Data): AST<Array<ts.Node>> => ... |
| 106 | +``` |
0 commit comments