Skip to content

Conversation

@basetunnel
Copy link
Collaborator

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

PR Preview Action v1.6.3

🚀 View preview at
https://IntersectMBO.github.io/plutus/pr-preview/docs/pr-7481/

Built to branch gh-pages at 2025-12-11 12:50 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@basetunnel basetunnel added the No Changelog Required Add this to skip the Changelog Check label Dec 11, 2025
@zliu41 zliu41 requested review from a team and SeungheonOh December 23, 2025 03:16
@Unisay
Copy link
Contributor

Unisay commented Dec 24, 2025

The doc seems useful! I propose to add Plinth examples to accompany UPLC examples, as this user guide is for Plinth and it makes sense to showcase its types/expressions too.

Copy link
Member

@zliu41 zliu41 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our convention for docs is to put each sentence on one line. No need to update this one but please keep it in mind in the future.


:::

In UPLC, it is possible to branch on expressions of certain built-in types, like
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should mention other ways of deconstructing builtin types (e.g., for bool one can use ifThenElse), and why using the new builtin casing feature is better.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added some :::info about this to most of the types, please check if my understanding is correct here.

lam x (case x (lam a (lam b [(builtin addInteger) a b])))
```

### Integer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention that the datatypes=BuiltinCasing optoin is irrelevant to Integer. To take advantage of casing on integer, in Plinth one must use PlutusTx.Builtins.caseInteger.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the implementation, I think the BuiltinCasing option is necessary. Otherwise it compiles into !!.

https://github.com/IntersectMBO/plutus/blob/master/plutus-tx-plugin/src/PlutusTx/Compiler/Expr.hs#L969

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No Changelog Required Add this to skip the Changelog Check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants