hydra
hydra copied to clipboard
Minimize standard imports in generated Haskell
Currently, we have the following boilerplate imports at the top of every file generated by the Haskell coder:
import qualified Data.Int as I
import qualified Data.List as L
import qualified Data.Map as M
import qualified Data.Set as S
When symbols like Set are included in generated Haskell, they are always qualified with the prefix, i.e. S.Set. However, the imports are not always needed. In Hydra-Python, we minimize standardized imports because otherwise the interpreter will complain about them. It should be straightforward to do the same thing in the Haskell coder. Do it.
Note: the same thing is now done in the C++ coder. The task becomes: take the metadata-gathering pattern in the Python and C++ coders, generalize it as much as possible, then re-use it in the Haskell coder.