-
Notifications
You must be signed in to change notification settings - Fork 472
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
[PLC] [Builtins] Removed static typed builtins #983
[PLC] [Builtins] Removed static typed builtins #983
Conversation
00e2a63
to
08424e5
Compare
|
||
-- | Convert a Haskell value to the corresponding PLC value. | ||
-- 'Nothing' represents a conversion failure. | ||
makeDynamicBuiltin :: dyn -> Maybe (Term TyName Name ()) | ||
makeKnown :: a -> Term TyName Name () |
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.
Removed the Maybe
, because we now do not have any failing conversions from Haskell to Plutus Core.
@@ -43,7 +43,6 @@ data BuiltinName = AddInteger | |||
| GreaterThanInteger | |||
| GreaterThanEqInteger | |||
| EqInteger | |||
| IntToByteString |
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.
Removed.
@@ -78,10 +77,10 @@ instance Monad ConstAppResult where | |||
ConstAppStuck >>= _ = ConstAppStuck | |||
ConstAppError err >>= _ = ConstAppError err | |||
|
|||
type ConstAppResultDef = ConstAppResult (Value TyName Name ()) | |||
type ConstAppResultDef = ConstAppResult (Term TyName Name ()) |
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.
type
synonyms bitrot too quickly... Perhaps it would be better to turn Value
into a newtype
wrapper.
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.
How do you mean?
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.
Currently we have type Value = Term
and we use Value
to indicate that a term is evaluated up to WHNF, but things change constantly and something that is no longer supposed to be a value is still marked as such. A newtype
would help here.
08424e5
to
fe46800
Compare
Ready for review, but do not merge yet, because docs are likely to be out of sync. |
5b53104
to
c4dccdf
Compare
ae970dd
to
cb263a8
Compare
Yeah, there were a lot of outdated docs and comments (related to sizes and other stuff that changed some time ago). Should be mergeable now, please review. |
@@ -78,10 +77,10 @@ instance Monad ConstAppResult where | |||
ConstAppStuck >>= _ = ConstAppStuck | |||
ConstAppError err >>= _ = ConstAppError err | |||
|
|||
type ConstAppResultDef = ConstAppResult (Value TyName Name ()) | |||
type ConstAppResultDef = ConstAppResult (Term TyName Name ()) |
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.
How do you mean?
cb263a8
to
10e9997
Compare
I'll merge this, because I need it to fix the |
This removes typed static builtins (
integer
andbytestring
) that previously were special-cased due to size problems.Do not review yet, it's here mostly because I want CI to check things like the playground for me.
(Who again failed to use draft pull requests? Yep, me!)