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

Some helpers for working with constant expression evaluator #285

Merged
merged 4 commits into from
Sep 4, 2024
Merged

Conversation

dorchard
Copy link
Member

@dorchard dorchard commented Sep 3, 2024

Adds:

fromConstInt :: FValue -> Maybe Integer
fromConstReal :: FValue -> Maybe Double

which adds helper deconstructor on the FValue representation (which is useful for CamFort)

@dorchard dorchard requested a review from raehik September 3, 2024 12:24
@dorchard dorchard mentioned this pull request Sep 3, 2024
Copy link
Collaborator

@raehik raehik left a comment

Choose a reason for hiding this comment

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

fromConstReal is partial due to a missed fallback case.

I'm happy to keep adding this sort of handy evaluator util a bit arbitrarily until we have enough to properly sort into a module of their own.

Re changelog: Let me know if I can help with the (Hackage) release.

src/Language/Fortran/Repr/Value/Machine.hs Show resolved Hide resolved
@dorchard dorchard merged commit a60c012 into master Sep 4, 2024
7 checks passed
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.

2 participants