{-# LANGUAGE CPP #-}
{-# LANGUAGE NoRebindableSyntax #-}
#if __GLASGOW_HASKELL__ >= 810
{-# OPTIONS_GHC -Wno-prepositive-qualified-module #-}
#endif
{-# OPTIONS_GHC -Wno-missing-import-lists #-}
{-# OPTIONS_GHC -w #-}
module Paths_haddock_api (
version,
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
import Data.Version (Version(..))
import System.Environment (getEnv)
import Prelude
#if defined(VERSION_base)
#if MIN_VERSION_base(4,0,0)
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#else
catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a
#endif
#else
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#endif
catchIO :: forall a. IO a -> (IOException -> IO a) -> IO a
catchIO = IO a -> (IOException -> IO a) -> IO a
forall e a. Exception e => IO a -> (e -> IO a) -> IO a
Exception.catch
version :: Version
version :: Version
version = [Int] -> [[Char]] -> Version
Version [Int
2,Int
30,Int
0] []
getDataFileName :: FilePath -> IO FilePath
getDataFileName :: [Char] -> IO [Char]
getDataFileName [Char]
name = do
dir <- IO [Char]
getDataDir
return (dir `joinFileName` name)
getBinDir :: IO FilePath
getLibDir :: IO FilePath
getDynLibDir :: IO FilePath
getDataDir :: IO FilePath
getLibexecDir :: IO FilePath
getSysconfDir :: IO FilePath
bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath
bindir :: [Char]
bindir = [Char]
"${pkgroot}/../bin"
libdir :: [Char]
libdir = [Char]
"${pkgroot}/../lib/x86_64-linux-ghc-9.15.20260130-inplace/haddock-api-2.30.0-inplace"
dynlibdir :: [Char]
dynlibdir = [Char]
"${pkgroot}/../lib/x86_64-linux-ghc-9.15.20260130-inplace"
datadir :: [Char]
datadir = [Char]
"${pkgroot}/../share/x86_64-linux-ghc-9.15.20260130-inplace/haddock-api-2.30.0"
libexecdir :: [Char]
libexecdir = [Char]
"${pkgroot}/../libexec/x86_64-linux-ghc-9.15.20260130-inplace/haddock-api-2.30.0"
sysconfdir :: [Char]
sysconfdir = [Char]
"${pkgroot}/../etc"
getBinDir :: IO [Char]
getBinDir = IO [Char] -> (IOException -> IO [Char]) -> IO [Char]
forall a. IO a -> (IOException -> IO a) -> IO a
catchIO ([Char] -> IO [Char]
getEnv [Char]
"haddock_api_bindir") (\IOException
_ -> [Char] -> IO [Char]
forall a. a -> IO a
forall (m :: Type -> Type) a. Monad m => a -> m a
return [Char]
bindir)
getLibDir :: IO [Char]
getLibDir = IO [Char] -> (IOException -> IO [Char]) -> IO [Char]
forall a. IO a -> (IOException -> IO a) -> IO a
catchIO ([Char] -> IO [Char]
getEnv [Char]
"haddock_api_libdir") (\IOException
_ -> [Char] -> IO [Char]
forall a. a -> IO a
forall (m :: Type -> Type) a. Monad m => a -> m a
return [Char]
libdir)
getDynLibDir :: IO [Char]
getDynLibDir = IO [Char] -> (IOException -> IO [Char]) -> IO [Char]
forall a. IO a -> (IOException -> IO a) -> IO a
catchIO ([Char] -> IO [Char]
getEnv [Char]
"haddock_api_dynlibdir") (\IOException
_ -> [Char] -> IO [Char]
forall a. a -> IO a
forall (m :: Type -> Type) a. Monad m => a -> m a
return [Char]
dynlibdir)
getDataDir :: IO [Char]
getDataDir = IO [Char] -> (IOException -> IO [Char]) -> IO [Char]
forall a. IO a -> (IOException -> IO a) -> IO a
catchIO ([Char] -> IO [Char]
getEnv [Char]
"haddock_api_datadir") (\IOException
_ -> [Char] -> IO [Char]
forall a. a -> IO a
forall (m :: Type -> Type) a. Monad m => a -> m a
return [Char]
datadir)
getLibexecDir :: IO [Char]
getLibexecDir = IO [Char] -> (IOException -> IO [Char]) -> IO [Char]
forall a. IO a -> (IOException -> IO a) -> IO a
catchIO ([Char] -> IO [Char]
getEnv [Char]
"haddock_api_libexecdir") (\IOException
_ -> [Char] -> IO [Char]
forall a. a -> IO a
forall (m :: Type -> Type) a. Monad m => a -> m a
return [Char]
libexecdir)
getSysconfDir :: IO [Char]
getSysconfDir = IO [Char] -> (IOException -> IO [Char]) -> IO [Char]
forall a. IO a -> (IOException -> IO a) -> IO a
catchIO ([Char] -> IO [Char]
getEnv [Char]
"haddock_api_sysconfdir") (\IOException
_ -> [Char] -> IO [Char]
forall a. a -> IO a
forall (m :: Type -> Type) a. Monad m => a -> m a
return [Char]
sysconfdir)
joinFileName :: String -> String -> FilePath
joinFileName :: [Char] -> [Char] -> [Char]
joinFileName [Char]
"" [Char]
fname = [Char]
fname
joinFileName [Char]
"." [Char]
fname = [Char]
fname
joinFileName [Char]
dir [Char]
"" = [Char]
dir
joinFileName dir :: [Char]
dir@(Char
c:[Char]
cs) [Char]
fname
| Char -> Bool
isPathSeparator (Char -> [Char] -> Char
forall {t}. t -> [t] -> t
lastChar Char
c [Char]
cs) = [Char]
dir [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
fname
| Bool
otherwise = [Char]
dir [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Char
pathSeparator Char -> [Char] -> [Char]
forall a. a -> [a] -> [a]
: [Char]
fname
where
lastChar :: t -> [t] -> t
lastChar t
x [] = t
x
lastChar t
_ (t
x:[t]
xs) = t -> [t] -> t
lastChar t
x [t]
xs
pathSeparator :: Char
pathSeparator :: Char
pathSeparator = Char
'/'
isPathSeparator :: Char -> Bool
isPathSeparator :: Char -> Bool
isPathSeparator Char
c = Char
c Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'/'