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

Report _both_ context _and_ info #54

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

edsko
Copy link
Contributor

@edsko edsko commented Aug 8, 2024

#47 changed the ThunkInfo type to

newtype ThunkInfo = ThunkInfo { thunkInfo  :: Either Context Info }

While having support for Info is fantastic and a great addition, in some cases having both pieces of information makes debugging a bit easier. I am not entirely sure why Either was chosen here instead of a tuple, perhaps there was a good reason; if so, feel free to disregard this PR. However, in this PR we change this to

newtype ThunkInfo = ThunkInfo { thunkInfo  :: (Context, Maybe Info) }

@edsko
Copy link
Contributor Author

edsko commented Aug 8, 2024

@coot I am preparing an Unfolder episode on nothunks, I will make sure to acknowledge your work on adding this provenance data, it's a really nice addition!

@erikd
Copy link
Member

erikd commented Aug 8, 2024

Why wrap a tuple in a newtype? Why not make ThunkInfo a struct, like this:

data ThunkInfo = ThunkInfo
    { thunkInfo  :: Maybe Info
    , thunkContext :: Context
    }

@edsko
Copy link
Contributor Author

edsko commented Aug 8, 2024

Why wrap a tuple in a newtype? Why not make ThunkInfo a struct, like this:

data ThunkInfo = ThunkInfo
    { thunkInfo  :: Maybe Info
    , thunkContext :: Context
    }

Yup, I'd be happy with that also, just kept the changes to a minimum. Will change that, and fix the failure on 8.10.

In some cases having both makes debugging a bit easier.
@edsko
Copy link
Contributor Author

edsko commented Aug 8, 2024

Done! :)

@erikd erikd requested a review from coot August 8, 2024 21:37
Copy link
Contributor

@coot coot left a comment

Choose a reason for hiding this comment

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

LGTM

@coot coot added this pull request to the merge queue Aug 12, 2024
Merged via the queue into input-output-hk:master with commit cddfe83 Aug 12, 2024
8 checks passed
@coot
Copy link
Contributor

coot commented Aug 13, 2024

@edsko nothunks-0.3 is on hackage. Thanks for the PR.

@edsko edsko deleted the edsko/info-and-context branch August 13, 2024 11:38
@edsko
Copy link
Contributor Author

edsko commented Aug 13, 2024

Perfect, thanks so much! I shall be talking about it this Wednesday :) (https://www.youtube.com/watch?v=NTW62s3mrXQ&list=PLD8gywOEY4HaG5VSrKVnHxCptlJv2GAn7)

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