Context travelled through the composed
CodePrinter function, all events are captured.
These can be converted to a string of formatted code.
As a final step in the process, we validate the result of the code generation.
We do this by parsing the existing code and investigating the fsharp diagnostics. When there are any warnings or errors, we will throw an exception. Some warnings are are allowed as they indicate problems that were most likely already present in the input code. See
Validation.fs for more details.