-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Utility for managing GHC target toolchains
--   
--   Utility for managing GHC target toolchains
@package ghc-toolchain
@version 0.1.0.0


-- | A very simple Lens implementation
module GHC.Toolchain.Lens
data Lens a b
Lens :: (a -> b) -> (b -> a -> a) -> Lens a b
[view] :: Lens a b -> a -> b
[set] :: Lens a b -> b -> a -> a
(%) :: Lens a b -> Lens b c -> Lens a c
over :: Lens a b -> (b -> b) -> a -> a

-- | Append <tt>b</tt> to <tt>[b]</tt>
--   
--   Example usage: @<tt> cc &amp; _ccProgram % _prgFlags %++ "-U__i686"
--   </tt>@
(%++) :: Lens a [b] -> b -> a -> a
(&) :: a -> (a -> b) -> b

module GHC.Toolchain.Monad
data Env
Env :: Int -> Maybe String -> Bool -> Bool -> [String] -> Env
[verbosity] :: Env -> Int
[targetPrefix] :: Env -> Maybe String
[keepTemp] :: Env -> Bool
[canLocallyExecute] :: Env -> Bool
[logContexts] :: Env -> [String]
data M a
runM :: Env -> M a -> IO (Either [Error] a)
getEnv :: M Env
makeM :: IO (Either [Error] a) -> M a
throwE :: String -> M a

-- | Branch on whether we can execute target code locally.
ifCrossCompiling :: M a -> M a -> M a
readFile :: FilePath -> M String
writeFile :: FilePath -> String -> M ()
appendFile :: FilePath -> String -> M ()

-- | Create an empty file.
createFile :: FilePath -> M ()
logInfo :: String -> M ()
logDebug :: String -> M ()
checking :: Show a => String -> M a -> M a
withLogContext :: String -> M a -> M a
instance GHC.Internal.Base.Alternative GHC.Toolchain.Monad.M
instance GHC.Internal.Base.Applicative GHC.Toolchain.Monad.M
instance GHC.Internal.Base.Functor GHC.Toolchain.Monad.M
instance Control.Monad.IO.Class.MonadIO GHC.Toolchain.Monad.M
instance GHC.Internal.Base.Monad GHC.Toolchain.Monad.M
instance GHC.Internal.Show.Show GHC.Toolchain.Monad.Error

