Add strong Fortran value & type representation #235
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
singletons-th
,singletons-base
requirements mean that the minimum GHC version required is now 9.0, up from 8.4.