hydra icon indicating copy to clipboard operation
hydra copied to clipboard

Minimize standard imports in generated Haskell

Open joshsh opened this issue 10 months ago • 1 comments

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.

joshsh avatar Feb 28 '25 16:02 joshsh

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.

joshsh avatar May 10 '25 13:05 joshsh