module GHC.Toolchain.Prelude
cycle :: HasCallStack => [a] -> [a]
const :: a -> b -> a
(++) :: [a] -> [a] -> [a]
class Foldable (t :: Type -> Type)
foldMap :: (Foldable t, Monoid m) => (a -> m) -> t a -> m
foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b
foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b
foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b
foldr1 :: Foldable t => (a -> a -> a) -> t a -> a
foldl1 :: Foldable t => (a -> a -> a) -> t a -> a
null :: Foldable t => t a -> Bool
length :: Foldable t => t a -> Int
elem :: (Foldable t, Eq a) => a -> t a -> Bool
maximum :: (Foldable t, Ord a) => t a -> a
minimum :: (Foldable t, Ord a) => t a -> a
sum :: (Foldable t, Num a) => t a -> a
product :: (Foldable t, Num a) => t a -> a
seq :: a -> b -> b
concat :: Foldable t => t [a] -> [a]
filter :: (a -> Bool) -> [a] -> [a]
zip :: [a] -> [b] -> [(a, b)]
print :: Show a => a -> IO ()
otherwise :: Bool
map :: (a -> b) -> [a] -> [b]
($) :: (a -> b) -> a -> b
class Num a
(+) :: Num a => a -> a -> a
(-) :: Num a => a -> a -> a
(*) :: Num a => a -> a -> a
negate :: Num a => a -> a
abs :: Num a => a -> a
signum :: Num a => a -> a
fromInteger :: Num a => Integer -> a
class Num a => Fractional a
(/) :: Fractional a => a -> a -> a
recip :: Fractional a => a -> a
fromRational :: Fractional a => Rational -> a
class Enum a
succ :: Enum a => a -> a
pred :: Enum a => a -> a
toEnum :: Enum a => Int -> a
fromEnum :: Enum a => a -> Int
enumFrom :: Enum a => a -> [a]
enumFromThen :: Enum a => a -> a -> [a]
enumFromTo :: Enum a => a -> a -> [a]
enumFromThenTo :: Enum a => a -> a -> a -> [a]
class Eq a
(==) :: Eq a => a -> a -> Bool
(/=) :: Eq a => a -> a -> Bool
class Eq a => Ord a
compare :: Ord a => a -> a -> Ordering
(<) :: Ord a => a -> a -> Bool
(<=) :: Ord a => a -> a -> Bool
(>) :: Ord a => a -> a -> Bool
(>=) :: Ord a => a -> a -> Bool
max :: Ord a => a -> a -> a
min :: Ord a => a -> a -> a
class Applicative m => Monad (m :: Type -> Type)
(>>=) :: Monad m => m a -> (a -> m b) -> m b
(>>) :: Monad m => m a -> m b -> m b
return :: Monad m => a -> m a
class Functor (f :: Type -> Type)
fmap :: Functor f => (a -> b) -> f a -> f b
(<$) :: Functor f => a -> f b -> f a
class Monad m => MonadFail (m :: Type -> Type)
fail :: MonadFail m => String -> m a
fromIntegral :: (Integral a, Num b) => a -> b
realToFrac :: (Real a, Fractional b) => a -> b
class (Real a, Enum a) => Integral a
quot :: Integral a => a -> a -> a
rem :: Integral a => a -> a -> a
div :: Integral a => a -> a -> a
mod :: Integral a => a -> a -> a
quotRem :: Integral a => a -> a -> (a, a)
divMod :: Integral a => a -> a -> (a, a)
toInteger :: Integral a => a -> Integer
class (Num a, Ord a) => Real a
toRational :: Real a => a -> Rational
class Semigroup a
(<>) :: Semigroup a => a -> a -> a
class Semigroup a => Monoid a
mempty :: Monoid a => a
mappend :: Monoid a => a -> a -> a
mconcat :: Monoid a => [a] -> a
class Functor f => Applicative (f :: Type -> Type)
pure :: Applicative f => a -> f a
(<*>) :: Applicative f => f (a -> b) -> f a -> f b
liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
(*>) :: Applicative f => f a -> f b -> f b
(<*) :: Applicative f => f a -> f b -> f a
class Bounded a
minBound :: Bounded a => a
maxBound :: Bounded a => a
class Fractional a => Floating a
pi :: Floating a => a
exp :: Floating a => a -> a
log :: Floating a => a -> a
sqrt :: Floating a => a -> a
(**) :: Floating a => a -> a -> a
logBase :: Floating a => a -> a -> a
sin :: Floating a => a -> a
cos :: Floating a => a -> a
tan :: Floating a => a -> a
asin :: Floating a => a -> a
acos :: Floating a => a -> a
atan :: Floating a => a -> a
sinh :: Floating a => a -> a
cosh :: Floating a => a -> a
tanh :: Floating a => a -> a
asinh :: Floating a => a -> a
acosh :: Floating a => a -> a
atanh :: Floating a => a -> a
class Read a
readsPrec :: Read a => Int -> ReadS a
readList :: Read a => ReadS [a]
class (RealFrac a, Floating a) => RealFloat a
floatRadix :: RealFloat a => a -> Integer
floatDigits :: RealFloat a => a -> Int
floatRange :: RealFloat a => a -> (Int, Int)
decodeFloat :: RealFloat a => a -> (Integer, Int)
encodeFloat :: RealFloat a => Integer -> Int -> a
exponent :: RealFloat a => a -> Int
significand :: RealFloat a => a -> a
scaleFloat :: RealFloat a => Int -> a -> a
isNaN :: RealFloat a => a -> Bool
isInfinite :: RealFloat a => a -> Bool
isDenormalized :: RealFloat a => a -> Bool
isNegativeZero :: RealFloat a => a -> Bool
isIEEE :: RealFloat a => a -> Bool
atan2 :: RealFloat a => a -> a -> a
class (Real a, Fractional a) => RealFrac a
properFraction :: (RealFrac a, Integral b) => a -> (b, a)
truncate :: (RealFrac a, Integral b) => a -> b
round :: (RealFrac a, Integral b) => a -> b
ceiling :: (RealFrac a, Integral b) => a -> b
floor :: (RealFrac a, Integral b) => a -> b
class Show a
showsPrec :: Show a => Int -> a -> ShowS
show :: Show a => a -> String
showList :: Show a => [a] -> ShowS
class (Functor t, Foldable t) => Traversable (t :: Type -> Type)
traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)
sequenceA :: (Traversable t, Applicative f) => t (f a) -> f (t a)
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
data Bool
False :: Bool
True :: Bool
type String = [Char]
data Char
data Double
data Float
data Int
data Integer
data Maybe a
Nothing :: Maybe a
Just :: a -> Maybe a
data Ordering
LT :: Ordering
EQ :: Ordering
GT :: Ordering
type Rational = Ratio Integer
class a ~# b => (a :: k) ~ (b :: k)
data IO a
data Word
data Either a b
Left :: a -> Either a b
Right :: b -> Either a b
(^) :: (Num a, Integral b) => a -> b -> a
(&&) :: Bool -> Bool -> Bool
(||) :: Bool -> Bool -> Bool
not :: Bool -> Bool
error :: HasCallStack => [Char] -> a
errorWithoutStackTrace :: [Char] -> a
undefined :: HasCallStack => a
(=<<) :: Monad m => (a -> m b) -> m a -> m b
id :: a -> a
(.) :: (b -> c) -> (a -> b) -> a -> c
flip :: (a -> b -> c) -> b -> a -> c
($!) :: (a -> b) -> a -> b
until :: (a -> Bool) -> (a -> a) -> a -> a
asTypeOf :: a -> a -> a
subtract :: Num a => a -> a -> a
maybe :: b -> (a -> b) -> Maybe a -> b
head :: HasCallStack => [a] -> a
tail :: HasCallStack => [a] -> [a]
last :: HasCallStack => [a] -> a
init :: HasCallStack => [a] -> [a]
scanl :: (b -> a -> b) -> b -> [a] -> [b]
scanl1 :: (a -> a -> a) -> [a] -> [a]
scanr :: (a -> b -> b) -> b -> [a] -> [b]
scanr1 :: (a -> a -> a) -> [a] -> [a]
iterate :: (a -> a) -> a -> [a]
repeat :: a -> [a]
replicate :: Int -> a -> [a]
takeWhile :: (a -> Bool) -> [a] -> [a]
dropWhile :: (a -> Bool) -> [a] -> [a]
take :: Int -> [a] -> [a]
drop :: Int -> [a] -> [a]
splitAt :: Int -> [a] -> ([a], [a])
span :: (a -> Bool) -> [a] -> ([a], [a])
break :: (a -> Bool) -> [a] -> ([a], [a])
reverse :: [a] -> [a]
and :: Foldable t => t Bool -> Bool
or :: Foldable t => t Bool -> Bool
any :: Foldable t => (a -> Bool) -> t a -> Bool
all :: Foldable t => (a -> Bool) -> t a -> Bool
notElem :: (Foldable t, Eq a) => a -> t a -> Bool
lookup :: Eq a => a -> [(a, b)] -> Maybe b
concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
(!!) :: HasCallStack => [a] -> Int -> a
zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
unzip :: [(a, b)] -> ([a], [b])
unzip3 :: [(a, b, c)] -> ([a], [b], [c])
type ShowS = String -> String
shows :: Show a => a -> ShowS
showChar :: Char -> ShowS
showString :: String -> ShowS
showParen :: Bool -> ShowS -> ShowS
even :: Integral a => a -> Bool
odd :: Integral a => a -> Bool
(^^) :: (Fractional a, Integral b) => a -> b -> a
gcd :: Integral a => a -> a -> a
lcm :: Integral a => a -> a -> a
fst :: (a, b) -> a
snd :: (a, b) -> b
curry :: ((a, b) -> c) -> a -> b -> c
uncurry :: (a -> b -> c) -> (a, b) -> c
(<$>) :: Functor f => (a -> b) -> f a -> f b
type ReadS a = String -> [(a, String)]
lex :: ReadS String
readParen :: Bool -> ReadS a -> ReadS a
either :: (a -> c) -> (b -> c) -> Either a b -> c
reads :: Read a => ReadS a
read :: Read a => String -> a
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
lines :: String -> [String]
unlines :: [String] -> String
words :: String -> [String]
unwords :: [String] -> String
type IOError = IOException
userError :: String -> IOError
type FilePath = String
ioError :: IOError -> IO a
putChar :: Char -> IO ()
putStr :: String -> IO ()
putStrLn :: String -> IO ()
getChar :: IO Char
getLine :: IO String
getContents :: IO String
interact :: (String -> String) -> IO ()
readLn :: Read a => IO a
readIO :: Read a => String -> IO a
(<|>) :: Alternative f => f a -> f a -> f a

