FunDecl captures function declarations along with any associated linkage required.
Everything needed to make a function declaration either at top-level or inside a let block,
or to extract the function body as an expression is captured as a FunDecl.
Options can be applied when extracting a FunDecl as generated code; to rename it,
to include or exclude it from the exposings, to modify or disable its docs, to include
a function signature or not.
This allows the decision to build a function as a top-level, a let expression or to extract it as an expression for further manipulation, to be deferred.
Code that writes function can therefore be used in many different ways as a result, and there is no need to write specialized cases for all the different ways in which a code generated function can be used.
All the parts of a function declaration.
Options for generating functions.
The default set of options.
Generates a Declaration for a function.
Generates a LetDeclaration for a function.
Note: As let declaractions are not visible outside of their scope, these are
never exposed, so the inExposings option is always set to False when using
this.
A let declaration will not have any docs or a type signature either.
Generates an Expression for a function.
Note: As the expression has not been assigned to a name, it cannot be visible
outside of the module. For this reason the inExposings option is always set
to False when using this. If you decide to expose the function you must add
whatever name you give it back into the linkage.
An expression will not have any docs or a type signature either.
A generated function with its linkage.