Examples

  • Simple demonstrates the bare bones features of the library. Creating a document from a few fragments and then "knitting" it into HTML text and writing that to a file. This includes hvega, diagrams and plots examples. Result here

  • MultiDoc demonstrates how to build multiple documents. Results here and here.

  • Mtl demonstrates the same simple features as above, but runs them atop an example mtl stack, allowing access to the mtl stack's functionality during document assembly. Result here.

  • Random builds on the mtl example to show how you can also add an additional polysemy effect (in this case, Polysemy.RandomFu from polysemy-RandomFu) to your document-building. This one also demonstrates a use of colonnade for adding a formatted table to the document. Result here.

  • Error: Similar to "Simple" but throws a user error during document assembly. Result [here][ErrorExample].

  • Async: Similar to "SimpleExample" but uses Polysemy's sequenceConcurrently to run some example computations concurrently (as long as you compile with "-threaded"). Result here

  • Cache: Similar to "SimpleExample" but uses the "AtomicCache" effect to store the result of a computation. Demonstrates the behavior of the cache when multiple threads attempt to access the same item--the first thread loads/creates the data while the other blocks until the data is in-memory. Also demonstrates use of time-stamps to force rebuilding when tracked inputs change. Result here.

  • CustomCache: Similar to "CacheExample" but implements and uses a different serializer and persistence layer than the default. Result here.