camfort / fortran-src

Fortran parsing and static analysis infrastructure
https://hackage.haskell.org/package/fortran-src
Other
48 stars 20 forks source link

document Fst/SndParam safety, fix erroneous instances #219

Closed raehik closed 2 years ago

raehik commented 2 years ago

I wrote an erroneous SecondParameter instance for a literal that would always fail at runtime. Along with fixing that, I swapped out an unsafe orphan instance derived for Value (since it apparently only saved on writing a couple more lines).

I tried putting the safety check in the generic derivation, but I couldn't get it to work. Copying from generic-lens works, but it has to do too much work, and bumps Language.Fortran.AST compilation time x4 and memory usage to x3 - way too much. So instead, I've noted their behaviour in the respective module.