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

HasBlueprintSchema and HasBlueprintDefinition instances #6271

Merged
merged 4 commits into from
Aug 25, 2024

Conversation

Unisay
Copy link
Contributor

@Unisay Unisay commented Jun 28, 2024

This PR contains changes in these categories:

  1. Improvements to the Blueprint (CIP-57) derivation machinery:
    • AsDefinitionId typeclass renamed to HasBlueprintDefinition
    • HasSchema typeclass renamed to HasBlueprintSchema
    • Unroll type-family is made associated with the HasBlueprintDefinition typeclass, allowing extensibility.
  2. HasBlueprintSchema and HasBlueprintDefinition instances for data types in the plutus-ledger-api and ones exported by the PlutusTx.Prelude.
  3. Example contract from docusaurus was enriched with domain types.

Closes #6265

@Unisay Unisay self-assigned this Jun 28, 2024
@Unisay Unisay force-pushed the yura/has-schema-instances branch 8 times, most recently from da90e6b to 7046453 Compare July 4, 2024 15:50
@Unisay Unisay changed the title HasSchema and AsDefinitionId instances HasBlueprintSchema and HasBlueprintDefinition instances Jul 4, 2024
@Unisay Unisay force-pushed the yura/has-schema-instances branch 3 times, most recently from 7057c67 to d5afe39 Compare July 5, 2024 14:02
@Unisay Unisay marked this pull request as ready for review July 5, 2024 14:37
@Unisay Unisay requested a review from effectfully July 5, 2024 14:37
@zeme-wana zeme-wana force-pushed the master branch 2 times, most recently from a161078 to db5cabb Compare July 9, 2024 09:24
@Unisay Unisay requested a review from zliu41 July 15, 2024 14:08
Copy link
Member

@zliu41 zliu41 left a comment

Choose a reason for hiding this comment

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

This looks largely fine, but I'm not seeing the removal of any -Wno-orphans, which is supposed to be the main benefit of this. Do we not have any examples or tests that are affected?

{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}

{-# OPTIONS_GHC -Wno-orphans #-}
Copy link
Member

Choose a reason for hiding this comment

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

There are a bunch of these in plutus-ledger-api. What are they for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure. Pretty likely they became obsolete. I've removed them, lets and if build doesn't fail (which it didn't locally).

@Unisay Unisay enabled auto-merge (squash) August 24, 2024 17:56
@Unisay Unisay merged commit 4b8e137 into master Aug 25, 2024
6 checks passed
@Unisay Unisay deleted the yura/has-schema-instances branch August 25, 2024 08:47
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.

HasBlueprintSchema, HasBlueprintDefinition instances for types shipped with Plutus, e.g. PubKeyHash
2 participants