GHC.BaseDir

ghc-boot-9.0.1: Shared functionality between GHC and its boot libraries

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.BaseDir

Description

Note [Base Dir] ~~~~~~~~~~~~~~~~~

GHC's base directory or top directory containers miscellaneous settings and the package database. The main compiler of course needs this directory to read those settings and read and write packages. ghc-pkg uses it to find the global package database too.

In the interest of making GHC builds more relocatable, many settings also will expand `${top_dir}` inside strings so GHC doesn't need to know it's on installation location at build time. ghc-pkg also can expand those variables and so needs the top dir location to do that too.

Synopsis

- expandTopDir :: FilePath -> String -> String
- expandPathVar :: String -> FilePath -> String -> String
- getBaseDir :: IO (Maybe String)

# Documentation

expandTopDir :: FilePath -> String -> String Source #

Expand occurrences of the `$topdir` interpolation in a string.

expandPathVar :: String -> FilePath -> String -> String Source #

    expandPathVar var value str

replaces occurrences of variable `$var` with `value` in str.

getBaseDir :: IO (Maybe String) Source #

Calculate the location of the base dir