[#431] Implement `ParsedOp` instance of `RenderDoc`

Description

ParsedOp instance of RenderDoc is not implemented. As a result, printing a parsed contract with printUntypedContract fails.

There is a note:

-- | Convert an untyped contract into a textual representation which
-- will be accepted by the OCaml reference client.
printUntypedContract :: (RenderDoc op) => Bool -> U.Contract' op -> TL.Text
...

So, the instance has to be implemented considering this property. As a solution, we just expand ParsedOp and use ExpandedOp instance of RenderDoc to implement renderDoc as Contract' ExpandedOp == Contract is acceptable by the reference client for sure and there are several reasons to use it (see this comment for more information).

Related issue(s)

Resolves #431 (closed)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Alyona Antonova

Merge request reports

Loading