This document discusses various rules of thumb and general trivia, aiming to make life as a Plutarch user or auditor easier.

Note: If you spot any mistakes/have any related questions that this guide lacks the answer to, please don't hesitate to raise an issue. The goal is to have high quality documentation for Plutarch users!

  • Plutarch functions are strict
  • Don't duplicate work
    • Where should arguments be pleted?
  • Prefer Plutarch level functions
  • When to use Haskell level functions?
  • The difference between PlutusType/PCon and PLift's pconstant
  • Let Haskell level functions take responsibility of evaluation
  • The isomorphism between makeIsDataIndexed, Haskell ADTs, and PIsDataRepr
  • Prefer statically building constants whenever possible
  • Figuring out the representation of a Plutarch type
  • Prefer pattern matching on the result of pmatch immediately
  • Working with bound fields yielded by pletFields