-
Notifications
You must be signed in to change notification settings - Fork 64
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
Delegate Rational
invariant to PNonZero
+ optimizations
#435
Conversation
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.
LGTM
I'm not sure this is the best solution. Shouldn't we just not export the constructors, or otherwise make the divisor (or dividend?) a Positive? |
I think We could indeed just not export the constructor but then the |
The in general, in Haskell, people expect constructors to be total. I don't think we should add partial constructors. |
Not wanting And for deconstruction, I suppose the |
Well that's why I suggested Positive. |
I assume you mean |
PlutusType
instanceRational
invariant to PNonZero
+ optimizations
Shouldn't it be |
The original invariant was |
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.
We need to find a general solution to this.
I removed the constructor export and kept the |
@TotallyNotChase Can you make this PR up to date? |
FYI this isn't ready yet - just syncing with staging. |
I'm trying to figure out optimization stops - where invariant checks should be skipped. |
Just put them in everywhere, then we'll make it efficient later. |
Alright, will do optimizations later then |
a47bd0b
to
18234e5
Compare
18234e5
to
8a5973e
Compare
Hmm, why did the |
looks like the benchmarks are performed on scripts compiled with tracing mode on - that's not correct. |
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.
We mostly just need TODOs, great work, thanks!
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.
LGTM
The "fail on zero" invariant should be forced in the
PlutusType
instance - otherwisepcon
is a trap for users.The golden changes are purely within dev mode and only exist due to a slight change in the error trace.