-
Notifications
You must be signed in to change notification settings - Fork 77
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
Remove polymorphism from As_prover.t
, hoist Typ.t
#854
Conversation
src/base/as_prover0.ml
Outdated
module Handle = struct | ||
let value (t : ('var, 'value) Handle.t) : ('value, 'field) t = | ||
fun _ -> Option.value_exn t.value | ||
type nonrec ('a, 'f) t = ('a, 'f) Types.Provider.t |
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.
It was confusing first that the type changes. But ok :).
@@ -1,46 +1,5 @@ | |||
open Core_kernel | |||
|
|||
module Data_spec0 = struct |
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.
Yay.
@@ -58,8 +58,6 @@ module Typ = struct | |||
('var, 'value, 'aux, 'field, 'checked) typ' | |||
-> ('var, 'value, 'field, 'checked) typ | |||
end | |||
|
|||
include T |
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.
Yay.
src/base/checked_runner.ml
Outdated
@@ -15,7 +15,41 @@ module Simple_types = struct | |||
end | |||
|
|||
module Typ = struct | |||
include Types.Typ.T |
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.
Yay.
src/base/checked_intf.ml
Outdated
|
||
val run : 'a t -> field Run_state.t -> field Run_state.t * 'a | ||
end | ||
|
||
module Unextend |
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.
Yay.
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.
Reviewed commit by commit. Makes sense so far. Curious to see the final result.
This PR bundles a few changes. This can be broken into smaller pieces by commit if needed.
The goal of this PR is to remove the generalisation over
Field.t
fromChecked.t
andAs_prover.t
, allowing us to hoistTyp.t
from the global implementation inTypes
. The result is a uniqueTyp.t
type for each instantiation of snarky, allowing us to generate it from any checked backend (and in particular from a rust backend).To achieve this, we
Types.Make_types
As_prover.t
Types
module signatureThe recommended way to review this PR is to 'ignore whitespace' in the GitHub UI (or equivalently using
git diff --ignore-all-space
), to ignore the indentation changes resulting from functorisation.