ghc-lib-parser-9.14.1.20251220: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Settings.Utils

Synopsis

- maybeRead :: Read a => String -> Maybe a
- maybeReadFuzzy :: Read a => String -> Maybe a
- type RawSettings = Map String String
- getTargetArchOS :: FilePath -> RawSettings -> Either String ArchOS
- getGlobalPackageDb :: FilePath -> RawSettings -> Either String FilePath
- getRawSetting :: FilePath -> RawSettings -> String -> Either String String
- getRawFilePathSetting :: FilePath -> FilePath -> RawSettings -> String -> Either String String
- getRawBooleanSetting :: FilePath -> RawSettings -> String -> Either String Bool
- readRawSetting :: (Show a, Read a) => FilePath -> RawSettings -> String -> Either String a

# Documentation

maybeRead :: Read a => String -> Maybe a #

maybeReadFuzzy :: Read a => String -> Maybe a #

type RawSettings = Map String String #

getTargetArchOS #

Arguments

:: FilePath | Settings filepath (for error messages)
-> RawSettings | Raw settings file contents
-> Either String ArchOS |

Read target Arch/OS from the settings

getGlobalPackageDb :: FilePath -> RawSettings -> Either String FilePath #

getRawSetting :: FilePath -> RawSettings -> String -> Either String String #

getRawFilePathSetting :: FilePath -> FilePath -> RawSettings -> String -> Either String String #

getRawBooleanSetting :: FilePath -> RawSettings -> String -> Either String Bool #

readRawSetting :: (Show a, Read a) => FilePath -> RawSettings -> String -> Either String a #