In the Daml documentation we have code snippets illustrating the concepts being explained.
The code snippets cannot be used in themselves, e.g. by copy / pasted in the appropriate part of my code, because of the missing module imports.
It turns out that the code snippets are snippets from actually working code files, batteries included, residing in the docs folder of the Daml Github repo.
The code for illustrating e.g. the Exception Handling section of the Daml docs, can be found here.
It’s not so easy to find the source files of the snippets though, I could find this file by searching for a word which I thought should not be found many times in the repo: TransferLimitExceeded
. And indeed, there are only two hits.
It would be easier to use the docs, if the links to the source code of the snippets were included in the respective chapters.