Illustrated by (but not limited to) the error generated by Haskell script file:
{- stack script
--snapshot nightly-2024-06-07
--package dhall
-}
main = pure ()
Currently, the stackYaml field of a value of type BuildConfig can refer to either a global or a project-level configuration file, in part because of Stack.Config.withBuildConfig (extract):
(project', stackYaml) <- case config.project of
...
PCNoProject extraDeps -> do
p <- ...
pure (p, config.userConfigPath) -- <<<< refering to the global configuration file!
It seems to me that types could be used to distinguish values that represent the location of global configuration files from those that represent the location of any project-level configuration file. Also, the field is a potential misnomer, as stackYaml could be understood to refer to stack.yaml, the default name of a project-level configuration file.
Motivation: #6602
Illustrated by (but not limited to) the error generated by Haskell script file:
Currently, the
stackYaml
field of a value of typeBuildConfig
can refer to either a global or a project-level configuration file, in part because ofStack.Config.withBuildConfig
(extract):It seems to me that types could be used to distinguish values that represent the location of global configuration files from those that represent the location of any project-level configuration file. Also, the field is a potential misnomer, as
stackYaml
could be understood to refer tostack.yaml
, the default name of a project-level configuration file.