module GHC.Toolchain.Utils
expectJust :: String -> Maybe a -> M a
expectFileExists :: FilePath -> String -> M ()
withTempDir :: (FilePath -> M a) -> M a
oneOf :: String -> [M b] -> M b
isSuccess :: ExitCode -> Bool

module GHC.Toolchain.Program
data Program
Program :: FilePath -> [String] -> Program
[prgPath] :: Program -> FilePath
[prgFlags] :: Program -> [String]
shProgram :: Program
_prgPath :: Lens Program FilePath
_prgFlags :: Lens Program [String]

-- | Prepends a flag to a program's flags if the flag is not in the
--   existing flags.
addFlagIfNew :: String -> Program -> Program
runProgram :: Program -> [String] -> M ExitCode
callProgram :: Program -> [String] -> M ()

-- | Runs a program with a list of arguments and returns the exit code and
--   the stdout and stderr output
readProgram :: Program -> [String] -> M (ExitCode, String, String)

-- | Runs a program with a list of arguments and returns the stdout output,
--   ignoring the exit code.
readProgramStdout :: Program -> [String] -> M String

-- | Program specifier from the command-line.
data ProgOpt
ProgOpt :: Maybe FilePath -> Maybe [String] -> ProgOpt
[poPath] :: ProgOpt -> Maybe FilePath
[poFlags] :: ProgOpt -> Maybe [String]
emptyProgOpt :: ProgOpt

