Skip to content

Conversation

newhoggy
Copy link
Collaborator

@newhoggy newhoggy commented Apr 14, 2025

Changelog

- description: |
    New `asTypeFromValue` function
# uncomment types applicable to the change:
  type:
  - feature        # introduces a new feature
  # - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  # - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...
# uncomment at least one main project this PR is associated with
  projects:
  # - cardano-api
  # - cardano-api-gen
  # - cardano-rpc
  # - cardano-wasm

Context

How to trust this PR

Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff


asTypeFromValue :: HasTypeProxy t => t -> AsType t
asTypeFromValue _ = proxyToAsType Proxy

Copy link
Contributor

@carbolymer carbolymer Apr 15, 2025

Choose a reason for hiding this comment

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

This would be useful too:

Suggested change
asType :: HasTypeProxy t => AsType t
asType = proxyToAsType Proxy

( HasTypeProxy (AsType, proxyToAsType)
, Proxy (..)
, FromSomeType (..)
, asTypeFromValue
Copy link
Contributor

Choose a reason for hiding this comment

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

don't you have to export it from Cardano.Api as well?

Copy link

This PR is stale because it has been open 45 days with no activity.

@github-actions github-actions bot added the Stale label May 31, 2025
@github-actions github-actions bot removed the Stale label Jul 25, 2025
Copy link

github-actions bot commented Sep 9, 2025

This PR is stale because it has been open 45 days with no activity.

@github-actions github-actions bot added the Stale label Sep 9, 2025
@github-actions github-actions bot removed the Stale label Sep 24, 2025
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.

3 participants