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

Add strong Fortran value & type representation #235

Merged
merged 5 commits into from
Aug 23, 2022
Merged

Add strong Fortran value & type representation #235

merged 5 commits into from
Aug 23, 2022

Conversation

raehik
Copy link
Collaborator

@raehik raehik commented Aug 23, 2022

This representation models Fortran values as Haskell ones, and aims to share edge case behaviours to enable efficient operation without needing the end user to do extra work. Terms are modeled in such a way that a given term's precise type can be inferred by simple pattern matching. Lots of definitions for combining types on the type level, and terms on the term level are provided.

Previously, Fortran types and values were modeled via AST definitions, which complicate usage due to handling lots of syntax, and elsewhere via a sum type which gathered valid Fortran terms & types respectively into a single Haskell type (Analysis.SemanticTypes). This representation takes inspiration from that.

This is one part of a larger update to improve the constants and type analyses in fortran-src.

Notable changes -- perhaps to discuss:

  • The singletons-th, singletons-base requirements mean that the minimum GHC version required is now 9.0, up from 8.4.
    • The Template Haskell usages can be expanded out following the singletons pattern to remove these requirements.

@raehik raehik changed the title Repr Add strong Fortran value & type representation Aug 23, 2022
@raehik raehik marked this pull request as ready for review August 23, 2022 16:16
@raehik raehik merged commit 4305803 into master Aug 23, 2022
@raehik raehik deleted the repr branch August 23, 2022 18:32
@raehik raehik mentioned this pull request May 4, 2023
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.

1 participant