-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework the "Using Plutus Tx" section of the user guide #6516
base: master
Are you sure you want to change the base?
Conversation
e267e84
to
f93e076
Compare
/benchmark validation |
(sorry for hijacking) |
Click here to check the status of your benchmark. |
Comparing benchmark results of 'validation' on '24e3cfc0f' (base) and 'f93e076ef' (PR) Results table
|
In general, we do not want GHC to perform optimizations, since GHC optimizes a program based on the assumption that it has non-strict semantics and is evaluated lazily (call by need), which is not true for Plutus Tx programs. | ||
Therefore, `INLINEABLE` is preferred over `-fexpose-all-unfoldings`, even though the latter is simpler. | ||
myPlutusTxCodeCompiled :: CompiledCode (Integer -> Integer) | ||
myPlutusTxCodeCompiled = plc (Proxy @"location info") myPlutusTxCode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe mention that "location info" is for debugging purposes and not very important
|
||
> ghc-options: | ||
> | ||
> : -fno-ignore-interface-pragmas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think typo here with a leading :
|
||
In [`PlutusTx.Builtins.Internal`](https://plutus.cardano.intersectmbo.org/haddock/latest/plutus-tx/PlutusTx-Builtins-Internal.html), functions marked `OPAQUE` are directly converted to the corresponding builtin function. | ||
For instance, `PlutusTx.Builtins.Internal.addInteger` is converted to UPLC term `(builtin addInteger)`. | ||
Using the `OPAQUE` pramga prevents GHC from inlining these functions, allowing the Plutus Tx compiler to determine where exactly they are invoked, and compile them appropriately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo "pragma"
|
||
## `IsString` Instances | ||
|
||
[`IsString`](https://hackage.haskell.org/package/base/docs/Data-String.html#t:IsString) is a type class from `base`, and can be used along with the `OverloadedString` language extension to convert string literals to types other than `String`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo "OverloadedStrings"
The section now looks like this:
asData
": unmodified