tweag/cooked-validators

Update `PrettyCooked`

Opened this issue · 2 comments

At the moment, our PrettyCooked features suffers from small inaccuracies:

  • module Pretty.Cooked is far too long
  • we sometimes use PP.pretty instead of prettyCookedOpts
  • some PrettyCooked instances are located in Pretty.Class, some others in Pretty.Cooked and the reason for this separation is unclear.
  • some PrettyCooked instances are actually written as instances, while others are functions named prettyXXX but are basically instances. This can lead to repeated code if one does not realize an instance is here but is not actually written as such.
  • PrettyCooked has it own hashable type class which could maybe be factored with toScriptHash to some extent (see #424)

In addition, there could be some improvements:

  • code can be factored (for example for redeemers)
  • we could provide some automation to deduce PrettyCooked instances

The factoring for redeemers is being performed in PR #428

what was the thought process behind centralizing all pretty cooked instances in dedicated modules? I find it very prone to circular dependencies issues.