diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-04-05 17:39:13 +0200 |
---|---|---|
committer | Sylvain Henry <sylvain@haskus.fr> | 2020-04-18 20:04:46 +0200 |
commit | 15312bbb53f247c9ed2c5cf75100a9f44c1c7227 (patch) | |
tree | 8306dcc04a5b7c82464f903044dfdd589e7fdcd7 /libraries/ghc-boot | |
parent | 3ca52151881451ce5b3a7740d003e811b586140d (diff) | |
download | haskell-15312bbb53f247c9ed2c5cf75100a9f44c1c7227.tar.gz |
Modules (#13009)
* SysTools
* Parser
* GHC.Builtin
* GHC.Iface.Recomp
* Settings
Update Haddock submodule
Metric Decrease:
Naperian
parsing001
Diffstat (limited to 'libraries/ghc-boot')
-rw-r--r-- | libraries/ghc-boot/GHC/Settings/Platform.hs (renamed from libraries/ghc-boot/GHC/Settings.hs) | 17 | ||||
-rw-r--r-- | libraries/ghc-boot/GHC/Settings/Utils.hs | 15 | ||||
-rw-r--r-- | libraries/ghc-boot/ghc-boot.cabal.in | 3 |
3 files changed, 19 insertions, 16 deletions
diff --git a/libraries/ghc-boot/GHC/Settings.hs b/libraries/ghc-boot/GHC/Settings/Platform.hs index fd0a0ef3ad..f97fff6b6f 100644 --- a/libraries/ghc-boot/GHC/Settings.hs +++ b/libraries/ghc-boot/GHC/Settings/Platform.hs @@ -11,14 +11,14 @@ -- -- The "0" suffix is because the caller will partially apply it, and that will -- in turn be used a few more times. -module GHC.Settings where +module GHC.Settings.Platform where import Prelude -- See Note [Why do we import Prelude here?] import GHC.BaseDir import GHC.Platform +import GHC.Settings.Utils -import Data.Char (isSpace) import Data.Map (Map) import qualified Data.Map as Map @@ -93,16 +93,3 @@ readSetting0 settingsFile mySettings key = case Map.lookup key mySettings of Just v -> Right v Nothing -> Left $ "Failed to read " ++ show key ++ " value " ++ show xs Nothing -> Left $ "No entry for " ++ show key ++ " in " ++ show settingsFile - ------------------------------------------------------------------------------ --- read helpers - -maybeRead :: Read a => String -> Maybe a -maybeRead str = case reads str of - [(x, "")] -> Just x - _ -> Nothing - -maybeReadFuzzy :: Read a => String -> Maybe a -maybeReadFuzzy str = case reads str of - [(x, s)] | all isSpace s -> Just x - _ -> Nothing diff --git a/libraries/ghc-boot/GHC/Settings/Utils.hs b/libraries/ghc-boot/GHC/Settings/Utils.hs new file mode 100644 index 0000000000..1f1cd67030 --- /dev/null +++ b/libraries/ghc-boot/GHC/Settings/Utils.hs @@ -0,0 +1,15 @@ +module GHC.Settings.Utils where + +import Prelude -- See Note [Why do we import Prelude here?] + +import Data.Char (isSpace) + +maybeRead :: Read a => String -> Maybe a +maybeRead str = case reads str of + [(x, "")] -> Just x + _ -> Nothing + +maybeReadFuzzy :: Read a => String -> Maybe a +maybeReadFuzzy str = case reads str of + [(x, s)] | all isSpace s -> Just x + _ -> Nothing diff --git a/libraries/ghc-boot/ghc-boot.cabal.in b/libraries/ghc-boot/ghc-boot.cabal.in index d837fc9875..c8ac491c59 100644 --- a/libraries/ghc-boot/ghc-boot.cabal.in +++ b/libraries/ghc-boot/ghc-boot.cabal.in @@ -45,7 +45,8 @@ Library GHC.HandleEncoding GHC.Platform GHC.Platform.Host - GHC.Settings + GHC.Settings.Platform + GHC.Settings.Utils GHC.UniqueSubdir GHC.Version |