-- | Make a <tt><a>Program</a></tt> from user specified program options
--   (<tt><a>ProgOpt</a></tt>), defaulting to the given path and flags if
--   unspecified in the <tt><a>ProgOpt</a></tt>.
programFromOpt :: ProgOpt -> FilePath -> [String] -> Program
_poPath :: Lens ProgOpt (Maybe FilePath)
_poFlags :: Lens ProgOpt (Maybe [String])

-- | Tries to find the user specified program by path or tries to look for
--   one in the given list of candidates.
--   
--   If the <a>ProgOpt</a> program flags are unspecified the program will
--   have an empty list of flags.
findProgram :: String -> ProgOpt -> [FilePath] -> M Program

-- | Compile a program with a given compiler.
--   
--   The compiler must * Take the program path as a positional argument *
--   Accept <tt>-o</tt> to specify output path
compile :: FilePath -> [String] -> Lens compiler Program -> compiler -> FilePath -> String -> M ()

-- | Does compiler program support the <tt>--target=<a>triple</a></tt>
--   option? If so, we should pass it whenever possible to avoid ambiguity
--   and potential compile-time errors (e.g. see #20162).
supportsTarget :: ArchOS -> Lens compiler Program -> (compiler -> M ()) -> String -> compiler -> M compiler
instance GHC.Classes.Eq GHC.Toolchain.Program.Program
instance GHC.Classes.Ord GHC.Toolchain.Program.Program
instance GHC.Internal.Read.Read GHC.Toolchain.Program.Program
instance GHC.Internal.Show.Show GHC.Toolchain.Program.Program

module GHC.Toolchain.Tools.Readelf
newtype Readelf
Readelf :: Program -> Readelf
[readelfProgram] :: Readelf -> Program

-- | Readelf is only needed by <a>checkBfdCopyBug</a>.
findReadelf :: ProgOpt -> M Readelf
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Readelf.Readelf
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Readelf.Readelf

module GHC.Toolchain.Tools.Ranlib
newtype Ranlib
Ranlib :: Program -> Ranlib
[ranlibProgram] :: Ranlib -> Program
findRanlib :: ProgOpt -> M Ranlib
instance GHC.Classes.Eq GHC.Toolchain.Tools.Ranlib.Ranlib
instance GHC.Classes.Ord GHC.Toolchain.Tools.Ranlib.Ranlib
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Ranlib.Ranlib
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Ranlib.Ranlib

module GHC.Toolchain.Tools.Nm
newtype Nm
Nm :: Program -> Nm
[nmProgram] :: Nm -> Program
findNm :: ProgOpt -> M Nm
instance GHC.Classes.Eq GHC.Toolchain.Tools.Nm.Nm
instance GHC.Classes.Ord GHC.Toolchain.Tools.Nm.Nm
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Nm.Nm
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Nm.Nm

module GHC.Toolchain.Tools.Cxx
newtype Cxx
Cxx :: Program -> Cxx
[cxxProgram] :: Cxx -> Program
findCxx :: ArchOS -> String -> ProgOpt -> M Cxx
compileCxx :: Cxx -> FilePath -> String -> M ()
instance GHC.Classes.Eq GHC.Toolchain.Tools.Cxx.Cxx
instance GHC.Classes.Ord GHC.Toolchain.Tools.Cxx.Cxx
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Cxx.Cxx
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Cxx.Cxx

module GHC.Toolchain.Tools.Cc
newtype Cc
Cc :: Program -> Cc
[ccProgram] :: Cc -> Program
_ccProgram :: Lens Cc Program
findBasicCc :: ProgOpt -> M Cc
findCc :: ArchOS -> String -> ProgOpt -> M Cc

-- | Preprocess the given program.
preprocess :: Cc -> String -> M String

-- | Compile a C source file to object code.
compileC :: Cc -> FilePath -> String -> M ()

-- | Compile an assembler source file to object code.
compileAsm :: Cc -> FilePath -> String -> M ()

-- | Add various platform-dependent compiler flags needed by GHC. We can't
--   do this in <a>findCc</a> since we need a <tt>Cc</tt> to determine the
--   <a>ArchOS</a>.
addPlatformDepCcFlags :: ArchOS -> Cc -> M Cc
checkC99Support :: Cc -> M Cc
instance GHC.Classes.Eq GHC.Toolchain.Tools.Cc.Cc
instance GHC.Classes.Ord GHC.Toolchain.Tools.Cc.Cc
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Cc.Cc
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Cc.Cc

module GHC.Toolchain.Tools.Link

-- | Configuration on how the C compiler can be used to link
data CcLink
CcLink :: Program -> Bool -> Bool -> Bool -> Bool -> Bool -> CcLink
[ccLinkProgram] :: CcLink -> Program
[ccLinkSupportsNoPie] :: CcLink -> Bool
[ccLinkSupportsCompactUnwind] :: CcLink -> Bool
[ccLinkSupportsFilelist] :: CcLink -> Bool
[ccLinkSupportsSingleModule] :: CcLink -> Bool
[ccLinkIsGnu] :: CcLink -> Bool
findCcLink :: String -> ProgOpt -> ProgOpt -> Bool -> ArchOS -> Cc -> Maybe Readelf -> M CcLink
instance GHC.Classes.Eq GHC.Toolchain.Tools.Link.CcLink
instance GHC.Classes.Ord GHC.Toolchain.Tools.Link.CcLink
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Link.CcLink
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Link.CcLink

module GHC.Toolchain.Tools.MergeObjs

-- | Configuration on how the C compiler can be used to link
data MergeObjs
MergeObjs :: Program -> Bool -> MergeObjs
[mergeObjsProgram] :: MergeObjs -> Program
[mergeObjsSupportsResponseFiles] :: MergeObjs -> Bool
findMergeObjs :: ProgOpt -> Cc -> CcLink -> Nm -> M MergeObjs
instance GHC.Classes.Eq GHC.Toolchain.Tools.MergeObjs.MergeObjs
instance GHC.Classes.Ord GHC.Toolchain.Tools.MergeObjs.MergeObjs
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.MergeObjs.MergeObjs
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.MergeObjs.MergeObjs

module GHC.Toolchain.Tools.Cpp
newtype HsCpp
HsCpp :: Program -> HsCpp
[hsCppProgram] :: HsCpp -> Program
findHsCpp :: ProgOpt -> Cc -> M HsCpp
newtype Cpp
Cpp :: Program -> Cpp
[cppProgram] :: Cpp -> Program
findCpp :: ProgOpt -> Cc -> M Cpp
instance GHC.Classes.Eq GHC.Toolchain.Tools.Cpp.Cpp
instance GHC.Classes.Eq GHC.Toolchain.Tools.Cpp.HsCpp
instance GHC.Classes.Ord GHC.Toolchain.Tools.Cpp.Cpp
instance GHC.Classes.Ord GHC.Toolchain.Tools.Cpp.HsCpp
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Cpp.Cpp
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Cpp.HsCpp
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Cpp.Cpp
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Cpp.HsCpp

module GHC.Toolchain.CheckArm

-- | Awkwardly, ARM triples sometimes contain insufficient information
--   about the platform. Consequently we instead extract this information
--   from the toolchain.
findArmIsa :: Cc -> M Arch

module GHC.Toolchain.ParseTriple

-- | Parse a triple `arch-vendor-os` into an <a>ArchOS</a> and a vendor
--   name <a>String</a>
--   
--   If the user specified a duple (`arch-os`) instead, the vendor name is
--   <a>Nothing</a>
parseTriple :: Cc -> String -> M (ArchOS, Maybe String)

module GHC.Toolchain.Tools.Ar
data Ar
Ar :: Program -> Bool -> Bool -> Bool -> Bool -> Ar
[arMkArchive] :: Ar -> Program
[arIsGnu] :: Ar -> Bool
[arSupportsAtFile] :: Ar -> Bool
[arSupportsDashL] :: Ar -> Bool
[arNeedsRanlib] :: Ar -> Bool
findAr :: Maybe String -> ProgOpt -> M Ar
instance GHC.Classes.Eq GHC.Toolchain.Tools.Ar.Ar
instance GHC.Classes.Ord GHC.Toolchain.Tools.Ar.Ar
instance GHC.Internal.Read.Read GHC.Toolchain.Tools.Ar.Ar
instance GHC.Internal.Show.Show GHC.Toolchain.Tools.Ar.Ar

module GHC.Toolchain.Target
data WordSize
WS4 :: WordSize
WS8 :: WordSize
data Endianness
LittleEndian :: Endianness
BigEndian :: Endianness

-- | A <a>Target</a> consists of:
--   
--   <ul>
--   <li>a target architecture and operating system</li>
--   <li>various bits of information about the platform</li>
--   <li>various toolchain components targetting that platform</li>
--   </ul>
data Target
Target :: ArchOS -> Maybe String -> Bool -> Bool -> Bool -> Bool -> WordSize -> Endianness -> Bool -> String -> Bool -> Bool -> Bool -> Cc -> Cxx -> Cpp -> HsCpp -> CcLink -> Ar -> Maybe Ranlib -> Nm -> Maybe MergeObjs -> Maybe Program -> Target
[tgtArchOs] :: Target -> ArchOS

-- | This is the vendor component of the triple, the other two components
--   are found in <tt><a>tgtArchOs</a></tt>
[tgtVendor] :: Target -> Maybe String
[tgtLocallyExecutable] :: Target -> Bool
[tgtSupportsGnuNonexecStack] :: Target -> Bool
[tgtSupportsSubsectionsViaSymbols] :: Target -> Bool
[tgtSupportsIdentDirective] :: Target -> Bool
[tgtWordSize] :: Target -> WordSize
[tgtEndianness] :: Target -> Endianness
[tgtSymbolsHaveLeadingUnderscore] :: Target -> Bool
[tgtLlvmTarget] :: Target -> String
[tgtUnregisterised] :: Target -> Bool
[tgtTablesNextToCode] :: Target -> Bool

-- | We need to know whether or not to include libffi headers, and generate
--   additional code for it
[tgtUseLibffiForAdjustors] :: Target -> Bool
[tgtCCompiler] :: Target -> Cc
[tgtCxxCompiler] :: Target -> Cxx
[tgtCPreprocessor] :: Target -> Cpp
[tgtHsCPreprocessor] :: Target -> HsCpp
[tgtCCompilerLink] :: Target -> CcLink
[tgtAr] :: Target -> Ar

-- | N.B. Most <tt>ar</tt> implementations will add an index by default
--   without <tt>ranlib</tt> so this is often optional
[tgtRanlib] :: Target -> Maybe Ranlib
[tgtNm] :: Target -> Nm

-- | We don't need a merge objects tool if we <tt>Ar</tt> supports
--   <tt>-L</tt>
[tgtMergeObjs] :: Target -> Maybe MergeObjs
[tgtWindres] :: Target -> Maybe Program

-- | The word size as an integer representing the number of bytes
wordSize2Bytes :: WordSize -> Int

-- | Reconstruct the platform triple from a toolchain target (specifically
--   from tgtArchOs and tgtVendor)
targetPlatformTriple :: Target -> String
instance GHC.Classes.Eq GHC.Toolchain.Target.Endianness
instance GHC.Classes.Eq GHC.Toolchain.Target.Target
instance GHC.Classes.Eq GHC.Toolchain.Target.WordSize
instance GHC.Classes.Ord GHC.Toolchain.Target.Endianness
instance GHC.Classes.Ord GHC.Toolchain.Target.Target
instance GHC.Classes.Ord GHC.Toolchain.Target.WordSize
instance GHC.Internal.Read.Read GHC.Toolchain.Target.Endianness
instance GHC.Internal.Read.Read GHC.Toolchain.Target.Target
instance GHC.Internal.Read.Read GHC.Toolchain.Target.WordSize
instance GHC.Internal.Show.Show GHC.Toolchain.Target.Endianness
instance GHC.Internal.Show.Show GHC.Toolchain.Target.Target
instance GHC.Internal.Show.Show GHC.Toolchain.Target.WordSize

module GHC.Toolchain

module GHC.Toolchain.NormaliseTriple

-- | Normalise the triple by calling `config.sub` on the given triple.
normaliseTriple :: String -> M String

module GHC.Toolchain.PlatformDetails
checkWordSize :: Cc -> M WordSize
checkEndianness :: Cc -> M Endianness
checkLeadingUnderscore :: Cc -> Nm -> M Bool
checkSubsectionsViaSymbols :: ArchOS -> Cc -> M Bool
checkIdentDirective :: Cc -> M Bool
checkGnuNonexecStack :: ArchOS -> Cc -> M Bool
