summaryrefslogtreecommitdiff
path: root/compiler/main/FileSettings.hs
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2019-05-21 23:00:27 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-05-29 16:06:45 -0400
commitace2e3350fa7da1f7ebcdb882f1241da10a90c26 (patch)
treea6ea9a688e3bf1230e8775e9f41a86576a9523b4 /compiler/main/FileSettings.hs
parent2d2aa2031b9abc3bff7b5585ab4201948c8bba7d (diff)
downloadhaskell-ace2e3350fa7da1f7ebcdb882f1241da10a90c26.tar.gz
Break up `Settings` into smaller structs
As far as I can tell, the fields within `Settings` aren't *intrinsicly* related. They just happen to be initialized the same way (in particular prior to the rest of `DynFlags`), and that is why they are grouped together. Within `Settings`, however, there are groups of settings that clearly do share something in common, regardless of how they anything is initialized. In the spirit of GHC being a library, where the end cosumer may choose to initialize this configuration in arbitrary ways, I made some new data types for thoses groups internal to `Settings`, and used them to define `Settings` instead. Hopefully this is a baby step towards a general decoupling of the stateful and stateless parts of GHC.
Diffstat (limited to 'compiler/main/FileSettings.hs')
-rw-r--r--compiler/main/FileSettings.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/main/FileSettings.hs b/compiler/main/FileSettings.hs
new file mode 100644
index 0000000000..f531d206a9
--- /dev/null
+++ b/compiler/main/FileSettings.hs
@@ -0,0 +1,16 @@
+module FileSettings
+ ( FileSettings (..)
+ ) where
+
+import GhcPrelude
+
+-- | Paths to various files and directories used by GHC, including those that
+-- provide more settings.
+data FileSettings = FileSettings
+ { fileSettings_ghcUsagePath :: FilePath -- ditto
+ , fileSettings_ghciUsagePath :: FilePath -- ditto
+ , fileSettings_toolDir :: Maybe FilePath -- ditto
+ , fileSettings_topDir :: FilePath -- ditto
+ , fileSettings_tmpDir :: String -- no trailing '/'
+ , fileSettings_systemPackageConfig :: FilePath
+ }