Skip to content
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

plutus-tx-plugin: use a phantom type parameter for CompiledCode #412

Merged
merged 1 commit into from
Dec 17, 2018

Conversation

michaelpj
Copy link
Contributor

This tracks the type of the Haskell that was compiled, and hence
implicitly (insofar as we believe that the compiation is
type-preserving) the type of the compiled code. This can be used to
ensure that application of compiled programs is well-typed - however in
our primary setting in wallet-api we simply have programs as
unknown serialized blobs, and so we cannot make use of this facility.

I considered using existentials in wallet-api so we could at least
enforce the shape of a validator script as a function of the
appropriate arity, but this makes things quite a bit more complicated,
and would give users confusing error messages, so I've decided not to do
that for now.

This tracks the type of the Haskell that was compiled, and hence
implicitly (insofar as we believe that the compiation is
type-preserving) the type of the compiled code. This can be used to
ensure that application of compiled programs is well-typed - however in
our primary setting in `wallet-api` we simply have programs as
unknown serialized blobs, and so we cannot make use of this facility.

I considered using existentials in `wallet-api` so we could at least
enforce the *shape* of a validator script as a function of the
appropriate arity, but this makes things quite a bit more complicated,
and would give users confusing error messages, so I've decided not to do
that for now.
Copy link
Contributor

@j-mueller j-mueller left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Copy link

@wadler wadler left a comment

Choose a reason for hiding this comment

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

I am not up to speed on the structure of the implementation, so I am not in a position to approve the changes. But they look to me to be along the right lines.

Copy link
Contributor

@effectfully effectfully left a comment

Choose a reason for hiding this comment

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

LGTM.

@j-mueller j-mueller merged commit b654016 into IntersectMBO:master Dec 17, 2018
@michaelpj michaelpj deleted the imp/phantom-types branch March 14, 2019 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants